/**
 * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
 *
 * Copyright 2011-2015 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
 */
/**
 * almond 0.2.6 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/almond for details
 */

/**
  @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
mersenne-twister.js - https://gist.github.com/banksean/300494

   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

     1. Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.

     2. Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.

     3. The names of its contributors may not be used to endorse or promote
        products derived from this software without specific prior written
        permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
 * @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
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
tween.js - https://github.com/sole/tween.js

Copyright (c) 2010-2012 Tween.js authors.

Easing equations Copyright (c) 2001 Robert Penner http://robertpenner.com/easing/

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 THE
AUTHORS OR COPYRIGHT HOLDERS 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
  fontmetrics.js - https://github.com/Pomax/fontmetrics.js

  Copyright (C) 2011 by Mike "Pomax" Kamermans

  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 THE
  AUTHORS OR COPYRIGHT HOLDERS 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
topojson - https://github.com/mbostock/topojson

Copyright (c) 2012, Michael Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* 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.

* The name Michael Bostock may not be used to endorse or promote products
  derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK 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.
*/

/*!
	 * Autolinker.js
	 * 0.15.2
	 *
	 * Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com>
	 * 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.
 *
 * TO  THE MAXIMUM  EXTENT PERMITTED  BY APPLICABLE  LAW, THIS SOFTWARE  IS PROVIDED
 * *AS IS*  AND NVIDIA AND  ITS SUPPLIERS DISCLAIM  ALL WARRANTIES,  EITHER  EXPRESS
 * OR IMPLIED, INCLUDING, BUT NOT LIMITED  TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL  NVIDIA 
 * OR ITS SUPPLIERS BE  LIABLE  FOR  ANY  DIRECT, SPECIAL,  INCIDENTAL,  INDIRECT,  OR  
 * CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,  DAMAGES FOR LOSS 
 * OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY 
 * OTHER PECUNIARY LOSS) ARISING OUT OF THE  USE OF OR INABILITY  TO USE THIS SOFTWARE, 
 * EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 */

/**
 * @license
 * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com)
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 
 * * Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * * 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.
 * * Neither the name of the project nor the names of its contributors may be
 *   used to endorse or promote products derived from this software without
 *   specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Modifications made by Analytical Graphics, Inc.
 */

/**
 * @license
 * Knockout JavaScript library v3.2.0
 * (c) Steven Sanderson - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * 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("/"),p=_.map,m=p&&p["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),u=0;u<e.length;u+=1)if(h=e[u],"."===h)e.splice(u,1),u-=1;else if(".."===h){if(1===u&&(".."===e[2]||".."===e[0]))break;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||m)&&p){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=p[d.slice(0,c).join("/")],n&&(n=n[i])){o=n,a=u;break}if(o)break;!s&&m&&m[i]&&(s=m[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 p.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,p,m,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,w=[].slice;m=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,p,_,C=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,p=0;p<t.length;p+=1)if(d=m(t[p],o),c=d.f,"require"===c)C[p]=f.require(e);else if("exports"===c)C[p]=f.exports(e),_=!0;else if("module"===c)s=C[p]=f.module(e);else if(n(v,c)||n(g,c)||n(y,c))C[p]=u(c);else{if(!d.p)throw new Error(e+" missing "+c);d.p.load(d.n,a(o,!0),l(c),{}),C[p]=v[c]}h=r.apply(v[e],C),e&&(s&&s.exports!==i&&s.exports!==v[e]?v[e]=s.exports:h===i&&_||(v[e]=h))}else e&&(v[e]=r)},e=t=p=function(e,t,r,n,o){return"string"==typeof e?f[e]?f[e](t):u(m(e,t).f):(e.splice||(_=e,t.splice?(e=t,t=r,r=null):e=i),t=t||function(){},"function"==typeof r&&(r=n,n=o),n?d(i,e,t,r):setTimeout(function(){d(i,e,t,r)},4),p)},p.config=function(e){return _=e,_.deps&&p(_.deps,_.callback),p},e._defined=v,r=function(e,t,r){t.splice||(r=t,t=[]),n(v,e)||n(g,e)||(g[e]=[e,t,r])},r.amd={jQuery:!0}}(),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){var r=new i(function(r){try{return t(r?r(e):e)}catch(i){return o(i)}});return r}function o(e){var r=new i(function(r,i){try{return i?t(i(e)):o(e)}catch(n){return o(n)}});return r}function a(){function e(e,t,r){return d(e,t,r)}function r(e){return m(e)}function n(e){return m(o(e))}function s(e){return p(e)}var l,u,c,h,d,p,m;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],h=[],d=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(t){i.progress(t)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),h.push(n),i.promise},p=function(e){return f(h,e),e},m=function(e){return e=t(e),d=e.then,m=t,p=g,f(c,e),h=c=w,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return v(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){m(e)}var u,c,h,d,p,m,f,v,_,y;if(_=t.length>>>0,u=Math.max(0,Math.min(r,_)),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(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 p(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 m(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=p,e.any=u,e.some=l,e.chain=m,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=0,i={},n=function(t,n,o){var a=e(o),s=e(n),l=e(t);l||s||(t=o),this._text=t,this._imageUrl=n,this._link=o,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,n,o]);e(i[c])?u=i[c]:(u=r++,i[c]=u),this._id=u};return t(n.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}}}),n.prototype.hasImage=function(){return this._hasImage},n.prototype.hasLink=function(){return this._hasLink},n.equals=function(t,r){return t===r||e(t)&&e(r)&&t._id===r._id},n.prototype.equals=function(e){return n.equals(this,e)},n}),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<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}),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){return r.zeroToTwoPi(e+r.PI)-r.PI},r.zeroToTwoPi=function(e){var t=r.mod(e,r.TWO_PI);return Math.abs(t)<r.EPSILON14&&Math.abs(e)>r.EPSILON14?r.TWO_PI:t},r.mod=function(e,t){return(e%t+t)%t},r.equalsEpsilon=function(e,r,i,n){n=t(n,i);var o=Math.abs(e-r);return n>=o||o<=i*Math.max(Math.abs(e),Math.abs(r))};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.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},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.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(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.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,r,i,o){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.x,r.x,i,o)&&n.equalsEpsilon(e.y,r.y,i,o)&&n.equalsEpsilon(e.z,r.z,i,o)},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,p=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:p,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;a<e.length;a++)i[a]=n.toRadians(e[a]);return o.fromRadiansArray(i,t,r)},o.fromRadiansArray=function(e,r,i){var n=e.length;t(i)?i.length=n/2:i=new Array(n/2);for(var a=0;n>a;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;a<e.length;a+=3)i[a]=n.toRadians(e[a]),i[a+1]=n.toRadians(e[a+1]),i[a+2]=e[a+2];return o.fromRadiansArrayHeights(i,t,r)},o.fromRadiansArrayHeights=function(e,r,i){var n=e.length;t(i)?i.length=n/3:i=new Array(n/3);for(var a=0;n>a;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,r){return o.equalsEpsilon(this,e,t,r)},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.packedLength=e.packedLength,u.pack=function(t,i,n){n=r(n,0),e.pack(t._radii,i,n)},u.unpack=function(t,i,n){i=r(i,0);var o=e.unpack(t,i);return u.fromCartesian3(o,n)},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,p=new e,m=new e;u.prototype.cartesianToCartographic=function(r,n){var o=this.scaleToGeodeticSurface(r,p);if(!i(o))return void 0;var a=this.geodeticSurfaceNormal(o,d),l=e.subtract(r,o,m),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,p=o*o*c*c,m=a*a*h*h,g=d+p+m,_=Math.sqrt(1/g),y=e.multiplyByScalar(t,_,f);if(g<this._centerToleranceSquared)return isFinite(_)?e.clone(y,r):void 0;var C=this._oneOverRadiiSquared,w=C.x,S=C.y,E=C.z,b=v;b.x=2*y.x*w,b.y=2*y.y*S,b.z=2*y.z*E;var x,T,P,A,M,I,D,O,R,L,N,F=(1-_)*e.magnitude(t)/(.5*e.magnitude(b)),B=0;do{F-=B,P=1/(1+F*w),A=1/(1+F*S),M=1/(1+F*E),I=P*P,D=A*A,O=M*M,R=I*P,L=D*A,N=O*M,x=d*I+p*D+m*O-1,T=d*R*w+p*L*S+m*N*E;var z=-2*T;B=x/z}while(Math.abs(x)>s.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;o<r.length;o++)if(r[o]===e&&i[o]===t){n=o;break}return-1!==n?(this._insideRaiseEvent?(this._toRemove.push(n),r[n]=void 0,i[n]=void 0):(r.splice(n,1),i.splice(n,1)),!0):!1},r.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var t,r=this._listeners,i=this._scopes,n=r.length;for(t=0;n>t;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.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(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.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,r,i,o){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.x,r.x,i,o)&&n.equalsEpsilon(e.y,r.y,i,o)},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,r){return o.equalsEpsilon(this,e,t,r)},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","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";var l=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)};i(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.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},l.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new l),n.west=e[i++],n.south=e[i++],n.east=e[i++],n.north=e[i],n},l.computeWidth=function(e){var t=e.east,r=e.west;return r>t&&(t+=s.TWO_PI),t-r},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,i,n,o,a){return e=s.toRadians(t(e,0)),i=s.toRadians(t(i,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),r(a)?(a.west=e,a.south=i,a.east=n,a.north=o,a):new l(e,i,n,o)},l.fromCartographicArray=function(e,t){for(var i=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=0,u=e.length;u>s;s++){var c=e[s];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 l(i,o,n,a)},l.packedLength=4,l.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},l.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new l),n.west=e[i++],n.south=e[i++],n.east=e[i++],n.north=e[i],n},l.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 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||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.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},l.validate=function(){},l.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)},l.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)},l.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)},l.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)},l.center=function(t,i){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 r(i)?(i.longitude=a,i.latitude=l,i.height=0,i):new e(a,l)},l.intersection=function(e,t,i){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<e.east||t.west<t.east)&&c>=h)return void 0;var d=Math.max(e.south,t.south),p=Math.min(e.north,t.north);return d>=p?void 0:r(i)?(i.west=c,i.south=d,i.east=h,i.north=p,i):new l(c,d,h,p)},l.contains=function(e,t){var r=t.longitude,i=t.latitude,n=e.west,o=e.east;return n>o&&(o+=s.TWO_PI,0>r&&(r+=s.TWO_PI)),(r>n||s.equalsEpsilon(r,n,s.EPSILON14))&&(o>r||s.equalsEpsilon(r,o,s.EPSILON14))&&i>=e.south&&i<=e.north};var u=new e;return l.subsample=function(e,i,n,a){i=t(i,o.WGS84),n=t(n,0),r(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]=i.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=i.cartographicToCartesian(f,a[c]),c++,f.latitude=d,a[c]=i.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=i.cartographicToCartesian(f,a[c]),c++,f.latitude=0>h?h:d>0?d:0;for(var v=1;8>v;++v)f.longitude=-Math.PI+v*s.PI_OVER_TWO,l.contains(e,f)&&(a[c]=i.cartographicToCartesian(f,a[c]),c++);return 0===f.latitude&&(f.longitude=m,a[c]=i.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=i.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}),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<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var i=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return r(t)?(t.west=i,t.south=n,t.east=o,t.north=a,t):new l(i,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,r,i){var n=this.tileXYToRectangle(e,t,r,i);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,i,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),u=o.width/a,c=e*u+o.west,h=(e+1)*u+o.west,d=o.height/s,p=o.north-t*d,m=o.north-(t+1)*d;return r(n)||(n=new l(c,m,h,p)),n.west=c,n.south=m,n.east=h,n.north=p,n},u.prototype.positionToTileXY=function(t,i,n){var o=this._rectangle;if(!l.contains(o,t))return void 0;
var a=this.getNumberOfXTilesAtLevel(i),u=this.getNumberOfYTilesAtLevel(i),c=o.width/a,h=o.height/u,d=t.longitude;o.east<o.west&&(d+=s.TWO_PI);var p=0|(d-o.west)/c;p>=a&&(p=a-1);var m=0|(o.north-t.latitude)/h;return m>=u&&(m=u-1),r(n)?(n.x=p,n.y=m,n):new e(p,m)},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","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";var l={};return l.DEFAULT_STRUCTURE=o({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),l.computeVertices=function(i){var o,u,c,h,d=Math.cos,p=Math.sin,m=Math.sqrt,f=Math.atan,v=Math.exp,g=a.PI_OVER_TWO,_=a.toRadians,y=i.vertices,C=i.heightmap,w=i.width,S=i.height,E=i.skirtHeight,b=t(i.isGeographic,!0),x=t(i.ellipsoid,n.WGS84),T=1/x.maximumRadius,P=i.nativeRectangle,A=i.rectangle;r(A)?(o=A.west,u=A.south,c=A.east,h=A.north):b?(o=_(P.west),u=_(P.south),c=_(P.east),h=_(P.north)):(o=P.west*T,u=g-2*f(v(-P.south*T)),c=P.east*T,h=g-2*f(v(-P.north*T)));var M=t(i.relativeToCenter,e.ZERO),I=t(i.structure,l.DEFAULT_STRUCTURE),D=t(I.heightScale,l.DEFAULT_STRUCTURE.heightScale),O=t(I.heightOffset,l.DEFAULT_STRUCTURE.heightOffset),R=t(I.elementsPerHeight,l.DEFAULT_STRUCTURE.elementsPerHeight),L=t(I.stride,l.DEFAULT_STRUCTURE.stride),N=t(I.elementMultiplier,l.DEFAULT_STRUCTURE.elementMultiplier),F=t(I.isBigEndian,l.DEFAULT_STRUCTURE.isBigEndian),B=s.computeWidth(P)/(w-1),z=s.computeHeight(P)/(S-1),V=x.radiiSquared,k=V.x,U=V.y,W=V.z,G=0,H=65536,q=-65536,j=0,Y=S,X=0,Z=w;E>0&&(--j,++Y,--X,++Z);for(var J=j;Y>J;++J){var Q=J;0>Q&&(Q=0),Q>=S&&(Q=S-1);var K=P.north-z*Q;K=b?_(K):g-2*f(v(-K*T));for(var $=d(K),et=p(K),tt=W*et,rt=(K-u)/(h-u),it=X;Z>it;++it){var nt=it;0>nt&&(nt=0),nt>=w&&(nt=w-1);var ot=P.west+B*nt;b?ot=_(ot):ot*=T;var at,st=Q*w*L+nt*L;if(1===R)at=C[st];else{at=0;var lt;if(F)for(lt=0;R>lt;++lt)at=at*N+C[st+lt];else for(lt=R-1;lt>=0;--lt)at=at*N+C[st+lt]}at=at*D+O,q=Math.max(q,at),H=Math.min(H,at),(it!==nt||J!==Q)&&(at-=E);var ut=$*d(ot),ct=$*p(ot),ht=k*ut,dt=U*ct,pt=m(ht*ut+dt*ct+tt*et),mt=1/pt,ft=ht*mt,vt=dt*mt,gt=tt*mt;y[G++]=ft+ut*at-M.x,y[G++]=vt+ct*at-M.y,y[G++]=gt+et*at-M.z,y[G++]=at;var _t=(ot-o)/(c-o);y[G++]=_t,y[G++]=rt}}return{maximumHeight:q,minimumHeight:H}},l}),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/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/TaskProcessor",["../ThirdParty/Uri","../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(){if(!n(v._canTransferArrayBuffer)){var e=new Worker(d("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 v._canTransferArrayBuffer=!1,v._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(),v._canTransferArrayBuffer=o},v._canTransferArrayBuffer=s.promise}return v._canTransferArrayBuffer}function h(e,t){--e._activeTasks;var r=t.id;if(n(r)){var i=e._deferreds,o=i[r];if(n(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new l(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new a(t.error.message),s.stack=t.error.stack),o.reject(s)}else o.resolve(t.result);delete i[r]}}function d(e){var t=r(e);if(s(t)){var i,n='importScripts("'+t+'");';try{i=new Blob([n],{type:"application/javascript"})}catch(o){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,l=new a;l.append(n),i=l.getBlob("application/javascript")}var u=window.URL||window.webkitURL;t=u.createObjectURL(i)}return t}function p(){return n(f)||(f=d("Workers/cesiumWorkerBootstrapper.js")),f}function m(t){var o=new Worker(p());o.postMessage=i(o.webkitPostMessage,o.postMessage);var a={loaderConfig:{},workerModule:v._workerModulePrefix+t._workerName};if(n(v._loaderConfig))a.loaderConfig=v._loaderConfig;else if(n(u.toUrl)){var s=new e("..").resolve(new e(r("Workers/cesiumWorkerBootstrapper.js"))).toString();a.loaderConfig.baseUrl=s}else a.loaderConfig.paths={Workers:r("Workers")};return o.postMessage(a),o.onmessage=function(e){h(t,e.data)},o}var f,v=function(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0},g=[];return v.prototype.scheduleTask=function(e,r){if(n(this._worker)||(this._worker=m(this)),this._activeTasks>=this._maximumActiveTasks)return void 0;++this._activeTasks;var i=this;return t(c(),function(o){n(r)?o||(r.length=0):r=g;var a=i._nextID++,s=t.defer();return i._deferreds[a]=s,i._worker.postMessage({id:a,parameters:e,canTransferArrayBuffer:o},r),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}),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,p=c+1;o[s++]=c,o[s++]=h,o[s++]=p,o[s++]=p,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),p=d+u-1,m=1<<s;c/=m,h/=m,d/=m,p/=m;var f=r*(l-1),v=i*(u-1);c-=f,h-=f,d-=v,p-=v;var g,_,C=0|c,w=0|h,S=0|d,E=0|p,b=w-C+1,x=E-S+1,T=e._buffer,P=e._structure,A=b*x,M=A*P.stride,I=new T.constructor(M),D=0,O=P.stride;if(O>1)for(_=S;E>=_;++_)for(g=C;w>=g;++g)for(var R=(_*l+g)*O,L=0;O>L;++L)I[D++]=T[R+L];else for(_=S;E>=_;++_)for(g=C;w>=g;++g)I[D++]=T[_*l+g];return new y({buffer:I,width:b,height:x,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function p(e,t,r,i,n,o,a,l){var u,c,h,d,p=e._width,v=e._height,g=e._structure,C=g.stride,w=e._buffer,S=new w.constructor(p*v*C),E=t.tileXYToRectangle(r,i,n),b=t.tileXYToRectangle(o,a,l);if(C>1){var x=g.elementsPerHeight,T=g.elementMultiplier,P=g.isBigEndian,A=Math.pow(T,x-1);for(c=0;v>c;++c)for(h=s.lerp(b.north,b.south,c/(v-1)),u=0;p>u;++u){d=s.lerp(b.west,b.east,u/(p-1));var M=f(w,x,T,C,P,E,p,v,d,h);_(S,x,T,A,C,P,c*p+u,M)}}else for(c=0;v>c;++c)for(h=s.lerp(b.north,b.south,c/(v-1)),u=0;p>u;++u)d=s.lerp(b.west,b.east,u/(p-1)),S[c*p+u]=m(w,E,p,v,d,h);return new y({buffer:S,width:p,height:v,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function m(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,p=s-c;c=i-1-c,h=i-1-h;var m=e[c*r+l],f=e[c*r+u],g=e[h*r+l],_=e[h*r+u];return v(d,p,m,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,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,r,i,n,m*a+d),w=g(e,t,r,i,n,m*a+p),S=g(e,t,r,i,n,f*a+d),E=g(e,t,r,i,n,f*a+p);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),p=s.cartographicToCartesian(l.center(d)),m=this._structure,f=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0)),v=f/(1<<a),g=C.scheduleTask({heightmap:this._buffer,structure:m,width:this._width,height:this._height,nativeRectangle:u,rectangle:d,relativeToCenter:p,ellipsoid:s,skirtHeight:Math.min(4*v,1e3),isGeographic:t instanceof o});return r(g)?e(g,function(e){return new c(p,new Float32Array(e.vertices),h.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace)}):void 0},y.prototype.interpolateHeight=function(e,t,r){var i,n=this._width,o=this._height,a=this._structure,s=a.stride;if(s>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=m(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):p(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)},y.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},y}),r("Core/loadImage",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl"],function(e,t,r,i,n){"use strict";var o=/^data:/,a=function(r,i){return i=t(i,!0),e(r,function(t){var r;r=o.test(t)||!i?!1:n(t);var s=e.defer();return a.createImage(t,r,s),s.promise})};return a.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(i.crossOrigin=""),i.src=e},a.defaultCreateImage=a.createImage,a}),r("Core/throttleRequestByServer",["../ThirdParty/Uri","../ThirdParty/when","./defaultValue"],function(e,t,r){"use strict";function i(t){var r=new e(t).resolve(a);r.normalize();var i=r.authority;return/:/.test(i)||(i=i+":"+("https"===r.scheme?"443":"80")),i}var n=6,o={},a=new e(document.location.href),s=function(e,a){var s=i(e),l=r(o[s],0);return l>=n?void 0:(o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,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,p,m){"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=p.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),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;i(f)&&(p=f.getURL(p));var v=m(p,h);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<<e)},f.prototype.getTileDataAvailable=function(){return void 0},f}),r("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){this._array=[],this._hash={}};return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var r=this._hash[e];t!==r&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var r=this._hash[t],i=e(r);if(i){var n=this._array;n.splice(n.indexOf(r),1),this._hash[t]=void 0}return i},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),r("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,i,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 r=t.x,i=t.y;t.x=(1-Math.abs(i))*n.signNotZero(r),t.y=(1-Math.abs(r))*n.signNotZero(i)}return t.x=n.toSNorm(t.x),t.y=n.toSNorm(t.y),t},o.octDecode=function(e,r,i){if(i.x=n.fromSNorm(e),i.y=n.fromSNorm(r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*n.signNotZero(o),i.y=(1-Math.abs(o))*n.signNotZero(i.y)}return t.normalize(i,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var r=e/256,i=Math.floor(r),n=256*(r-i);return o.octDecode(i,n,t)},o.octPack=function(e,t,r,i){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(r,a);return i.x=65536*l.x+n,i.y=65536*l.y+s,i},o.octUnpack=function(e,t,r,i){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,r),o.octDecode(a,l,i)},o.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},o.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},o}),r("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),r("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,i,n){"use strict";var o=function(i,n,o){this.minimum=e.clone(t(i,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),r(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,i){if(r(i)||(i=new o),!r(t)||0===t.length)return i.minimum=e.clone(e.ZERO,i.minimum),i.maximum=e.clone(e.ZERO,i.maximum),i.center=e.clone(e.ZERO,i.center),i;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=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.width<n||i+e.height<o||i>o+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","./Math"],function(e,t,r,i,n){"use strict";var o=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)};o.fromElements=function(e,r,i,n,a){return t(a)?(a.x=e,a.y=r,a.z=i,a.w=n,a):new o(e,r,i,n)},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,i){i=e(i,0),r[i++]=t.x,r[i++]=t.y,r[i++]=t.z,r[i]=t.w},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.w=r[i],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,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.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(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 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;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,l);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.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,r,i,o){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.x,r.x,i,o)&&n.equalsEpsilon(e.y,r.y,i,o)&&n.equalsEpsilon(e.z,r.z,i,o)&&n.equalsEpsilon(e.w,r.w,i,o)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),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(p[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(p[a],d[a])]);s>i&&(n=a,i=s)}var l=1,c=0,h=d[n],m=p[n];if(Math.abs(e[u.getElementIndex(m,h)])>r){var f,v=e[u.getElementIndex(m,m)],g=e[u.getElementIndex(h,h)],_=e[u.getElementIndex(m,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(m,m)]=l,t[u.getElementIndex(m,h)]=c,t[u.getElementIndex(h,m)]=-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.packedLength=9,u.pack=function(e,r,i){i=t(i,0),r[i++]=e[0],r[i++]=e[1],r[i++]=e[2],r[i++]=e[3],r[i++]=e[4],r[i++]=e[5],r[i++]=e[6],r[i++]=e[7],r[i++]=e[8]},u.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n[0]=e[i++],n[1]=e[i++],n[2]=e[i++],n[3]=e[i++],n[4]=e[i++],n[5]=e[i++],n[6]=e[i++],n[7]=e[i++],n[8]=e[i++],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):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,p=e.w*e.w,m=i-s-h+p,f=2*(n-d),v=2*(o+c),g=2*(n+d),_=-i+s-h+p,y=2*(l-a),C=2*(o-c),w=2*(l+a),S=-i-s+h+p;return r(t)?(t[0]=m,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(m,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],p=[2,2,1],m=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),p=t.diagonal=u.clone(e,t.diagonal),v=i*a(p);n>h&&s(p)>v;)l(p,m),u.transpose(m,f),u.multiply(p,m,p),u.multiply(f,p,p),u.multiply(d,m,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],p=e[8],m=u.determinant(e);if(Math.abs(m)<=o.EPSILON15)throw new i("matrix is not invertible");t[0]=l*p-d*c,t[1]=d*a-n*p,t[2]=n*c-l*a,t[3]=h*c-s*p,t[4]=r*p-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/m;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.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},u}),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,p,m,f,v){this[0]=r(e,0),this[1]=r(o,0),this[2]=r(u,0),this[3]=r(p,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(c,0),this[7]=r(m,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(h,0),this[11]=r(f,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(d,0),this[15]=r(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,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),w=2*(h+f),S=2*(c+g),E=-l+p-v+_,b=2*(m-d),x=2*(h-f),T=2*(m+d),P=-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]=E*a,n[6]=T*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,p=h.z,m=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+p*-S,b=g*-C+_*-w+y*-S,x=m*C+f*w+v*S;return i(r)?(r[0]=s,r[1]=g,r[2]=-m,r[3]=0,r[4]=l,r[5]=_,r[6]=-f,r[7]=0,r[8]=p,r[9]=y,r[10]=-v,r[11]=0,r[12]=E,r[13]=b,r[14]=x,r[15]=1,r):new u(s,l,p,E,g,_,y,b,-m,-f,-v,x,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,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,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,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 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 p=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var m=new e;u.getMaximumScale=function(t){return u.getScale(t,m),e.maximumComponent(m)},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],p=e[10],m=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],x=t[6],T=t[7],P=t[8],A=t[9],M=t[10],I=t[11],D=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+p*w+g*S,z=a*y+c*C+m*w+_*S,V=i*E+s*b+h*x+f*T,k=n*E+l*b+d*x+v*T,U=o*E+u*b+p*x+g*T,W=a*E+c*b+m*x+_*T,G=i*P+s*A+h*M+f*I,H=n*P+l*A+d*M+v*I,q=o*P+u*A+p*M+g*I,j=a*P+c*A+m*M+_*I,Y=i*D+s*O+h*R+f*L,X=n*D+l*O+d*R+v*L,Z=o*D+u*O+p*R+g*L,J=a*D+c*O+m*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]=J,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],p=e[13],m=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],x=t[13],T=t[14],P=i*f+a*v+u*g,A=n*f+s*v+c*g,M=o*f+l*v+h*g,I=i*_+a*y+u*C,D=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*x+u*T+d,B=n*b+s*x+c*T+p,z=o*b+l*x+h*T+m;return r[0]=P,r[1]=A,r[2]=M,r[3]=0,r[4]=I,r[5]=D,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.multiplyByMatrix3=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=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],w=i*d+a*p+u*m,S=n*d+s*p+c*m,E=o*d+l*p+h*m,b=i*f+a*v+u*g,x=n*f+s*v+c*g,T=o*f+l*v+h*g,P=i*_+a*y+u*C,A=n*_+s*y+c*C,M=o*_+l*y+h*C;return r[0]=w,r[1]=S,r[2]=E,r[3]=0,r[4]=b,r[5]=x,r[6]=T,r[7]=0,r[8]=P,r[9]=A,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],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[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,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],p=e[9],m=e[13],f=e[2],C=e[6],w=e[10],S=e[14],E=e[3],b=e[7],x=e[11],T=e[15],P=w*T,A=S*x,M=C*T,I=S*b,D=C*x,O=w*b,R=f*T,L=S*E,N=f*x,F=w*E,B=f*b,z=C*E,V=P*d+I*p+D*m-(A*d+M*p+O*m),k=A*h+R*p+F*m-(P*h+L*p+N*m),U=M*h+L*d+B*m-(I*h+R*d+z*m),W=O*h+N*d+z*p-(D*h+F*d+B*p),G=A*n+M*o+O*c-(P*n+I*o+D*c),H=P*i+L*o+N*c-(A*i+R*o+F*c),q=I*i+R*n+z*c-(M*i+L*n+B*c),j=D*i+F*n+B*o-(O*i+N*n+z*o);P=o*m,A=c*p,M=n*m,I=c*d,D=n*p,O=o*d,R=i*m,L=c*h,N=i*p,F=o*h,B=i*d,z=n*h;var Y=P*b+I*x+D*T-(A*b+M*x+O*T),X=A*E+R*x+F*T-(P*E+L*x+N*T),Z=M*E+L*b+B*T-(I*E+R*b+z*T),J=O*E+N*b+z*x-(D*E+F*b+B*x),Q=M*w+O*S+A*C-(D*S+P*C+I*w),K=N*S+P*f+L*w-(R*w+F*S+A*f),$=R*C+z*S+I*f-(B*S+M*f+L*C),et=B*w+D*f+F*C-(N*C+z*w+O*f),tt=i*V+n*k+o*U+c*W;if(Math.abs(tt)<a.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=V*tt,r[1]=k*tt,r[2]=U*tt,r[3]=W*tt,r[4]=G*tt,r[5]=H*tt,r[6]=q*tt,r[7]=j*tt,r[8]=Y*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},u.inverseTransformation=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],h=e[12],d=e[13],p=e[14],m=-r*h-i*d-n*p,f=-o*h-a*d-s*p,v=-l*h-u*d-c*p;return t[0]=r,t[1]=o,t[2]=l,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=m,t[13]=f,t[14]=v,t[15]=1,t},u.IDENTITY=o(new u(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN0ROW3=3,u.COLUMN1ROW0=4,u.COLUMN1ROW1=5,u.COLUMN1ROW2=6,u.COLUMN1ROW3=7,u.COLUMN2ROW0=8,u.COLUMN2ROW1=9,u.COLUMN2ROW2=10,u.COLUMN2ROW3=11,u.COLUMN3ROW0=12,u.COLUMN3ROW1=13,u.COLUMN3ROW2=14,u.COLUMN3ROW3=15,u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&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]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.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]+")"},u}),r("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(t,i){this.center=e.clone(r(t,e.ZERO)),this.radius=r(i,0)},d=new e,p=new e,m=new e,f=new e,v=new e,g=new e,_=new e,y=new e,C=new e,w=new e,S=new e,E=new e;h.fromPoints=function(t,r){if(i(r)||(r=new h),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],_),o=e.clone(n,d),a=e.clone(n,p),s=e.clone(n,m),l=e.clone(n,f),u=e.clone(n,v),c=e.clone(n,g),b=t.length,x=1;b>x;x++){e.clone(t[x],n);var T=n.x,P=n.y,A=n.z;T<o.x&&e.clone(n,o),T>l.x&&e.clone(n,l),P<a.y&&e.clone(n,a),P>u.y&&e.clone(n,u),A<s.z&&e.clone(n,s),A>c.z&&e.clone(n,c)}var M=e.magnitudeSquared(e.subtract(l,o,y)),I=e.magnitudeSquared(e.subtract(u,a,y)),D=e.magnitudeSquared(e.subtract(c,s,y)),O=o,R=l,L=M;I>L&&(L=I,O=a,R=u),D>L&&(L=D,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(x=0;b>x;x++){e.clone(t[x],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,x=new e,T=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,x),u=n.project(A,T),d=u.x-l.x,p=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(d*d+p*p+m*m);var f=s.center;return f.x=l.x+.5*d,f.y=l.y+.5*p,f.z=l.z+.5*m,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,p),c=e.clone(s,m),b=e.clone(s,f),x=e.clone(s,v),T=e.clone(s,g),P=t.length,A=0;P>A;A+=o){var M=t[A]+n.x,I=t[A+1]+n.y,D=t[A+2]+n.z;s.x=M,s.y=I,s.z=D,M<l.x&&e.clone(s,l),M>b.x&&e.clone(s,b),I<u.y&&e.clone(s,u),I>x.y&&e.clone(s,x),D<c.z&&e.clone(s,c),D>T.z&&e.clone(s,T)}var O=e.magnitudeSquared(e.subtract(b,l,y)),R=e.magnitudeSquared(e.subtract(x,u,y)),L=e.magnitudeSquared(e.subtract(T,c,y)),N=l,F=b,B=O;R>B&&(B=R,N=u,F=x),L>B&&(B=L,N=c,F=T);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=x.y,W.z=T.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};var I=new e;h.fromBoundingSpheres=function(t,r){if(i(r)||(r=new h),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return h.clone(t[0],r);if(2===n)return h.union(t[0],t[1],r);for(var o=[],a=0;n>a;a++)o.push(t[a].center);r=h.fromPoints(o,r);var s=r.center,l=r.radius;for(a=0;n>a;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,I)+u.radius)}return r.radius=l,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,O=new e;h.union=function(t,r,n){i(n)||(n=new h);var o=t.center,a=r.center;e.add(o,a,O);var s=e.multiplyByScalar(O,.5,O),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 R=new e;h.expand=function(t,r,i){i=h.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,R));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 L=new e;h.distanceSquaredTo=function(t,r){var i=e.subtract(t.center,r,L);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 N=new e;h.computePlaneDistances=function(t,r,n,o){i(o)||(o=new l);var a=e.subtract(t.center,r,N),s=e.multiplyByScalar(n,e.dot(n,a),N),u=e.magnitude(s);return o.start=u-t.radius,o.stop=u+t.radius,o};for(var F=new e,B=new e,z=new e,V=new e,k=new e,U=new t,W=new Array(8),G=0;8>G;++G)W[G]=new e;var H=new a;return h.projectTo2D=function(t,i,n){i=r(i,H);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,F),u=e.cross(e.UNIT_Z,l,B);e.normalize(u,u);var c=e.cross(l,u,z);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,k),p=e.negate(u,V),m=W,f=m[0];e.add(l,c,f),e.add(f,u,f),f=m[1],e.add(l,c,f),e.add(f,p,f),f=m[2],e.add(l,d,f),e.add(f,p,f),f=m[3],e.add(l,d,f),e.add(f,u,f),e.negate(l,l),f=m[4],e.add(l,c,f),e.add(f,u,f),f=m[5],e.add(l,c,f),e.add(f,p,f),f=m[6],e.add(l,d,f),e.add(f,p,f),f=m[7],e.add(l,d,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(_,U);i.project(y,_)}n=h.fromPoints(m,n),a=n.center;var C=a.x,w=a.y,S=a.z;return a.x=S,a.y=C,a.z=w,n},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(v)){v=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(v=!0,g=i(e[1]))}return v}function o(){return n()&&g}function a(){if(!t(_)&&(_=!1,!n()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(_=!0,y=i(e[1]))}return _}function s(){return a()&&y}function l(){if(!t(C)){C=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(C=!0,w=i(e[1]),w.isNightly=!!e[2])}return C}function u(){return l()&&w}function c(){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,E=i(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(S=!0,E=i(e[1])))}return S}function h(){return c()&&E}function d(){if(!t(b)){b=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(b=!0,x=i(e[1]))}return b}function p(){return t(T)||(T=/Windows/i.test(navigator.appVersion)),T}function m(){return d()&&x}function f(){return t(P)||(P=t(window.PointerEvent)&&(!t(window.navigator.pointerEnabled)||window.navigator.pointerEnabled)),P}var v,g,_,y,C,w,S,E,b,x,T,P,A={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(navigator.hardwareConcurrency,3),supportsPointerEvents:f};return A.supportsFullscreen=function(){return r.supportsFullscreen()},A.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},A.supportsWebWorkers=function(){return"undefined"!=typeof Worker},A}),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),this.boundingSphereCV=void 0};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","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"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=i(new n({position:!0})),n.POSITION_AND_NORMAL=i(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=i(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=i(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=i(new n({position:!0,color:!0})),n.ALL=i(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,r,i){i=e(i,0),r[i++]=t.position?1:0,r[i++]=t.normal?1:0,r[i++]=t.st?1:0,r[i++]=t.binormal?1:0,r[i++]=t.tangent?1:0,r[i++]=t.color?1:0},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.position=1===r[i++],o.normal=1===r[i++],o.st=1===r[i++],o.binormal=1===r[i++],o.tangent=1===r[i++],o.color=1===r[i++],o},n.clone=function(e,r){return t(e)?(t(r)||(r=new n),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},n}),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"};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.packedLength=2*t.packedLength+c.packedLength,d.pack=function(e,r,n){n=i(n,0),t.pack(e._minimumCorner,r,n),t.pack(e._maximumCorner,r,n+t.packedLength),c.pack(e._vertexFormat,r,n+2*t.packedLength)};var p=new t,m=new t,f=new c,v={minimumCorner:p,maximumCorner:m,vertexFormat:f};return d.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,p),s=t.unpack(e,r+t.packedLength,m),l=c.unpack(e,r+2*t.packedLength,f);return n(o)?(o._minimumCorner=t.clone(a,o._minimumCorner),o._maximumCorner=t.clone(s,o._maximumCorner),o._vertexFormat=c.clone(l,o._vertexFormat),o):new d(v)},d.createGeometry=function(i){var n,o,c=i._minimumCorner,d=i._maximumCorner,p=i._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]=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,m.position=new s({componentDatatype:r.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:r.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:r.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:r.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: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,m.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:m,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"};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.packedLength=2*t.packedLength,h.pack=function(e,r,n){n=i(n,0),t.pack(e._min,r,n),t.pack(e._max,r,n+t.packedLength)};var d=new t,p=new t,m={minimumCorner:d,maximumCorner:p};return h.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,d),s=t.unpack(e,r+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new h(m)},h.createGeometry=function(i){var n=i._min,o=i._max,h=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,h.position=new s({componentDatatype:r.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,c),f=.5*t.magnitude(m);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&&t<i[r+1])return r;if(n>r+2&&t<i[r+2])return r+1}else if(r-1>=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;n-1>o&&!(t>=i[o]&&t<i[o+1]);++o);else for(o=r-1;o>=0&&!(t>=i[o]&&t<i[o+1]);--o);return o===n-1&&(o=n-2),o},i}),r("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,r,i,n,o){"use strict";var a=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.points,i=e.times;this._times=i,this._points=r,this._lastTimeIndex=0};return i(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,i){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return r(i)||(i=new e),e.lerp(n[a],n[a+1],s,i)},a}),r("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e){"use strict";var t={};return t.solve=function(t,r,i,n){var o,a=new Array(i.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=i[0]/r[0],s[0]=e.multiplyByScalar(n[0],1/r[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(r[o]-a[o-1]*t[o-1]),a[o]=i[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(r[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},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=m,s=p,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;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,h=l[c],i(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h);return o[c]=0,a[c]=1,s[c]=4,h=l[c],i(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h),s[c+1]=1,h=l[c+1],i(h)||(h=l[c+1]=new e),e.clone(n,h),u.solve(o,s,a,l)}function h(t){var r=d,n=m,o=p,a=f;r.length=n.length=t.length-1,o.length=a.length=t.length;var s;r[0]=n[0]=1,o[0]=2;var l=a[0];for(i(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<r.length;++s)r[s]=n[s]=1,o[s]=4,l=a[s],i(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],i(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(r,o,n,a)}var d=[],p=[],m=[],f=[],v=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.points,i=e.times,n=e.inTangents,o=e.outTangents;this._times=i,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0};n(v.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),v.createC1=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.tangents,o=n.slice(0,n.length-1),a=n.slice(1,n.length);return new v({times:t,points:i,inTangents:a,outTangents:o})},v.createNaturalCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points;if(i.length<3)return new a({points:i,times:t});var n=h(i),o=n.slice(0,n.length-1),s=n.slice(1,n.length);return new v({times:t,points:i,inTangents:s,outTangents:o})},v.createClampedCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.firstTangent,o=e.lastTangent;if(i.length<3)return new a({points:i,times:t});var s=c(i,n,o),l=s.slice(0,s.length-1),u=s.slice(1,s.length);return new v({times:t,points:i,inTangents:u,outTangents:l})},v.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),v.prototype.findTimeInterval=l.prototype.findTimeInterval;var g=new t,_=new e;return v.prototype.evaluate=function(t,r){i(r)||(r=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),h=g;h.z=c,h.y=c*c,h.x=h.y*c,h.w=1;var d=s.multiplyByVector(v.hermiteCoefficientMatrix,h,h);return r=e.multiplyByScalar(n[u],d.x,r),e.multiplyByScalar(n[u+1],d.y,_),e.add(r,_,r),e.multiplyByScalar(l[u],d.z,_),e.add(r,_,r),e.multiplyByScalar(a[u],d.w,_),e.add(r,_,r)},v}),r("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./HermiteSpline","./Matrix4","./Spline"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){var r=t.points,n=t.times;if(r.length<3){var o=n[0],l=1/(n[1]-o),u=r[0],p=r[1];return function(t,r){i(r)||(r=new e);var n=(t-o)*l;return e.lerp(u,p,n,r)}}return function(o,l){i(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),p=(o-n[u])/(n[u+1]-n[u]),m=c;m.z=p,m.y=p*p,m.x=m.y*p,m.w=1;var v,g,_,y,C;return 0===u?(v=r[0],g=r[1],_=t.firstTangent,y=e.subtract(r[2],v,h),e.multiplyByScalar(y,.5,y),C=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):u===r.length-2?(v=r[u],g=r[u+1],y=t.lastTangent,_=e.subtract(g,r[u-1],h),e.multiplyByScalar(_,.5,_),C=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):(v=r[u-1],g=r[u],_=r[u+1],y=r[u+2],C=s.multiplyByVector(f.catmullRomCoefficientMatrix,m,m)),l=e.multiplyByScalar(v,C.x,l),e.multiplyByScalar(g,C.y,d),e.add(l,d,l),e.multiplyByScalar(_,C.z,d),e.add(l,d,l),e.multiplyByScalar(y,C.w,d),e.add(l,d,l)}}var c=new t,h=new e,d=new e,p=new e,m=new e,f=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(n.length>2&&(i(a)||(a=p,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=m,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;i<r.length;++i){var n=r[i],o=n.indexOf(": ");if(o>0){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;o<r.length;o++)n[o]=r.charCodeAt(o);return i}function l(e,r){r=t(r,"");var n=e[1],o=!!e[2],l=e[3];switch(r){case"":case"text":return a(o,l);case"arraybuffer":return s(o,l);case"blob":var u=s(o,l);return new Blob([u],{type:n});case"document":var c=new DOMParser;return c.parseFromString(a(o,l),n);case"json":return JSON.parse(a(o,l));default:throw new i("Unhandled responseType: "+r)}}var u=function(r){r=t(r,t.EMPTY_OBJECT);var i=r.responseType,n=t(r.method,"GET"),o=r.data,a=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,i,n,o,a,r,s),r.promise})},c=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,i,a,s,u,h){var d=c.exec(e);if(null!==d)return u.resolve(l(d,t)),void 0;var p=new XMLHttpRequest;if(r(h)&&r(p.overrideMimeType)&&p.overrideMimeType(h),p.open(i,e,!0),r(s))for(var m in s)s.hasOwnProperty(m)&&p.setRequestHeader(m,s[m]);r(t)&&(p.responseType=t),p.onload=function(){200===p.status?r(p.response)?u.resolve(p.response):r(p.responseXML)&&p.responseXML.hasChildNodes()?u.resolve(p.responseXML):r(p.responseText)?u.resolve(p.responseText):u.reject(new o("unknown XMLHttpRequest response type.")):u.reject(new n(p.status,p.response,p.getAllResponseHeaders()))},p.onerror=function(){u.reject(new n)},p.send(a)},u.defaultLoad=u.load,u}),r("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"arraybuffer",headers:r})};return t}),r("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n};return t}),r("Core/loadText",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,headers:r})};return t}),r("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,i){"use strict";var n={Accept:"application/json,*/*;q=0.01"},o=function(r,o){return t(o)?t(o.Accept)||(o=e(o),o.Accept=n.Accept):o=n,i(r,o).then(function(e){return JSON.parse(e)})};return o}),r("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,r,i,n,o,a){t(a)?a.length=0:a=[];var s,l,u;r?(s=e>i,l=e>n,u=e>o):(s=i>e,l=n>e,u=o>e);var c,h,d,p,m,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),p=(e-n)/(i-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)/(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!==m&&(a.push(-1),a.push(2),a.push(0),a.push(m))):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)):(p=(e-n)/(i-n),m=(e-o)/(i-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(r,i,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=i-u,g=r-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}),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){m.length=e.length;for(var i=!1,n=0,o=e.length;o>n;++n)m[n]=e[n],i=i||n>0&&t(e[n-1],e[n])>0;return i?(m.sort(t),s.createTypedArray(r,m)):e}var p=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(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var m=[],f=new c("createVerticesFromQuantizedTerrainMesh");p.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");p.prototype.upsample=function(i,o,a,l,u,c,h){var d=2*o!==u,m=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:m,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=m?.5*y:this._southSkirtHeight,S=d?this._eastSkirtHeight:.5*y,E=m?this._northSkirtHeight:.5*y;return e(_,function(e){var i,o=new Uint16Array(e.vertices),a=s.createTypedArray(o.length/3,e.indices);return n(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new p({quantizedVertices:o,indices:a,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 p.prototype.interpolateHeight=function(e,t,r){var i=u.clamp((t-e.west)/e.width,0,1);i*=g;var n=u.clamp((r-e.south)/e.height,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 p=c[h],m=c[h+1],f=c[h+2],v=o[p],y=o[m],C=o[f],w=a[p],S=a[m],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 x=b.x*s[p]+b.y*s[m]+b.z*s[f];return u.lerp(this._minimumHeight,this._maximumHeight,x/g)}}return void 0},p.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)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),r("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r};return t}),r("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,r){"use strict";var i=function(t,r,i,n,o,a){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1};return i.handleError=function(e,n,o,a,s,l,u,c){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,++h.timesRetried):h=new i(n,a,s,l,u,0),o.numberOfListeners>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,p,m,f,v,g,_,y,C){"use strict";function w(e){if(s(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function S(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 E(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,m=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 x=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var T=new i(new n(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0)),w.getFloat64(u+d,!0));u+=m;var A=new n(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=d;var M=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var I=new Uint16Array(t,u,3*M);u+=M*g,M>65536&&(y=Uint32Array.BYTES_PER_ELEMENT,C=y*_);var D,O=I.subarray(0,M),R=I.subarray(M,2*M),L=I.subarray(2*M,3*M),N=0,F=0,B=0;for(D=0;M>D;++D)N+=l(O[D]),F+=l(R[D]),B+=l(L[D]),O[D]=N,R[D]=F,L[D]=B;0!==u%y&&(u+=y-u%y);var z=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var V=p.createTypedArrayFromArrayBuffer(M,t,u,z*_);u+=z*C;var k=0;for(D=0;D<V.length;++D){var U=V[D];V[D]=k-U,0===U&&++k}var W=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var G=p.createTypedArrayFromArrayBuffer(M,t,u,W);u+=W*y;var H=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var q=p.createTypedArrayFromArrayBuffer(M,t,u,H);u+=H*y;var j=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Y=p.createTypedArrayFromArrayBuffer(M,t,u,j);u+=j*y;var X=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Z=p.createTypedArrayFromArrayBuffer(M,t,u,X);u+=X*y;for(var J,Q;u<w.byteLength;){var K=w.getUint8(u,!0);u+=Uint8Array.BYTES_PER_ELEMENT;var $=w.getUint32(u,e._littleEndianExtensionSize);u+=Uint32Array.BYTES_PER_ELEMENT,K===P.OCT_VERTEX_NORMALS&&e._requestVertexNormals?J=new Uint8Array(t,u,2*M):K===P.WATER_MASK&&e._requestWaterMask&&(Q=new Uint8Array(t,u,$)),u+=$}var et=5*e.getLevelMaximumGeometricError(r);return new v({center:S,minimumHeight:E,maximumHeight:x,boundingSphere:T,horizonOcclusionPoint:A,quantizedVertices:I,encodedNormals:J,indices:V,westIndices:G,southIndices:q,eastIndices:Y,northIndices:Z,westSkirtHeight:et,southSkirtHeight:et,eastSkirtHeight:et,northSkirtHeight:et,childTileMask:b(e,r,o,s),waterMask:Q})}function b(e,t,r,i){var n=e._availableTiles;if(!n||0===n.length)return 15;var o=t+1;if(o>=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 T=function(i){function n(t){var r;if(!t.format)return r="The tile format is not specified in the layer.json file.",m=C.handleError(m,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.",m=C.handleError(m,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,v._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return r='The tile format "'+t.format+'" is invalid or not supported.',m=C.handleError(m,v,v._errorEvent,r,void 0,void 0,void 0,u),void 0;var i=new e(p);v._tileUrlTemplates=t.tiles;for(var n=0;n<v._tileUrlTemplates.length;++n)v._tileUrlTemplates[n]=new e(v._tileUrlTemplates[n]).resolve(i).toString().replace("{version}",t.version);v._availableTiles=t.available,!s(v._credit)&&s(t.attribution)&&null!==t.attribution&&(v._credit=new o(t.attribution)),s(t.extensions)&&-1!==t.extensions.indexOf("octvertexnormals")?v._hasVertexNormals=!0:s(t.extensions)&&-1!==t.extensions.indexOf("vertexnormals")&&(v._hasVertexNormals=!0,v._littleEndianExtensionSize=!1),s(t.extensions)&&-1!==t.extensions.indexOf("watermask")&&(v._hasWaterMask=!0),v._ready=!0}function l(e){if(s(e)&&404===e.statusCode)return n({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]}),void 0;
var t="An error occurred while accessing "+p+".";m=C.handleError(m,v,v._errorEvent,t,void 0,void 0,void 0,u)}function u(){var e=f(p);t(e,n,l)}this._url=r(i.url),this._proxy=i.proxy,this._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=_.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=a(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=a(i.requestWaterMask,!1),this._errorEvent=new c;var d=i.credit;"string"==typeof d&&(d=new o(d)),this._credit=d,this._ready=!1;var p=this._url+"layer.json";s(this._proxy)&&(p=this._proxy.getURL(p));var m,v=this;u()},P={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return T.prototype.requestTileGeometry=function(e,r,i,n){var o=this._tileUrlTemplates;if(0===o.length)return void 0;var l=this._tilingScheme.getNumberOfYTilesAtLevel(i),u=l-r-1,c=o[0].replace("{z}",i).replace("{x}",e).replace("{y}",u),h=this._proxy;s(h)&&(c=h.getURL(c));var d,p=[];this._requestVertexNormals&&this._hasVertexNormals&&p.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&p.push("watermask");var f=function(e){return m(e,w(p))};if(n=a(n,!0)){if(d=y(c,f),!s(d))return void 0}else d=f(c);var v=this;return t(d,function(t){return s(v._heightmapStructure)?S(v,t,i,e,r,u):E(v,t,i,e,r,u)})},l(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}},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<<e)},T.prototype.getTileDataAvailable=function(e,t,r){var i=this._availableTiles;if(i&&0!==i.length){if(r>=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},T}),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],p=e[s.COLUMN1ROW1],m=e[s.COLUMN2ROW2],f=d+p+m;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;p>d&&(g=1),m>d&&m>p&&(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 l;l.fromHeadingPitchRoll=function(t,r,i,n){var o=l.fromAxisAngle(e.UNIT_X,i,d),a=l.fromAxisAngle(e.UNIT_Y,-r,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,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,g),l.conjugate(g,g);for(var n=0,o=r-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);i[a]=p.x*s,i[a+1]=p.y*s,i[a+2]=p.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,v),0===s?l.clone(l.IDENTITY,f):l.fromAxisAngle(m,s,f),l.multiply(f,v,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,p=a*u+i*l-n*s+o*c,m=a*c-i*s-n*l-o*u;return r.x=h,r.y=d,r.z=p,r.w=m,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)<a.EPSILON6)return t.x=t.y=t.z=0,t;var i=1/Math.sqrt(1-r*r);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},l.computeAngle=function(e){return Math.abs(e.w-1)<a.EPSILON6?0:2*Math.acos(e.w)};var _=new l;l.lerp=function(e,t,r,i){return _=l.multiplyByScalar(t,r,_),i=l.multiplyByScalar(e,1-r,i),l.add(_,i,i)};var y=new l,C=new l,w=new l;l.slerp=function(e,t,r,i){var n=l.dot(e,t),o=t;if(0>n&&(n=-n,o=y=l.negate(t,y)),1-n<a.EPSILON6)return l.lerp(e,o,r,i);var s=Math.acos(n);return C=l.multiplyByScalar(e,Math.sin((1-r)*s),C),w=l.multiplyByScalar(o,Math.sin(r*s),w),i=l.add(C,w,i),l.multiplyByScalar(i,1/Math.sin(s),i)},l.log=function(t,r){var i=a.acosClamped(t.w),n=0;return 0!==i&&(n=i/Math.sin(i)),e.multiplyByScalar(t,n,r)},l.exp=function(t,r){var i=e.magnitude(t),n=0;return 0!==i&&(n=Math.sin(i)/i),r.x=t.x*n,r.y=t.y*n,r.z=t.z*n,r.w=Math.cos(i),r};var S=new e,E=new e,b=new l,x=new l;l.computeInnerQuadrangle=function(t,r,i,n){var o=l.conjugate(r,b);l.multiply(o,i,x);var a=l.log(x,S);l.multiply(o,t,x);var s=l.log(x,E);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),l.exp(a,b),l.multiply(r,b,n)},l.squad=function(e,t,r,i,n,o){var a=l.slerp(e,t,n,b),s=l.slerp(r,i,n,x);return l.slerp(a,s,2*n*(1-n),o)};for(var T=new l,P=1.9011074535173003,A=n.supportsTypedArrays()?new Float32Array(8):[],M=n.supportsTypedArrays()?new Float32Array(8):[],I=n.supportsTypedArrays()?new Float32Array(8):[],D=n.supportsTypedArrays()?new Float32Array(8):[],O=0;7>O;++O){var R=O+1,L=2*R+1;A[O]=1/(R*L),M[O]=R/L}return A[7]=P/136,M[7]=8*P/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)I[h]=(A[h]*u-M[h])*a,D[h]=(A[h]*c-M[h])*a;var d=n*r*(1+I[0]*(1+I[1]*(1+I[2]*(1+I[3]*(1+I[4]*(1+I[5]*(1+I[6]*(1+I[7])))))))),p=s*(1+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,T);return l.multiplyByScalar(t,d,i),l.add(m,i,i)},l.fastSquad=function(e,t,r,i,n,o){var a=l.fastSlerp(e,t,n,b),s=l.fastSlerp(r,i,n,x);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,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),w=C/m;return i.fromAxisAngle(a,w,l),r.fromQuaternion(l,u),r.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,m,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,p=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=t.length,m=i?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),w=e.multiplyByScalar(C,o,d);e.add(_,w,_),i&&(e.multiplyByScalar(C,a,w),e.add(y,w,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(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,p=8*r.granularity,g=a*a,_=s*s,y=s*a,C=e.magnitude(u),w=e.normalize(u,m),S=e.cross(e.UNIT_Z,u,f);S=e.normalize(S,S);var E=e.cross(w,S,v),b=1+Math.ceil(t.PI_OVER_TWO/p),x=t.PI_OVER_TWO/(b-1),T=t.PI_OVER_TWO-b*x;0>T&&(b-=Math.ceil(Math.abs(T)/x));var P,A,M,I,D,O=2*b*(b+1),R=i?new Array(3*O):void 0,L=0,N=c,F=h,B=3*(2*b+2*(b-1)),z=B-1,V=0,k=o?new Array(B):void 0;for(T=t.PI_OVER_TWO,P=0;b>P;++P){if(N=n(T,l,E,S,g,y,_,C,w,N),F=n(Math.PI-T,l,E,S,g,y,_,C,w,F),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,M=2*P+2,A=1;M-1>A;++A)I=A/(M-1),D=e.lerp(N,F,I,d),R[L++]=D.x,R[L++]=D.y,R[L++]=D.z;R[L++]=F.x,R[L++]=F.y,R[L++]=F.z}o&&(k[z--]=N.z,k[z--]=N.y,k[z--]=N.x,0!==P&&(k[V++]=F.x,k[V++]=F.y,k[V++]=F.z)),T=t.PI_OVER_TWO-(P+1)*x}for(P=b;P>0;--P){if(T=t.PI_OVER_TWO-(P-1)*x,N=n(-T,l,E,S,g,y,_,C,w,N),F=n(T+Math.PI,l,E,S,g,y,_,C,w,F),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,M=2*(P-1)+2,A=1;M-1>A;++A)I=A/(M-1),D=e.lerp(N,F,I,d),R[L++]=D.x,R[L++]=D.y,R[L++]=D.z;R[L++]=F.x,R[L++]=F.y,R[L++]=F.z}o&&(k[z--]=N.z,k[z--]=N.y,k[z--]=N.x,1!==P&&(k[V++]=F.x,k[V++]=F.y,k[V++]=F.z))}var U={};return i&&(U.positions=R,U.numPts=b),o&&(U.outerPositions=k),U},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,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0};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,p,m,f,v,g,_;r(s.z)?(h=t.subtract(l,s,i),d=t.subtract(u,s,n),p=t.subtract(a,s,o),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,s,i),d=e.subtract(u,s,n),p=e.subtract(a,s,o),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};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)))<i?0:n}var i={};return i.computeDiscriminant=function(e,t,r){var i=t*t-4*e*r;return i},i.computeRealRoots=function(e,i,n){var o;if(0===e)return 0===i?[]:[-n/i];if(0===i){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(s>a&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(o=-n/e,0>o)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,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 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),x=o===S?-b:-y/b;return n=0>=y?b+x:-C/(b*b+x*x+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var T=m,P=-2*s*m+a*f,A=v,M=-u*f+2*l*v,I=Math.sqrt(g),D=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*I,-P)/3);n=2*Math.sqrt(-T);var R=Math.cos(O);o=n*R;var L=n*(-R/2-D*Math.sin(O)),N=o+L>2*s?o-s:L-s,F=a,B=N/F;O=Math.abs(Math.atan2(u*I,-M)/3),n=2*Math.sqrt(-A),R=Math.cos(O),o=n*R,L=n*(-R/2-D*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,p=h[h.length-1];if(Math.abs(p)<r.EPSILON14){var m=i.computeRealRoots(1,l,c);if(2===m.length){var f,v=m[0],g=m[1];if(v>=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),w=(l+p-u/C)/2,S=(l+p+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]<b[1]?[b[0],E[0],b[1],E[1]]:[E[0],b[0],E[1],b[1]]):E):0!==b.length?(b[0]+=d,b[1]+=d,b):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,h=o*t+l-4*a,d=u*a-o*n*t+s,p=e.computeRealRoots(1,c,h,d);if(p.length>0){var m,f,v=p[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 x=Math.sqrt(E);m=x/2,f=0===x?0:(t*C-o)/x}else{var T=Math.sqrt(w);m=0===T?0:(t*C-o)/T,f=T/2}var P,A;0===y&&0===m?(P=0,A=0):r.sign(y)===r.sign(m)?(P=y+m,A=v/P):(A=y-m,P=v/A);var M,I;0===C&&0===f?(M=0,I=0):r.sign(C)===r.sign(f)?(M=C+f,I=a/M):(I=C-f,M=a/I);var D=i.computeRealRoots(1,P,M),O=i.computeRealRoots(1,A,I);if(0!==D.length)return 0!==O.length?D[1]<=O[0]?[D[0],D[1],O[0],O[1]]:O[1]<=D[0]?[O[0],O[1],D[0],D[1]]:D[0]>=O[0]&&D[1]<=O[1]?[O[0],D[0],D[1],O[1]]:O[0]>=D[0]&&O[1]<=D[1]?[D[0],O[0],O[1],D[1]]:D[0]>O[0]&&D[0]<O[1]?[O[0],D[0],O[1],D[1]]:[D[0],O[0],D[1],O[1]]:D;if(0!==O.length)return O}return[]}var a={};return a.computeDiscriminant=function(e,t,r,i,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=r*r,c=u*r,h=i*i,d=h*i,p=n*n,m=p*n,f=s*u*h-4*l*d-4*e*c*h+18*e*t*r*d-27*o*h*h+256*a*m+n*(18*l*r*i-4*s*c+16*e*u*u-80*e*t*u*i-6*e*s*h+144*o*r*h)+p*(144*e*s*r-27*s*s-128*o*u-192*o*t*i);return f},a.computeRealRoots=function(t,i,a,s,l){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(i,a,s,l);var u=i/t,c=a/t,h=s/t,d=l/t,p=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 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,p=t.origin,m=t.direction,f=e.subtract(n,i,v),w=e.subtract(a,i,g),S=e.cross(m,w,_),E=e.dot(f,S);if(s){if(E<o.EPSILON6)return void 0;if(l=e.subtract(p,i,y),c=e.dot(l,S),0>c||c>E)return void 0;if(u=e.cross(l,f,C),h=e.dot(m,u),0>h||c+h>E)return void 0;d=e.dot(w,u)/E}else{if(Math.abs(E)<o.EPSILON6)return void 0;var b=1/E;if(l=e.subtract(p,i,y),c=e.dot(l,S)*b,0>c||c>1)return void 0;if(u=e.cross(l,f,C),h=e.dot(m,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),p=e.magnitudeSquared(u)-l,m=h(c,d,p,S);return i(m)?(n.start=m.root0,n.stop=m.root1,n):void 0}function p(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)))<r?0:i}function m(t,r,i,n,u){var c,h=n*n,d=u*u,m=(t[a.COLUMN1ROW1]-t[a.COLUMN2ROW2])*d,f=u*(n*p(t[a.COLUMN1ROW0],t[a.COLUMN0ROW1],o.EPSILON15)+r.y),v=t[a.COLUMN0ROW0]*h+t[a.COLUMN2ROW2]*d+n*r.x+i,g=d*p(t[a.COLUMN2ROW1],t[a.COLUMN1ROW2],o.EPSILON15),_=u*(n*p(t[a.COLUMN2ROW0],t[a.COLUMN0ROW2])+r.z),y=[];if(0===_&&0===g){if(c=s.computeRealRoots(m,f,v),0===c.length)return y;var C=c[0],w=Math.sqrt(Math.max(1-C*C,0));if(y.push(new e(n,u*C,u*-w)),y.push(new e(n,u*C,u*w)),2===c.length){var S=c[1],E=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,u*S,u*-E)),y.push(new e(n,u*S,u*E))}return y}var b=_*_,x=g*g,T=m*m,P=_*g,A=T+x,M=2*(f*m+P),I=2*v*m+f*f-x+b,D=2*(v*f-P),O=v*v-b;if(0===A&&0===M&&0===I&&0===D)return y;c=l.computeRealRoots(A,M,I,D,O);var R=c.length;if(0===R)return y;for(var L=0;R>L;++L){var N,F=c[L],B=F*F,z=Math.max(1-B,0),V=Math.sqrt(z);N=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 k=p(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)<o.EPSILON15)return void 0;var c=(-r.distance-e.dot(l,a))/u;return 0>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,x=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,x),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return void 0;var p=d*d;if(i=h-1,n=e.magnitudeSquared(c),o=n*i,o>p)return void 0;if(p>o){a=d*d-o,s=-d+Math.sqrt(a);var m=s/n,f=i/s;return f>m?{start:m,stop:f}:{start:f,stop:m}}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 T=new e,P=new e,A=new e,M=new e,I=new e,D=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,T);if(e.dot(s,l)>=0)return n;var u=i(this.rayEllipsoid(t,r)),c=r.transformPositionToScaledSpace(s,T),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,M),p=e.normalize(e.cross(d,h,P),P),f=e.normalize(e.cross(h,p,A),A),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,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),x=a.multiplyByVector(E,n,I),U=m(b,e.negate(x,T),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,new e)}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)<o.EPSILON6)return void 0;var c=e.dot(l,t),h=-(n.distance+c)/u;return 0>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;h<r.length;){var d=r[h];n[d].numLiveTriangles&&(l=0,o-n[d].timeStamp+2*n[d].numLiveTriangles<=t&&(l=o-n[d].timeStamp),(l>c||-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],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,w=[],S=[],E=0,b=[],x=u/3,T=[];for(f=0;x>f;f++)T[f]=!1;for(var P,A;-1!==g;){w=[],C=m[g],A=C.vertexTriangles.length;for(var M=0;A>M;++M)if(v=C.vertexTriangles[M],!T[v]){T[v]=!0,h=v+v+v;for(var I=0;3>I;++I)P=a[h],w.push(P),S.push(P),b[E]=P,++E,y=m[P],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h}g=n(a,l,w,m,_,S,c)}return b},r}),r("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,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x){"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 P(e){for(var t=e.length,r=6*(t/3),i=g.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 A(e){var t=e.length;if(t>=3){var r=6*(t-2),i=g.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 M(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=g.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 I(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 m({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;o<n.componentsPerAttribute;++o)e[i].values.push(n.values[r*n.componentsPerAttribute+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,ot),S.multiplyByPoint(e,ot,ot),n.pack(ot,r,o)}function R(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;i>o;o+=3)n.unpack(r,o,ot),w.multiplyByVector(e,ot,ot),ot=n.normalize(ot,ot),n.pack(ot,r,o)}function L(e,t){var r,i=e.length,n={},o=e[0][t].attributes;for(r in o)if(o.hasOwnProperty(r)&&u(o[r])&&u(o[r].values)){for(var a=o[r],l=a.values.length,c=!0,h=1;i>h;++h){var d=e[h][t].attributes[r];if(!u(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){c=!1;break}l+=d.values.length}c&&(n[r]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function N(e,t){var i,o,a,s,l=e.length;e[0].modelMatrix;var c,h,d,m=u(e[0][t].indices),f=e[0][t].primitiveType,v=L(e,t);for(i in v)if(v.hasOwnProperty(i))for(c=v[i].values,s=0,o=0;l>o;++o)for(h=e[o][t].attributes[i].values,d=h.length,a=0;d>a;++a)c[s++]=h[a];var _;if(m){var y=0;for(o=0;l>o;++o)y+=e[o][t].indices.length;var C=p.computeNumberOfVertices(new p({attributes:v,primitiveType:b.POINTS})),w=g.createTypedArray(C,y),S=0,E=0;for(o=0;l>o;++o){var x=e[o][t].indices,T=x.length;for(s=0;T>s;++s)w[S++]=E+x[s];E+=p.computeNumberOfVertices(e[o][t])}_=w}var P,A=new n,M=0;for(o=0;l>o;++o){if(P=e[o][t].boundingSphere,!u(P)){A=void 0;break}n.add(P.center,A,A)}if(u(A))for(n.divideByScalar(A,l,A),o=0;l>o;++o){P=e[o][t].boundingSphere;var I=n.magnitude(n.subtract(P.center,A,lt))+P.radius;I>M&&(M=I)}return new p({attributes:v,indices:_,primitiveType:f,boundingSphere:u(A)?new r(A,M):void 0})}function F(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;t>i;++i)r[i]=i;return e.indices=r,e}function B(e){var t=p.computeNumberOfVertices(e),r=g.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=b.TRIANGLES,e}function z(e){var t=p.computeNumberOfVertices(e),r=g.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=b.TRIANGLES,e}function V(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;t>i;++i)r[i]=i;return e.indices=r,e}function k(e){var t=p.computeNumberOfVertices(e),r=g.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=b.LINES,e}function U(e){var t=p.computeNumberOfVertices(e),r=g.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=b.LINES,e}function W(e){switch(e.primitiveType){case b.TRIANGLE_FAN:return B(e);case b.TRIANGLE_STRIP:return z(e);case b.TRIANGLES:return F(e);case b.LINE_STRIP:return k(e);case b.LINE_LOOP:return U(e);case b.LINES:return V(e)}return e}function G(e,t){Math.abs(e.y)<C.EPSILON6&&(e.y=t?-C.EPSILON6:C.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return G(e,e.y<0),G(t,t.y<0),G(r,r.y<0),void 0;var i,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(r.y);i=n>o?n>a?C.sign(e.y):C.sign(r.y):o>a?C.sign(t.y):C.sign(r.y);var s=0>i;G(e,s),G(t,s),G(r,s)}function q(e,t,r,i){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ct),e.y/(e.y-t.y),Ct),r),n.clone(r,i),G(r,!0),G(i,!1)}function j(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;H(e,t,r);var i=e.y<0,n=t.y<0,o=r.y<0,a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=xt.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(q(e,t,wt,Et),q(e,r,St,bt),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(q(t,r,wt,Et),q(t,e,St,bt),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(q(r,e,wt,Et),q(r,t,St,bt),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||(q(r,e,wt,Et),q(r,t,St,bt),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(q(t,r,wt,Et),q(t,e,St,bt),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(q(e,t,wt,Et),q(e,r,St,bt),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xt.positions;return l[0]=e,l[1]=t,l[2]=r,l.length=3,(1===a||2===a)&&(l[3]=wt,l[4]=St,l[5]=Et,l[6]=bt,l.length=7),xt
}function Y(e,t){var i=e.attributes;if(0===i.position.values.length)return void 0;for(var n in i)if(i.hasOwnProperty(n)&&u(i[n])&&u(i[n].values)){var o=i[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=r.fromVertices(i.position.values)),e}function X(e){var t=e.attributes,r={};for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values)){var n=t[i];r[i]=new m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var i=u(e.geometry.boundingSphere);t=Y(t,i),r=Y(r,i),u(r)&&!u(t)?e.geometry=r:!u(r)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function J(e,r,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,Tt),v=n.fromArray(s,3*r,Pt),g=n.fromArray(s,3*o,At),_=t(a,f,v,g,Mt);if(u(l)){var y=n.fromArray(l,3*e,Tt),C=n.fromArray(l,3*r,Pt),w=n.fromArray(l,3*o,At);n.multiplyByScalar(y,_.x,y),n.multiplyByScalar(C,_.y,C),n.multiplyByScalar(w,_.z,w);var S=n.add(y,C,y);n.add(S,w,S),n.normalize(S,S),n.pack(S,p.normal.values,3*m)}if(u(c)){var E=n.fromArray(c,3*e,Tt),b=n.fromArray(c,3*r,Pt),x=n.fromArray(c,3*o,At);n.multiplyByScalar(E,_.x,E),n.multiplyByScalar(b,_.y,b),n.multiplyByScalar(x,_.z,x);var T=n.add(E,b,E);n.add(T,x,T),n.normalize(T,T),n.pack(T,p.binormal.values,3*m)}if(u(h)){var P=n.fromArray(h,3*e,Tt),A=n.fromArray(h,3*r,Pt),M=n.fromArray(h,3*o,At);n.multiplyByScalar(P,_.x,P),n.multiplyByScalar(A,_.y,A),n.multiplyByScalar(M,_.z,M);var I=n.add(P,A,P);n.add(I,M,I),n.normalize(I,I),n.pack(I,p.tangent.values,3*m)}if(u(d)){var D=i.fromArray(d,2*e,It),O=i.fromArray(d,2*r,Dt),R=i.fromArray(d,2*o,Ot);i.multiplyByScalar(D,_.x,D),i.multiplyByScalar(O,_.y,O),i.multiplyByScalar(R,_.z,R);var L=i.add(D,O,D);i.add(L,R,L),i.pack(L,p.st.values,2*m)}}}function Q(e,t,r,i,n,o){var a=e.position.values.length/3;if(-1!==n){var s=i[n],l=r[s];return-1===l?(r[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 K(e){var t,r,i,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 w=f[a],S=f[a+1],E=f[a+2],b=n.fromArray(c,3*w),x=n.fromArray(c,3*S),T=n.fromArray(c,3*E),P=j(b,x,T);if(u(P)&&P.positions.length>3)for(var A=P.positions,M=P.indices,I=M.length,D=0;I>D;++D){var O=M[D],R=A[O];R.y<0?(t=g.attributes,r=g.indices,i=_):(t=v.attributes,r=v.indices,i=y),o=Q(t,r,i,f,3>O?a+O:-1,R),J(w,S,E,R,c,h,d,p,m,t,o)}else u(P)&&(b=P.positions[0],x=P.positions[1],T=P.positions[2]),b.y<0?(t=g.attributes,r=g.indices,i=_):(t=v.attributes,r=v.indices,i=y),o=Q(t,r,i,f,a,b),J(w,S,E,b,c,h,d,p,m,t,o),o=Q(t,r,i,f,a+1,x),J(w,S,E,x,c,h,d,p,m,t,o),o=Q(t,r,i,f,a+2,T),J(w,S,E,T,c,h,d,p,m,t,o)}Z(e,g,v)}function $(e){var t,r=e.geometry,i=r.attributes,o=i.position.values,a=r.indices,s=X(r),l=X(r),c=a.length,h=[];h.length=o.length/3;var d=[];for(d.length=o.length/3,t=0;t<h.length;++t)h[t]=-1,d[t]=-1;for(t=0;c>t;t+=2){var p=a[t],m=a[t+1],f=n.fromArray(o,3*p,Tt),v=n.fromArray(o,3*m,Pt);Math.abs(f.y)<C.EPSILON6&&(f.y=f.y<0?-C.EPSILON6:C.EPSILON6),Math.abs(v.y)<C.EPSILON6&&(v.y=v.y<0?-C.EPSILON6:C.EPSILON6);var g=s.attributes,_=s.indices,w=d,S=l.attributes,E=l.indices,b=h,x=y.lineSegmentPlane(f,v,Rt,At);if(u(x)){var T=n.multiplyByScalar(n.UNIT_Y,5*C.EPSILON9,Lt);f.y<0&&(n.negate(T,T),g=l.attributes,_=l.indices,w=h,S=s.attributes,E=s.indices,b=d);var P=n.add(x,T,Nt);Q(g,_,w,a,t,f),Q(g,_,w,a,-1,P),n.negate(T,T),n.add(x,T,P),Q(S,E,b,a,-1,P),Q(S,E,b,a,t+1,v)}else{var A,M,I;f.y<0?(A=l.attributes,M=l.indices,I=h):(A=s.attributes,M=s.indices,I=d),Q(A,M,I,a,t,f),Q(A,M,I,a,t+1,v)}}Z(e,l,s)}function et(e){var t=e.geometry,r=t.attributes,a=r.position.values,s=r.prevPosition.values,l=r.nextPosition.values,c=r.expandAndWidth.values;t.indices;var h,d,p,m=u(r.st)?r.st.values:void 0,f=u(r.color)?r.color.values:void 0,v=X(t),g=X(t),_=a.length/3;for(h=0;_>h;h+=4){var w=h,S=h+1,E=h+2,b=h+3,x=n.fromArray(a,3*w,zt),T=n.fromArray(a,3*S,Vt),P=n.fromArray(a,3*E,kt),A=n.fromArray(a,3*b,Ut);Math.abs(x.y)<C.EPSILON6&&(x.y=C.EPSILON6*(P.y<0?-1:1),T.y=x.y),Math.abs(P.y)<C.EPSILON6&&(P.y=C.EPSILON6*(x.y<0?-1:1),A.y=P.y);var M=v.attributes,I=v.indices,D=g.attributes,O=g.indices,R=y.lineSegmentPlane(x,P,Rt,Wt);if(u(R)){var L=n.multiplyByScalar(n.UNIT_Y,5*C.EPSILON9,Gt);x.y<0&&(n.negate(L,L),M=g.attributes,I=g.indices,D=v.attributes,O=v.indices);var N=n.add(R,L,Ht);for(M.position.values.push(x.x,x.y,x.z,T.x,T.y,T.z),M.position.values.push(N.x,N.y,N.z),M.position.values.push(N.x,N.y,N.z),n.negate(L,L),n.add(R,L,N),D.position.values.push(N.x,N.y,N.z),D.position.values.push(N.x,N.y,N.z),D.position.values.push(P.x,P.y,P.z,A.x,A.y,A.z),d=3*w;3*w+6>d;++d)M.prevPosition.values.push(s[d]);for(M.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),d=3*E;3*E+6>d;++d)D.prevPosition.values.push(s[d]);for(d=3*w;3*w+6>d;++d)M.nextPosition.values.push(l[d]);for(M.nextPosition.values.push(P.x,P.y,P.z,P.x,P.y,P.z),D.nextPosition.values.push(P.x,P.y,P.z,P.x,P.y,P.z),d=3*E;3*E+6>d;++d)D.nextPosition.values.push(l[d]);var F=i.fromArray(c,2*w,Ft),B=Math.abs(F.y);M.expandAndWidth.values.push(-1,B,1,B),M.expandAndWidth.values.push(-1,-B,1,-B),D.expandAndWidth.values.push(-1,B,1,B),D.expandAndWidth.values.push(-1,-B,1,-B);var z=n.magnitudeSquared(n.subtract(R,x,Ut));if(z/=n.magnitudeSquared(n.subtract(P,x,Ut)),u(f)){var V=o.fromArray(f,4*w,qt),k=o.fromArray(f,4*E,qt),U=C.lerp(V.x,k.x,z),W=C.lerp(V.y,k.y,z),G=C.lerp(V.z,k.z,z),H=C.lerp(V.w,k.w,z);for(d=4*w;4*w+8>d;++d)M.color.values.push(f[d]);for(M.color.values.push(U,W,G,H),M.color.values.push(U,W,G,H),D.color.values.push(U,W,G,H),D.color.values.push(U,W,G,H),d=4*E;4*E+8>d;++d)D.color.values.push(f[d])}if(u(m)){var q=i.fromArray(m,2*w,Ft),j=i.fromArray(m,2*(h+3),Bt),Y=C.lerp(q.x,j.x,z);for(d=2*w;2*w+4>d;++d)M.st.values.push(m[d]);for(M.st.values.push(Y,q.y),M.st.values.push(Y,j.y),D.st.values.push(Y,q.y),D.st.values.push(Y,j.y),d=2*E;2*E+4>d;++d)D.st.values.push(m[d])}p=M.position.values.length/3-4,I.push(p,p+2,p+1),I.push(p+1,p+2,p+3),p=D.position.values.length/3-4,O.push(p,p+2,p+1),O.push(p+1,p+2,p+3)}else{var J,Q;for(x.y<0?(J=g.attributes,Q=g.indices):(J=v.attributes,Q=v.indices),J.position.values.push(x.x,x.y,x.z),J.position.values.push(T.x,T.y,T.z),J.position.values.push(P.x,P.y,P.z),J.position.values.push(A.x,A.y,A.z),d=3*h;3*h+12>d;++d)J.prevPosition.values.push(s[d]),J.nextPosition.values.push(l[d]);for(d=2*h;2*h+8>d;++d)J.expandAndWidth.values.push(c[d]),u(m)&&J.st.values.push(m[d]);if(u(f))for(d=4*h;4*h+16>d;++d)J.color.values.push(f[d]);p=J.position.values.length/3-4,Q.push(p,p+2,p+1),Q.push(p+1,p+2,p+3)}}Z(e,g,v)}var tt={};tt.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case b.TRIANGLES:e.indices=P(t);break;case b.TRIANGLE_STRIP:e.indices=A(t);break;case b.TRIANGLE_FAN:e.indices=M(t);break;default:throw new c("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=b.LINES}return e},tt.createLineSegmentsForVectors=function(e,t,i){t=l(t,"normal"),i=l(i,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]*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 p({attributes:{position:new m({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:b.LINES,boundingSphere:f})},tt.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},tt.reorderForPreVertexCache=function(e){var t=p.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=g.createTypedArray(t,l),h=0,d=0,m=0;l>h;)o=i[a[h]],-1!==o?c[d]=o:(o=a[h],i[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,w=_.componentsPerAttribute,S=s.createTypedArray(_.componentDatatype,m*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},tt.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===b.TRIANGLES&&u(r)){for(var i=r.length,n=0,o=0;i>o;o++)r[o]>n&&(n=r[o]);e.indices=x.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},tt.fitToUnsignedShortIndices=function(e){var t=[],r=p.computeNumberOfVertices(e);if(u(e.indices)&&r>C.SIXTY_FOUR_KILOBYTES){var i,n=[],o=[],a=0,s=I(e.attributes),l=e.indices,c=l.length;e.primitiveType===b.TRIANGLES?i=3:e.primitiveType===b.LINES?i=2:e.primitiveType===b.POINTS&&(i=1);for(var h=0;c>h;h+=i){for(var d=0;i>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+i>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=I(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 rt=new n,it=new a;tt.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,p=new Float64Array(h.length),f=0,v=0;v<h.length;v+=3){var g=n.fromArray(h,v,rt),_=l.cartesianToCartographic(g,it);if(!u(_))throw new c("Could not project point ("+g.x+", "+g.y+", "+g.z+") to 2D.");var y=o.project(_,rt);p[f++]=y.x,p[f++]=y.y,p[f++]=y.z}return e.attributes[r]=a,e.attributes[i]=new m({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:p}),delete e.attributes[t],e};var nt={high:0,low:0};tt.encodeAttribute=function(e,t,r,i){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;a>c;++c)h.encode(o[c],nt),l[c]=nt.high,u[c]=nt.low;var d=n.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var ot=new n,at=new S,st=new w;tt.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(S.equals(t,S.IDENTITY))return e;var i=e.geometry.attributes;O(t,i.position),O(t,i.prevPosition),O(t,i.nextPosition),(u(i.normal)||u(i.binormal)||u(i.tangent))&&(S.inverse(t,at),S.transpose(at,at),S.getRotation(at,st),R(st,i.normal),R(st,i.binormal),R(st,i.tangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=r.transform(n,t,n)),e.modelMatrix=S.clone(S.IDENTITY),e};var lt=new n;tt.combineInstances=function(e){for(var t=[],r=[],i=e.length,n=0;i>n;++n){var o=e[n];u(o.geometry)?t.push(o):r.push(o)}var a=[];return t.length>0&&a.push(N(t,"geometry")),r.length>0&&(a.push(N(r,"westHemisphereGeometry")),a.push(N(r,"eastHemisphereGeometry"))),a};var ut=new n,ct=new n,ht=new n,dt=new n;tt.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 p=t[h],f=t[h+1],v=t[h+2],g=3*p,_=3*f,y=3*v;ct.x=i[g],ct.y=i[g+1],ct.z=i[g+2],ht.x=i[_],ht.y=i[_+1],ht.z=i[_+2],dt.x=i[y],dt.y=i[y+1],dt.z=i[y+2],l[p].count++,l[f].count++,l[v].count++,n.subtract(ht,ct,ht),n.subtract(dt,ct,dt),u[d]=n.cross(ht,dt,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,ut),d=0;d<w.count;d++)n.add(ut,u[c[w.indexOffset+d]],ut);n.normalize(ut,ut),E[b]=ut.x,E[b+1]=ut.y,E[b+2]=ut.z}else E[b]=0,E[b+1]=0,E[b+2]=1}return e.attributes.normal=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:E}),e};var pt=new n,mt=new n,ft=new n;tt.computeBinormalAndTangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,i=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,l=t.length,u=new Array(3*a),c=0;c<u.length;c++)u[c]=0;var h,d,p;for(c=0;l>c;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,w=r[h],S=r[h+1],E=r[h+2],b=o[_],x=o[_+1],T=o[y+1]-x,P=o[C+1]-x,A=1/((o[y]-b)*P-(o[C]-b)*T),M=(P*(r[d]-w)-T*(r[p]-w))*A,I=(P*(r[d+1]-S)-T*(r[p+1]-S))*A,D=(P*(r[d+2]-E)-T*(r[p+2]-E))*A;u[h]+=M,u[h+1]+=I,u[h+2]+=D,u[d]+=M,u[d+1]+=I,u[d+2]+=D,u[p]+=M,u[p+1]+=I,u[p+2]+=D}var O=new Float32Array(3*a),R=new Float32Array(3*a);for(c=0;a>c;c++){h=3*c,d=h+1,p=h+2;var L=n.fromArray(i,h,pt),N=n.fromArray(u,h,ft),F=n.dot(L,N);n.multiplyByScalar(L,F,mt),n.normalize(n.subtract(N,mt,N),N),R[h]=N.x,R[d]=N.y,R[p]=N.z,n.normalize(n.cross(L,N,N),N),O[h]=N.x,O[d]=N.y,O[p]=N.z}return e.attributes.tangent=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.binormal=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e};var vt=new i,gt=new n,_t=new n,yt=new n;tt.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,p=t.attributes.binormal;u(r)&&(a=r.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(_),w=0,S=0;g>S;++S){u(l)&&(i.fromArray(l,2*S,vt),C[w++]=e.compressTextureCoordinates(vt));var E=3*S;u(a)&&u(c)&&u(h)?(n.fromArray(a,E,gt),n.fromArray(c,E,_t),n.fromArray(h,E,yt),e.octPack(gt,_t,yt,vt),C[w++]=vt.x,C[w++]=vt.y):(u(a)&&(n.fromArray(a,E,gt),C[w++]=e.octEncodeFloat(gt)),u(c)&&(n.fromArray(c,E,gt),C[w++]=e.octEncodeFloat(gt)),u(h)&&(n.fromArray(h,E,gt),C[w++]=e.octEncodeFloat(gt)))}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 Ct=new n,wt=new n,St=new n,Et=new n,bt=new n,xt={positions:new Array(7),indices:new Array(9)},Tt=new n,Pt=new n,At=new n,Mt=new n,It=new i,Dt=new i,Ot=new i,Rt=E.fromPointNormal(n.ZERO,n.UNIT_Y),Lt=new n,Nt=new n,Ft=new i,Bt=new i,zt=new n,Vt=new n,kt=new n,Ut=new n,Wt=new n,Gt=new n,Ht=new n,qt=new o;return new o,tt.splitLongitude=function(e){var t=e.geometry,i=t.boundingSphere;if(u(i)){var n=i.center.x-i.radius;if(n>0||r.intersect(i,o.UNIT_Y)!==_.INTERSECTING)return e}if(t.geometryType!==v.NONE)switch(t.geometryType){case v.POLYLINES:et(e);break;case v.TRIANGLES:K(e);break;case v.LINES:$(e)}else W(t),t.primitiveType===b.TRIANGLES?K(e):t.primitiveType===b.LINES&&$(e);return e},tt}),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,p,m,f,v,g,_,y,C,w){"use strict";function S(e,i,o){var a=i.vertexFormat,s=i.center,u=i.semiMajorAxis,h=i.semiMinorAxis,m=i.ellipsoid,f=i.stRotation,v=o?2*(e.length/3):e.length/3,g=a.st?new Float32Array(2*v):void 0,y=a.normal?new Float32Array(3*v):void 0,w=a.tangent?new Float32Array(3*v):void 0,S=a.binormal?new Float32Array(3*v):void 0,E=0,b=N,x=F,T=B,P=new c(m),D=P.project(m.cartesianToCartographic(s,z),V),W=m.scaleToGeodeticSurface(s,A);m.geodeticSurfaceNormal(W,W);for(var G=C.fromAxisAngle(W,f,L),H=_.fromQuaternion(G,R),q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,k),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,U),Y=e.length,X=o?Y:0,Z=2*(X/3),J=0;Y>J;J+=3){var Q=J+1,K=J+2,$=r.fromArray(e,J,A);if(a.st){var et=_.multiplyByVector(H,$,M),tt=P.project(m.cartesianToCartographic(et,z),I);r.subtract(tt,D,tt),O.x=(tt.x+u)/(2*u),O.y=(tt.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[E+Z]=O.x,g[E+1+Z]=O.y),g[E++]=O.x,g[E++]=O.y}b=m.geodeticSurfaceNormal($,b),(a.normal||a.tangent||a.binormal)&&((a.tangent||a.binormal)&&(x=r.cross(r.UNIT_Z,b,x),_.multiplyByVector(H,x,x)),a.normal&&(y[J]=b.x,y[Q]=b.y,y[K]=b.z,o&&(y[J+X]=-b.x,y[Q+X]=-b.y,y[K+X]=-b.z)),a.tangent&&(w[J]=x.x,w[Q]=x.y,w[K]=x.z,o&&(w[J+X]=-x.x,w[Q+X]=-x.y,w[K+X]=-x.z)),a.binormal&&(T=r.cross(b,x,T),S[J]=T.x,S[Q]=T.y,S[K]=T.z,o&&(S[J+X]=T.x,S[Q+X]=T.y,S[K+X]=T.z)))}if(a.st){Y=g.length;for(var rt=0;Y>rt;rt+=2)g[rt]=(g[rt]-q.x)/(j.x-q.x),g[rt+1]=(g[rt+1]-q.y)/(j.y-q.y)}var it=new p;if(a.position){var nt=l.raisePositionsToHeight(e,i,o);it.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:nt})}return a.st&&(it.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:g})),a.normal&&(it.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(it.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),a.binormal&&(it.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),it}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;W=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,W),t.height,W),W=r.add(i,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=E(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:u,indices:c}}function x(e,i){var o=i.vertexFormat,a=i.center,s=i.semiMajorAxis,l=i.semiMinorAxis,u=i.ellipsoid,h=i.height,m=i.extrudedHeight,f=i.stRotation,v=2*(e.length/3),g=new Float64Array(3*v),y=o.st?new Float32Array(2*v):void 0,w=o.normal?new Float32Array(3*v):void 0,S=o.tangent?new Float32Array(3*v):void 0,E=o.binormal?new Float32Array(3*v):void 0,b=0,x=N,T=F,P=B,W=new c(u),G=W.project(u.cartesianToCartographic(a,z),V),H=u.scaleToGeodeticSurface(a,A);u.geodeticSurfaceNormal(H,H);for(var q=C.fromAxisAngle(H,f,L),j=_.fromQuaternion(q,R),Y=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,k),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,U),Z=e.length,J=2*(Z/3),Q=0;Z>Q;Q+=3){var K,$=Q+1,et=Q+2,tt=r.fromArray(e,Q,A);if(o.st){var rt=_.multiplyByVector(j,tt,M),it=W.project(u.cartesianToCartographic(rt,z),I);r.subtract(it,G,it),O.x=(it.x+s)/(2*s),O.y=(it.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[b+J]=O.x,y[b+1+J]=O.y,y[b++]=O.x,y[b++]=O.y}tt=u.scaleToGeodeticSurface(tt,tt),K=r.clone(tt,M),x=u.geodeticSurfaceNormal(tt,x);var nt=r.multiplyByScalar(x,h,D);if(tt=r.add(tt,nt,tt),nt=r.multiplyByScalar(x,m,nt),K=r.add(K,nt,K),o.position&&(g[Q+Z]=K.x,g[$+Z]=K.y,g[et+Z]=K.z,g[Q]=tt.x,g[$]=tt.y,g[et]=tt.z),o.normal||o.tangent||o.binormal){P=r.clone(x,P);var ot=r.fromArray(e,(Q+3)%Z,D);r.subtract(ot,tt,ot);var at=r.subtract(K,tt,I);x=r.normalize(r.cross(at,ot,x),x),o.normal&&(w[Q]=x.x,w[$]=x.y,w[et]=x.z,w[Q+Z]=x.x,w[$+Z]=x.y,w[et+Z]=x.z),o.tangent&&(T=r.normalize(r.cross(P,x,T),T),S[Q]=T.x,S[$]=T.y,S[et]=T.z,S[Q+Z]=T.x,S[Q+1+Z]=T.y,S[Q+2+Z]=T.z),o.binormal&&(E[Q]=P.x,E[$]=P.y,E[et]=P.z,E[Q+Z]=P.x,E[$+Z]=P.y,E[et+Z]=P.z)}}if(o.st){Z=y.length;for(var st=0;Z>st;st+=2)y[st]=(y[st]-Y.x)/(X.x-Y.x),y[st+1]=(y[st+1]-Y.y)/(X.y-Y.y)}var lt=new p;return o.position&&(lt.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(lt.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(lt.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),o.tangent&&(lt.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),o.binormal&&(lt.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),lt}function T(e){for(var t=e.length/3,r=v.createTypedArray(t,6*t),i=0,n=0;t>n;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;r[i++]=o,r[i++]=a,r[i++]=s,r[i++]=s,r[i++]=a,r[i++]=l}return r}function P(t){var i=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,A),t.height,A);G.center=r.add(i,a,G.center),G.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),t.extrudedHeight,a),H.center=r.add(i,a,H.center),H.radius=o;var s=l.computeEllipsePositions(t,!0,!0),u=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(G,H),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}),I=x(d,t);_=T(d);var D=v.createTypedArray(2*d.length/3,_),O=new h({attributes:I,indices:D,primitiveType:y.TRIANGLES}),R=f.combineInstances([new m({geometry:M}),new m({geometry:O})]);return{boundingSphere:p,attributes:R[0].attributes,indices:R[0].indices}}var A=new r,M=new r,I=new r,D=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 t,U=new t,W=new r,G=new e,H=new e,q=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,i=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,w.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=u.clone(i),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=c,this._granularity=l,this._vertexFormat=w.clone(p),this._extrudedHeight=o(h,c),this._extrude=d,this._workerName="createEllipseGeometry"};q.packedLength=r.packedLength+u.packedLength+w.packedLength+8,q.pack=function(e,t,i){i=o(i,0),r.pack(e._center,t,i),i+=r.packedLength,u.pack(e._ellipsoid,t,i),i+=u.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i]=e._extrude?1:0};var j=new r,Y=new u,X=new w,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 q.unpack=function(e,t,i){t=o(t,0);var n=r.unpack(e,t,j);t+=r.packedLength;var s=u.unpack(e,t,Y);t+=u.packedLength;var l=w.unpack(e,t,X);t+=w.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(i)?(i._center=r.clone(n,i._center),i._ellipsoid=u.clone(s,i._ellipsoid),i._vertexFormat=w.clone(l,i._vertexFormat),i._semiMajorAxis=c,i._semiMinorAxis=h,i._rotation=d,i._stRotation=p,i._height=m,i._granularity=f,i._extrudedHeight=v,i._extrude=g,i):(Z.height=m,Z.extrudedHeight=v,Z.granularity=f,Z.stRotation=p,Z.rotation=d,Z.semiMajorAxis=c,Z.semiMinorAxis=h,new q(Z))},q.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=P(r)):t=b(r),new h({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},q}),r("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.radius,i={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 n(i),this._workerName="createCircleGeometry"};s.packedLength=n.packedLength,s.pack=function(e,t,r){n.pack(e._ellipseGeometry,t,r)};var l=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),u={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new a,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return s.unpack=function(t,i,c){var h=n.unpack(t,i,l);return u.center=e.clone(h._center,u.center),u.ellipsoid=o.clone(h._ellipsoid,u.ellipsoid),u.height=h._height,u.extrudedHeight=h._extrudedHeight,u.granularity=h._granularity,u.vertexFormat=a.clone(h._vertexFormat,u.vertexFormat),u.stRotation=h._stRotation,r(c)?(u.semiMajorAxis=h._semiMajorAxis,u.semiMinorAxis=h._semiMinorAxis,c._ellipseGeometry=new n(u),c):(u.radius=h._semiMajorAxis,new s(u))},s.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},s}),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,p){"use strict";function m(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,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=i(n.numberOfVerticalLines,16);o=Math.max(o,0);var s=n.center,l=n.ellipsoid,d=n.semiMajorAxis,p=t.multiplyByScalar(l.geodeticSurfaceNormal(s,v),n.height,v);_.center=t.add(s,p,_.center),_.radius=d,p=t.multiplyByScalar(l.geodeticSurfaceNormal(s,p),n.extrudedHeight,p),y.center=t.add(s,p,y.center),y.radius=d;var m=a.computeEllipsePositions(n,!1,!0).outerPositions,f=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(m,n,!0)})});m=f.position.values;var g=e.union(_,y),C=m.length/3,w=h.createTypedArray(C,2*C+2*o);C/=2;var S,E=0;for(S=0;C>S;++S)w[E++]=S,w[E++]=(S+1)%C,w[E++]=S+C,w[E++]=(S+1)%C+C;var b;if(o>0){var x=Math.min(o,C);b=Math.round(C/x)}var T=Math.min(b*o,C);if(o>0)for(S=0;T>S;S+=b)w[E++]=S,w[E++]=S+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=i(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=i(e.granularity,d.RADIANS_PER_DEGREE),c=i(e.height,0),h=e.extrudedHeight,p=n(h)&&Math.abs(c-h)>1;this._center=t.clone(r),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=i(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=p,this._numberOfVerticalLines=Math.max(i(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};C.packedLength=t.packedLength+s.packedLength+9,C.pack=function(e,r,o){o=i(o,0),t.pack(e._center,r,o),o+=t.packedLength,s.pack(e._ellipsoid,r,o),o+=s.packedLength,r[o++]=e._semiMajorAxis,r[o++]=e._semiMinorAxis,r[o++]=e._rotation,r[o++]=e._height,r[o++]=e._granularity,r[o++]=n(e._extrudedHeight)?1:0,r[o++]=i(e._extrudedHeight,0),r[o++]=e._extrude?1:0,r[o]=e._numberOfVerticalLines};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return C.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,w);r+=t.packedLength;var l=s.unpack(e,r,S);r+=s.packedLength;var u=e[r++],c=e[r++],h=e[r++],d=e[r++],p=e[r++],m=e[r++],f=e[r++],v=1===e[r++],g=e[r];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=v,o._numberOfVerticalLines=g,o):(E.height=d,E.extrudedHeight=m?f:void 0,E.granularity=p,E.rotation=h,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=g,new C(E))},C.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,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=m(r),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})},C}),r("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";var a=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.radius,i={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(i),this._workerName="createCircleOutlineGeometry"};a.packedLength=n.packedLength,a.pack=function(e,t,r){n.pack(e._ellipseGeometry,t,r)};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,i,u){var c=n.unpack(t,i,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,r(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}),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 p,m,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 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 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 p(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 m(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})?$/,x=/^(\d{2})(\.\d+)?/.source+b.source,T=/^(\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,p(n,t,this),i===u.UTC&&h(this)};M.fromDate=function(e,t){var r=m(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return i(t)?(p(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,I=0,D=l[0],O=l[1];if(!i(D))throw new n(A);var R;if(l=D.match(E),null!==l){if(R=D.split("-").length-1,R>0&&2!==R)throw new n(A);r=+l[1],c=+l[2],d=+l[3]}else if(l=D.match(C),null!==l)r=+l[1],c=+l[2];else if(l=D.match(y),null!==l)r=+l[1];else{var L;if(l=D.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=D.match(S),null===l)throw new n(A);r=+l[1];var N=+l[2],F=+l[3]||0;if(R=D.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],I=1e3*+(l[4]||0),z=5}else if(l=O.match(T),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(x),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||I>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(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=m(r,c,d,f,_,b,I);return i(t)?(p(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 I=new M(0,0,u.TAI);return M.toGregorianDate=function(e,t){var r=!1,n=d(e,I);i(n)||(M.addSeconds(e,-1,I),n=d(I,I),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 p=0|80*u/2447,m=0|u-(0|2447*p/80);u=0|p/11;var f=0|p+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=m,t.hour=g,t.minute=y,t.second=C,t.millisecond=w,t.isLeapSecond=r,t):new o(v,f,m,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 p(e.dayNumber,e.secondsOfDay+t,r)},M.addMinutes=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,i,r)},M.addHours=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,i,r)},M.addDays=function(e,t,r){var i=e.dayNumber+t;return p(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,p=!i(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=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(r,i,n,o,a){return r=s.byteToFloat(e(r,255)),i=s.byteToFloat(e(i,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=r,a.green=i,a.blue=n,a.alpha=o,a):new s(r,i,n,o)},s.fromAlpha=function(e,r,i){return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=r,i):new s(e.red,e.green,e.blue,r)};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 p=e(r.minimumBlue,0),m=e(r.maximumBlue,1);d=p+o.nextRandomNumber()*(m-p)}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,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(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=p.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=m.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.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),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.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}),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,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,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=p,b.cosineAlpha=m,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,p,m=(t-r)/t,f=o-i,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),w=Math.sin(g),S=_*C,E=_*w,b=y*w,x=y*C,T=f,P=s.TWO_PI,A=Math.cos(T),M=Math.sin(T);do{A=Math.cos(T),M=Math.sin(T);var I=E-x*A;h=Math.sqrt(C*C*M*M+I*I),u=b+S*A,l=Math.atan2(h,u);var D;0===h?(D=0,d=1):(D=S*M/h,d=1-D*D),P=T,p=u-2*b/d,isNaN(p)&&(p=0),T=f+c(m,D,d,l,h,u,p)}while(Math.abs(T-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=p*p,F=L*h*(p+L*(u*(2*N-1)-L*p*(4*h*h-3)*(4*N-3)/6)/4),B=r*R*(l-F),z=Math.atan2(C*M,E-x*A),V=Math.atan2(_*M,E*A-x);e._distance=B,e._startHeading=z,e._endHeading=V,e._uSquared=O}function d(r,i,n,o){e.normalize(o.cartographicToCartesian(i,m),p),e.normalize(o.cartographicToCartesian(n,m),m),h(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),r._start.height=0,r._end.height=0,l(r)}var p=new e,m=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),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,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),x=Math.cos(C),T=n.cosineU*x,P=n.sineU*b,A=Math.atan2(b*n.sineHeading,T-P*n.cosineHeading),M=A-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,x,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=b;i.length=e;var n;if(t===r){for(n=0;e>n;n++)i[n]=t;return i}var o=r-t,a=o/e;for(n=0;e>n;n++){var s=t+n*a;i[n]=s}return i}function p(t,r,i,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,A),c=n.scaleToGeodeticSurface(r,M),h=m.numberOfPoints(t,r,i),p=n.cartesianToCartographic(u,x),f=n.cartesianToCartographic(c,T),v=d(h,o,a);I.setEndPoints(p,f);var g=I.surfaceDistance/h,_=l;p.height=o;var y=n.cartographicToCartesian(p,P);e.pack(y,s,_),_+=3;for(var C=1;h>C;C++){var w=I.interpolateUsingSurfaceDistance(C*g,T);w.height=v[C],y=n.cartographicToCartesian(w,P),e.pack(y,s,_),_+=3}return _}var m={};m.numberOfPoints=function(t,r,i){var n=e.distance(t,r);return Math.ceil(n/i)};var f=new t;m.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=[],x=new t,T=new t,P=new e,A=new e,M=new e,I=new a;m.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,_),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,w),b=1;o.push(e.clone(t[0]));for(var x=o[0],T=t.length,P=1;T>P;++P){var A=t[P];if(h.getPointDistance(f,x)<0||h.getPointDistance(f,A)<0){var M=s.lineSegmentPlane(x,A,p,S);if(i(M)){var I=e.multiplyByScalar(d,5e-9,E);h.getPointDistance(p,x)<0&&e.negate(I,I),o.push(e.add(M,I,new e)),a.push(b+1),e.negate(I,I),o.push(e.add(M,I,new e)),b=1}}o.push(e.clone(t[P])),b++,x=A}a.push(b)}return{positions:o,lengths:a}};var D=u.EPSILON7;return m.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.equalsEpsilon(n,o,D));++i);if(i===r)return void 0;for(var a=t.slice(0,i);r>i;++i)o=t[i],e.equalsEpsilon(n,o,D)||(a.push(e.clone(o)),n=o);return a},m.generateArc=function(t){i(t)||(t={});var n=t.positions,a=r(t.ellipsoid,o.WGS84),s=r(t.height,0),c=t.minDistance;if(!i(c)){var h=r(t.granularity,u.RADIANS_PER_DEGREE);c=u.chordLength(h,a.maximumRadius)}var d,f=n.length,v=0;for(d=0;f-1>d;d++)v+=m.numberOfPoints(n[d],n[d+1],c);var g=3*(v+1),_=new Array(g),y=0,C=l(s);for(d=0;f-1>d;d++){var w=n[d],S=n[d+1],E=C?s[d]:s,T=C?s[d+1]:s;y=p(w,S,c,a,E,T,_,y)}b.length=0;var A=n[f-1],M=a.cartesianToCartographic(A,x);M.height=C?s[f-1]:s;var I=a.cartographicToCartesian(M,P);return e.pack(I,_,g-3),_},m.generateCartesianArc=function(t){for(var r=m.generateArc(t),i=r.length/3,n=new Array(i),o=0;i>o;o++)n[o]=e.unpack(r,3*o);return n},m}),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 p(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"),p=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>u||0>p||0>m||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=p,e._yCelestialPoleOffsetRadiansColumn=m,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,x=new a(b,E,h.TAI);if(g.push(x),y){if(E!==_&&i(_)){var T=a.leapSeconds,P=t(T,x,d);if(0>P){var A=new s(x,E);T.splice(~P,0,A)}}_=E}}}function m(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 m(e,r,n,l,s),s;if(i.equals(c))return m(e,r,o,l,s),s;var h=a.secondsDifference(i,u)/a.secondsDifference(c,u),d=n*l,p=o*l,v=r[d+e._ut1MinusUtcSecondsColumn],g=r[p+e._ut1MinusUtcSecondsColumn],_=g-v;if(_>.5||-.5>_){var y=r[d+e._taiMinusUtcSecondsColumn],C=r[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(i)?v=g:g-=C-y)}return s.xPoleWander=f(h,r[d+e._xPoleWanderRadiansColumn],r[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=f(h,r[d+e._yPoleWanderRadiansColumn],r[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=f(h,r[d+e._xCelestialPoleOffsetRadiansColumn],r[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=f(h,r[d+e._yCelestialPoleOffsetRadiansColumn],r[p+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))p(this,t.data);else if(i(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){p(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};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],p=a.lessThanOrEquals(h,e),m=!i(d),f=m||a.greaterThanOrEquals(d,e);if(p&&f)return l=s,!m&&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?(g<o.length-1&&o[g+1].equals(e)&&++g,l=g,c=g):(c=~g,l=c-1,0>l&&(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,p=[],m=h;d>=m;++m)p.push(u(this,m));return e.all(p)},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,p=this._samples;if(i(p[3*c])||(u(this,0|c/this._samplesPerXysFile),d=!0),i(p[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 m,f,v=o-c*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 w=3*(c+m);r.x+=y[m]*p[w++],r.y+=y[m]*p[w++],r.s+=y[m]*p[w]}return r},c}),r("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,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";var _={},y=new r,C=new r,w=new r;_.eastNorthUpToFixedFrame=function(e,t,i){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.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=y,l=C,c=w;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 S=new r,E=new r,b=new r;_.northEastDownToFixedFrame=function(e,t,i){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.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=S,l=E,c=b;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)},_.northUpEastToFixedFrame=function(e,t,i){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.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=y,l=C,c=w;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 x=new v,T=new r(1,1,1),P=new f;_.headingPitchRollToFixedFrame=function(e,t,i,n,o,a){var s=v.fromHeadingPitchRoll(t,i,n,x),l=f.fromTranslationQuaternionRotationScale(r.ZERO,s,T,P);return a=_.eastNorthUpToFixedFrame(e,o,a),f.multiply(a,l,a)};var A=new f,M=new m;_.headingPitchRollQuaternion=function(e,t,r,i,n,o){var a=_.headingPitchRollToFixedFrame(e,t,r,i,n,A),s=f.getRotation(a,M);return v.fromRotationMatrix(s,o)};var I=24110.54841,D=8640184.812866,O=.093104,R=-62e-7,L=1.1772758384668e-19,N=72921158553e-15,F=p.TWO_PI/86400,B=new d;_.computeTemeToPseudoFixedMatrix=function(e,t){B=d.addSeconds(e,-d.computeTaiMinusUtc(e),B);var r,i=B.dayNumber,n=B.secondsOfDay,a=i-2451545;r=n>=43200?(a+.5)/g.DAYS_PER_JULIAN_CENTURY:(a-.5)/g.DAYS_PER_JULIAN_CENTURY;var s=I+r*(D+r*(O+r*R)),l=s*F%p.TWO_PI,u=N+L*(i-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 z=32.184,V=2451545;_.preloadIcrfFixed=function(t){var r=t.start.dayNumber,i=t.start.secondsOfDay+z,n=t.stop.dayNumber,o=t.stop.secondsOfDay+z,a=_.iau2006XysData.preload(r,i,n,o),s=_.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},_.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var r=_.computeFixedToIcrfMatrix(e,t);return o(r)?m.transpose(r,t):void 0};var k=new h(0,0,0),U=new l(0,0,0,0,0,0),W=new m,G=new m;_.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var r=_.earthOrientationParameters.compute(e,U);if(!o(r))return void 0;var i=e.dayNumber,n=e.secondsOfDay+z,a=_.iau2006XysData.computeXysRadians(i,n,k);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=W;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,G),f=m.multiply(c,h,W),v=e.dayNumber,y=e.secondsOfDay-d.computeTaiMinusUtc(e)+r.ut1MinusUtc,C=v-2451545,w=y/g.SECONDS_PER_DAY,S=.779057273264+w+.00273781191135448*(C+w);S=S%1*p.TWO_PI;var E=m.fromRotationZ(S,G),b=m.multiply(f,E,W),x=Math.cos(r.xPoleWander),T=Math.cos(r.yPoleWander),P=Math.sin(r.xPoleWander),A=Math.sin(r.yPoleWander),M=i-V+n/g.SECONDS_PER_DAY;M/=36525;var I=-47e-6*M*p.RADIANS_PER_DEGREE/3600,D=Math.cos(I),O=Math.sin(I),R=G;return R[0]=x*D,R[1]=x*O,R[2]=P,R[3]=-T*O+A*P*D,R[4]=T*D+A*P*O,R[5]=-A*x,R[6]=-A*O-T*P*D,R[7]=A*D-T*P*O,R[8]=T*x,m.multiply(b,R,t)};var H=new i;_.pointToWindowCoordinates=function(e,t,r,i){return i=_.pointToGLWindowCoordinates(e,t,r,i),i.y=2*t[5]-i.y,i},_.pointToGLWindowCoordinates=function(e,r,n,a){o(a)||(a=new t);var s=H;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)};var q=new r,j=new r,Y=new r;return _.rotationMatrixFromPositionVelocity=function(e,t,i,a){var s=n(i,u.WGS84).geodeticSurfaceNormal(e,q),l=r.cross(t,s,j);r.equalsEpsilon(l,r.ZERO,p.EPSILON6)&&(l=r.clone(r.UNIT_X,l));var c=r.cross(l,t,Y);return r.cross(t,c,l),r.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},_}),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,p){"use strict";var m=new i,f=function(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var i=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(c.getColumn(i,0,m)),this._yAxis=r.fromCartesian4(c.getColumn(i,1,m));var o=r.fromCartesian4(c.getColumn(i,2,m));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;i<e.length;i++){var n=e[i];L=t.cartesianToCartographic(n,L),r[i]=L.height,e[i]=t.scaleToGeodeticSurface(n,n)}return r}function p(e,r,i,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(r===i){for(o=0;u>o;o++)c[o]=r;return c.push(i),c}var h=i-r,d=h/u;for(o=1;u>o;o++){var p=r+o*d;c[o]=p}return c[0]=r,c.push(i),c}function m(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,p=U;F=h.eastNorthUpToFixedFrame(e,o,F),d=l.multiplyByPointAsVector(F,N,d),d=t.normalize(d,d);var f=m(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;_<i.length;_+=3)p=t.fromArray(i,_,p),p=s.multiplyByVector(v,p,p),p=l.multiplyByPoint(F,p,p),n.push(p.x,p.y,p.z);return n}function v(e,r,i,n,o,a,s){for(var l=0;l<e.length;l+=3){var u=t.fromArray(e,l,G);n=f(u,r,i,n,o,a[l/3],s,1)}return n}function g(e,t){var r=e.length,i=new Array(6*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a;for(var l=1;r>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,p,m){var v,g=t.angleBetween(t.subtract(r,e,D),t.subtract(i,e,O)),_=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,D),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=m?2:1,S=0;_>S;S++)r=s.multiplyByVector(v,r,r),y=t.subtract(r,e,D),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,p,1,w);else y=t.subtract(r,e,D),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,p,1,1),i=t.clone(i,q),y=t.subtract(i,e,D),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,O),h=f(C,y,d,h,u,p,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,x=new t,T=new t,P=new t,A=new t,M=new t,I=new t,D=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,J=new i;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,J);C(s,l)||i.push(a)}return i};var Q=new t,K=new t;return R.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,m=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=x,G=T,H=P,q=A,j=M,Y=I,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 J=c[0],$=c[1];s&&(z=f(X,j,O,z,l,J+L,1,1)),Y=t.clone(X,Y),X=Z,k=t.negate(V,k);for(var et,tt,rt=1;F-1>rt;rt++){var it=s?2:1;Z=e[rt+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 nt=t.multiplyByScalar(W,t.dot(V,W),Q);t.subtract(V,nt,nt),t.normalize(nt,nt);var ot=t.multiplyByScalar(W,t.dot(k,W),K);t.subtract(k,ot,ot),t.normalize(ot,ot);var at=!a.equalsEpsilon(Math.abs(t.dot(nt,ot)),1,a.EPSILON7);if(at){U=t.cross(U,W,U),U=t.cross(W,U,U),U=t.normalize(U,U);var st=1/Math.max(.25,t.magnitude(t.cross(U,k,D))),lt=R.angleIsGreaterThanPi(V,k,X,l);lt?(G=t.add(X,t.multiplyByScalar(U,st*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]),et=p(w,J+L,$+L,h),tt=u.generateArc({positions:w,granularity:h,ellipsoid:l}),B=v(tt,j,C,B,l,et,1),j=t.cross(W,V,j),j=t.normalize(j,j),q=t.add(G,t.multiplyByScalar(j,N,q),q),m===n.ROUNDED||m===n.BEVELED?y(G,H,q,m,lt,l,B,C,$+L,s):(U=t.negate(U,U),B=f(X,U,C,B,l,$+L,st,it)),Y=t.clone(q,Y)):(G=t.add(X,t.multiplyByScalar(U,st*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]),et=p(w,J+L,$+L,h),tt=u.generateArc({positions:w,granularity:h,ellipsoid:l}),B=v(tt,j,C,B,l,et,1),j=t.cross(W,V,j),j=t.normalize(j,j),q=t.add(G,t.multiplyByScalar(j,-N,q),q),m===n.ROUNDED||m===n.BEVELED?y(G,H,q,m,lt,l,B,C,$+L,s):B=f(X,U,C,B,l,$+L,st,it),Y=t.clone(q,Y)),k=t.negate(V,k)}else B=f(Y,j,C,B,l,J+L,1,1),Y=X;J=$,$=c[rt+1],X=Z}w[0]=t.clone(Y,w[0]),w[1]=t.clone(X,w[1]),et=p(w,J+L,$+L,h),tt=u.generateArc({positions:w,granularity:h,ellipsoid:l}),B=v(tt,j,C,B,l,et,1),s&&(z=f(X,j,O,z,l,$+L,1,1)),F=B.length;var ut=s?F+z.length:F,ct=new Float64Array(ut);return ct.set(B),s&&ct.set(z,F),ct},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,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(r,f),c/h,I),D):o.fromQuaternion(l.fromAxisAngle(r,c/h,I),D);var g=0;i=e.clone(i,f);for(var _=0;h>_;_++)i=o.multiplyByVector(m,i,i),p[g++]=i.x,p[g++]=i.y,p[g++]=i.z;return p}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;h<t.length;h+=3){var d=e.fromArray(t,h,g),p=e.add(d,l,_);o[u++]=p.x,o[u++]=p.y,o[u++]=p.z;var m=e.add(d,s,_);a[c--]=m.z,a[c--]=m.y,a[c--]=m.x}return n.push(o,a),n}function p(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}var m={},f=new e,v=new e,g=new e,_=new e,y=[new e,new e],C=new e,w=new e,S=new e,E=new e,b=new e,x=new e,T=new e,P=new e,A=new e,M=new e,I=new l,D=new o;m.addAttribute=function(e,t,i,n){var o=t.x,a=t.y,s=t.z;r(i)&&(e[i]=o,e[i+1]=a,e[i+2]=s),r(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var O=new e,R=new e;m.computePositions=function(r){var i=r.granularity,o=r.positions,l=r.ellipsoid;o=p(o,l);var m=r.width/2,v=r.cornerType,g=r.saveAttributes,_=C,I=w,D=S,L=E,N=b,F=x,B=T,z=P,V=A,k=M,U=[],W=g?[]:void 0,G=g?[]:void 0,H=o[0],q=o[1];I=e.normalize(e.subtract(q,H,I),I),_=l.geodeticSurfaceNormal(H,_),L=e.normalize(e.cross(_,I,L),L),g&&(W.push(L.x,L.y,L.z),G.push(_.x,_.y,_.z)),B=e.clone(H,B),H=q,D=e.negate(I,D);var j,Y,X=[],Z=o.length;for(Y=1;Z-1>Y;Y++){_=l.geodeticSurfaceNormal(H,_),q=o[Y+1],I=e.normalize(e.subtract(q,H,I),I),N=e.normalize(e.add(I,D,N),N);var J=e.multiplyByScalar(_,e.dot(I,_),O);e.subtract(I,J,J),e.normalize(J,J);var Q=e.multiplyByScalar(_,e.dot(D,_),R);e.subtract(D,Q,Q),e.normalize(Q,Q);var K=!n.equalsEpsilon(Math.abs(e.dot(J,Q)),1,n.EPSILON7);if(K){N=e.cross(N,_,N),N=e.cross(_,N,N);var $=m/Math.max(.25,e.magnitude(e.cross(N,D,f))),et=s.angleIsGreaterThanPi(I,D,H,l);N=e.multiplyByScalar(N,$,N),et?(z=e.add(H,N,z),k=e.add(z,e.multiplyByScalar(L,m,k),k),V=e.add(z,e.multiplyByScalar(L,2*m,V),V),y[0]=e.clone(B,y[0]),y[1]=e.clone(k,y[1]),j=a.generateArc({positions:y,granularity:i,ellipsoid:l}),U=d(j,L,m,U),g&&(W.push(L.x,L.y,L.z),G.push(_.x,_.y,_.z)),F=e.clone(V,F),L=e.normalize(e.cross(_,I,L),L),V=e.add(z,e.multiplyByScalar(L,2*m,V),V),B=e.add(z,e.multiplyByScalar(L,m,B),B),v===t.ROUNDED||v===t.BEVELED?X.push({leftPositions:u(z,F,V,v,et)}):X.push({leftPositions:h(H,e.negate(N,N),V,et)})):(V=e.add(H,N,V),k=e.add(V,e.negate(e.multiplyByScalar(L,m,k),k),k),z=e.add(V,e.negate(e.multiplyByScalar(L,2*m,z),z),z),y[0]=e.clone(B,y[0]),y[1]=e.clone(k,y[1]),j=a.generateArc({positions:y,granularity:i,ellipsoid:l}),U=d(j,L,m,U),g&&(W.push(L.x,L.y,L.z),G.push(_.x,_.y,_.z)),F=e.clone(z,F),L=e.normalize(e.cross(_,I,L),L),z=e.add(V,e.negate(e.multiplyByScalar(L,2*m,z),z),z),B=e.add(V,e.negate(e.multiplyByScalar(L,m,B),B),B),v===t.ROUNDED||v===t.BEVELED?X.push({rightPositions:u(V,F,z,v,et)}):X.push({rightPositions:h(H,N,z,et)})),D=e.negate(I,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:i,ellipsoid:l}),U=d(j,L,m,U),g&&(W.push(L.x,L.y,L.z),G.push(_.x,_.y,_.z));var tt;return v===t.ROUNDED&&(tt=c(U)),{positions:U,corners:X,lefts:W,normals:G,endPositions:tt}};var L=new e,N=new e;return m.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,N),N),h=L;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},m}),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,p,m,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,m=e.positions,f=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new h,w=0,T=0,I=0;for(l=0;l<m.length;l+=2)u=m[l].length-3,w+=u,I+=2*u,T+=m[l+1].length-3;for(w+=3,T+=3,l=0;l<f.length;l++){s=f[l];var D=f[l].leftPositions;a(D)?(u=D.length,w+=u,I+=u):(u=f[l].rightPositions.length,T+=u,I+=u)}var O,R=a(v);R&&(O=v[0].length-3,w+=O,T+=O,O/=3,I+=6*O);var L,N,F,B,z,V,k=w+T,U=new Float64Array(k),W=i.normal?new Float32Array(k):void 0,G=i.tangent?new Float32Array(k):void 0,H=i.binormal?new Float32Array(k):void 0,q={normals:W,tangents:G,binormals:H},j=0,Y=k-1,X=S,Z=E,J=O/2,Q=d.createTypedArray(k/3,I),K=0;if(R){V=b,z=x;var $=v[0];for(X=t.fromArray(y,0,X),Z=t.fromArray(_,0,Z),l=0;J>l;l++)V=t.fromArray($,3*(J-1-l),V),z=t.fromArray($,3*(J+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,Q[K++]=L,Q[K++]=N,Q[K++]=F,Q[K++]=F,Q[K++]=N,Q[K++]=B,j+=3,Y-=3}var et=0,tt=0,rt=m[et++],it=m[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,Q[K++]=L,Q[K++]=N,Q[K++]=F,Q[K++]=F,Q[K++]=N,Q[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;l<f.length;l++){var at;s=f[l];var st,lt,ut=s.leftPositions,ct=s.rightPositions,ht=P,dt=b,pt=x;if(X=t.fromArray(y,tt,X),a(ut)){for(g(q,X,Z,void 0,Y,i),Y-=3,st=B,lt=F,at=0;at<ut.length/3;at++)ht=t.fromArray(ut,3*at,ht),Q[K++]=st,Q[K++]=lt-at-1,Q[K++]=lt-at,n.addAttribute(U,ht,void 0,Y),dt=t.fromArray(U,3*(lt-at-1),dt),pt=t.fromArray(U,3*st,pt),Z=t.normalize(t.subtract(dt,pt,Z),Z),g(q,X,Z,void 0,Y,i),Y-=3;ht=t.fromArray(U,3*st,ht),dt=t.subtract(t.fromArray(U,3*lt,dt),ht,dt),pt=t.subtract(t.fromArray(U,3*(lt-at),pt),ht,pt),Z=t.normalize(t.add(dt,pt,Z),Z),g(q,X,Z,j,void 0,i),j+=3}else{for(g(q,X,Z,j,void 0,i),j+=3,st=F,lt=B,at=0;at<ct.length/3;at++)ht=t.fromArray(ct,3*at,ht),Q[K++]=st,Q[K++]=lt+at,Q[K++]=lt+at+1,n.addAttribute(U,ht,j),dt=t.fromArray(U,3*st,dt),pt=t.fromArray(U,3*(lt+at),pt),Z=t.normalize(t.subtract(dt,pt,Z),Z),g(q,X,Z,j,void 0,i),j+=3;ht=t.fromArray(U,3*st,ht),dt=t.subtract(t.fromArray(U,3*(lt+at),dt),ht,dt),pt=t.subtract(t.fromArray(U,3*lt,pt),ht,pt),Z=t.normalize(t.negate(t.add(pt,dt,Z),Z),Z),g(q,X,Z,void 0,Y,i),Y-=3}for(rt=m[et++],it=m[et++],rt.splice(0,3),it.splice(it.length-3,3),U.set(rt,j),U.set(it,Y-it.length+1),u=it.length-3,tt+=3,Z=t.fromArray(_,tt,Z),at=0;at<it.length;at+=3)nt=o.geodeticSurfaceNormal(t.fromArray(rt,at,A),A),ot=o.geodeticSurfaceNormal(t.fromArray(it,u-at,M),M),X=t.normalize(t.add(nt,ot,X),X),g(q,X,Z,j,Y,i),B=j/3,N=B-1,F=(Y-2)/3,L=F+1,Q[K++]=L,Q[K++]=N,Q[K++]=F,Q[K++]=F,Q[K++]=N,Q[K++]=B,j+=3,Y-=3;j-=3,Y+=3}if(X=t.fromArray(y,y.length-3,X),g(q,X,Z,j,Y,i),R){j+=3,Y-=3,V=b,z=x;var mt=v[1];for(l=0;J>l;l++)V=t.fromArray(mt,3*(O-l-1),V),z=t.fromArray(mt,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,Q[K++]=L,Q[K++]=N,Q[K++]=F,Q[K++]=F,Q[K++]=N,Q[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,T/=3;var yt=Math.PI/(O+1);vt=1/(w-O+1),ft=1/(T-O+1);var Ct,wt=O/2;for(l=wt+1;O+1>l;l++)Ct=p.PI_OVER_TWO+yt*l,gt[_t++]=ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=1;T-O+1>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=O;l>wt;l--)Ct=p.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=p.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=p.PI_OVER_TWO+yt*l,gt[_t++]=vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct))}else{for(w/=3,T/=3,vt=1/(w-1),ft=1/(T-1),l=0;T>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:Q}}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,p=r.binormal?new Float32Array(6*u):void 0,m=r.tangent?new Float32Array(6*u):void 0,f=S,v=E,g=b,_=x,y=T,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(p,C,A),n.addAttribute(p,C,A+3),n.addAttribute(p,C,w),n.addAttribute(p,C,w+3)),r.tangent&&(y=t.normalize(t.cross(C,_,y),y),n.addAttribute(m,y,A),n.addAttribute(m,y,A+3),n.addAttribute(m,y,w),n.addAttribute(m,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?(p.set(o),p.set(o,u),e.binormal.values=p):e.binormal=void 0,r.tangent){var M=e.tangent.values;m.set(M),m.set(M,u),e.tangent.values=m}}if(r.st){var I=e.st.values,D=new Float32Array(6*c);D.set(I),D.set(I,c);for(var O=2*c,R=0;2>R;R++){for(D[O++]=I[0],D[O++]=I[1],s=2;c>s;s+=2){var L=I[s],N=I[s+1];D[O++]=L,D[O++]=N,D[O++]=L,D[O++]=N}D[O++]=I[0],D[O++]=I[1]}e.st.values=D}return e}function C(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;i<e.length;i+=3){var n=e[i],o=e[i+1],a=e[i+2];r[t++]=n,r[t++]=o,r[t++]=a,r[t++]=n,r[t++]=o,r[t++]=a}return r[t++]=e[0],r[t++]=e[1],r[t++]=e[2],r}function w(e,t){var r=new v({position:t.positon,normal:t.normal||t.binormal,tangent:t.tangent,binormal:t.normal||t.binormal,st:t.st}),i=e.ellipsoid,o=n.computePositions(e),a=_(o,r,i),s=e.height,l=e.extrudedHeight,u=a.attributes,c=a.indices,h=u.position.values,p=h.length,m=new Float64Array(6*p),f=new Float64Array(p);f.set(h);var g=new Float64Array(4*p);h=n.scaleToGeodeticHeight(h,s,i,h),g=C(h,0,g),f=n.scaleToGeodeticHeight(f,l,i,f),g=C(f,2*p,g),m.set(h),m.set(f,p),m.set(g,2*p),u.position.values=m,p/=3;var w,S=c.length,E=p+p,b=d.createTypedArray(m.length/3,2*S+3*E);b.set(c);var x=S;for(w=0;S>w;w+=3){var T=c[w],P=c[w+1],A=c[w+2];b[x++]=A+p,b[x++]=P+p,b[x++]=T+p}u=y(u,t);var M,I,D,O;for(w=0;E>w;w+=2)M=w+E,I=M+E,D=M+1,O=I+1,b[x++]=M,b[x++]=I,b[x++]=D,b[x++]=D,b[x++]=I,b[x++]=O;return{attributes:u,indices:b}}var S=new t,E=new t,b=new t,x=new t,T=new t,P=new t,A=new t,M=new t,I=function(e){e=o(e,o.EMPTY_OBJECT);var r=e.positions,n=e.width;this._positions=r,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,i.ROUNDED),this._granularity=o(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this.packedLength=1+r.length*t.packedLength+l.packedLength+v.packedLength+5};I.pack=function(e,r,i){i=o(i,0);var n=e._positions,a=n.length;r[i++]=a;
for(var s=0;a>s;++s,i+=t.packedLength)t.pack(n[s],r,i);l.pack(e._ellipsoid,r,i),i+=l.packedLength,v.pack(e._vertexFormat,r,i),i+=v.packedLength,r[i++]=e._width,r[i++]=e._height,r[i++]=e._extrudedHeight,r[i++]=e._cornerType,r[i]=e._granularity};var D=l.clone(l.UNIT_SPHERE),O=new v,R={positions:void 0,ellipsoid:D,vertexFormat:O,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return I.unpack=function(e,r,i){r=o(r,0);for(var n=e[r++],s=new Array(n),u=0;n>u;++u,r+=t.packedLength)s[u]=t.unpack(e,r);var c=l.unpack(e,r,D);r+=l.packedLength;var h=v.unpack(e,r,O);r+=v.packedLength;var d=e[r++],p=e[r++],m=e[r++],f=e[r++],g=e[r];return a(i)?(i._positions=s,i._ellipsoid=l.clone(c,i._ellipsoid),i._vertexFormat=v.clone(h,i._vertexFormat),i._width=d,i._height=p,i._extrudedHeight=m,i._cornerType=f,i._granularity=g,i):(R.positions=s,R.width=d,R.height=p,R.extrudedHeight=m,R.cornerType=f,R.granularity=g,new I(R))},I.createGeometry=function(t){var r=t._positions,i=t._height,o=t._extrudedHeight,s=i!==o,l=m.removeDuplicates(r);if(a(l)||(l=r),l.length<2)return void 0;var c,h=t._ellipsoid,d=t._vertexFormat,p={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,p.height=i,p.extrudedHeight=o,c=w(p,d)}else{var g=n.computePositions(p);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})},I}),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,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,w=0,S=0,E=0;for(l=0;l<m.length;l+=2)u=m[l].length-3,w+=u,E+=4*(u/3),S+=m[l+1].length-3;for(w+=3,S+=3,l=0;l<f.length;l++){s=f[l];var b=f[l].leftPositions;a(b)?(u=b.length,w+=u,E+=2*(u/3)):(u=f[l].rightPositions.length,S+=u,E+=2*(u/3))}var x,T=a(v);T&&(x=v[0].length-3,w+=x,S+=x,x/=3,E+=4*x);var P,A,M,I,D,O,R=w+S,L=new Float64Array(R),N=0,F=R-1,B=x/2,z=d.createTypedArray(R/3,E+4),V=0;if(z[V++]=N/3,z[V++]=(F-2)/3,T){p.push(N/3),O=_,D=y;var k=v[0];for(l=0;B>l;l++)O=t.fromArray(k,3*(B-1-l),O),D=t.fromArray(k,3*(B+l),D),n.addAttribute(L,D,N),n.addAttribute(L,O,void 0,F),A=N/3,I=A+1,P=(F-2)/3,M=P-1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=I,N+=3,F-=3}var U=0,W=m[U++],G=m[U++];for(L.set(W,N),L.set(G,F-G.length+1),u=G.length-3,p.push(N/3,(F-2)/3),l=0;u>l;l+=3)A=N/3,I=A+1,P=(F-2)/3,M=P-1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=I,N+=3,F-=3;for(l=0;l<f.length;l++){var H;s=f[l];var q,j=s.leftPositions,Y=s.rightPositions,X=C;if(a(j)){for(F-=3,q=M,p.push(I),H=0;H<j.length/3;H++)X=t.fromArray(j,3*H,X),z[V++]=q-H-1,z[V++]=q-H,n.addAttribute(L,X,void 0,F),F-=3;p.push(q-Math.floor(j.length/6)),o===i.BEVELED&&p.push((F-2)/3+1),N+=3}else{for(N+=3,q=I,p.push(M),H=0;H<Y.length/3;H++)X=t.fromArray(Y,3*H,X),z[V++]=q+H,z[V++]=q+H+1,n.addAttribute(L,X,N),N+=3;p.push(q+Math.floor(Y.length/6)),o===i.BEVELED&&p.push(N/3-1),F-=3}for(W=m[U++],G=m[U++],W.splice(0,3),G.splice(G.length-3,3),L.set(W,N),L.set(G,F-G.length+1),u=G.length-3,H=0;H<G.length;H+=3)I=N/3,A=I-1,M=(F-2)/3,P=M+1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=I,N+=3,F-=3;N-=3,F+=3,p.push(N/3,(F-2)/3)}if(T){N+=3,F-=3,O=_,D=y;var Z=v[1];for(l=0;B>l;l++)O=t.fromArray(Z,3*(x-l-1),O),D=t.fromArray(Z,3*l,D),n.addAttribute(L,O,void 0,F),n.addAttribute(L,D,N),I=N/3,A=I-1,M=(F-2)/3,P=M+1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=I,N+=3,F-=3;p.push(N/3)}else p.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:p}}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,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],w=u[f+1];_[y++]=C+h,_[y++]=w+h}var S,E;for(f=0;f<o.length;f++)S=o[f],E=S+h,_[y++]=S,_[y++]=E;return{attributes:l,indices:_}}var _=new t,y=new t,C=new t,w=function(e){e=o(e,o.EMPTY_OBJECT);var r=e.positions,n=e.width;this._positions=r,this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._width=n,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,i.ROUNDED),this._granularity=o(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+r.length*t.packedLength+l.packedLength+5};w.pack=function(e,r,i){i=o(i,0);var n=e._positions,a=n.length;r[i++]=a;for(var s=0;a>s;++s,i+=t.packedLength)t.pack(n[s],r,i);l.pack(e._ellipsoid,r,i),i+=l.packedLength,r[i++]=e._width,r[i++]=e._height,r[i++]=e._extrudedHeight,r[i++]=e._cornerType,r[i]=e._granularity};var S=l.clone(l.UNIT_SPHERE),E={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return w.unpack=function(e,r,i){r=o(r,0);for(var n=e[r++],s=new Array(n),u=0;n>u;++u,r+=t.packedLength)s[u]=t.unpack(e,r);var c=l.unpack(e,r,S);r+=l.packedLength;var h=e[r++],d=e[r++],p=e[r++],m=e[r++],f=e[r];return a(i)?(i._positions=s,i._ellipsoid=l.clone(c,i._ellipsoid),i._width=h,i._height=d,i._extrudedHeight=p,i._cornerType=m,i._granularity=f,i):(E.positions=s,E.width=h,E.height=d,E.extrudedHeight=p,E.cornerType=m,E.granularity=f,new w(E))},w.createGeometry=function(t){var r=t._positions,i=t._height,o=t._extrudedHeight,s=i!==o,l=m.removeDuplicates(r);if(a(l)||(l=r),l.length<2)return void 0;var c,h=t._ellipsoid,d={ellipsoid:h,positions:l,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1};if(s){var p=Math.max(i,o);o=Math.min(i,o),i=p,d.height=i,d.extrudedHeight=o,c=g(d)}else{var _=n.computePositions(d);c=v(_,d.cornerType),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 new u({attributes:y,indices:c.indices,primitiveType:f.LINES,boundingSphere:C})},w}),r("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,r,i,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*i,C=_*i,w=g*r,S=_*r;h[p+m]=y,h[p+m+1]=C,h[p+m+2]=l,h[p+f]=w,h[p+f+1]=S,h[p+f+2]=s,p+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=w,h[d++]=S,h[d++]=s)}return h},t}),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,p,m){"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,m.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=r,this._bottomRadius=i,this._vertexFormat=m.clone(n),this._slices=a,this._workerName="createCylinderGeometry"};C.packedLength=m.packedLength+4,C.pack=function(e,t,r){r=o(r,0),m.pack(e._vertexFormat,t,r),r+=m.packedLength,t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r]=e._slices};var w=new m,S={vertexFormat:w,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return C.unpack=function(e,t,r){t=o(t,0);var i=m.unpack(e,t,w);t+=m.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(r)?(r._vertexFormat=m.clone(i,r._vertexFormat),r._length=n,r._topRadius=s,r._bottomRadius=l,r._slices=u,r):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new C(S))},C.createGeometry=function(o){var a,s=o._length,m=o._topRadius,C=o._bottomRadius,w=o._vertexFormat,S=o._slices,E=S+S,b=S+E,x=E+E,T=n.computePositions(s,m,C,S,!0),P=w.st?new Float32Array(2*x):void 0,A=w.normal?new Float32Array(3*x):void 0,M=w.tangent?new Float32Array(3*x):void 0,I=w.binormal?new Float32Array(3*x):void 0,D=w.normal||w.tangent||w.binormal;if(D){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);D&&(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),I[N++]=z.x,I[N++]=z.y,I[N++]=z.z,I[N++]=z.x,I[N++]=z.y,I[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&&(I[N++]=0,I[N++]=-1,I[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&&(I[N++]=0,I[N++]=1,I[N++]=0)}var W=12*S-12,G=h.createTypedArray(x,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(m,C);for(a=0;x>a;a++){var X=r.fromArray(T,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:T})),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:I})),w.st&&(Z.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:P})),f.x=.5*s,f.y=Math.max(C,m);var J=new e(r.ZERO,t.magnitude(f));return new l({attributes:Z,indices:G,primitiveType:p.TRIANGLES,boundingSphere:J})},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 p=new t,m=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"};m.packedLength=5,m.pack=function(e,t,r){r=o(r,0),t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r++]=e._slices,t[r]=e._numberOfVerticalLines};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return m.unpack=function(e,t,r){t=o(t,0);var i=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(r)?(r._length=i,r._topRadius=n,r._bottomRadius=s,r._slices=l,r._numberOfVerticalLines=u,r):(f.length=i,f.topRadius=n,f.bottomRadius=s,f.slices=l,f.numberOfVerticalLines=u,new m(f))},m.createGeometry=function(o){var a,s=o._length,m=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,m,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 x=new c;x.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y}),p.x=.5*s,p.y=Math.max(f,m);var T=new e(r.ZERO,t.magnitude(p));return new l({attributes:x,indices:S,primitiveType:d.LINES,boundingSphere:T})},m}),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();r<e.length;)e[r].update(t)?r++:e.splice(r,1);return!0}}}();return e.Tween=function(t){var r=t,i={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,h=0,d=null,p=e.Easing.Linear.None,m=e.Interpolation.Linear,f=[],v=null,g=!1,_=null,y=null,C=null;for(var w in t)i[w]=parseFloat(t[w],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,g=!1,d=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),d+=h;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[r[a]].concat(n[a])}i[a]=r[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==C&&C.call(r),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=f.length;t>e;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(r),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=p(u);for(t in n){var w=i[t]||0,S=n[t];S instanceof Array?r[t]=m(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,x=f.length;x>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","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m){"use strict";var f=new r,v=new r,g=new r,_=new r,y=new r,C=new r(1,1,1),w=Math.cos,S=Math.sin,E=function(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,C),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=m.clone(a),this._workerName="createEllipsoidGeometry"};E.packedLength=r.packedLength+m.packedLength+2,E.pack=function(e,t,i){i=n(i,0),r.pack(e._radii,t,i),i+=r.packedLength,m.pack(e._vertexFormat,t,i),i+=m.packedLength,t[i++]=e._stackPartitions,t[i]=e._slicePartitions};var b=new r,x=new m,T={radii:b,vertexFormat:x,stackPartitions:void 0,slicePartitions:void 0};return E.unpack=function(e,t,i){t=n(t,0);var a=r.unpack(e,t,b);t+=r.packedLength;var s=m.unpack(e,t,x);t+=m.packedLength;var l=e[t++],u=e[t];return o(i)?(i._radii=r.clone(a,i._radii),i._vertexFormat=m.clone(s,i._vertexFormat),i._stackPartitions=l,i._slicePartitions=u,i):(T.stackPartitions=l,T.slicePartitions=u,new E(T))},E.createGeometry=function(n){var o,a,m=n._radii,C=s.fromCartesian3(m),E=n._vertexFormat,b=n._slicePartitions+1,x=n._stackPartitions+1,T=x*b,P=new Float64Array(3*T),A=6*(b-1)*(x-1),M=h.createTypedArray(T,A),I=E.normal?new Float32Array(3*T):void 0,D=E.tangent?new Float32Array(3*T):void 0,O=E.binormal?new Float32Array(3*T):void 0,R=E.st?new Float32Array(2*T):void 0,L=new Array(b),N=new Array(b),F=0;for(o=0;b>o;o++){var B=d.TWO_PI*o/(b-1);L[o]=w(B),N[o]=S(B),P[F++]=0,P[F++]=0,P[F++]=m.z}for(o=1;x-1>o;o++){var z=Math.PI*o/(x-1),V=S(z),k=m.x*V,U=m.y*V,W=m.z*w(z);for(a=0;b>a;a++)P[F++]=L[a]*k,P[F++]=N[a]*U,P[F++]=W}for(o=0;b>o;o++)P[F++]=0,P[F++]=0,P[F++]=-m.z;var G=new c;E.position&&(G.position=new u({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;T>o;o++){var X=r.fromArray(P,3*o,f),Z=C.geodeticSurfaceNormal(X,v);if(E.st){var J=t.negate(Z,y);t.magnitude(J)<d.EPSILON6&&(F=3*(o+b*Math.floor(.5*x)),F>P.length&&(F=3*(o-b*Math.floor(.5*x))),r.fromArray(P,F,J),C.geodeticSurfaceNormal(J,J),t.negate(J,J)),R[H++]=Math.atan2(J.y,J.x)/d.TWO_PI+.5,R[H++]=Math.asin(Z.z)/Math.PI+.5}if(E.normal&&(I[q++]=Z.x,I[q++]=Z.y,I[q++]=Z.z),E.tangent||E.binormal){var Q=g;if(b>o||o>T-b-1?(r.cross(r.UNIT_X,Z,Q),r.normalize(Q,Q)):(r.cross(r.UNIT_Z,Z,Q),r.normalize(Q,Q)),E.tangent&&(D[j++]=Q.x,D[j++]=Q.y,D[j++]=Q.z),E.binormal){var K=r.cross(Z,Q,_);r.normalize(K,K),O[Y++]=K.x,O[Y++]=K.y,O[Y++]=K.z}}}E.st&&(G.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R})),E.normal&&(G.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),E.tangent&&(G.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),E.binormal&&(G.binormal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O}))}for(F=0,o=0;x>o;o++){var $=o*b,et=(o+1)*b;for(a=0;b-1>a;a++)M[F++]=et+a,M[F++]=et+a+1,M[F++]=$+a+1,M[F++]=et+a,M[F++]=$+a+1,M[F++]=$+a}return new l({attributes:G,indices:M,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(C)})},E}),r("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var p=new t(1,1,1),m=Math.cos,f=Math.sin,v=function(e){e=i(e,i.EMPTY_OBJECT);var r=i(e.radii,p),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"};v.packedLength=t.packedLength+3,v.pack=function(e,r,n){n=i(n,0),t.pack(e._radii,r,n),n+=t.packedLength,r[n++]=e._stackPartitions,r[n++]=e._slicePartitions,r[n]=e._subdivisions};var g=new t,_={radii:g,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return v.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,g);r+=t.packedLength;var s=e[r++],l=e[r++],u=e[r++];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 v(_))},v.createGeometry=function(t){var i,n,o,p,v,g,_=t._radii,y=a.fromCartesian3(_),C=t._stackPartitions,w=t._slicePartitions,S=t._subdivisions,E=S*(C+w-1),b=E-w+2,x=new Float64Array(3*b),T=c.createTypedArray(b,2*E),P=0,A=new Array(S),M=new Array(S);for(i=0;S>i;i++)o=h.TWO_PI*i/S,A[i]=m(o),M[i]=f(o);for(i=1;C>i;i++)for(p=Math.PI*i/C,v=m(p),g=f(p),n=0;S>n;n++)x[P++]=_.x*A[n]*g,x[P++]=_.y*M[n]*g,x[P++]=_.z*v;for(A.length=w,M.length=w,i=0;w>i;i++)o=h.TWO_PI*i/w,A[i]=m(o),M[i]=f(o);for(x[P++]=0,x[P++]=0,x[P++]=_.z,i=1;S>i;i++)for(p=Math.PI*i/S,v=m(p),g=f(p),n=0;w>n;n++)x[P++]=_.x*A[n]*g,x[P++]=_.y*M[n]*g,x[P++]=_.z*v;for(x[P++]=0,x[P++]=0,x[P++]=-_.z,P=0,i=0;C-1>i;++i){var I=i*S;for(n=0;S-1>n;++n)T[P++]=I+n,T[P++]=I+n+1;T[P++]=I+S-1,T[P++]=I}var D=S*(C-1);for(n=1;w+1>n;++n)T[P++]=D,T[P++]=D+n;for(i=0;S-2>i;++i){var O=i*w+1+D,R=(i+1)*w+1+D;for(n=0;w-1>n;++n)T[P++]=R+n,T[P++]=O+n;T[P++]=R+w-1,T[P++]=O+w-1}var L=x.length/3-1;for(n=L-1;n>L-w-1;--n)T[P++]=L,T[P++]=n;var N=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})});return new s({attributes:N,indices:T,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})},v}),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<<e)},l.prototype.getTileDataAvailable=function(){return void 0},l}),r("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,r,i,n,o,a){"use strict";function s(e,r,i){var n=e.transformPositionToScaledSpace(r,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,i),u=t.magnitude(t.cross(s,i,s)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function l(e,r,i){return 0>=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 p=r[h],m=s(o,p,a);c=Math.max(c,m)}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,p=u(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=s(h,d,p);m=Math.max(m,g)}return l(p,m,c)};var p=[];c.prototype.computeHorizonCullingPointFromRectangle=function(r,i,n){var o=a.subsample(r,i,0,p),s=e.fromPoints(o);return t.magnitude(s.center)<.1*i.minimumRadius?void 0:this.computeHorizonCullingPoint(s.center,o,n)};var m=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;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,r,i-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;o>l;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-r[t[l]])}return c}function o(e,t,r,n,o,a){for(var s,l,u=-1,c=t.length,h=c*(c+1)/2,d=0;o>d;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=r[t[s]],w=r[t[s+m]];if(0>=w-C)l=t[s]*o*(a+1)+o*m+d,_=n[l],y=_/i.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=_/(w-C),e[p+v+f]=y,f++}g=g||0!==_}g&&(u=Math.max(u,m))}}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,p,m=r.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(i[p]);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?(p=_[u]*o+o*l+h,w=i[p],f[h][l].push(w/a(l))):(w=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(w/(E-S))),C=C||0!==w}C||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var b=n(e,_,r,c,l,[]);for(h=0;o>h;h++){var x=f[h][l][0];s[h+c*o]+=x*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 p=r.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,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,m,r,E,f,C),x=Math.floor(f*(1-f)/2)+g*f,T=0;a>T;T++){var P=Math.floor(T*w),A=_[P+x];c[T+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,p=26.4057084,m=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,x=(125.045+l*E)*i.RADIANS_PER_DEGREE,T=(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,I=(311.589+p*E)*i.RADIANS_PER_DEGREE,D=(134.963+m*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(x),V=Math.sin(T),k=Math.sin(P),U=Math.sin(A),W=Math.sin(M),G=Math.sin(I),H=Math.sin(D),q=Math.sin(O),j=Math.sin(R),Y=Math.sin(L),X=Math.sin(N),Z=Math.sin(F),J=Math.sin(B),Q=Math.cos(x),K=Math.cos(T),$=Math.cos(P),et=Math.cos(A),tt=Math.cos(M),rt=Math.cos(I),it=Math.cos(D),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*J)*i.RADIANS_PER_DEGREE,ht=(66.5392+.013*b+1.5419*Q+.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*J)*i.RADIANS_PER_DEGREE,pt=(13.17635815-1.4e-12*2*E+3.561*Q*l+.1208*K*u-.0642*$*c+.0158*et*h+.0252*tt*d-.0066*rt*p-.0047*it*m-.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=pt,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 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 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,p=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),m=a.fromAxisAngle(e.UNIT_Z,h,p),f=o.fromQuaternion(a.conjugate(m,m),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 p=e.isStartIncluded,m=e.isStopIncluded,f=r.isStartIncluded,v=r.isStopIncluded,g=o.lessThan(l,c);return i.start=h?u:s,i.isStartIncluded=p&&f||!o.equals(u,s)&&(h&&f||d&&p),i.stop=g?l:c,i.isStopIncluded=g?m:m&&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.packedLength=4,o.pack=function(e,r,i){i=t(i,0),r[i++]=e[0],r[i++]=e[1],r[i++]=e[2],r[i++]=e[3]},o.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new o),n[0]=e[i++],n[1]=e[i++],n[2]=e[i++],n[3]=e[i++],n},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.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]},o.equalsEpsilon=function(e,t,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,p=new e,m=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=m;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 x=n.computeEigenDecomposition(b,f),T=n.transpose(x.unitary,i.rotation);g=e.subtract(t[0],s,c);var P=n.multiplyByVector(T,g,h),A=e.clone(P,d),M=e.clone(P,p);for(o=1;a>o;o++)g=e.subtract(t[o],s,g),n.multiplyByVector(T,g,P),e.minimumByComponent(M,P,M),e.maximumByComponent(A,P,A);var I=e.add(M,A,h);e.multiplyByScalar(I,.5,I),n.multiplyByVector(T,I,I),e.add(s,I,i.translation);var D=e.subtract(A,M,h);return e.multiplyByScalar(D,.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 p=new t;c.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,p),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,i<this._occluderRadius)return o>0?(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 m=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,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(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),p=c._horizonToPlaneNormalDotProduct(e,u,h,d,i[0]);if(!p)return void 0;for(var m,v=1;l>v;++v){if(m=c._horizonToPlaneNormalDotProduct(e,u,h,d,i[v]),!m)return void 0;p>m&&(p=m)}if(.0017453283658983088>p)return void 0;var g=s/p;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,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),E=Math.sqrt(d-g*g),b=this._rotationVector(s,r,i,a,n),x=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);x=t.normalize(x,x);var T=t.multiplyByScalar(x,E,y);b=t.normalize(t.subtract(t.add(_,T,w),s,w),w);var P=t.dot(r,b);b=t.normalize(t.subtract(t.subtract(_,T,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+"<br/>"+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 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),i&&(p.strokeStyle="black",p.lineWidth=t.lineWidth,p.strokeText(r,d/2,v)),n&&(p.fillStyle="black",p.fillText(r,d/2,v));for(var g=p.getImageData(0,0,m,f).data,_=0,y=4*m,C=g.length;++_<C&&255===g[_];);var w=0|_/y;for(_=C-1;--_>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 x=0|_%y/4+1;o.ascent=v-w,o.descent=S-v,o.bounds={minx:E-d/2,maxx:x-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,i){"use strict";var n,o=function(o,a){if(""===o)return void 0;a=r(a,r.EMPTY_OBJECT);var s=r(a.font,"10px sans-serif"),l=r(a.stroke,!1),u=r(a.fill,!0),c=r(a.strokeWidth,1),h=document.createElement("canvas");h.width=1,h.height=1,h.style.font=s;var d=h.getContext("2d");i(n)||(i(d.imageSmoothingEnabled)?n="imageSmoothingEnabled":i(d.mozImageSmoothingEnabled)?n="mozImageSmoothingEnabled":i(d.webkitImageSmoothingEnabled)?n="webkitImageSmoothingEnabled":i(d.msImageSmoothingEnabled)&&(n="msImageSmoothingEnabled")),d.font=s,d.lineJoin="round",d.lineWidth=c,d[n]=!1,d.textBaseline=r(a.textBaseline,"bottom"),h.style.visibility="hidden",document.body.appendChild(h);var p=e(d,o,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[n]=!1,l){var v=r(a.strokeColor,t.BLACK);d.strokeStyle=v.toCssColorString(),d.strokeText(o,0,f)}if(u){var g=r(a.fillColor,t.WHITE);d.fillStyle=g.toCssColorString(),d.fillText(o,0,f)}return h};return o}),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.width<r.height&&(o=n*(r.width/r.height));var s=(i-o)/2,l=7/24*i-a/2;e.globalCompositeOperation="destination-out",e.drawImage(r,s-1,l,o,a),e.drawImage(r,s,l-1,o,a),e.drawImage(r,s+1,l,o,a),e.drawImage(r,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+1,a+1),e.globalCompositeOperation="destination-out",e.drawImage(r,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s,l,o,a)}function l(e,t,i,l,u){h[0]=e,h[1]=t,h[2]=i,h[3]=l;var c=JSON.stringify(h),d=u[c];if(r(d))return d;var p=document.createElement("canvas");p.width=l,p.height=l;var m=p.getContext("2d");if(a(m,i,l),r(e)){var f=n(e).then(function(e){return s(m,e,l),u[c]=p,p});return u[c]=f,f}if(r(t)){var v=o(t,{font:"bold "+l+"px sans-serif"});s(m,v,l)}return u[c]=p,p}var u=function(){this._cache={}};u.prototype.fromColor=function(e,t){return l(void 0,void 0,e,t,this._cache)},u.prototype.fromUrl=function(e,t,r){return l(e,void 0,t,r,this._cache)},u.prototype.fromMakiIconId=function(t,r,i){return l(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,r,i,this._cache)},u.prototype.fromText=function(e,t,r){return l(void 0,e,t,r,this._cache)};var c=new t,h=new Array(4);return u}),r("Core/PixelFormat",["./freezeObject"],function(e){"use strict";var t={DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,validate:function(e){return e===t.DEPTH_COMPONENT||e===t.DEPTH_STENCIL||e===t.ALPHA||e===t.RGB||e===t.RGBA||e===t.LUMINANCE||e===t.LUMINANCE_ALPHA},isColorFormat:function(e){return e===t.ALPHA||e===t.RGB||e===t.RGBA||e===t.LUMINANCE||e===t.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===t.DEPTH_COMPONENT||e===t.DEPTH_STENCIL}};return e(t)}),r("Core/PolygonGeometryLibrary",["./Cartesian3","./defaultValue","./defined","./Ellipsoid"],function(e,t,r,i){"use strict";function n(t,r,i,n){return e.subtract(r,t,a),e.multiplyByScalar(a,i/n,a),e.add(t,a,a),[a.x,a.y,a.z]}var o={};o.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},o.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},o.unpackPolygonHierarchy=function(t,r){for(var i=t[r++],n=t[r++],a=new Array(i),s=n>0?new Array(n):void 0,l=0;i>l;++l,r+=e.packedLength)a[l]=e.unpack(t,r);for(var u=0;n>u;++u)s[u]=o.unpackPolygonHierarchy(t,r),r=s[u].startingIndex,delete s[u].startingIndex;return{positions:a,holes:s,startingIndex:r}};var a=new e;o.subdivideLineCount=function(t,r,i){var n=e.distance(t,r),o=n/i,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},o.subdivideLine=function(t,i,a,s){var l=o.subdivideLineCount(t,i,a),u=e.distance(t,i),c=u/l;r(s)||(s=[]);var h=s;h.length=3*l;for(var d=0,p=0;l>p;p++){var m=n(t,i,p*c,u);h[d++]=m[0],h[d++]=m[1],h[d++]=m[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 p=s,m=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,p),v=h.scaleToGeodeticSurface(f,v),m=e.multiplyByScalar(p,a,m),m=e.add(v,m,m),g[y+_]=m.x,g[y+1+_]=m.y,g[y+2+_]=m.z,d&&(v=e.clone(f,v)),m=e.multiplyByScalar(p,o,m),m=e.add(v,m,m),g[y]=m.x,g[y+1]=m.y,g[y+2]=m.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,p,m){"use strict";function f(t,r,i){var n=e.subtract(r,t,N),o=e.subtract(i,r,F);return n.x*o.y-n.y*o.x>=0}function v(e){for(var t=e[0].x,r=0,i=0;i<e.length;i++)e[i].x>t&&(t=e[i].x,r=i);return r}function g(e){for(var t=e[0][0].x,r=0,i=0;i<e.length;i++){var n=e[i][v(e[i])].x;n>t&&(t=n,r=i)}return r}function _(e){for(var t=[],r=0;r<e.length;r++){var i=e[(r-1+e.length)%e.length],n=e[r],o=e[(r+1)%e.length];f(i,n,o)||t.push(n)}return t}function y(t,r){for(var i=0;i<t.length;i++)if(e.equals(r,t[i]))return i;return-1}function C(r,n,o){o=i(o,[]);var a=Number.MAX_VALUE,s=v(n),l=new e(n[s].x,r.y);o.push(s),o.push((s+1)%n.length);for(var u=n[0].x,c=u,h=1;h<n.length;++h)n[h].x<u?u=n[h].x:n[h].x>c&&(c=n[h].x);c+=c-u;var d=new t(c,r.y,0);for(h=0;h<n.length;h++){var p=n[h],m=n[(h+1)%n.length];if((p.x>=r.x||m.x>=r.x)&&(p.y>=r.y&&m.y<=r.y||p.y<=r.y&&m.y>=r.y)){var f=(m.y-p.y)*(d.x-r.x)-(m.x-p.x)*(d.y-r.y);if(0!==f){f=1/f;var g=((m.x-p.x)*(r.y-p.y)-(m.y-p.y)*(r.x-p.x))*f,_=((d.x-r.x)*(r.y-p.y)-(d.y-r.y)*(r.x-p.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,B);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,z)),p=e.magnitudeSquared(e.subtract(t[s[1]],a,z)),m=p>d?t[s[0]]:t[s[1]],f=_(t),w=f.indexOf(m);-1!==w&&f.splice(w,1);for(var S=[],E=0;E<f.length;E++){var b=f[E];h(b,a,l,m)&&S.push(b)}var x=Number.MAX_VALUE;if(S.length>0){var T=e.fromElements(1,0,z);for(E=0;E<S.length;E++){var P=e.subtract(S[E],a,V),A=e.magnitude(T)*e.magnitudeSquared(P);if(0!==A){var M=Math.abs(c.acosClamped(e.dot(T,P)/A));x>M&&(x=M,m=S[E])}}}return t.indexOf(m)}function S(e,r,i){for(var n=$.computeWindingOrder2D(e),o=0;o<r.length;o++){var a=r[o];t.equals(a[0],a[a.length-1])||a.push(a[0]);var l=$.computeWindingOrder2D(a);l===n&&a.reverse()}var u=s.fromPoints(e,i),c=u.projectPointsOntoPlane(e),h=[];for(o=0;o<r.length;o++)h.push(u.projectPointsOntoPlane(r[o]));var d=w(c,h),p=g(h),m=v(h[p]),f=r[p],_=[];for(o=0;o<e.length;o++)_.push(e[o]);var y,C=[];if(0!==m)for(y=0;y<=f.length;y++){var S=(y+m)%f.length;0!==S&&C.push(f[S])}else for(y=0;y<f.length;y++)C.push(f[(y+m)%f.length]);var E=_.lastIndexOf(e[d]);C.push(e[E]);var b=_.slice(0,E+1),x=_.slice(E+1);return _=b.concat(C,x),r.splice(p,1),_}function E(e){var t=c.nextRandomNumber(),r=Math.floor(t*e);return r===e&&r--,r}function b(e,t,r,i){var n=i[e].position,o=i[t].position,a=i[r].position,s=a.x,l=a.y,u=n.x-s,c=n.y-l,h=o.x-s,d=o.y-l;return u*d-c*h}function x(e,t){return e.x*t.y-e.y*t.x}function T(e,t){var r=t.length,i=c.mod(e-1,r),n=c.mod(e+1,r);return 0===b(i,n,e,t)?!1:!0}function P(t,r){return e.magnitudeSquared(r)<e.magnitudeSquared(t)}function A(t,r,i){if(!T(t,i))return t;var n=i[t].position,o=i[r].position,a=i.length,s=c.mod(t-1,a);if(!T(s,i))return s;var l=c.mod(t+1,a);if(!T(l,i))return l;var u=e.subtract(i[s].position,n,W),h=e.subtract(i[l].position,n,G),d=e.subtract(o,n,H),p=x(u,d),m=x(h,d);if(0===p)return P(u,d)?k:U;if(0===m)return P(h,d)?k:U;var f=x(u,h);return 0>f?0>p&&m>0?k:U:f>0?p>0&&0>m?U:k:void 0}function M(e,t,r){return(e>t||e>r)&&(t>e||r>e)||t===r&&t===e}function I(t,r,i,n){var o=e.subtract(i,t,j),a=r.x*n.y-r.y*n.x,s=a*a,l=e.magnitudeSquared(r),u=e.magnitudeSquared(n);if(s>q*l*u){var c=(o.x*n.y-o.y*n.x)/a;return e.add(t,e.multiplyByScalar(r,c,j),j)}return void 0}function D(t,r,i){for(var o=e.subtract(r,t,Y),a=i.length,s=0;a>s;s++){var l=i[s].position,u=i[c.mod(s+1,a)].position;if(!(e.equals(t,l)||e.equals(r,u)||e.equals(t,u)||e.equals(r,l))){var h=e.subtract(u,l,X),d=I(t,o,l,h);if(n(d)&&!(e.equals(d,t)||e.equals(d,r)||e.equals(d,l)||e.equals(d,u))){var p=d.x,m=d.y,f=M(p,t.x,r.x)&&M(m,t.y,r.y)&&M(p,l.x,u.x)&&M(m,l.y,u.y);if(f)return!0}}}return!1}function O(t,r,i){var n=A(t,r,i);if(n>=0)return n;var o=A(r,t,i);return o>=0?o:n!==k||o!==k||D(i[t].position,i[r].position,i)||e.equals(i[t].position,i[r].position)?J:Z}function R(e){return 0===b(1,2,0,e)}function L(e){var t=e.length;if(3===t)return R(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,i,n=0,a=10*e.length,s=J;Z>s&&n++<a;){for(r=E(e.length),i=r+1;Math.abs(r-i)<2||Math.abs(r-i)>e.length-2;)i=E(e.length);if(r>i){var l=r;r=i,i=l}s=O(r,i,e)}if(s===Z){var u=e.splice(r,i-r+1,e[r],e[i]);return L(e).concat(L(u))}return s>=0?(e.splice(s,1),L(e)):[]}var N=new e,F=new e,B=new e,z=new e(1,0),V=new e,k=-1,U=-2,W=new t,G=new t,H=new t,q=c.EPSILON14,j=new e;new e;var Y=new e,X=new e,Z=-1,J=-2,Q=new t,K=new t,$={};$.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},$.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
},$.computeWindingOrder2D=function(e){var t=$.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},$.triangulate=function(e){for(var t=e.length,r=[],i=0;t>i;++i)r[i]={position:e[i],index:i};return L(r)};var et=new t,tt=new t,rt=new t,it=new t,nt=new t,ot=new t,at=new t;return $.computeSubdivision=function(e,o,a,s){s=i(s,c.RADIANS_PER_DEGREE);var h,p=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,w=c.chordLength(s,C),S=w*w;p.length>0;){var E,b,x=p.pop(),T=p.pop(),P=p.pop(),A=t.fromArray(f,3*P,et),M=t.fromArray(f,3*T,tt),I=t.fromArray(f,3*x,rt),D=t.multiplyByScalar(t.normalize(A,it),C,it),O=t.multiplyByScalar(t.normalize(M,nt),C,nt),R=t.multiplyByScalar(t.normalize(I,ot),C,ot),L=t.magnitudeSquared(t.subtract(D,O,at)),N=t.magnitudeSquared(t.subtract(O,R,at)),F=t.magnitudeSquared(t.subtract(R,D,at)),B=Math.max(L,N,F);B>S?L===B?(E=Math.min(P,T)+" "+Math.max(P,T),h=y[E],n(h)||(b=t.add(A,M,at),t.multiplyByScalar(b,.5,b),f.push(b.x,b.y,b.z),h=f.length/3-1,y[E]=h),p.push(P,h,x),p.push(h,T,x)):N===B?(E=Math.min(T,x)+" "+Math.max(T,x),h=y[E],n(h)||(b=t.add(M,I,at),t.multiplyByScalar(b,.5,b),f.push(b.x,b.y,b.z),h=f.length/3-1,y[E]=h),p.push(T,h,P),p.push(h,x,P)):F===B&&(E=Math.min(x,P)+" "+Math.max(x,P),h=y[E],n(h)||(b=t.add(I,A,at),t.multiplyByScalar(b,.5,b),f.push(b.x,b.y,b.z),h=f.length/3-1,y[E]=h),p.push(x,h,T),p.push(h,P,T)):(_.push(P),_.push(T),_.push(x))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:_,primitiveType:d.TRIANGLES})},$.scaleToGeodeticHeight=function(e,r,o,s){o=i(o,a.WGS84);var l=Q,u=K;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},$.eliminateHoles=function(e,r,n){n=i(n,a.WGS84);for(var o=[],s=0;s<r.length;s++){for(var l=[],u=0;u<r[s].length;u++)l.push(t.clone(r[s][u]));o.push(l)}for(var c=e;o.length>0;)c=S(c,o,n);return c},$}),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,p,m,f,v,g,_,y,C,w,S,E,b){"use strict";function x(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,p=0;d>p;++p){var m=i.clone(t[p],D);g.multiplyByVector(s,m,m);var f=e.projectPointOntoPlane(m,I);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,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 m=t.length,f=new Array(3*m),v=0,g=0;m>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(e,t,l,r);return new p({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),p=x(d,o,s,N),m=W;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,C=e.normal?new Float32Array(_):void 0,S=e.tangent?new Float32Array(_):void 0,E=e.binormal?new Float32Array(_):void 0,b=0,T=0,P=B,A=z,M=V,I=!0,D=w.fromAxisAngle(d._plane.normal,s,q),O=g.fromQuaternion(D,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),J=d.projectPointOntoPlane(Z,G);r.subtract(J,m,J),l&&(y[b+L]=J.x/p.width,y[b+1+L]=J.y/p.height),y[b]=J.x/p.width,y[b+1]=J.y/p.height,b+=2}if(e.normal||e.tangent||e.binormal){var Q=T+1,K=T+2;if(c){if(_>Y+3){var $=i.fromArray(f,Y+3,k);if(I){var et=i.fromArray(f,Y+_,U);i.subtract($,X,$),i.subtract(et,X,et),P=i.normalize(i.cross(et,$,P),P),I=!1}i.equalsEpsilon($,X,v.EPSILON10)&&(I=!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[T+R]=-P.x,C[Q+R]=-P.y,C[K+R]=-P.z):(C[T+R]=P.x,C[Q+R]=P.y,C[K+R]=P.z),C[T]=P.x,C[Q]=P.y,C[K]=P.z),e.tangent&&(l&&!c?(S[T+R]=-A.x,S[Q+R]=-A.y,S[K+R]=-A.z):(S[T+R]=A.x,S[Q+R]=A.y,S[K+R]=A.z),S[T]=A.x,S[Q]=A.y,S[K]=A.z),e.binormal&&(l&&(E[T+R]=M.x,E[Q+R]=M.y,E[K+R]=M.z),E[T]=M.x,E[Q]=M.y,E[K]=M.z),T+=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,o){var a,s,l,u,p,m=e.length,g=0;if(o)for(s=2*3*m,a=new Array(2*s),l=0;m>l;l++)u=e[l],p=e[(l+1)%m],a[g]=a[g+s]=u.x,++g,a[g]=a[g+s]=u.y,++g,a[g]=a[g+s]=u.z,++g,a[g]=a[g+s]=p.x,++g,a[g]=a[g+s]=p.y,++g,a[g]=a[g+s]=p.z,++g;else{var y=v.chordLength(r,t.maximumRadius),w=0;for(l=0;m>l;l++)w+=_.subdivideLineCount(e[l],e[(l+1)%m],y);for(s=3*(w+m),a=new Array(2*s),l=0;m>l;l++){u=e[l],p=e[(l+1)%m];for(var S=_.subdivideLine(u,p,y,Y),E=S.length,b=0;E>b;++b,++g)a[g]=S[b],a[g+s]=S[b];a[g]=p.x,a[g+s]=p.x,++g,a[g]=p.y,a[g+s]=p.y,++g,a[g]=p.z,a[g+s]=p.z,++g}}m=a.length;var x=f.createTypedArray(m/3,m-6*e.length),T=0;for(m/=6,l=0;m>l;l++){var P=l,A=P+1,M=P+m,I=M+1;u=i.fromArray(a,3*P,k),p=i.fromArray(a,3*A,U),i.equalsEpsilon(u,p,v.EPSILON14)||(x[T++]=P,x[T++]=M,x[T++]=A,x[T++]=A,x[T++]=M,x[T++]=I)}return new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:a})}),indices:x,primitiveType:C.TRIANGLES})}function M(e,t,r,i,o){var a=T(e,t,r,o).geometry,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=l.length,w=v/2;for(_=0;C>_;_+=3){var S=g[_]+w,E=g[_+1]+w,x=g[_+2]+w;g[_+C]=x,g[_+1+C]=E,g[_+2+C]=S}var P=new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:m})}),indices:g,primitiveType:a.primitiveType}),M={topAndBottom:new p({geometry:P}),walls:[]},I=i.outerRing,D=u.fromPoints(I,e),O=D.projectPointsOntoPlane(I,X),R=y.computeWindingOrder2D(O);R===b.CLOCKWISE&&I.reverse();var L=A(I,e,r,o);M.walls.push(new p({geometry:L}));var N=i.holes;for(_=0;_<N.length;_++){var F=N[_];D=u.fromPoints(F,e),O=D.projectPointsOntoPlane(F,X),R=y.computeWindingOrder2D(O),R===b.COUNTER_CLOCKWISE&&F.reverse(),L=A(F,e,r),M.walls.push(new p({geometry:L}))}return M}var I=new r,D=new i,O=new w,R=new g,L=[],N=new e,F=new i,B=new i,z=new i,V=new i,k=new i,U=new i,W=new r,G=new r,H=new i,q=new w,j=new g,Y=[],X=[],Z=function(e){var t=e.polygonHierarchy,r=o(e.vertexFormat,E.DEFAULT),i=o(e.ellipsoid,l.WGS84),n=o(e.granularity,v.RADIANS_PER_DEGREE),s=o(e.stRotation,0),u=o(e.height,0),c=o(e.perPositionHeight,!1),h=e.extrudedHeight,d=a(h)&&(!v.equalsEpsilon(u,h,v.EPSILON6)||c);if(d){var p=h;h=Math.min(p,u),u=Math.max(p,u)}this._vertexFormat=E.clone(r),this._ellipsoid=l.clone(i),this._granularity=n,this._stRotation=s,this._height=u,this._extrudedHeight=o(h,0),this._extrude=d,this._polygonHierarchy=t,this._perPositionHeight=c,this._workerName="createPolygonGeometry",this.packedLength=_.computeHierarchyPackedLength(t)+l.packedLength+E.packedLength+7};Z.fromPositions=function(e){e=o(e,o.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new Z(t)},Z.pack=function(e,t,r){r=o(r,0),r=_.packPolygonHierarchy(e._polygonHierarchy,t,r),l.pack(e._ellipsoid,t,r),r+=l.packedLength,E.pack(e._vertexFormat,t,r),r+=E.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r]=e.packedLength};var J=l.clone(l.UNIT_SPHERE),Q=new E,K={polygonHierarchy:{}};return Z.unpack=function(e,t,r){t=o(t,0);var i=_.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=l.unpack(e,t,J);t+=l.packedLength;var s=E.unpack(e,t,Q);t+=E.packedLength;var u=e[t++],c=e[t++],h=e[t++],d=e[t++],p=1===e[t++],m=1===e[t++],f=e[t];return a(r)||(r=new Z(K)),r._polygonHierarchy=i,r._ellipsoid=l.clone(n,r._ellipsoid),r._vertexFormat=E.clone(s,r._vertexFormat),r._height=u,r._extrudedHeight=c,r._granularity=h,r._stRotation=d,r._extrude=p,r._perPositionHeight=m,r.packedLength=f,r},Z.createGeometry=function(e){var r,i,n,o=e._vertexFormat,s=e._ellipsoid,l=e._granularity,u=e._stRotation,h=e._height,d=e._extrudedHeight,p=e._extrude,v=e._polygonHierarchy,g=e._perPositionHeight,C=[],w=new S;w.enqueue(v),v=[];for(var E;0!==w.length;){var b=w.dequeue(),x=b.positions,A=b.holes;if(x=y.removeDuplicates(x),!(x.length<3)){var I=a(A)?A.length:0,D=[];for(E=0;I>E;E++){var O=A[E];if(O.positions=y.removeDuplicates(O.positions),!(O.positions.length<3)){D.push(O.positions);var R=0;a(O.holes)&&(R=O.holes.length);for(var L=0;R>L;L++)w.enqueue(O.holes[L])}}v.push({outerRing:x,holes:D});var N=D.length>0?y.eliminateHoles(x,D):x;C.push(N)}}if(0===C.length)return void 0;n=C[0];var F,B=[];if(p)for(E=0;E<C.length;E++){F=M(s,C[E],l,v[E],g),i=F.topAndBottom,i.geometry=_.scaleToGeodeticHeightExtruded(i.geometry,h,d,s,g),i.geometry=P(o,i.geometry,n,s,u,!0,!1),B.push(i),r=F.walls;for(var z=0;z<r.length;z++){var V=r[z];V.geometry=_.scaleToGeodeticHeightExtruded(V.geometry,h,d,s,g),V.geometry=P(o,V.geometry,n,s,u,!0,!0),B.push(V)}}else for(E=0;E<C.length;E++)F=T(s,C[E],l,g),F.geometry=y.scaleToGeodeticHeight(F.geometry,h,s,!g),F.geometry=P(o,F.geometry,n,s,u,!1,!1),B.push(F);F=m.combineInstances(B)[0],F.attributes.position.values=new Float64Array(F.attributes.position.values),F.indices=f.createTypedArray(F.attributes.position.values.length/3,F.indices);var k=F.attributes,U=t.fromVertices(k.position.values);return o.position||delete k.position,new c({attributes:k,indices:F.indices,primitiveType:F.primitiveType,boundingSphere:U})},Z}),r("Core/PolygonHierarchy",["./defined"],function(e){"use strict";var t=function(t,r){this.positions=e(t)?t:[],this.holes=e(r)?r:[]};return t}),r("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,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_){"use strict";function y(e,r,i,n){var o=a.fromPoints(r,e),h=o.projectPointsOntoPlane(r,w),p=f.computeWindingOrder2D(h);p===_.CLOCKWISE&&(h.reverse(),r.reverse());var g,y,C=r.length,E=0;if(n)for(g=new Float64Array(3*2*C),y=0;C>y;y++){var b=r[y],x=r[(y+1)%C];g[E++]=b.x,g[E++]=b.y,g[E++]=b.z,g[E++]=x.x,g[E++]=x.y,g[E++]=x.z}else{var T=0;for(y=0;C>y;y++)T+=m.subdivideLineCount(r[y],r[(y+1)%C],i);for(g=new Float64Array(3*T),y=0;C>y;y++)for(var P=m.subdivideLine(r[y],r[(y+1)%C],i,S),A=P.length,M=0;A>M;++M)g[E++]=P[M]}C=g.length/3;var I=2*C,D=d.createTypedArray(C,I);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,r,i,n){var o=a.fromPoints(r,e),h=o.projectPointsOntoPlane(r,w),p=f.computeWindingOrder2D(h);p===_.CLOCKWISE&&(h.reverse(),r.reverse());var g,y,C=r.length,E=new Array(C),b=0;if(n)for(g=new Float64Array(2*3*2*C),y=0;C>y;++y){E[y]=b/3;var x=r[y],T=r[(y+1)%C];g[b++]=x.x,g[b++]=x.y,g[b++]=x.z,g[b++]=T.x,g[b++]=T.y,g[b++]=T.z}else{var P=0;for(y=0;C>y;y++)P+=m.subdivideLineCount(r[y],r[(y+1)%C],i);for(g=new Float64Array(2*3*P),y=0;C>y;++y){E[y]=b/3;for(var A=m.subdivideLine(r[y],r[(y+1)%C],i,S),M=A.length,I=0;M>I;++I)g[b++]=A[I]}}C=g.length/6;var D=E.length,O=2*(2*C+D),R=d.createTypedArray(C,O);for(b=0,y=0;C>y;++y)R[b++]=y,R[b++]=(y+1)%C,R[b++]=y+C,R[b++]=(y+1)%C+C;for(y=0;D>y;y++){var L=E[y];R[b++]=L,R[b++]=L+C}return new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:R,primitiveType:v.LINES})})}var w=[],S=[],E=function(e){var t=e.polygonHierarchy,n=r(e.ellipsoid,o.WGS84),a=r(e.granularity,p.RADIANS_PER_DEGREE),s=r(e.height,0),l=r(e.perPositionHeight,!1),u=e.extrudedHeight,c=i(u)&&(!p.equalsEpsilon(s,u,p.EPSILON6)||l);if(c){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=r(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=l,this._workerName="createPolygonOutlineGeometry",this.packedLength=m.computeHierarchyPackedLength(t)+o.packedLength+6};E.pack=function(e,t,i){i=r(i,0),i=m.packPolygonHierarchy(e._polygonHierarchy,t,i),o.pack(e._ellipsoid,t,i),i+=o.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e.packedLength};var b=o.clone(o.UNIT_SPHERE),x={polygonHierarchy:{}};return E.unpack=function(e,t,n){t=r(t,0);var a=m.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var s=o.unpack(e,t,b);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 i(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=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 E(t)},E.createGeometry=function(t){var r=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 w=v.dequeue(),S=w.positions;if(S=f.removeDuplicates(S),!(S.length<3)){var E=w.holes?w.holes.length:0;for(_=0;E>_;_++){var b=w.holes[_];if(b.positions=f.removeDuplicates(b.positions),!(b.positions.length<3)){d.push(b.positions);var x=0;i(b.holes)&&(x=b.holes.length);for(var T=0;x>T;T++)v.enqueue(b.holes[T])}}d.push(S)}}if(0===d.length)return void 0;var P,A=[],M=p.chordLength(n,r.maximumRadius);if(l)for(_=0;_<d.length;_++)P=C(r,d[_],M,c),P.geometry=m.scaleToGeodeticHeightExtruded(P.geometry,o,a,r,c),A.push(P);else for(_=0;_<d.length;_++)P=y(r,d[_],M,c),P.geometry=f.scaleToGeodeticHeight(P.geometry,o,r,!c),A.push(P);P=h.combineInstances(A)[0];var I=e.fromVertices(P.attributes.position.values);return new s({attributes:P.attributes,indices:P.indices,primitiveType:P.primitiveType,boundingSphere:I})},E}),r("Core/PolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(e,t,i,n,o){var a=_;a.length=o;var s,l=i.red,u=i.green,c=i.blue,h=i.alpha,d=n.red,p=n.green,m=n.blue,f=n.alpha;if(r.equals(i,n)){for(s=0;o>s;s++)a[s]=r.clone(i);return a}var v=(d-l)/o,g=(p-u)/o,y=(m-c)/o,C=(f-h)/o;for(s=0;o>s;s++)a[s]=new r(l+s*v,u+s*g,c+s*y,h+s*C);return a}var _=[],y=function(e){e=n(e,n.EMPTY_OBJECT);var i=e.positions,a=e.colors,l=n(e.width,1),u=n(e.colorsPerVertex,!1);this._positions=i,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+i.length*t.packedLength;c+=o(a)?1+a.length*r.packedLength:1,this.packedLength=c+s.packedLength+v.packedLength+4};y.pack=function(e,i,a){a=n(a,0);var l,u=e._positions,c=u.length;for(i[a++]=c,l=0;c>l;++l,a+=t.packedLength)t.pack(u[l],i,a);var h=e._colors;for(c=o(h)?h.length:0,i[a++]=c,l=0;c>l;++l,a+=r.packedLength)r.pack(h[l],i,a);s.pack(e._ellipsoid,i,a),a+=s.packedLength,v.pack(e._vertexFormat,i,a),a+=v.packedLength,i[a++]=e._width,i[a++]=e._colorsPerVertex?1:0,i[a++]=e._followSurface?1:0,i[a]=e._granularity};var C=s.clone(s.UNIT_SPHERE),w=new v,S={positions:void 0,colors:void 0,ellipsoid:C,vertexFormat:w,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};y.unpack=function(e,i,a){i=n(i,0);var l,u=e[i++],c=new Array(u);for(l=0;u>l;++l,i+=t.packedLength)c[l]=t.unpack(e,i);u=e[i++];var h=u>0?new Array(u):void 0;for(l=0;u>l;++l,i+=r.packedLength)h[l]=r.unpack(e,i);var d=s.unpack(e,i,C);i+=s.packedLength;var p=v.unpack(e,i,w);i+=v.packedLength;var m=e[i++],f=1===e[i++],g=1===e[i++],_=e[i];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=_,a):(S.positions=c,S.colors=h,S.width=m,S.colorsPerVertex=f,S.followSurface=g,S.granularity=_,new y(S))};var E=new t,b=new t,x=new t,T=new t;return y.createGeometry=function(n){var a,s,v,y=n._width,C=n._vertexFormat,w=n._colors,S=n._colorsPerVertex,P=n._followSurface,A=n._granularity,M=n._ellipsoid,I=p.chordLength(A,M.maximumRadius),D=m.removeDuplicates(n._positions);o(D)||(D=n._positions);var O=D.length;if(2>O)return void 0;if(P){var R=m.extractHeights(D,M);if(o(w)){var L=1;for(a=0;O-1>a;++a)L+=m.numberOfPoints(D[a],D[a+1],I);var N=new Array(L),F=0;for(a=0;O-1>a;++a){var B=D[a],z=D[a+1],V=w[a],k=m.numberOfPoints(B,z,I);if(S&&L>a){var U=w[a+1],W=g(B,z,V,U,k),G=W.length;for(s=0;G>s;++s)N[F++]=W[s]}else for(s=0;k>s;++s)N[F++]=r.clone(V)}N[F]=r.clone(w[w.length-1]),w=N,_.length=0}D=m.generateCartesianArc({positions:D,minDistance:I,ellipsoid:M,height:R})}O=D.length;var H,q=4*O-4,j=new Float64Array(3*q),Y=new Float64Array(3*q),X=new Float64Array(3*q),Z=new Float32Array(2*q),J=C.st?new Float32Array(2*q):void 0,Q=o(w)?new Uint8Array(4*q):void 0,K=0,$=0,et=0,tt=0;for(s=0;O>s;++s){0===s?(H=E,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],b),s===O-1?(H=E,t.subtract(D[O-1],D[O-2],H),t.add(D[O-1],H,H)):H=D[s+1],t.clone(H,T);var rt,it;o(Q)&&(rt=0===s||S?w[s]:w[s-1],s!==O-1&&(it=w[s]));var nt=0===s?2:0,ot=s===O-1?2:4;for(v=nt;ot>v;++v){t.pack(b,j,K),t.pack(x,Y,K),t.pack(T,X,K),K+=3;var at=0>v-2?-1:1;if(Z[$++]=2*(v%2)-1,Z[$++]=at*y,C.st&&(J[et++]=s/(O-1),J[et++]=Math.max(Z[$-2],0)),o(Q)){var st=2>v?rt:it;Q[tt++]=r.floatToByte(st.red),Q[tt++]=r.floatToByte(st.green),Q[tt++]=r.floatToByte(st.blue),Q[tt++]=r.floatToByte(st.alpha)}}}var lt=new c;lt.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:j}),lt.prevPosition=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:Y}),lt.nextPosition=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:X}),lt.expandAndWidth=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(lt.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:J})),o(Q)&&(lt.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:Q,normalize:!0}));var ut=d.createTypedArray(q,6*O-6),ct=0,ht=0,dt=O-1;for(s=0;dt>s;++s)ut[ht++]=ct,ut[ht++]=ct+2,ut[ht++]=ct+1,ut[ht++]=ct+1,ut[ht++]=ct+2,ut[ht++]=ct+3,ct+=4;return new l({attributes:lt,indices:ut,primitiveType:f.TRIANGLES,boundingSphere:e.fromPoints(D),geometryType:h.POLYLINES})},y}),r("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./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,p,m,f,v,g,_,y,C){"use strict";function w(e,r,i,o){var a=new d;o.position&&(a.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,f,g,y,C=r.length,w=e.length/3,S=(w-2*C)/(2*C),E=v.triangulate(r),b=6*(S-1)*C+2*E.length,x=m.createTypedArray(w,b),T=2*C,P=0;for(s=0;S-1>s;s++){for(l=0;C-1>l;l++)u=2*l+2*s*C,y=u+T,f=u+1,g=f+T,x[P++]=f,x[P++]=u,x[P++]=g,x[P++]=g,x[P++]=u,x[P++]=y;u=2*C-2+2*s*C,f=u+1,g=f+T,y=u+T,x[P++]=f,x[P++]=u,x[P++]=g,x[P++]=g,x[P++]=u,x[P++]=y}if(o.st||o.tangent||o.binormal){var A,M,I=new Float32Array(2*w),D=1/(S-1),O=1/i.height,R=i.height/2,L=0;for(s=0;S>s;s++){for(A=s*D,M=O*(r[0].y+R),I[L++]=A,I[L++]=M,l=1;C>l;l++)M=O*(r[l].y+R),I[L++]=A,I[L++]=M,I[L++]=A,I[L++]=M;M=O*(r[0].y+R),I[L++]=A,I[L++]=M}for(l=0;C>l;l++)A=0,M=O*(r[l].y+R),I[L++]=A,I[L++]=M;for(l=0;C>l;l++)A=(S-1)*D,M=O*(r[l].y+R),I[L++]=A,I[L++]=M;a.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:new Float32Array(I)})}var N=w-2*C;for(s=0;s<E.length;s+=3){var F=E[s]+N,B=E[s+1]+N,z=E[s+2]+N;x[P++]=F,x[P++]=B,x[P++]=z,x[P++]=z+C,x[P++]=B+C,x[P++]=F+C}var V=new c({attributes:a,indices:x,boundingSphere:t.fromVertices(e),primitiveType:_.TRIANGLES});return o.normal&&(V=p.computeNormal(V)),(o.tangent||o.binormal)&&(V=p.computeBinormalAndTangent(V),o.tangent||(V.attributes.tangent=void 0),o.binormal||(V.attributes.binormal=void 0),o.st||(V.attributes.st=void 0)),V}var S=function(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._vertexFormat=y.clone(a(e.vertexFormat,y.DEFAULT)),this._granularity=a(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var s=1+t.length*i.packedLength;s+=1+n.length*r.packedLength,this.packedLength=s+u.packedLength+y.packedLength+2};S.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+=i.packedLength)i.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=r.packedLength)r.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,y.pack(e._vertexFormat,t,n),n+=y.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var E=u.clone(u.UNIT_SPHERE),b=new y,x={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:b,cornerType:void 0,granularity:void 0};S.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+=i.packedLength)c[o]=i.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)h[o]=r.unpack(e,t);var d=u.unpack(e,t,E);t+=u.packedLength;var p=y.unpack(e,t,b);t+=y.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=y.clone(p,n._vertexFormat),n._cornerType=m,n._granularity=f,n):(x.polylinePositions=c,x.shapePositions=h,x.cornerType=m,x.granularity=f,new S(x))};var T=new e;return S.createGeometry=function(t){var r=t._positions,i=g.removeDuplicatesFromPositions(r,t._ellipsoid),n=t._shape;if(n=g.removeDuplicatesFromShape(n),i.length<2||n.length<3)return void 0;v.computeWindingOrder2D(n)===C.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,T),a=g.computePositions(i,n,o,t,!0);return w(a,n,o,t._vertexFormat)},S}),r("Core/PolylineVolumeOutlineGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_){"use strict";function y(e,r){var i=new d;i.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e});var o,a,s=r.length,l=i.position.values.length/3,u=e.length/3,m=u/s,f=p.createTypedArray(l,2*s*(m+1)),v=0;o=0;var _=o*s;for(a=0;s-1>a;a++)f[v++]=a+_,f[v++]=a+_+1;for(f[v++]=s-1+_,f[v++]=_,o=m-1,_=o*s,a=0;s-1>a;a++)f[v++]=a+_,f[v++]=a+_+1;for(f[v++]=s-1+_,f[v++]=_,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 w=new c({attributes:i,indices:p.createTypedArray(l,f),boundingSphere:t.fromVertices(e),primitiveType:g.LINES});return w}var C=function(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*i.packedLength;s+=1+n.length*r.packedLength,this.packedLength=s+u.packedLength+2};C.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+=i.packedLength)i.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=r.packedLength)r.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var w=u.clone(u.UNIT_SPHERE),S={polylinePositions:void 0,shapePositions:void 0,ellipsoid:w,height:void 0,cornerType:void 0,granularity:void 0};C.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+=i.packedLength)c[o]=i.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)h[o]=r.unpack(e,t);var d=u.unpack(e,t,w);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):(S.polylinePositions=c,S.shapePositions=h,S.cornerType=p,S.granularity=m,new C(S))};var E=new e;return C.createGeometry=function(t){var r=t._positions,i=v.removeDuplicatesFromPositions(r,t._ellipsoid),n=t._shape;if(n=v.removeDuplicatesFromShape(n),i.length<2||n.length<3)return void 0;f.computeWindingOrder2D(n)===_.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,E),a=v.computePositions(i,n,o,t,!1);return y(a,n)},C}),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],p=i[l+1];return n.fastSquad(c,h,d,p,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,p=h.latitude-e.granYCos*t+i*e.granXSin,m=l(p),f=u(p),v=s.z*f,g=h.longitude+t*e.granYSin+i*e.granXCos,_=m*l(g),y=m*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=(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,w=t._surfaceHeight,S=t._rotation,E=t._extrudedHeight,b=n.east,x=n.west,T=n.north,P=n.south,A=T-P;x>b?(_=o.TWO_PI-x+b,u=Math.ceil(_/y)+1,c=Math.ceil(A/y)+1,h=_/(u-1),g=A/(c-1)):(_=b-x,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,m),I=g,D=h,O=0,R=0;if(r(S)){var L=Math.cos(S);I*=L,D*=L;var N=Math.sin(S);O=g*N,R=h*N,p=v.project(l,p),f=v.project(M,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,z=B+(u-1)*R,V=B-I*(c-1),k=B-I*(c-1)+(u-1)*R;T=Math.max(B,z,V,k),P=Math.min(B,z,V,k);var U=l.longitude,W=U+(u-1)*D,G=U+(c-1)*O,H=U+(c-1)*O+(u-1)*D;if(b=Math.max(U,W,G,H),x=Math.min(U,W,G,H),T<-o.PI_OVER_TWO||T>o.PI_OVER_TWO||P<-o.PI_OVER_TWO||P>o.PI_OVER_TWO)throw new i("Rotated extent is invalid.");n.north=T,n.south=P,n.east=b,n.west=x}return{granYCos:I,granYSin:O,granXCos:D,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,p,m,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 x(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,p=0;o>p;p+=3){var m=r.fromArray(e,p,D),f=u+1,v=u+2;(t.normal||t.tangent||t.binormal)&&(d=i.geodeticSurfaceNormal(m,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 T(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,p=R,m=O,v=0;n>v;v+=6){var g=r.fromArray(e,v,D);if(t.normal||t.tangent||t.binormal){var _=r.fromArray(e,(v+6)%n,V);if(h){var y=r.fromArray(e,(v+3)%n,k);r.subtract(_,g,_),r.subtract(y,g,y),m=r.normalize(r.cross(y,_,m),m),h=!1
}r.equalsEpsilon(_,g,f.EPSILON10)&&(h=!0),(t.tangent||t.binormal)&&(d=i.geodeticSurfaceNormal(g,d),t.tangent&&(p=r.normalize(r.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 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=D,p=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,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 w=0;w<l.length;w+=2)l[w]=(l[w]-f)/(g-f),l[w+1]=(l[w+1]-v)/(_-v);for(var E=x(s,t,r,e.tangentRotationMatrix),b=6*(a-1)*(o-1),T=m.createTypedArray(i,b),P=0,A=0,M=0;o-1>M;++M){for(var I=0;a-1>I;++I){var O=P,R=O+a,L=R+1,N=O+1;T[A++]=O,T[A++]=R,T[A++]=N,T[A++]=N,T[A++]=R,T[A++]=L,++P}++P}return E.indices=T,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 I(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,x=i.normal?new Float32Array(w):void 0,I=i.tangent?new Float32Array(w):void 0,D=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(x.set(R),t=0;C>t;t++)R[t]=-R[t];x.set(R,C),g.attributes.normal.values=x}if(i.tangent){var L=g.attributes.tangent.values;for(I.set(L),t=0;C>t;t++)L[t]=-L[t];I.set(L,C),g.attributes.tangent.values=I}if(i.binormal){var N=g.attributes.binormal.values;D.set(N),D.set(N,C),g.attributes.binormal.values=D}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=m.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=T(H,i,v);i.st&&(Z.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var J,Q,K,$,et=m.createTypedArray(G,6*W);C=H.length/3;var tt=0;for(t=0;C-1>t;t+=2){J=t,$=(J+2)%C;var rt=r.fromArray(H,3*J,V),it=r.fromArray(H,3*$,k);r.equalsEpsilon(rt,it,f.EPSILON10)||(Q=(J+1)%C,K=(Q+2)%C,et[tt++]=J,et[tt++]=Q,et[tt++]=$,et[tt++]=$,et[tt++]=Q,et[tt++]=K)}return Z.indices=et,Z=p.combineInstances([new d({geometry:g}),new d({geometry:Z})]),Z[0]}var D=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),s=o(e.rotation,0),u=o(e.stRotation,0),c=o(e.vertexFormat,E.DEFAULT),h=e.extrudedHeight,d=a(h)&&Math.abs(n-h)>1,p=o(e.closeTop,!0),m=o(e.closeBottom,!0);this._rectangle=t,this._granularity=r,this._ellipsoid=l.clone(i),this._surfaceHeight=n,this._rotation=s,this._stRotation=u,this._vertexFormat=E.clone(c),this._extrudedHeight=o(h,0),this._extrude=d,this._closeTop=p,this._closeBottom=m,this._workerName="createRectangleGeometry"};U.packedLength=w.packedLength+l.packedLength+E.packedLength+8,U.pack=function(e,t,r){r=o(r,0),w.pack(e._rectangle,t,r),r+=w.packedLength,l.pack(e._ellipsoid,t,r),r+=l.packedLength,E.pack(e._vertexFormat,t,r),r+=E.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r++]=e._closeTop?1:0,t[r]=e._closeBottom?1:0};var W=new w,G=l.clone(l.UNIT_SPHERE),H=new E,q={rectangle:W,ellipsoid:G,vertexFormat:H,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};U.unpack=function(e,t,r){t=o(t,0);var i=w.unpack(e,t,W);t+=w.packedLength;var n=l.unpack(e,t,G);t+=l.packedLength;var s=E.unpack(e,t,H);t+=E.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(r)?(r._rectangle=w.clone(i,r._rectangle),r._ellipsoid=l.clone(n,r._ellipsoid),r._vertexFormat=E.clone(s,r._vertexFormat),r._granularity=u,r._surfaceHeight=c,r._rotation=h,r._stRotation=d,r._extrudedHeight=m?p:void 0,r._extrude=m,r._closeTop=f,r._closeBottom=v,r):(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 U(q))};var j=new v,Y=new g,X=new i,Z=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._extrude,l=t._extrudedHeight,c=t._stRotation,d=t._vertexFormat,p=S.computeOptions(t,i,X),m=j,f=Y;if(a(c)){v.fromRotation(-c,m);var y=w.center(i,J),E=n.cartographicToCartesian(y,V);r.normalize(E,E),C.fromAxisAngle(E,-c,Z),g.fromQuaternion(Z,f)}else v.clone(v.IDENTITY,m),g.clone(g.IDENTITY,f);p.lonScalar=1/i.width,p.latScalar=1/i.height,p.vertexFormat=d,p.textureMatrix=m,p.tangentRotationMatrix=f,p.size=p.width*p.height;var b,x;if(i=t._rectangle,s){b=I(p);var T=e.fromRectangle3D(i,n,o,z),A=e.fromRectangle3D(i,n,l,B);x=e.union(T,A)}else b=P(p),b=_.scaleToGeodeticHeight(b,o,n,!1),x=e.fromRectangle3D(i,n,o);return d.position||delete b.attributes.position,new u({attributes:new h(b.attributes),indices:b.indices,primitiveType:b.primitiveType,boundingSphere:x})},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,p,m,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,p=w;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=2*(a.length/3),g=h.createTypedArray(a.length/3,f),_=0,y=0;y<a.length/3-1;y++)g[_++]=y,g[_++]=y+1;g[_++]=a.length/3-1,g[_++]=0;var C=new l({attributes:new c,primitiveType:m.LINES});return C.attributes.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a}),C.indices=g,C}function _(e){var t=e.surfaceHeight,r=e.extrudedHeight,i=e.ellipsoid,n=Math.min(r,t),o=Math.max(r,t),a=g(e);if(d.equalsEpsilon(n,o,.1))return a;var s=e.height,l=e.width;a=p.scaleToGeodeticHeight(a,o,i,!1);var u=a.attributes.position.values,c=u.length,m=new Float64Array(2*c);m.set(u),a=p.scaleToGeodeticHeight(a,n,i);var f=a.attributes.position.values;m.set(f,c),a.attributes.position.values=m;var v=2*(m.length/3)+8,_=h.createTypedArray(m.length/3,v);c=m.length/6;for(var y=0,C=0;c-1>C;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=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=r,this._ellipsoid=i,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"};E.packedLength=f.packedLength+s.packedLength+5,E.pack=function(e,t,r){r=n(r,0),f.pack(e._rectangle,t,r),r+=f.packedLength,s.pack(e._ellipsoid,t,r),r+=s.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=o(e._extrudedHeight)?1:0,t[r]=n(e._extrudedHeight,0)};var b=new f,x=s.clone(s.UNIT_SPHERE),T={rectangle:b,ellipsoid:x,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};E.unpack=function(e,t,r){t=n(t,0);var i=f.unpack(e,t,b);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(r)?(r._rectangle=f.clone(i,r._rectangle),r._ellipsoid=s.clone(a,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=h?d:void 0,r):(T.granularity=l,T.height=u,T.rotation=c,T.extrudedHeight=h?d:void 0,new E(T))};var P=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,P);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=p.scaleToGeodeticHeight(u,n,i,!1),c=e.fromRectangle3D(r,i,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:m.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",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,r){var i=e._element;if(i===document)return r.x=t.clientX,r.y=t.clientY,r;var n=i.getBoundingClientRect();return r.x=t.clientX-n.left,r.y=t.clientY-n.top,r}function c(e,t){var r=e;return i(t)&&(r+="+"+t),r}function h(e){return e.shiftKey?s.SHIFT:e.ctrlKey?s.CTRL:e.altKey?s.ALT:void 0}function d(e,t,r,i){var n=function(t){i(e,t)};r.addEventListener(t,n,!1),e._removalFunctions.push(function(){r.removeEventListener(t,n,!1)})}function p(e){var t=e._element,r=i(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(d(e,"pointerdown",t,x),d(e,"pointerup",t,T),d(e,"pointermove",t,P)):(d(e,"mousedown",t,f),d(e,"mouseup",r,v),d(e,"mousemove",r,g),d(e,"touchstart",t,C),d(e,"touchend",r,w),d(e,"touchmove",r,E)),d(e,"dblclick",t,_);var n;n="onwheel"in t?"wheel":i(document.onmousewheel)?"mousewheel":"DOMMouseScroll",d(e,n,t,y)}function m(e){for(var t=e._removalFunctions,r=0;r<t.length;++r)t[r]()}function f(e,r){if(!e._seenAnyTouchEvents){var n=r.button;e._buttonDown=n;var o;if(n===A.LEFT)o=l.LEFT_DOWN;else if(n===A.MIDDLE)o=l.MIDDLE_DOWN;else{if(n!==A.RIGHT)return;o=l.RIGHT_DOWN}var a=u(e,r,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(r),c=e.getInputAction(o,s);i(c)&&(t.clone(a,M.position),c(M),r.preventDefault())}}function v(e,r){if(!e._seenAnyTouchEvents){var n=r.button;e._buttonDown=void 0;var o,a;if(n===A.LEFT)o=l.LEFT_UP,a=l.LEFT_CLICK;else if(n===A.MIDDLE)o=l.MIDDLE_UP,a=l.MIDDLE_CLICK;else{if(n!==A.RIGHT)return;o=l.RIGHT_UP,a=l.RIGHT_CLICK}var s=h(r),c=e.getInputAction(o,s),d=e.getInputAction(a,s);if(i(c)||i(d)){var p=u(e,r,e._primaryPosition);if(i(c)&&(t.clone(p,I.position),c(I)),i(d)){var m=e._primaryStartPosition,f=m.x-p.x,v=m.y-p.y,g=Math.sqrt(f*f+v*v);g<e._clickPixelTolerance&&(t.clone(p,D.position),d(D))}}}}function g(e,r){if(!e._seenAnyTouchEvents){var n=h(r),o=u(e,r,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(l.MOUSE_MOVE,n);i(s)&&(t.clone(a,O.startPosition),t.clone(o,O.endPosition),s(O)),t.clone(o,a),i(e._buttonDown)&&r.preventDefault()}}function _(e,t){var r,n=t.button;if(n===A.LEFT)r=l.LEFT_DOUBLE_CLICK;else if(n===A.MIDDLE)r=l.MIDDLE_DOUBLE_CLICK;else{if(n!==A.RIGHT)return;r=l.RIGHT_DOUBLE_CLICK}var o=h(t),a=e.getInputAction(r,o);i(a)&&(u(e,t,R.position),a(R))}function y(e,t){var r;if(i(t.deltaY)){var n=t.deltaMode;r=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else r=t.detail>0?-120*t.detail:t.wheelDelta;if(i(r)){var o=h(t),a=e.getInputAction(l.WHEEL,o);i(a)&&(a(r),t.preventDefault())}}function C(e,r){e._seenAnyTouchEvents=!0;var i,n,o,a=r.changedTouches,s=a.length,l=e._positions;for(i=0;s>i;++i)n=a[i],o=n.identifier,l.set(o,u(e,n,new t));S(e,r);var c=e._previousPositions;for(i=0;s>i;++i)n=a[i],o=n.identifier,c.set(o,t.clone(l.get(o)))}function w(e,t){e._seenAnyTouchEvents=!0;var r,i,n,o=t.changedTouches,a=o.length,s=e._positions;for(r=0;a>r;++r)i=o[r],n=i.identifier,s.remove(n);S(e,t);var l=e._previousPositions;for(r=0;a>r;++r)i=o[r],n=i.identifier,l.remove(n)}function S(e,r){var n,o,a=h(r),s=e._positions,u=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===A.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(l.LEFT_UP,a),i(n)&&(t.clone(e._primaryPosition,F.position),n(F)),0===c&&(o=e.getInputAction(l.LEFT_CLICK,a),i(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);v<e._clickPixelTolerance&&(t.clone(e._primaryPosition,B.position),o(B))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(l.PINCH_END,a),i(n)&&n()),1===c){var g=s.values[0];t.clone(g,e._primaryPosition),t.clone(g,e._primaryStartPosition),t.clone(g,e._primaryPreviousPosition),e._buttonDown=A.LEFT,n=e.getInputAction(l.LEFT_DOWN,a),i(n)&&(t.clone(g,L.position),n(L)),r.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(l.PINCH_START,a),i(n)&&(t.clone(s.values[0],N.position1),t.clone(s.values[1],N.position2),n(N)))}function E(e,r){e._seenAnyTouchEvents=!0;var n,o,a,s=r.changedTouches,l=s.length,c=e._positions;for(n=0;l>n;++n){o=s[n],a=o.identifier;var h=c.get(a);i(h)&&u(e,o,h)}b(e,r);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 b(e,r){var n,o=h(r),a=e._positions,s=e._previousPositions,u=a.length;if(1===u&&e._buttonDown===A.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(l.MOUSE_MOVE,o),i(n)&&(t.clone(d,z.startPosition),t.clone(c,z.endPosition),n(z)),t.clone(c,d),r.preventDefault()}else if(2===u&&e._isPinching&&(n=e.getInputAction(l.PINCH_MOVE,o),i(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,w=v.y-f.y,S=.25*Math.sqrt(C*C+w*w),E=.125*(m.y+p.y),b=.125*(v.y+f.y),x=Math.atan2(_,g),T=Math.atan2(w,C);t.fromElements(0,S,V.distance.startPosition),t.fromElements(0,y,V.distance.endPosition),t.fromElements(T,b,V.angleAndHeight.startPosition),t.fromElements(x,E,V.angleAndHeight.endPosition),n(V)}}function x(e,r){if(r.target.setPointerCapture(r.pointerId),"touch"===r.pointerType){var i=e._positions,n=r.pointerId;i.set(n,u(e,r,new t)),S(e,r);var o=e._previousPositions;o.set(n,t.clone(i.get(n)))}else f(e,r)}function T(e,t){if("touch"===t.pointerType){var r=e._positions,i=t.pointerId;r.remove(i),S(e,t);var n=e._previousPositions;n.remove(i)}else v(e,t)}function P(e,r){if("touch"===r.pointerType){var i=e._positions,n=r.pointerId;u(e,r,i.get(n)),b(e,r);var o=e._previousPositions;t.clone(i.get(n),o.get(n))}else g(e,r)}var A={LEFT:0,MIDDLE:1,RIGHT:2},M={position:new t},I={position:new t},D={position:new t},O={startPosition:new t,endPosition:new t},R={position:new t},L={position:new t},N={position1:new t,position2:new t},F={position:new t},B={position:new t},z={startPosition:new t,endPosition:new t},V={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}},k=function(i){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=r(i,document),p(this)};return k.prototype.setInputAction=function(e,t,r){var i=c(t,r);this._inputEvents[i]=e},k.prototype.getInputAction=function(e,t){var r=c(e,t);return this._inputEvents[r]},k.prototype.removeInputAction=function(e,t){var r=c(e,t);delete this._inputEvents[r]},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){return m(this),n(this)},k}),r("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i){"use strict";var n=function(e){e=t(e,!0),this.value=n.toValue(e)};return i(n.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!0}}}),n.toValue=function(e,t){return r(t)?(t[0]=e,t):new Uint8Array([e])},n}),r("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,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=i.addSeconds(e,C,t);var r=i.totalDays(t)-w;return t=i.addSeconds(t,l(r),t)}function c(i,a,s,l,u,c,p,m){if(0>s&&(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 x=w/b;return t(m)?(m.x=x*S,m.y=x*E,m.z=0):m=new e(x*S,x*E,0),o.multiplyByVector(M,m,m)}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=p(e,t);return m(i,t)}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,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;I>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>=I)throw new r("Kepler equation did not converge");return s=a+i*n.TWO_PI}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=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),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,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)+Q*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)+J*Math.cos(W*n)+nt*Math.sin(W*n),s=R+L*i+pt*Math.cos(ot*n)+wt*Math.sin(ot*n)+mt*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)+xt*Math.sin(ut*n)+_t*Math.cos(ct*n)+Tt*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*T+11612.3529*P*i,d=469.97289*P*i,p=174.87317577*T-8679.27034*P*i;return c(o,l,d,h,p,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*T,p=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,m=83.35324312*T,f=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*T,g=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*T,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,C=297.85019547*T+P*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*T+P*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),b=134.96340251*T+P*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*T+P*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),M=310.17137918*T-P*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),I=2*C,D=4*C,O=6*C,R=2*b,L=3*b,N=4*b,F=2*w;l+=3400.4*Math.cos(I)-635.6*Math.cos(I-b)-235.6*Math.cos(b)+218.1*Math.cos(I-A)+181*Math.cos(I+b),h+=.014216*Math.cos(I-b)+.008551*Math.cos(I-R)-.001383*Math.cos(b)+.001356*Math.cos(I+b)-.001147*Math.cos(D-L)-914e-6*Math.cos(D-R)+869e-6*Math.cos(I-A-b)-627e-6*Math.cos(I)-394e-6*Math.cos(D-N)+282e-6*Math.cos(I-A-R)-279e-6*Math.cos(C-b)-236e-6*Math.cos(R)+231e-6*Math.cos(D)+229e-6*Math.cos(O-N)-201e-6*Math.cos(R-F),p+=486.26*Math.cos(I-F)-40.13*Math.cos(I)+37.51*Math.cos(F)+25.73*Math.cos(R-F)+19.97*Math.cos(I-A-F),f+=-55609*Math.sin(I-b)-34711*Math.sin(I-R)-9792*Math.sin(b)+9385*Math.sin(D-L)+7505*Math.sin(D-R)+5318*Math.sin(I+b)+3484*Math.sin(D-N)-3417*Math.sin(I-A-b)-2530*Math.sin(O-N)-2376*Math.sin(I)-2075*Math.sin(I-L)-1883*Math.sin(R)-1736*Math.sin(O-5*b)+1626*Math.sin(A)-1370*Math.sin(O-L),g+=-5392*Math.sin(I-F)-540*Math.sin(A)-441*Math.sin(I)+423*Math.sin(F)-288*Math.sin(R-F),y+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-b)-662.5*Math.sin(A)+396.3*Math.sin(b)-218*Math.sin(I-A);var B=2*M,z=3*M;p+=46.997*Math.cos(M)*i-.614*Math.cos(I-F+M)*i+.614*Math.cos(I-F-M)*i-.0297*Math.cos(B)*n-.0335*Math.cos(M)*n+.0012*Math.cos(I-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(I-F-M)*i-.0015*Math.sin(M)*n;f+=V,y+=V,g+=-520.77*Math.sin(M)*i+13.66*Math.sin(I-F+M)*i+1.12*Math.sin(I-M)*i-1.06*Math.sin(F-M)*i+.66*Math.sin(B)*n+.371*Math.sin(M)*n-.035*Math.sin(I-F+B)*n-.015*Math.sin(I-F+M)*n+.0014*Math.sin(M)*o-.0011*Math.sin(z)*o-9e-4*Math.sin(B)*o,l*=x;var k=d+p*P,U=m+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,Dt,r)}var y={},C=32.184,w=2451545,S=new i(2451545,0,s.TAI),E=398600435e6,b=328900.56*1.012300034*E,x=1e3,T=n.RADIANS_PER_DEGREE,P=n.RADIANS_PER_ARCSECOND,A=14959787e4,M=new o,I=50,D=n.EPSILON8,O=1.0000010178*A,R=100.46645683*T,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,J=-11*1e-7*A,Q=-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,pt=-325*1e-7,mt=-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,xt=-116*1e-7,Tt=-88*1e-7,Pt=-112*1e-7,At=-80*1e-7,Mt=new i(0,0,s.TAI),It=.012300034,Dt=-1*(It/(It+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,p,m){"use strict";function f(e,t,i,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=i.red,h=i.green,d=i.blue,m=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(m);return s}var y=(f-c)/u,C=(v-h)/u,w=(g-d)/u,S=(_-m)/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(m+l*S);return E}var v=function(e){e=n(e,n.EMPTY_OBJECT);var i=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=i,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+i.length*t.packedLength;u+=o(a)?1+a.length*r.packedLength:1,this.packedLength=u+s.packedLength+3};v.pack=function(e,i,a){a=n(a,0);var l,u=e._positions,c=u.length;for(i[a++]=c,l=0;c>l;++l,a+=t.packedLength)t.pack(u[l],i,a);var h=e._colors;for(c=o(h)?h.length:0,i[a++]=c,l=0;c>l;++l,a+=r.packedLength)r.pack(h[l],i,a);s.pack(e._ellipsoid,i,a),a+=s.packedLength,i[a++]=e._colorsPerVertex?1:0,i[a++]=e._followSurface?1:0,i[a]=e._granularity},v.unpack=function(e,i,a){i=n(i,0);var l,u=e[i++],c=new Array(u);for(l=0;u>l;++l,i+=t.packedLength)c[l]=t.unpack(e,i);u=e[i++];var h=u>0?new Array(u):void 0;for(l=0;u>l;++l,i+=r.packedLength)h[l]=r.unpack(e,i);var d=s.unpack(e,i);i+=s.packedLength;var p=1===e[i++],m=1===e[i++],f=e[i];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,w,S=n._positions,E=n._colors,b=n._colorsPerVertex,x=n._followSurface,T=n._granularity,P=n._ellipsoid,A=d.chordLength(T,P.maximumRadius),M=o(E)&&!b,I=S.length,D=0;if(x){var O=p.extractHeights(S,P),R=y;if(R.minDistance=A,R.ellipsoid=P,M){var L=0;for(a=0;I-1>a;a++)L+=p.numberOfPoints(S[a],S[a+1],A)+1;s=new Float64Array(3*L),C=new Uint8Array(4*L),R.positions=g,R.height=_;var N=0;for(a=0;I-1>a;++a){g[0]=S[a],g[1]=S[a+1],_[0]=O[a],_[1]=O[a+1];var F=p.generateArc(R);if(o(E)){var B=F.length/3;w=E[a];for(var z=0;B>z;++z)C[N++]=r.floatToByte(w.red),C[N++]=r.floatToByte(w.green),C[N++]=r.floatToByte(w.blue),C[N++]=r.floatToByte(w.alpha)}s.set(F,D),D+=F.length}}else if(R.positions=S,R.height=O,s=new Float64Array(p.generateArc(R)),o(E)){for(C=new Uint8Array(4*(s.length/3)),a=0;I-1>a;++a){var V=S[a],k=S[a+1],U=E[a],W=E[a+1];D=f(V,k,U,W,A,C,D)}var G=E[I-1];C[D++]=r.floatToByte(G.red),C[D++]=r.floatToByte(G.green),C[D++]=r.floatToByte(G.blue),C[D++]=r.floatToByte(G.alpha)}}else{v=M?2*I-2:I,s=new Float64Array(3*v),C=o(E)?new Uint8Array(4*v):void 0;var H=0,q=0;for(a=0;I>a;++a){var j=S[a];if(M&&a>0&&(t.pack(j,s,H),H+=3,w=E[a-1],C[q++]=r.floatToByte(w.red),C[q++]=r.floatToByte(w.green),C[q++]=r.floatToByte(w.blue),C[q++]=r.floatToByte(w.alpha)),M&&a===I-1)break;t.pack(j,s,H),H+=3,o(E)&&(w=E[a],C[q++]=r.floatToByte(w.red),C[q++]=r.floatToByte(w.green),C[q++]=r.floatToByte(w.blue),C[q++]=r.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),v=s.length/3;var X=2*(v-1),Z=h.createTypedArray(v,X),J=0;for(a=0;v-1>a;++a)Z[J++]=a,Z[J++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},v}),r("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,r,i,n,o){"use strict";var a=function(r){var i=t(r.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:r.stackPartitions,slicePartitions:r.slicePartitions,vertexFormat:r.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"};a.packedLength=n.packedLength,a.pack=function(e,t,r){n.pack(e._ellipsoidGeometry,t,r)};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,i,u){var c=n.unpack(t,i,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,r(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}),r("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,r,i,n){"use strict";var o=function(r){var i=t(r.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:r.stackPartitions,slicePartitions:r.slicePartitions,subdivisions:r.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"};o.packedLength=n.packedLength,o.pack=function(e,t,r){n.pack(e._ellipsoidGeometry,t,r)};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,i,l){var u=n.unpack(t,i,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,r(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}),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(e){if(this._intervals=[],this._changedEvent=new o,r(e))for(var t=e.length,i=0;t>i;i++)this.addInterval(e[i])};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-1<r.length&&s.contains(r[i-1],t)?i-1:~i)},u.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var i=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;u>l;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:o<u.length&&!t.isStartIncluded&&u[o].isStartIncluded&&u[o].start.equals(t.start)&&++o,o>0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((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}))));o<u.length&&(n=a.compare(t.stop,u[o].start),n>0||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],p=d.stop;(a.greaterThan(p,o)||s.equals(p,o)&&d.isStopIncluded&&c)&&(r=!0,(a.greaterThan(p,u)||d.isStopIncluded&&!h&&s.equals(p,u))&&i.splice(n,0,new s({start:u,stop:p,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 m=i[n];for(n<i.length&&!c&&m.isStartIncluded&&o.equals(m.start)&&(r=!0,i.splice(n,0,new s({start:m.start,stop:m.start,isStartIncluded:!0,isStopIncluded:!0,data:m.data})),++n,m=i[n]);n<i.length&&a.greaterThan(u,m.stop);)r=!0,i.splice(n,1);return n<i.length&&u.equals(m.stop)&&(r=!0,!h&&m.isStopIncluded?(n+1<i.length&&i[n+1].start.equals(u)&&m.data===i[n+1].data?(i.splice(n,1),m=new s({start:m.start,stop:m.stop,isStartIncluded:!0,isStopIncluded:m.isStopIncluded,data:m.data})):m=new s({start:u,stop:u,isStartIncluded:!0,isStopIncluded:!0,data:m.data}),i[n]=m):i.splice(n,1)),n<i.length&&(a.greaterThan(u,m.start)||u.equals(m.start)&&h&&m.isStartIncluded)&&(r=!0,i[n]=new s({start:u,stop:m.stop,isStartIncluded:!h,isStopIncluded:m.isStopIncluded,data:m.data})),r&&this._changedEvent.raiseEvent(this),r},u.prototype.intersect=function(e,t,i){for(var n=0,o=0,l=new u,c=this._intervals,h=e._intervals;n<c.length&&o<h.length;){var d=c[n],p=h[o];if(a.lessThan(d.stop,p.start))++n;else if(a.lessThan(p.stop,d.start))++o;else{if(r(i)||r(t)&&t(d.data,p.data)||!r(t)&&p.data===d.data){var m=s.intersect(d,p,new s,i);m.isEmpty||l.addInterval(m,t)}a.lessThan(d.stop,p.stop)||d.stop.equals(p.stop)&&!d.isStopIncluded&&p.isStopIncluded?++n:++o}}return l},u}),r("Core/loadXML",["./loadWithXhr"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"document",headers:r,overrideMimeType:"text/xml"})};return t}),r("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,r,i,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(e,t,r,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,r,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var h=c.rectangle,d=m.intersection(h,s,S);i(d)&&(C(o,h,2*t,2*r,n+1)&&(l|=4),C(o,h,2*t+1,2*r,n+1)&&(l|=8),C(o,h,2*t,2*r+1,n+1)&&(l|=1),C(o,h,2*t+1,2*r+1,n+1)&&(l|=2))}}return l}function C(e,t,r,n,o){var a=e.tileXYToRectangle(r,n,o);return i(m.intersection(a,t,S))}var w=function(n){function u(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return c("SRS "+t+" is not supported."),void 0;C._tilingScheme=new l({ellipsoid:w});var r=e.getElementsByTagName("TileFormat")[0];C._heightmapWidth=parseInt(r.getAttribute("width"),10),C._heightmapHeight=parseInt(r.getAttribute("height"),10),C._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(w,Math.min(C._heightmapWidth,C._heightmapHeight),C._tilingScheme.getNumberOfXTilesAtLevel(0));for(var i=e.getElementsByTagName("DataExtent"),n=0;n<i.length;++n){var o=i[n],a=p.toRadians(parseFloat(o.getAttribute("minx"))),s=p.toRadians(parseFloat(o.getAttribute("miny"))),u=p.toRadians(parseFloat(o.getAttribute("maxx"))),h=p.toRadians(parseFloat(o.getAttribute("maxy"))),d=parseInt(o.getAttribute("maxlevel"),10);C._rectangles.push(new _(new m(a,s,u,h),d))}C._ready=!0}function c(e){var t=r(e,"An error occurred while accessing "+C._url+".");y=g.handleError(y,C,C._errorEvent,t,void 0,void 0,void 0,h)}function h(){e(d(C._url),u,c)}if(n=r(n,r.EMPTY_OBJECT),!i(n.url))throw new o("options.url is required.");this._url=n.url,this._url.length>0&&"/"!==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",p=this._proxy;i(p)&&(d=p.getURL(d));var m;if(s=r(s,!0)){if(m=v(d,h),!i(m))return void 0}else m=h(d);var f=this;return e(m,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<<e)};var S=new m;return w.prototype.getTileDataAvailable=function(){return void 0},w}),r("Core/WallGeometryLibrary",["./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){return n.equalsEpsilon(e.latitude,t.latitude,n.EPSILON14)&&n.equalsEpsilon(e.longitude,t.longitude,n.EPSILON14)}function u(r,i,n,o){var a=i.length;if(2>a)return{positions:i};var s=t(o),u=t(n),c=new Array(a),p=new Array(a),m=new Array(a),f=i[0];c[0]=f;var v=r.cartesianToCartographic(f,h);u&&(v.height=n[0]),p[0]=v.height,m[0]=s?o[0]:0;for(var g=1,_=1;a>_;++_){var y=i[_],C=r.cartesianToCartographic(y,d);u&&(C.height=n[_]),l(v,C)?v.height<C.height&&(p[g-1]=C.height):(c[g]=y,p[g]=C.height,m[g]=s?o[_]:0,e.clone(C,v),++g)}return c.length=g,p.length=g,m.length=g,{positions:c,topHeights:p,bottomHeights:m}}var c={},h=new e,d=new e,p=new Array(2),m=new Array(2),f={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,t,r,l,c,h){var d=u(e,t,r,l);if(t=d.positions,r=d.topHeights,l=d.bottomHeights,t.length<2)return void 0;if(t.length>=3){var v=i.fromPoints(t,e),g=v.projectPointsOntoPlane(t);o.computeWindingOrder2D(g)===s.CLOCKWISE&&(t.reverse(),r.reverse(),l.reverse())}var _,y,C=t.length,w=n.chordLength(c,e.maximumRadius),S=f;if(S.minDistance=w,S.ellipsoid=e,h){var E,b=0;for(E=0;C-1>E;E++)b+=a.numberOfPoints(t[E],t[E+1],w)+1;_=new Float64Array(3*b),y=new Float64Array(3*b);var x=p,T=m;S.positions=x,S.height=T;var P=0;for(E=0;C-1>E;E++){x[0]=t[E],x[1]=t[E+1],T[0]=r[E],T[1]=r[E+1];var A=a.generateArc(S);_.set(A,P),T[0]=l[E],T[1]=l[E+1],y.set(a.generateArc(S),P),P+=A.length}}else S.positions=t,S.height=r,_=new Float64Array(a.generateArc(S)),S.height=l,y=new Float64Array(a.generateArc(S));return{bottomPositions:y,topPositions:_}},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,p,m){"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 r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.vertexFormat,p.DEFAULT),u=i(e.granularity,h.RADIANS_PER_DEGREE),c=i(e.ellipsoid,a.WGS84);this._positions=r,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+r.length*t.packedLength+2;n(s)&&(d+=s.length),n(o)&&(d+=o.length),this.packedLength=d+a.packedLength+p.packedLength+1};E.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;u>s;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;u>s;++s)r[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,r[o++]=u,n(h))for(s=0;u>s;++s)r[o++]=h[s];a.pack(e._ellipsoid,r,o),o+=a.packedLength,p.pack(e._vertexFormat,r,o),o+=p.packedLength,r[o]=e._granularity};var b=a.clone(a.UNIT_SPHERE),x=new p,T={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:b,vertexFormat:x,granularity:void 0};return E.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;l>s;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;l>s;++s)c[s]=e[r++];l=e[r++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[r++];var d=a.unpack(e,r,b);r+=a.packedLength;var m=p.unpack(e,r,x);r+=p.packedLength;var f=e[r];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=f,o):(T.positions=u,T.minimumHeights=c,T.maximumHeights=h,T.granularity=f,new E(T))},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 o=i._positions,a=i._minimumHeights,p=i._maximumHeights,E=i._vertexFormat,b=i._granularity,x=i._ellipsoid,T=m.computePositions(x,o,p,a,b,!0);if(!n(T))return void 0;var P=T.bottomPositions,A=T.topPositions,M=A.length,I=2*M,D=E.position?new Float64Array(I):void 0,O=E.normal?new Float32Array(I):void 0,R=E.tangent?new Float32Array(I):void 0,L=E.binormal?new Float32Array(I):void 0,N=E.st?new Float32Array(2*(I/3)):void 0,F=0,B=0,z=0,V=0,k=0,U=S,W=w,G=C,H=!0;M/=3;var q;for(q=0;M>q;++q){var j=3*q,Y=t.fromArray(A,j,f),X=t.fromArray(P,j,v);if(E.position&&(D[F++]=X.x,D[F++]=X.y,D[F++]=X.z,D[F++]=Y.x,D[F++]=Y.y,D[F++]=Y.z),E.normal||E.tangent||E.binormal){var Z,J=t.clone(t.ZERO,y),Q=x.scaleToGeodeticSurface(t.fromArray(A,j,v),v);if(M>q+1&&(Z=x.scaleToGeodeticSurface(t.fromArray(A,j+3,g),g),J=t.fromArray(A,j+3,y)),H){var K=t.subtract(J,Y,_),$=t.subtract(Q,Y,f);U=t.normalize(t.cross($,K,U),U),H=!1}t.equalsEpsilon(Z,Q,h.EPSILON6)?H=!0:(E.tangent&&(W=t.normalize(t.subtract(Z,Q,W),W)),E.binormal&&(G=t.normalize(t.cross(U,W,G),G))),E.normal&&(O[B++]=U.x,O[B++]=U.y,O[B++]=U.z,O[B++]=U.x,O[B++]=U.y,O[B++]=U.z),E.tangent&&(R[V++]=W.x,R[V++]=W.y,R[V++]=W.z,R[V++]=W.x,R[V++]=W.y,R[V++]=W.z),E.binormal&&(L[z++]=G.x,L[z++]=G.y,L[z++]=G.z,L[z++]=G.x,L[z++]=G.y,L[z++]=G.z)}if(E.st){var et=q/(M-1);N[k++]=et,N[k++]=0,N[k++]=et,N[k++]=1}}var tt=new u;E.position&&(tt.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:D})),E.normal&&(tt.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:O})),E.tangent&&(tt.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),E.binormal&&(tt.binormal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),E.st&&(tt.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:N}));var rt=I/3;I-=6;var it=c.createTypedArray(rt,I),nt=0;for(q=0;rt-2>q;q+=2){var ot=q,at=q+2,st=t.fromArray(D,3*ot,f),lt=t.fromArray(D,3*at,v);if(!t.equalsEpsilon(st,lt,h.EPSILON6)){var ut=q+1,ct=q+3;it[nt++]=ut,it[nt++]=ot,it[nt++]=ct,it[nt++]=ct,it[nt++]=ot,it[nt++]=at}}return new s({attributes:tt,indices:it,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,p){"use strict";var m=new t,f=new t,v=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.granularity,h.RADIANS_PER_DEGREE),u=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+r.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1};v.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;u>s;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;u>s;++s)r[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,r[o++]=u,n(h))for(s=0;u>s;++s)r[o++]=h[s];a.pack(e._ellipsoid,r,o),o+=a.packedLength,r[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 v.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;l>s;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;l>s;++s)c[s]=e[r++];l=e[r++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[r++];var d=a.unpack(e,r,g);r+=a.packedLength;var p=e[r];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 v(_))},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 o=i._positions,a=i._minimumHeights,v=i._maximumHeights,g=i._granularity,_=i._ellipsoid,y=p.computePositions(_,o,v,a,g,!1);if(!n(y))return void 0;var C=y.bottomPositions,w=y.topPositions,S=w.length,E=2*S,b=new Float64Array(E),x=0;S/=3;var T;for(T=0;S>T;++T){var P=3*T,A=t.fromArray(w,P,m),M=t.fromArray(C,P,f);b[x++]=M.x,b[x++]=M.y,b[x++]=M.z,b[x++]=A.x,b[x++]=A.y,b[x++]=A.z}var I=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:b})}),D=E/3;E=2*D-4+D;var O=c.createTypedArray(D,E),R=0;for(T=0;D-2>T;T+=2){var L=T,N=T+2,F=t.fromArray(b,3*L,m),B=t.fromArray(b,3*N,f);if(!t.equalsEpsilon(F,B,h.EPSILON6)){var z=T+1,V=T+3;O[R++]=z,O[R++]=L,O[R++]=z,O[R++]=V,O[R++]=L,O[R++]=N}}return O[R++]=D-2,O[R++]=D-1,new s({attributes:I,indices:O,primitiveType:d.LINES,boundingSphere:new e.fromVertices(b)})},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<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var i=this._projection,n=i.project(o.southwest(e)),a=i.project(o.northeast(e));return r(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,i,n){var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,h=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-t*h,p=this._rectangleNortheastInMeters.y-(t+1)*h;return r(n)?(n.west=u,n.south=p,n.east=c,n.north=d,n):new o(u,p,c,d)},s.prototype.tileXYToRectangle=function(t,r,i,n){var o=this.tileXYToNativeRectangle(t,r,i,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,i,n){var a=this._rectangle;if(!o.contains(a,t))return void 0;var s=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,h=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,d=h/l,p=this._projection,m=p.project(t),f=m.x-this._rectangleSouthwestInMeters.x,v=this._rectangleNortheastInMeters.y-m.y,g=0|f/c;g>=s&&(g=s-1);var _=0|v/d;return _>=l&&(_=l-1),r(n)?(n.x=g,n.y=_,n):new e(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/definedNotNull",[],function(){"use strict";var e=function(e){return void 0!==e&&null!==e};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),p=s(i(d.query,""));n(u.parameters)&&(p=r(u.parameters,p));var m=i(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,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"],function(e){"use strict";var t=function(t,r){return e({url:t,responseType:"blob",headers:r})};return t}),r("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,r){"use strict";var i=/^data:/,n=function(n){return i.test(n)?r(n):t(n).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,p=i;for(l=0;c>l;++l)d[l]=e[o+l];for(u=0;h>u;++u)p[u]=e[a+u+1];l=0,u=0;for(var m=o;s>=m;++m){var f=d[l],v=p[u];c>l&&(u>=h||t(f,v,n)<=0)?(e[m]=f,++l):h>u&&(e[m]=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","./getTimestamp"],function(e,t){"use strict";var r=window.requestAnimationFrame;!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 r=t(),i=Math.max(a-(r-s),0);return s=r+i,setTimeout(function(){e(s)},i)}}}();var i=function(e){return r(e)};return i}),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;a<o.length;++a){var c=s.positionToTileXY(o[a],n),h=c.toString();if(!u.hasOwnProperty(h)){var d={x:c.x,y:c.y,level:n,tilingScheme:s,terrainProvider:t,positions:[]};u[h]=d,l.push(d)}u[h].positions.push(o[a])}var p=[];for(a=0;a<l.length;++a){var m=l[a],f=m.terrainProvider.requestTileGeometry(m.x,m.y,m.level,!1),v=e(f,r(m),i(m));p.push(v)}return e.all(p,function(){return o})}function r(e){var t=e.positions,r=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var i=0;i<t.length;++i){var n=t[i];n.height=e.interpolateHeight(r,n.longitude,n.latitude)}}}function i(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){var r=t[e];r.height=void 0}}}var n=function(r,i,n){function o(){r.ready?e(t(r,i,n),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise};return n}),r("Core/subdivideArray",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t){for(var r=[],i=e.length,n=0;i>n;){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/ConstantProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,r,i,n){"use strict";var o=function(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new n,this.setValue(e)};return r(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 r=this._value;if(r!==e){var i=t(e),n=i&&"function"==typeof e.clone,o=i&&"function"==typeof e.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!e.equals(r);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}),r("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,r){"use strict";function i(e,r,i,n,o){return{configurable:n,get:function(){return this[r]},set:function(n){var a=this[r],s=this[i];t(s)&&(s(),this[i]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new r(e)}function o(t,r,o){return i(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(r,!1),e(o,n))}return o}),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(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._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))
};return r(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")}),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):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)},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;\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"}),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"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"}),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{\nfloat sinLatitude = sin(latitude);\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);\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"}),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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,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:p,czm_piOverSix:m,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:x,czm_depthRangeStruct:T,czm_ellipsoid:P,czm_material:A,czm_materialInput:M,czm_ray:I,czm_raySegment:D,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:J,czm_getWaterNoise:Q,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:pt,czm_translucentPhong:mt,czm_transpose:ft,czm_windowToEyeCoordinates:vt}}),r("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4"],function(e,t){"use strict";var r=new e,i=function(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue};if("undefined"==typeof WebGLRenderingContext)return{};var n={};n[WebGLRenderingContext.FLOAT]="float",n[WebGLRenderingContext.FLOAT_VEC2]="vec2",n[WebGLRenderingContext.FLOAT_VEC3]="vec3",n[WebGLRenderingContext.FLOAT_VEC4]="vec4",n[WebGLRenderingContext.INT]="int",n[WebGLRenderingContext.INT_VEC2]="ivec2",n[WebGLRenderingContext.INT_VEC3]="ivec3",n[WebGLRenderingContext.INT_VEC4]="ivec4",n[WebGLRenderingContext.BOOL]="bool",n[WebGLRenderingContext.BOOL_VEC2]="bvec2",n[WebGLRenderingContext.BOOL_VEC3]="bvec3",n[WebGLRenderingContext.BOOL_VEC4]="bvec4",n[WebGLRenderingContext.FLOAT_MAT2]="mat2",n[WebGLRenderingContext.FLOAT_MAT3]="mat3",n[WebGLRenderingContext.FLOAT_MAT4]="mat4",n[WebGLRenderingContext.SAMPLER_2D]="sampler2D",n[WebGLRenderingContext.SAMPLER_CUBE]="samplerCube",i.prototype.getDeclaration=function(e){var t="uniform "+n[this._datatype]+" "+e,r=this._size;return t+=1===r?";":"["+r.toString()+"];"};var o={czm_viewport:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_model:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_sunPositionWC:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new i({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,r)}}),czm_frameNumber:new i({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new i({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new i({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_temeToPseudoFixed:new i({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new i({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.resolutionScale}})};return o}),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;a<i.length;++a)i[a].name===e&&(n=i[a]);return t(n)||(r=o(r),n={name:e,glslSource:r,dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)),n}function s(e,r){if(!e.evaluated){e.evaluated=!0;var i=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(i)&&null!==i&&(i=i.filter(function(e,t){return i.indexOf(e)===t}),i.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var i=a(t,h._czmBuiltinsAndUniforms[t],r);e.dependsOn.push(i),i.requiredBy.push(e),s(i,r)}}))}}function l(e){for(var t=[],i=[];e.length>0;){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<o.dependsOn.length;++a){var s=o.dependsOn[a],l=s.requiredBy.indexOf(o);s.requiredBy.splice(l,1),0===s.requiredBy.length&&t.push(s)}}for(var u=[],c=0;c<i.length;++c)0!==i[c].requiredBy.length&&u.push(i[c]);if(0!==u.length){var h="A circular dependency was found in the following built-in functions/structs/constants: \n";for(c=0;c<u.length;++c)h=h+u[c].name+"\n";throw new r(h)}}function u(e){var t=[],r=a("main",e,t);s(r,t),l(t);for(var i="",n=t.length-1;n>=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 p=e.defines;if(t(p))for(n=0,a=p.length;a>n;++n){var m=p[n];0!==m.length&&(d+="#define "+m+"\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 p in n)if(n.hasOwnProperty(p)){var m=n[p];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[p]=m.getDeclaration(p))}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.sizeInBytes<n)return o&&i.destroy(),t.vertexBuffer=e._context.createVertexBuffer(t.arrayBuffer,t.usage),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function l(e,t,r){if(e.needsCommit&&e.vertexSizeInBytes>0){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={},p=s.length,m=0;p>m;++m){var f=s[m];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;o<r.length;++o){var s=r[o],l={index:t(s.index,o),enabled:t(s.enabled,!0),componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype||e.FLOAT,normalize:s.normalize||!1,vertexBuffer:s.vertexBuffer,usage:s.usage||a.STATIC_DRAW};if(i.push(l),1!==l.componentsPerAttribute&&2!==l.componentsPerAttribute&&3!==l.componentsPerAttribute&&4!==l.componentsPerAttribute)throw new n("attribute.componentsPerAttribute must be in the range [1, 4].");var u=l.componentDatatype;if(!e.validate(u))throw new n("Attribute must have a valid componentDatatype or not specify it.");if(!a.validate(l.usage))throw new n("Attribute must have a valid usage or not specify it.")}for(var c=new Array(i.length),h=0;h<i.length;++h){var d=i[h],p=d.index;if(c[p])throw new n("Index "+p+" is used by more than one attribute.");c[p]=!0}return i},c._vertexSizeInBytes=function(t){for(var r=0,i=t.length,n=0;i>n;++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=[],p=Math.ceil(this._size/o.SIXTY_FOUR_KILOBYTES),m=0;p>m;++m){var f=[];for(var v in h)h.hasOwnProperty(v)&&(t=h[v],c._appendAttributes(f,t,m*t.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES));f=f.concat(this._precreated),d.push({va:this._context.createVertexArray(f,e),indicesCount:1.5*(m!==p-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(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;\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,p=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,p);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,p);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 m=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,m),n===u.COLUMBUS_VIEW)return r.fromElements(m.z,m.x,m.y,i);if(n===u.SCENE2D)return r.fromElements(0,m.x,m.y,i);var c=e.morphTime;return r.fromElements(s.lerp(m.z,t.x,c),s.lerp(m.x,t.y,c),s.lerp(m.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,p,m,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,x=g.IMAGE_INDEX_INDEX=7,T=g.COLOR_INDEX=8,P=g.ROTATION_INDEX=9,A=g.ALIGNED_AXIS_INDEX=10,M=g.SCALE_BY_DISTANCE_INDEX=11,I=g.TRANSLUCENCY_BY_DISTANCE_INDEX=12,D=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,I))}},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,D))}},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,T))}},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,x))}},height:{get:function(){return a(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,v(this,x))}},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,x))}},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,x)}}).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=e.clone(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===p.SCENE3D?e:(c.multiplyByPoint(r,e,O),m.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,l){var u=s.camera,h=u.viewMatrix,d=u.frustum.projectionMatrix,p=c.multiplyTransformation(h,e,R),f=c.multiplyByVector(p,i.fromElements(n.x,n.y,n.z,1,L),L),v=r.multiplyComponents(o,r.normalize(f,N),N);f.x+=o.x+v.x,f.y+=o.y+v.y,f.z+=v.z;var g=c.multiplyByVector(d,f,L),_=m.clipToGLWindowCoordinates(s,g,l);a=t.clone(a,B),a.y=-a.y;var y=t.multiplyByScalar(a,s.context.uniformState.resolutionScale,F);return _.x+=y.x,_.y+=y.y,_};var z=new t(0,0);return g.prototype.computeScreenSpacePosition=function(e,r){var i=this._billboardCollection;s(r)||(r=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=i.modelMatrix,o=g._computeScreenSpacePosition(n,this._actualPosition,this._eyeOffset,z,e,r);return o.y=e.canvas.clientHeight-o.y,o},g.prototype.equals=function(i){return this===i||s(i)&&this._id===i._id&&r.equals(this._position,i._position)&&this._imageId===i._imageId&&this._show===i._show&&this._scale===i._scale&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&e.equals(this._imageSubRegion,i._imageSubRegion)&&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={GLOBE:0,OPAQUE:1,TRANSLUCENT:2,OVERLAY:3,NUMBER_OF_PASSES:4};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 p(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,p=new d(new t(a+e._borderWidthInPixels,0),new t(l,s)),m=new d(new t,new t(l,s),e._root,p),f=new d(new t(0,s+e._borderWidthInPixels),new t(l,u)),v=new d(new t,new t(l,u),m,f);e._root=v;for(var g=0;g<e._textureCoordinates.length;g++){var _=e._textureCoordinates[g];n(_)&&(_.x*=c,_.y*=h,_.width*=c,_.height*=h)}var y=e._context.createTexture2D({width:l,height:u,pixelFormat:e._pixelFormat}),C=e._context.createFramebuffer({colorTextures:[e._texture]});C._bind(),y.copyFromFramebuffer(0,0,0,0,a,s),C._unBind(),C.destroy(),e._texture=y}else{var w=o*(r.width+e._borderWidthInPixels),S=o*(r.height+e._borderWidthInPixels);e._texture=e._texture&&e._texture.destroy(),e._texture=e._context.createTexture2D({width:w,height:S,pixelFormat:e._pixelFormat}),e._root=new d(new t,new t(w,S))}}function m(e,r,i){if(!n(r))return void 0;if(!n(r.childNode1)&&!n(r.childNode2)){if(n(r.imageIndex))return void 0;var o=r.topRight.x-r.bottomLeft.x,a=r.topRight.y-r.bottomLeft.y,s=o-i.width,l=a-i.height;if(0>s||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;u<r.topRight.x&&(r.childNode2=new d(new t(u,r.bottomLeft.y),new t(r.topRight.x,r.topRight.y)))}else{r.childNode1=new d(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.topRight.x,r.bottomLeft.y+i.height));var c=r.bottomLeft.y+i.height+e._borderWidthInPixels;c<r.topRight.y&&(r.childNode2=new d(new t(r.bottomLeft.x,c),new t(r.topRight.x,r.topRight.y)))}return m(e,r.childNode1,i)}return m(e,r.childNode1,i)||m(e,r.childNode2,i)}function f(t,i,o){var a=m(t,t._root,i);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,h=a.bottomLeft.x/s,d=a.bottomLeft.y/l,v=u/s,g=c/l;t._textureCoordinates[o]=new e(h,d,v,g),t._texture.copyFrom(i,a.bottomLeft.x,a.bottomLeft.y)}else p(t,i),f(t,i,o);t._guid=r()}var v=new t(16,16),g=function(e){e=i(e,i.EMPTY_OBJECT);var n=i(e.borderWidthInPixels,1),o=i(e.initialSize,v);this._context=e.context,this._pixelFormat=i(e.pixelFormat,u.RGBA),this._borderWidthInPixels=n,this._textureCoordinates=[],this._guid=r(),this._idHash={},this._texture=this._context.createTexture2D({width:o.x,height:o.y,pixelFormat:this._pixelFormat}),this._root=new d(new t,new t(o.x,o.y))};return o(g.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),g.prototype.addImage=function(e,t){var r=this._idHash[e];if(n(r))return r;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var i=this;return r=h(t,function(e){if(i.isDestroyed())return-1;var t=i.numberOfImages;return f(i,e,t),t}),this._idHash[e]=r,r},g.prototype.addSubRegion=function(t,i){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return h(o,function(t){if(-1===t)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+i.x/n,c=l.y+i.y/o,h=i.width/n,d=i.height/o;return a._textureCoordinates.push(new e(u,c,h,d)),a._guid=r(),s})},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},g}),r("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./HorizontalOrigin","./Pass","./SceneMode","./TextureAtlas"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T){"use strict";function P(e){for(var t=e.length,r=0;t>r;++r)e[r]&&e[r]._destroy()}function A(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;i>n;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function M(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 I(e,t,r){return new _(e,[{index:it.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[G]},{index:it.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[G]},{index:it.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[H]},{index:it.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[et]},{index:it.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[J]},{index:it.eyeOffset,componentsPerAttribute:3,componentDatatype:o.FLOAT,usage:r[q]},{index:it.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[$]},{index:it.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[tt]}],4*t)}function D(e,r,i,n,o){var a=4*o._index,s=o._getActualPosition();e._mode===x.SCENE3D&&(t.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(s,ot);var l=o.scale,u=o.rotation;0!==u&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);var c=n[it.positionHighAndScale],d=ot.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 p=n[it.positionLowAndRotation],m=ot.low;p(a+0,m.x,m.y,m.z,u),p(a+1,m.x,m.y,m.z,u),p(a+2,m.x,m.y,m.z,u),p(a+3,m.x,m.y,m.z,u)}function O(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 m=o.horizontalOrigin,f=o.verticalOrigin,v=o.show;0===o.color.alpha&&(v=!1),t._allHorizontalCenter=t._allHorizontalCenter&&m===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,x=_+C,T=Math.floor(p.clamp(l,-st,st)+st)*ct;T+=(m+1)*ht,T+=(f+1)*dt,T+=(v?1:0)*pt;var P=Math.floor(p.clamp(u,-st,st)+st)*ut,A=Math.floor(p.clamp(h,-st,st)+st)*ut,M=(p.clamp(d,-st,st)+st)*mt,I=Math.floor(M),D=Math.floor((M-I)*ut);P+=I,A+=D,at.x=g,at.y=_;var O=e.compressTextureCoordinates(at);at.x=b;var R=e.compressTextureCoordinates(at);at.y=x;var L=e.compressTextureCoordinates(at);at.x=g;var N=e.compressTextureCoordinates(at),F=n[it.compressedAttribute0];F(a+0,T+ft,P,A,O),F(a+1,T+vt,P,A,R),F(a+2,T+gt,P,A,L),F(a+3,T+_t,P,A,N)}function R(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,m=1,f=1,v=l.translucencyByDistance;s(v)&&(h=v.near,d=v.nearValue,m=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=p.clamp(w,0,lt),E=0;Math.abs(i.magnitudeSquared(c)-1)<p.EPSILON6&&(E=e.octEncodeFloat(c)),d=p.clamp(d,0,1),d=1===d?255:0|255*d,S=S*ut+d,f=p.clamp(f,0,1),f=1===f?255:0|255*f,E=E*ut+f;var b=o[it.compressedAttribute1];b(u+0,S,E,h,m),b(u+1,S,E,h,m),b(u+2,S,E,h,m),b(u+3,S,E,h,m)}function L(e,t,r,i,o){var s=4*o._index,l=o.color,u=o.getPickId(t).color,c=0,h=o._imageIndex;if(-1!==h){var d=r[h];c=d.height}var p=e._textureAtlas.texture.dimensions,m=Math.ceil(.5*a(o.height,p.y*c));e._maxSize=Math.max(e._maxSize,m);var f=n.floatToByte(l.red),v=n.floatToByte(l.green),g=n.floatToByte(l.blue),_=f*lt+v*ut+g;f=n.floatToByte(u.red),v=n.floatToByte(u.green),g=n.floatToByte(u.blue);var y=f*lt+v*ut+g,C=n.floatToByte(l.alpha)*ut+n.floatToByte(u.alpha),w=i[it.compressedAttribute2];w(s+0,_,y,C,m),w(s+1,_,y,C,m),w(s+2,_,y,C,m),w(s+3,_,y,C,m)}function N(e,t,r,i,n){var o=4*n._index,a=n.eyeOffset;e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(a.z));var s=i[it.eyeOffset];s(o+0,a.x,a.y,a.z),s(o+1,a.x,a.y,a.z),s(o+2,a.x,a.y,a.z),s(o+3,a.x,a.y,a.z)}function F(e,t,r,i,n){var o=4*n._index,a=i[it.scaleByDistance],l=0,u=1,c=1,h=1,d=n.scaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,(1!==u||1!==h)&&(e._shaderScaleByDistance=!0)),a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h)}function B(e,t,r,i,n){var o=4*n._index,a=i[it.pixelOffsetScaleByDistance],l=0,u=1,c=1,h=1,d=n.pixelOffsetScaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,(1!==u||1!==h)&&(e._shaderPixelOffsetScaleByDistance=!0)),a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h)}function z(e,t,r,i,n){D(e,t,r,i,n),O(e,t,r,i,n),R(e,t,r,i,n),L(e,t,r,i,n),N(e,t,r,i,n),F(e,t,r,i,n),B(e,t,r,i,n)}function V(e,r,i,n,o,a){var l;n.mode===x.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;i>c;++c){var h=r[c],d=h.position,p=w._computeActualPosition(d,n,o);s(p)&&(h._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function k(e,t){var r=t.mode,i=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==x.SCENE3D&&!m.equals(o,e.modelMatrix)?(e._mode=r,m.clone(e.modelMatrix,o),e._createVertexArray=!0,(r===x.SCENE3D||r===x.SCENE2D||r===x.COLUMBUS_VIEW)&&V(e,i,i.length,t,o,!0)):r===x.MORPHING?V(e,i,i.length,t,o,!0):(r===x.SCENE2D||r===x.COLUMBUS_VIEW)&&V(e,n,e._billboardsToUpdateIndex,t,o,!1)}function U(e,t,r,n){var o=r.camera,a=o.frustum,s=i.subtract(o.positionWC,n.center,Ct),l=i.multiplyByScalar(o.directionWC,i.dot(s,o.directionWC),wt),u=Math.max(0,i.magnitude(l)-n.radius);yt.x=t.drawingBufferWidth,yt.y=t.drawingBufferHeight;var c=a.getPixelSize(yt,u),h=Math.max(c.x,c.y),d=2*h*e._maxScale*e._maxSize;e._allHorizontalCenter&&(d*=.5);var p=h*e._maxPixelOffset+e._maxEyeOffset;n.radius+=d+p}var W=w.SHOW_INDEX,G=w.POSITION_INDEX,H=w.PIXEL_OFFSET_INDEX,q=w.EYE_OFFSET_INDEX,j=w.HORIZONTAL_ORIGIN_INDEX,Y=w.VERTICAL_ORIGIN_INDEX,X=w.SCALE_INDEX,Z=w.IMAGE_INDEX_INDEX,J=w.COLOR_INDEX,Q=w.ROTATION_INDEX,K=w.ALIGNED_AXIS_INDEX,$=w.SCALE_BY_DISTANCE_INDEX,et=w.TRANSLUCENCY_BY_DISTANCE_INDEX,tt=w.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,rt=w.NUMBER_OF_PROPERTIES,it={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7},nt=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(rt),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=m.clone(a(e.modelMatrix,m.IDENTITY)),this._modelMatrix=m.clone(m.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this._mode=x.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(nt.prototype,{length:{get:function(){return A(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}}}),nt.prototype.add=function(e){var t=new w(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},nt.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},nt.prototype.removeAll=function(){P(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},nt.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},nt.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},nt.prototype.get=function(e){return A(this),this._billboards[e]},nt.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;rt>i;++i){var n=0===r[i]?f.STATIC_DRAW:f.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var ot=new h,at=new r,st=32768,lt=65536,ut=256,ct=128,ht=32,dt=8,pt=4,mt=1/256,ft=0,vt=2,gt=3,_t=1,yt=new r,Ct=new i,wt=new i,St=[];return nt.prototype.update=function(e,r,i){A(this);var n=this._billboards,o=n.length,a=this._textureAtlas;if(!s(a)){a=this._textureAtlas=new T({context:e});for(var l=0;o>l;++l)n[l]._loadImage()}var u=a.textureCoordinates;if(0!==u.length){k(this,r),n=this._billboards,o=n.length;var c=this._billboardsToUpdate,h=this._billboardsToUpdateIndex,d=this._propertiesChanged,p=a.guid,f=this._createVertexArray||this._textureAtlasGUID!==p;this._textureAtlasGUID=p;var _,w=r.passes,E=w.pick;if(f||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var P=0;rt>P;++P)d[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=I(e,o,this._buffersUsage),_=this._vaf.writers;for(var V=0;o>V;++V){var nt=this._billboards[V];nt._dirty=!1,z(this,e,u,_,nt)}this._vaf.commit(M(e))}this._billboardsToUpdateIndex=0}else if(h>0){var ot=St;ot.length=0,(d[G]||d[Q]||d[X])&&ot.push(D),(d[Z]||d[H]||d[j]||d[Y]||d[W])&&ot.push(O),(d[Z]||d[K]||d[et])&&ot.push(R),(d[Z]||d[J])&&ot.push(L),d[q]&&ot.push(N),d[$]&&ot.push(F),d[tt]&&ot.push(B);var at=ot.length;if(_=this._vaf.writers,h/o>.1){for(var st=0;h>st;++st){var lt=c[st];lt._dirty=!1;for(var ut=0;at>ut;++ut)ot[ut](this,e,u,_,lt)}this._vaf.commit(M(e))}else{for(var ct=0;h>ct;++ct){var ht=c[ct];ht._dirty=!1;for(var dt=0;at>dt;++dt)ot[dt](this,e,u,_,ht);this._vaf.subCommit(4*ht._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(h>1.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 pt,mt=m.IDENTITY;r.mode===x.SCENE3D?(mt=this.modelMatrix,pt=t.clone(this._baseVolumeWC,this._boundingVolume)):pt=t.clone(this._baseVolume2D,this._boundingVolume),U(this,e,r,pt);var ft,vt,gt,_t,yt,Ct;if(w.render){var wt=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)&&(yt=new g({sources:[C]}),this._shaderRotation&&yt.defines.push("ROTATION"),this._shaderAlignedAxis&&yt.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&yt.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&yt.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&yt.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._sp=e.replaceShaderProgram(this._sp,yt,y,it),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),ft=this._vaf.va,vt=ft.length,wt.length=vt,_t=0;vt>_t;++_t)gt=wt[_t],s(gt)||(gt=wt[_t]=new v({pass:b.OPAQUE,owner:this})),gt.boundingVolume=pt,gt.modelMatrix=mt,gt.count=ft[_t].indicesCount,gt.shaderProgram=this._sp,gt.uniformMap=this._uniforms,gt.vertexArray=ft[_t].va,gt.renderState=this._rs,gt.debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(gt)}if(E){var Et=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)&&(yt=new g({defines:["RENDER_FOR_PICK"],sources:[C]}),this._shaderRotation&&yt.defines.push("ROTATION"),this._shaderAlignedAxis&&yt.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&yt.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&yt.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&yt.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),Ct=new g({defines:["RENDER_FOR_PICK"],sources:[y]}),this._spPick=e.replaceShaderProgram(this._spPick,yt,Ct,it),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),ft=this._vaf.va,vt=ft.length,Et.length=vt,_t=0;vt>_t;++_t)gt=Et[_t],s(gt)||(gt=Et[_t]=new v({pass:b.OPAQUE,owner:this})),gt.boundingVolume=pt,gt.modelMatrix=mt,gt.count=ft[_t].indicesCount,gt.shaderProgram=this._spPick,gt.uniformMap=this._uniforms,gt.vertexArray=ft[_t].va,gt.renderState=this._rs,i.push(gt)}}}},nt.prototype.isDestroyed=function(){return!1},nt.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(),P(this._billboards),u(this)},nt}),r("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),r("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Iso8601"],function(e,t,r,i){"use strict";var n=function(){i.throwInstantiationError()};return r(n.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),n.prototype.getValue=i.throwInstantiationError,n.prototype.equals=i.throwInstantiationError,n.equals=function(e,r){return e===r||t(e)&&e.equals(r)},n.arrayEquals=function(e,r){if(e===r)return!0;if(!t(e)||!t(r)||e.length!==r.length)return!1;for(var i=e.length,o=0;i>o;o++)if(!n.equals(e[o],r[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,r,i){return t(e)?e.getValue(r,i):void 0},n.getValueOrDefault=function(r,i,n,o){return t(r)?e(r.getValue(i,o),n):n},n.getValueOrClonedDefault=function(e,r,i,n){var o;return t(e)&&(o=e.getValue(r,n)),t(o)||(o=i.clone(o)),o},n}),r("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,r,i,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t){if(o(e)){var r=e.billboard;o(r)&&(e.textureValue=void 0,e.billboard=void 0,r.show=!1,r.image=void 0,t.push(r._index))}}var f=n.WHITE,v=i.ZERO,g=r.ZERO,_=1,y=0,C=i.ZERO,w=c.CENTER,S=h.CENTER,E=new i,b=new n,x=new i,T=new r,P=new l,A=new l,M=new l,I=new t,D=function(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0},O=function(t,r){r.collectionChanged.addEventListener(O.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._billboardCollection=void 0,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])};return O.prototype.update=function(e){for(var t=this._items.values,r=this._unusedIndexes,i=0,n=t.length;n>i;i++){var a,s=t[i],l=s.entity,c=l._billboard,h=s.billboard,d=l.isShowing&&l.isAvailable(e)&&p.getValueOrDefault(c._show,e,!0);if(d&&(E=p.getValueOrUndefined(l._position,e,E),a=p.getValueOrUndefined(c._image,e),d=o(E)&&o(a)),d){if(!o(h)){var D=this._billboardCollection;o(D)||(D=new u,this._billboardCollection=D,this._scene.primitives.add(D));var O=r.length;h=O>0?D.get(r.pop()):D.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=E,h.color=p.getValueOrDefault(c._color,e,f,b),h.eyeOffset=p.getValueOrDefault(c._eyeOffset,e,v,x),h.pixelOffset=p.getValueOrDefault(c._pixelOffset,e,g,T),h.scale=p.getValueOrDefault(c._scale,e,_),h.rotation=p.getValueOrDefault(c._rotation,e,y),h.alignedAxis=p.getValueOrDefault(c._alignedAxis,e,C),h.horizontalOrigin=p.getValueOrDefault(c._horizontalOrigin,e,w),h.verticalOrigin=p.getValueOrDefault(c._verticalOrigin,e,S),h.width=p.getValueOrUndefined(c._width,e),h.height=p.getValueOrUndefined(c._height,e),h.scaleByDistance=p.getValueOrUndefined(c._scaleByDistance,e,P),h.translucencyByDistance=p.getValueOrUndefined(c._translucencyByDistance,e,A),h.pixelOffsetScaleByDistance=p.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,M);var R=p.getValueOrUndefined(c._imageSubRegion,e,I);o(R)&&h.setImageSubRegion(h._imageId,R)}else m(s,r)}return!0},O.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);return o(r)&&o(r.billboard)?(t.center=i.clone(r.billboard.position,t.center),t.radius=0,d.DONE):d.FAILED},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(O.prototype._onCollectionChanged,this),o(this._billboardCollection)&&this._scene.primitives.remove(this._billboardCollection),a(this)},O.prototype._onCollectionChanged=function(e,t,r,i){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 D(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._billboard)&&o(a._position)?l.contains(a.id)||l.set(a.id,new D(a)):(m(l.get(a.id),s),l.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],m(l.get(a.id),s),l.remove(a.id)},O}),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 = 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"}),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 = 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"}),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 = 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"
}),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/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){e=r(e,r.EMPTY_OBJECT),this.material=e.material,this.translucent=r(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=r(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"),i(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return i(this.material)&&this.material.isTranslucent()||!i(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=o.ALPHA_BLEND):r.depthMask=!0,r},s.getDefaultRenderState=function(e,r,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),r&&(s.cull={enabled:!0,face:a.BACK}),i(n)&&(s=t(n,s,!0)),s},s}),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 p=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 p=n.preMultiplyAlpha||h===s.RGB||h===s.LUMINANCE,m=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,p),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,m),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=p,this._flipY=m,this._sampler=void 0,this.sampler=void 0};return i(p.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}}}),p.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)},p.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)},p.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)},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},p}),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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M){"use strict";function I(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 D(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;i<t.length;i++){var n="'"+t[i]+"'";r+=i===t.length-1?"or "+n+".":n+", "}throw new u(r)}function R(e){var t="fabric: uniforms and materials cannot share the same property '"+e+"'";throw new u(t)}function L(e){var t=e._template,r=t.uniforms,i=t.materials,n=t.components;if(a(n)&&a(t.source))throw new u("fabric: cannot have source and components in the same template.");D(t,q,O,!0),D(n,j,O,!0);var o=[];for(var s in i)i.hasOwnProperty(s)&&o.push(s);D(r,o,R,!1)}function N(e){var t=e._template.components,r=e._template.source;if(a(r))e.shaderSource+=r+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var i in t)t.hasOwnProperty(i)&&(e.shaderSource+="material."+i+" = "+t[i]+";\n");e.shaderSource+="return material;\n}\n"}}function F(e){return function(t,r){var i,n,o=t.uniforms,s=o[e],l=t._textures[e];if(s instanceof v&&s!==l)return H._textureCache.releaseTexture(t._texturePaths[e]),t._texturePaths[e]=void 0,t._textures[e]=s,i=e+"Dimensions",o.hasOwnProperty(i)&&(n=o[i],n.x=s._width,n.y=s._height),void 0;if(a(l)||(t._texturePaths[e]=void 0,l=t._textures[e]=r.defaultTexture,i=e+"Dimensions",o.hasOwnProperty(i)&&(n=o[i],n.x=l._width,n.y=l._height)),s!==H.DefaultImageId&&s!==t._texturePaths[e]){var u=H._textureCache.getTexture(s);a(u)?(H._textureCache.releaseTexture(t._texturePaths[e]),t._textures[e]=u):"string"==typeof s?M(h(s),function(r){t._loadedImages.push({id:e,image:r})}):s instanceof HTMLCanvasElement&&t._loadedImages.push({id:e,image:s}),t._texturePaths[e]=s}}}function B(e){return function(t,r){var i=t.uniforms[e];if(i instanceof f)return H._textureCache.releaseTexture(t._texturePaths[e]),t._texturePaths[e]=void 0,t._textures[e]=i,void 0;if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=r.defaultCubeMap),i!==H.DefaultCubeMapId){var n=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(n!==t._texturePaths[e]){var o=H._textureCache.getTexture(n);if(a(o))H._textureCache.releaseTexture(t._texturePaths[e]),t._textures[e]=o;else{var s=[h(i.positiveX),h(i.negativeX),h(i.positiveY),h(i.negativeY),h(i.positiveZ),h(i.negativeZ)];M.all(s).then(function(r){t._loadedCubeMaps.push({id:e,images:r})})}t._texturePaths[e]=n}}}}function z(e){var t=e._template.uniforms;for(var r in t)t.hasOwnProperty(r)&&V(e,r)}function V(e,t){var r=e._strict,i=e._template.uniforms,n=i[t],o=k(n);if(!a(o))throw new u("fabric: uniform '"+t+"' has invalid type.");if("channels"===o){if(0===W(e,t,n,!1)&&r)throw new u("strict: shader source does not use channels '"+t+"'.")}else{if("sampler2D"===o){var s=t+"Dimensions";G(e,s)>0&&(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||e instanceof HTMLCanvasElement)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=[],I(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 p=d.images,m=H._textureCache.getTexture(this._texturePaths[r]);a(m)||(m=e.createCubeMap({source:{positiveX:p[0],negativeX:p[1],positiveY:p[2],negativeY:p[3],positiveZ:p[4],negativeZ:p[5]}}),H._textureCache.addTexture(this._texturePaths[r],m)),this._textures[r]=m}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:p,mat4:m};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:T},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:x},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 p=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=e(r.closed,!1),o=e(r.materialSupport,p.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=h.getDefaultRenderState(i,n,r.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,!n)};return r(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: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})},p}),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 = 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"}),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,p=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=s.getDefaultRenderState(r,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=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/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(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)d.transformToWorldCoordinates(e[i]);else m.multiplyTransformation(t,e[0].modelMatrix,t)}function g(e,i){var n=e.attributes,o=n.position,a=4*(o.values.length/o.componentsPerAttribute);n.pickColor=new c({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var s=t.floatToByte(i.red),l=t.floatToByte(i.green),u=t.floatToByte(i.blue),h=t.floatToByte(i.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 r=e.length,i=0;r>i;++i){var o=e[i],a=t[i];n(o.geometry)?g(o.geometry,a):(g(o.westHemisphereGeometry,a),g(o.eastHemisphereGeometry,a))}}function y(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 C(e,t,i){for(var n=u.computeNumberOfVertices(t),o=i.length,a=0;o>a;++a){for(var s=i[a],l=e[s],h=l.componentDatatype,d=l.value,p=d.length,m=r.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 w(e,t){for(var r=e.length,i=0;r>i;++i){var o=e[i],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 i,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;if(a[0].geometry.primitiveType,v(a,f,c),!c)for(i=0;g>i;++i)d.splitLongitude(a[i]);h&&_(a,s);var C=y(a);if(w(a,C),p)for(i=0;g>i;++i){var S=a[i];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 E=d.combineInstances(a);for(g=E.length,i=0;g>i;++i){o=E[i];var b,x=o.attributes;if(c)for(b in x)x.hasOwnProperty(b)&&x[b].componentDatatype===r.DOUBLE&&d.encodeAttribute(o,b,b+"3DHigh",b+"3DLow");else for(b in x)if(x.hasOwnProperty(b)&&x[b].componentDatatype===r.DOUBLE){var T=b+"3D",P=b+"2D";d.projectTo2D(o,b,T,P,l),n(o.boundingSphere)&&"position"===b&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),d.encodeAttribute(o,T,T+"High",T+"Low"),d.encodeAttribute(o,P,P+"High",P+"Low")}m&&d.compressVertices(o)}if(!u){var A=[];for(g=E.length,i=0;g>i;++i)o=E[i],A=A.concat(d.fitToUnsignedShortIndices(o));E=A}return E}function E(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 b(e,t,r,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=i(h[f],0),C=s[y],w=C.length,S=0;w>S&&(_=C[S],_.index!==v);++S);n(l[e][f])||(l[e][f]={dirty:!1,valid:!0,value:r[f].value,indices:[]});var E,b=_.values.length/_.componentsPerAttribute,x=i(c[f],0);b>x+g?(E=g,l[e][f].indices.push({attribute:_,offset:x,count:E}),c[f]=x+g):(E=b-x,l[e][f].indices.push({attribute:_,offset:x,count:E}),c[f]=0,h[f]=y+1),g-=E}}function x(e,t,r,i,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)&&b(a,s.geometry,l,o,i,r,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.westHemisphereGeometry)&&b(a,s.westHemisphereGeometry,l,o,i,r,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.eastHemisphereGeometry)&&b(a,s.eastHemisphereGeometry,l,o,i,r,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 T(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 P(e,t){for(var r=e.length,i=0;r>i;++i)T(e[i],t)}function A(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 M(t){for(var r=1,i=t.length,o=0;i>o;o++){var a=t[o];if(++r,n(a)){var s=a.attributes;r+=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];r+=5+u.values.length}}}return r}function I(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 D(e){for(var r=e.length,i=new Array(r),n=0;r>n;n++)i[n]=t.fromRgba(e[n]);return i}function O(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 R(e,t){var r=new Float64Array(O(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;p<h.length;p++){var f=h[p],v=c[f];r[s++]=i[f],r[s++]=v.componentDatatype,r[s++]=v.componentsPerAttribute,r[s++]=v.normalize,r[s++]=v.value.length,r.set(v.value,s),s+=v.value.length}}return t.push(r.buffer),{stringTable:o,packedData:r}}function L(e){for(var t=e.packedData,i=e.stringTable,n=new Array(t[0]),o=0,a=1;a<t.length;){var s=m.unpack(t,a);a+=m.packedLength;for(var l={},u=t[a++],c=0;u>c;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 N(t){for(var r=t.length,i=1+r,o=0;r>o;o++){var a=t[o];i+=2,i+=n(a.boundingSphere)?e.packedLength:0,i+=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];i+=4+3*l.indices.length+l.value.length}}return i}function F(t,r){var i=new Float64Array(N(t)),o=[],a=[],s={},l=t.length,u=0;i[u++]=l;for(var c=0;l>c;c++){var h=t[c],d=h.boundingSphere,p=n(d);i[u++]=p?1:0,p&&(e.pack(d,i,u),u+=e.packedLength),d=h.boundingSphereCV,p=n(d),i[u++]=p?1:0,p&&(e.pack(d,i,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)));i[u++]=m.length;for(var v=0;v<m.length;v++){var g=m[v],_=h[g];i[u++]=s[g],i[u++]=_.valid?1:0;var y=_.indices,C=y.length;i[u++]=C;for(var w=0;C>w;w++){var S=y[w];i[u++]=S.count,i[u++]=S.offset;var E=a.indexOf(S.attribute);-1===E&&(E=a.length,a.push(S.attribute)),i[u++]=E}i[u++]=_.value.length,i.set(_.value,u),u+=_.value.length}}return r.push(i.buffer),{stringTable:o,packedData:i,attributeTable:a}}function B(t){for(var i=t.stringTable,n=t.attributeTable,o=t.packedData,a=new Array(o[0]),s=0,l=1,u=o.length;u>l;){var c={},h=1===o[l++];h&&(c.boundingSphere=e.unpack(o,l),l+=e.packedLength),h=1===o[l++],h&&(c.boundingSphereCV=e.unpack(o,l),l+=e.packedLength);for(var d=o[l++],p=0;d>p;p++){for(var m=i[o[l++]],f=1===o[l++],v=o[l++],g=v>0?new Array(v):void 0,_=0;v>_;_++){var y={};y.count=o[l++],y.offset=o[l++],y.attribute=n[o[l++]],g[_]=y}for(var C=o[l++],w=f?r.createTypedArray(g[0].attribute.componentDatatype,C):new Array(C),S=0;C>S;S++)w[S]=o[l++];c[m]={dirty:!1,valid:f,indices:g,value:w}}a[s++]=c}return a}if(!s.supportsTypedArrays())return{};var z={};return z.combineGeometry=function(e){var t,r,i,o,a,s=e.instances,l=e.invalidInstances;if(s.length>0){t=S(e),r=d.createAttributeLocations(t[0]),o=y(s),i=[],a=t.length;for(var u=0;a>u;++u){var c=t[u];i.push(E(c,r,o))}}o=n(o)?o:y(l);var h=x(s,l,i,r,o);return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:i,vaAttributeLocations:h,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices}},z.packCreateGeometryResults=function(t,r){var i=new Float64Array(M(t)),o=[],a={},s=t.length,l=0;i[l++]=s;for(var u=0;s>u;u++){var c=t[u],h=n(c);if(i[l++]=h?1:0,h){i[l++]=c.primitiveType,i[l++]=c.geometryType;var d=n(c.boundingSphere)?1:0;i[l++]=d,d&&e.pack(c.boundingSphere,i,l),l+=e.packedLength;var p=n(c.boundingSphereCV)?1:0;i[l++]=p,p&&e.pack(c.boundingSphereCV,i,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)));i[l++]=f.length;for(var g=0;g<f.length;g++){var _=f[g],y=m[_];i[l++]=a[_],i[l++]=y.componentDatatype,i[l++]=y.componentsPerAttribute,i[l++]=y.normalize?1:0,i[l++]=y.values.length,i.set(y.values,l),l+=y.values.length}var C=n(c.indices)?c.indices.length:0;i[l++]=C,C>0&&(i.set(c.indices,l),l+=C)}}return r.push(i.buffer),{stringTable:o,packedData:i}},z.unpackCreateGeometryResults=function(t){for(var i,n=t.stringTable,o=t.packedData,a=new Array(o[0]),s=0,l=1;l<o.length;){var d=1===o[l++];if(d){var m,f,v=o[l++],g=o[l++],_=1===o[l++];_&&(m=e.unpack(o,l)),l+=e.packedLength;var y=1===o[l++];y&&(f=e.unpack(o,l)),l+=e.packedLength;var C,w,S,E=new h,b=o[l++];for(i=0;b>i;i++){var x=n[o[l++]],T=o[l++];S=o[l++];var P=0!==o[l++];C=o[l++],w=r.createTypedArray(T,C);for(var A=0;C>A;A++)w[A]=o[l++];E[x]=new c({componentDatatype:T,componentsPerAttribute:S,normalize:P,values:w})}var M;if(C=o[l++],C>0){var I=w.length/S;for(M=p.createTypedArray(I,C),i=0;C>i;i++)M[i]=o[l++]}a[s++]=new u({primitiveType:v,geometryType:g,boundingSphere:m,indices:M,attributes:E})}else a[s++]=void 0}return a},z.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=I(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:R(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}},z.unpackCombineGeometryParameters=function(e){for(var t=L(e.packedInstances),r=e.allowPicking,i=r?D(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 w=_[C],S=t[u];n(w)?(S.geometry=w,c.push(S),d.push(u),r&&v.push(i[u])):(h.push(S),p.push(u)),++u}var E=a.clone(e.ellipsoid),b=e.isGeographic?new l(E):new f(E);return{instances:c,invalidInstances:h,validInstancesIndices:d,invalidInstancesIndices:p,pickIds:v,ellipsoid:E,projection:b,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:m.clone(e.modelMatrix)}},z.packCombineGeometryResults=function(e,t){return n(e.geometries)&&(P(e.geometries,t),A(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:F(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices}},z.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:B(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},z}),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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,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 I(e){return new m({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function D(e,t){var r=e.attributes,i={};for(var n in r)r.hasOwnProperty(n)&&(i[n]=I(r[n]));return new p({geometry:t,modelMatrix:v.clone(e.modelMatrix),attributes:i,pickPrimitive:e.pickPrimitive,id:e.id})}function O(e,t,r){for(var i,n="",o="",a="";null!==(i=H.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 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=p.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_non_compressed_main()");var m="void main() \n{ \n"+h+"    czm_non_compressed_main(); \n"+"}";return[u,c,p,m].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){var r=t[e];return function(){return o(r)&&o(r.value)?t[e].value:r}}function k(e,t,r){return function(i){var n=t[e];n.value=i,!n.dirty&&n.valid&&(r.push(n),n.dirty=!0)}}function U(e,t,r,i){e._error=i,e._state=r,t.afterRender.push(function(){e._ready=e._state===T.COMPLETE||e._state===T.FAILED,o(i)?e._readyPromise.reject(i):e._readyPromise.resolve(e)})}var W=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=T.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._createGeometryResults=void 0,this._ready=!1,this._readyPromise=S.defer()};a(W.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}}});var G,H=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g,q=Math.max(u.hardwareConcurrency-1,1),j=new _("combineGeometry",Number.POSITIVE_INFINITY);return W.prototype.update=function(a,s,u){if(!(!o(this.geometryInstances)&&0===this._va.length||o(this.geometryInstances)&&f(this.geometryInstances)&&0===this.geometryInstances.length||!o(this.appearance)||s.mode!==P.SCENE3D&&s.scene3DOnly||!s.passes.render&&!s.passes.pick)){if(o(this._error))throw this._error;if(this._state!==T.FAILED){var c,h,d,p,m,A,I,V,k,W,H,Y,X,Z,J=s.mapProjection,Q=this.allowPicking,K=this._instanceIds,$=s.scene3DOnly,et=this;if(this._state!==T.COMPLETE&&this._state!==T.COMBINED)if(this.asynchronous){if(this._state===T.READY){Y=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],this._numberOfInstances=A=Y.length;
var tt=[],rt=[];for(I=0;A>I;++I)d=Y[I].geometry,K.push(Y[I].id),rt.push({moduleName:d._workerName,geometry:d});if(!o(G))for(G=new Array(q),I=0;q>I;I++)G[I]=new _("createGeometry",Number.POSITIVE_INFINITY);var it;for(rt=g(rt,q),I=0;I<rt.length;I++){var nt=0,ot=rt[I],at=ot.length;for(V=0;at>V;++V)it=ot[V],d=it.geometry,o(d.constructor.pack)&&(it.offset=nt,nt+=n(d.constructor.packedLength,d.packedLength));var st;if(nt>0){var lt=new Float64Array(nt);for(st=[lt.buffer],V=0;at>V;++V)it=ot[V],d=it.geometry,o(d.constructor.pack)&&(d.constructor.pack(d,lt,it.offset),it.geometry=lt)}tt.push(G[I].scheduleTask({subTasks:rt[I]},st))}this._state=T.CREATING,S.all(tt,function(e){et._createGeometryResults=e,et._state=T.CREATED}).otherwise(function(e){U(et,s,T.FAILED,e)})}else if(this._state===T.CREATED){var ut=[];Y=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],W=j.scheduleTask(x.packCombineGeometryParameters({createGeometryResults:this._createGeometryResults,instances:Y,pickIds:Q?B(a,this,Y):void 0,ellipsoid:J.ellipsoid,projection:J,elementIndexUintSupported:a.elementIndexUint,scene3DOnly:$,allowPicking:Q,vertexCacheOptimize:this.vertexCacheOptimize,compressVertices:this.compressVertices,modelMatrix:this.modelMatrix},ut),ut),this._createGeometryResults=void 0,this._state=T.COMBINING,S(W,function(e){var t=x.unpackCombineGeometryResults(e);et._geometries=t.geometries,et._attributeLocations=t.attributeLocations,et._vaAttributes=t.vaAttributes,et._perInstanceAttributeLocations=t.perInstanceAttributeLocations,et.modelMatrix=v.clone(t.modelMatrix,et.modelMatrix),et._validModelMatrix=!v.equals(et.modelMatrix,v.IDENTITY);for(var r=e.validInstancesIndices,i=e.invalidInstancesIndices,n=et._instanceIds,a=new Array(n.length),l=r.length,u=0;l>u;++u)a[u]=n[r[u]];for(var c=i.length,h=0;c>h;++h)a[l+h]=n[i[h]];et._instanceIds=a,o(et._geometries)?et._state=T.COMBINED:U(et,s,T.FAILED,void 0)}).otherwise(function(e){U(et,s,T.FAILED,e)})}}else{Y=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],this._numberOfInstances=A=Y.length,Z=new Array(A),X=new Array(A);var ct=[],ht=0;for(I=0;A>I;I++){H=Y[I],d=H.geometry;var dt;dt=o(d.attributes)&&o(d.primitiveType)?M(d):d.constructor.createGeometry(d),o(dt)?(Z[ht]=dt,X[ht++]=D(H,dt),K.push(H.id)):ct.push(H)}Z.length=ht,X.length=ht;var pt=x.combineGeometry({instances:X,invalidInstances:ct,pickIds:Q?B(a,this,X):void 0,ellipsoid:J.ellipsoid,projection:J,elementIndexUintSupported:a.elementIndexUint,scene3DOnly:$,allowPicking:Q,vertexCacheOptimize:this.vertexCacheOptimize,compressVertices:this.compressVertices,modelMatrix:this.modelMatrix});for(this._geometries=pt.geometries,this._attributeLocations=pt.attributeLocations,this._vaAttributes=pt.vaAttributes,this._perInstanceAttributeLocations=pt.vaAttributeLocations,this.modelMatrix=v.clone(pt.modelMatrix,this.modelMatrix),this._validModelMatrix=!v.equals(this.modelMatrix,v.IDENTITY),I=0;I<ct.length;++I)H=ct[I],K.push(H.id);o(this._geometries)?this._state=T.COMBINED:U(this,s,T.FAILED,void 0)}var mt=this._attributeLocations;if(this._state===T.COMBINED){Z=this._geometries;var ft=this._vaAttributes,vt=[];for(A=Z.length,I=0;A>I;++I){d=Z[I],p=ft[I];var gt=p.length;for(V=0;gt>V;++V)m=p[V],m.vertexBuffer=a.createVertexBuffer(m.values,y.DYNAMIC_DRAW),delete m.values;if(vt.push(a.createVertexArrayFromGeometry({geometry:d,attributeLocations:mt,bufferUsage:y.STATIC_DRAW,interleave:this._interleave,vertexArrayAttributes:p})),this._boundingSpheres.push(e.clone(d.boundingSphere)),this._boundingSphereWC.push(new e),!$){var _t=d.boundingSphereCV.center,yt=_t.x,Ct=_t.y,wt=_t.z;_t.x=wt,_t.y=yt,_t.z=Ct,this._boundingSphereCV.push(e.clone(d.boundingSphereCV)),this._boundingSphere2D.push(new e),this._boundingSphereMorph.push(new e)}}this._va=vt,this._primitiveType=Z[0].primitiveType,this.releaseGeometryInstances&&(this.geometryInstances=void 0),this._geometries=void 0,U(this,s,T.COMPLETE,void 0)}if(this.show&&this._state===T.COMPLETE){var St=this.appearance,Et=St.material,bt=!1,xt=!1;this._appearance!==St?(this._appearance=St,this._material=Et,bt=!0,xt=!0):this._material!==Et&&(this._material=Et,xt=!0);var Tt=this._appearance.isTranslucent();this._translucent!==Tt&&(this._translucent=Tt,bt=!0),o(this._material)&&this._material.update(a);var Pt=St.closed&&Tt;if(bt){var At,Mt=St.getRenderState();Pt?(At=t(Mt,!1),At.cull={enabled:!0,face:E.BACK},this._frontFaceRS=a.createRenderState(At),At.cull.face=E.FRONT,this._backFaceRS=a.createRenderState(At)):(this._frontFaceRS=a.createRenderState(Mt),this._backFaceRS=this._frontFaceRS),Q?Pt?(At=t(Mt,!1),At.cull={enabled:!1},this._pickRS=a.createRenderState(At)):this._pickRS=this._frontFaceRS:(At=t(Mt,!1),At.colorMask={red:!1,green:!1,blue:!1,alpha:!1},Pt?(At.cull={enabled:!1},this._pickRS=a.createRenderState(At)):this._pickRS=a.createRenderState(At))}if(xt){var It=O(this,St.vertexShaderSource,$);It=L(this,It),It=N(this,It);var Dt=St.getFragmentShaderSource();if(this._sp=a.replaceShaderProgram(this._sp,It,Dt,mt),F(this._sp,mt),Q){var Ot=new w({sources:[Dt],pickColorQualifier:"varying"});this._pickSP=a.replaceShaderProgram(this._pickSP,R(It),Ot,mt)}else this._pickSP=a.createShaderProgram(It,Dt,mt);F(this._pickSP,mt)}var Rt=this._colorCommands,Lt=this._pickCommands;if(bt||xt){var Nt=o(Et)?Et._uniforms:void 0,Ft={},Bt=St.uniforms;if(o(Bt))for(var zt in Bt)if(Bt.hasOwnProperty(zt)){if(o(Nt)&&o(Nt[zt]))throw new l("Appearance and material have a uniform with the same name: "+zt);Ft[zt]=z(Bt,zt)}var Vt=r(Ft,Nt),kt=Tt?b.TRANSLUCENT:b.OPAQUE;Rt.length=this._va.length*(Pt?2:1),Lt.length=this._va.length,A=Rt.length;var Ut=0,Wt=0;for(I=0;A>I;++I)Pt&&(c=Rt[I],o(c)||(c=Rt[I]=new C({owner:this,primitiveType:this._primitiveType})),c.vertexArray=this._va[Wt],c.renderState=this._backFaceRS,c.shaderProgram=this._sp,c.uniformMap=Vt,c.pass=kt,++I),c=Rt[I],o(c)||(c=Rt[I]=new C({owner:this,primitiveType:this._primitiveType})),c.vertexArray=this._va[Wt],c.renderState=this._frontFaceRS,c.shaderProgram=this._sp,c.uniformMap=Vt,c.pass=kt,h=Lt[Ut],o(h)||(h=Lt[Ut]=new C({owner:this,primitiveType:this._primitiveType})),h.vertexArray=this._va[Wt],h.renderState=this._pickRS,h.shaderProgram=this._pickSP,h.uniformMap=Vt,h.pass=kt,++Ut,++Wt}if(this._dirtyAttributes.length>0){for(p=this._dirtyAttributes,A=p.length,I=0;A>I;++I){m=p[I];var Gt=m.value,Ht=m.indices,qt=Ht.length;for(V=0;qt>V;++V){k=Ht[V];for(var jt=k.offset,Yt=k.count,Xt=k.attribute,Zt=Xt.componentDatatype,Jt=Xt.componentsPerAttribute,Qt=i.createTypedArray(Zt,Yt*Jt),Kt=0;Yt>Kt;++Kt)Qt.set(Gt,Kt*Jt);var $t=jt*Jt*i.getSizeInBytes(Zt);Xt.vertexBuffer.copyFromArrayView(Qt,$t)}m.dirty=!1}p.length=0}var er=this.modelMatrix;if(!v.equals(er,this._modelMatrix))for(v.clone(er,this._modelMatrix),A=this._boundingSpheres.length,I=0;A>I;++I){var tr=this._boundingSpheres[I];o(tr)&&(this._boundingSphereWC[I]=e.transform(tr,er,this._boundingSphereWC[I]),$||(this._boundingSphere2D[I]=e.clone(this._boundingSphereCV[I],this._boundingSphere2D[I]),this._boundingSphere2D[I].center.x=0,this._boundingSphereMorph[I]=e.union(this._boundingSphereWC[I],this._boundingSphereCV[I])))}var rr;s.mode===P.SCENE3D?rr=this._boundingSphereWC:s.mode===P.COLUMBUS_VIEW?rr=this._boundingSphereCV:s.mode===P.SCENE2D&&o(this._boundingSphere2D)?rr=this._boundingSphere2D:o(this._boundingSphereMorph)&&(rr=this._boundingSphereMorph);var ir=s.passes;if(ir.render)for(A=Rt.length,I=0;A>I;++I){var nr=Pt?Math.floor(I/2):I;Rt[I].modelMatrix=er,Rt[I].boundingVolume=rr[nr],Rt[I].cull=this.cull,Rt[I].debugShowBoundingVolume=this.debugShowBoundingVolume,u.push(Rt[I])}if(ir.pick)for(A=Lt.length,I=0;A>I;++I)Lt[I].modelMatrix=er,Lt[I].boundingVolume=rr[I],Lt[I].cull=this.cull,u.push(Lt[I])}}}},W.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,s=0;n>s;++s){var l=(r+s)%n;if(e===i[l]){t=l;break}}if(-1===t)return void 0;var u=this._perInstanceAttributeCache[t];if(o(u))return u;var c=this._perInstanceAttributeLocations[t];u={};var h={},d=!1;for(var p in c)c.hasOwnProperty(p)&&(d=!0,h[p]={get:V(p,c)},"boundingSphere"!==p&&"boundingSphereCV"!==p&&(h[p].set=k(p,c,this._dirtyAttributes)));return d&&a(u,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=u,u},W.prototype.isDestroyed=function(){return!1},W.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)},W}),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 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}),r("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,r,i){"use strict";var n=function(r,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(r),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,n.modelMatrix,a),i.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(r),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,o.modelMatrix,a),i.DONE):t(n)&&!n.ready||t(o)&&!o.ready?i.PENDING:i.FAILED};return n}),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/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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";var w=new v(r.WHITE),S=new g(!0),E=new g(!0),b=new g(!1),x=new g(r.BLACK),T=new r,P=function(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0},A=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.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 P(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)};a(A,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),a(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&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}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new d(l&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t));if(this._materialProperty instanceof v){var p=r.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(t)),a=i.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})},A.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=C.getValueOrDefault(this._outlineColorProperty,e,r.BLACK);return new c({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(h.MINIMUM_VALUE),attributes:{show:new d(o&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),s(this)},A.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var r=this._entity.box;if(!o(r))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var i=r.fill,a=o(i)&&i.isConstant?i.getValue(h.MINIMUM_VALUE):!0,s=r.outline,l=o(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=r.dimensions,c=e.position,d=r.show;if(!o(u)||!o(c)||o(d)&&d.isConstant&&!d.getValue(h.MINIMUM_VALUE))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var f=n(r.material,w),g=f instanceof v;this._materialProperty=f,this._fillProperty=n(i,E),this._showProperty=n(d,S),this._showOutlineProperty=n(r.outline,b),this._outlineColorProperty=l?n(r.outlineColor,x):void 0;var _=r.outlineWidth;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&C.isConstant(e.orientation)&&u.isConstant&&C.isConstant(_)){var y=this._options;y.vertexFormat=g?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,y.dimensions=u.getValue(h.MINIMUM_VALUE,y.dimensions),this._outlineWidth=o(_)?_.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new M(e,this)};var M=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity)};return M.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 w=C.getValueOrClonedDefault(u.outlineColor,n,r.BLACK,T),S=C.getValueOrDefault(u.outlineWidth,n,1),E=1!==w.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:t.fromDimensions(h),modelMatrix:d,attributes:{color:i.fromColor(w)}}),appearance:new m({flat:!0,translucent:E,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},M.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},A}),r("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=new e(1,1),l=function(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.image=e.image,this.repeat=e.repeat};return i(l.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")}),l.prototype.getType=function(){return"Image"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.image=a.getValueOrUndefined(this._image,e),t.repeat=a.getValueOrClonedDefault(this._repeat,e,s,t.repeat),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._image,e._image)&&a.equals(this._repeat,e._repeat)},l}),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||t instanceof HTMLCanvasElement){var i=new n;return i.image=t,i}}function a(e,t){return i(e,t,o)}return a}),r("DataSources/BoxGraphics",["../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._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 r(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}),r("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,r,i){"use strict";var n=function(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new i,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 r=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,r&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),r("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=t.WHITE,u=t.BLACK,c=new e(2,2),h=function(e){e=r(e,r.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};return n(h.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")}),h.prototype.getType=function(){return"Checkerboard"},h.prototype.getValue=function(e,t){return i(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,l,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,u,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,c),t},h.prototype.equals=function(e){return this===e||e instanceof h&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},h}),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("DataSources/CorridorGraphics",["../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._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 r(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}),r("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function r(r,i){return e(r,i,t)}return r}),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._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")}),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}),r("DataSources/EllipseGraphics",["../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._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 r(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}),r("DataSources/EllipsoidGraphics",["../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._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 r(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}),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(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 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"),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}),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(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._uri=void 0,this._uriSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))};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.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.uri=this.uri,e):new a(this)},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","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";var s=function(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 r(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}),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(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._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))};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.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,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)},a}),r("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(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 o,this._fill=void 0,this._fillSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))};return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:s("show"),material:a("material"),positions:{get:function(){return i("PolygonGraphics.positions","PolygonGraphics.positions was deprecated in Cesium 1.6, use PolygonGraphics.hierarchy instead."),this.hierarchy},set:function(e){i("PolygonGraphics.positions","PolygonGraphics.positions was deprecated in Cesium 1.6, use PolygonGraphics.hierarchy instead."),this.hierarchy=e}},hierarchy:s("hierarchy"),height:s("height"),extrudedHeight:s("extrudedHeight"),granularity:s("granularity"),stRotation:s("stRotation"),fill:s("fill"),outline:s("outline"),outlineColor:s("outlineColor"),outlineWidth:s("outlineWidth"),perPositionHeight:s("perPositionHeight")}),l.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 l(this)},l.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)},l}),r("DataSources/PolylineGraphics",["../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._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 r(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}),r("DataSources/PolylineVolumeGraphics",["../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._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 r(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}),r("DataSources/RectangleGraphics",["../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._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 r(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}),r("DataSources/WallGraphics",["../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._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 r(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}),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","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./RectangleGraphics","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M){"use strict";function I(e){return new p(e)}function D(e){return f(e,void 0,I)}function O(e,t){return f(e,void 0,function(e){return e instanceof t?e:new t(e)})}function R(e,t){for(var r=e._children,i=r.length,n=0;i>n;n++){var o=r[n],a=o._show,s=!t&&a,l=t&&a;s!==l&&o._definitionChanged.raiseEvent(o,"isShowing",l,s)}e._definitionChanged.raiseEvent(e,"isShowing",t,!t)}var L=function(e){e=r(e,r.EMPTY_OBJECT);var n=e.id;i(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=r(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.parent=e.parent,this.merge(e)};n(L.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 r=this.isShowing;t!==r&&R(this,r),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!i(this._parent)||this._parent._show)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var r=this.isShowing;if(i(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,e._children.push(this);var o=this.isShowing;r!==o&&R(this,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:O("billboard",h),box:O("box",d),corridor:O("corridor",m),cylinder:O("cylinder",g),description:f("description"),ellipse:O("ellipse",_),ellipsoid:O("ellipsoid",y),label:O("label",C),model:O("model",w),orientation:f("orientation"),path:O("path",S),point:O("point",E),polygon:O("polygon",b),polyline:O("polyline",x),polylineVolume:O("polylineVolume",T),position:D("position"),rectangle:O("rectangle",A),viewFrom:f("viewFrom"),wall:O("wall",M)}),L.prototype.isAvailable=function(e){var t=this._availability;return!i(t)||t.contains(e)},L.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,v(e,!0))},L.prototype.removeProperty=function(e){this._propertyNames,this._propertyNames.push(e),delete this[e]},L.prototype.merge=function(e){this.name=r(this.name,e.name),this.availability=r(e.availability,this.availability);for(var t=this._propertyNames,n=i(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];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 N=new s,F=new e,B=new u;return L.prototype._getModelMatrix=function(e,t){var r=P.getValueOrUndefined(this._position,e,F);if(!i(r))return void 0;var n=P.getValueOrUndefined(this._orientation,e,B);return t=i(n)?l.fromRotationTranslation(s.fromQuaternion(n,N),r,t):c.eastNorthUpToFixedFrame(r,void 0,t)},L}),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={id:void 0},p=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 p.prototype.suspendEvents=function(){this._suspendCount++},p.prototype.resumeEvents=function(){this._suspendCount--,h(this)},p.collectionChangedEventCallback=void 0,i(p.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}}}),p.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})},p.prototype.add=function(e){e instanceof c||(e=new c(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.");return r.set(t,e),this._removedEntities,this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(p.prototype._onEntityDefinitionChanged,this),h(this),e},p.prototype.remove=function(e){return r(e)?this.removeById(e.id):!1},p.prototype.contains=function(e){return this._entities.get(e.id)===e},p.prototype.removeById=function(e){if(!r(e))return!1;var t=this._entities,i=t.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,i),this._changedEntities.remove(e)),this._entities.remove(e),i.definitionChanged.removeEventListener(p.prototype._onEntityDefinitionChanged,this),h(this),!0):!1},p.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(p.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),h(this)},p.prototype.getById=function(e){return this._entities.get(e)},p.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return r(t)||(d.id=e,t=new c(d),this.add(t)),t},p.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),h(this)},p}),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(f.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,v=m.length,g=e._collectionsCopy,_=g.length,y=e._composite,C=new a,w=e._eventHash;for(r=0;_>r;r++)for(h=g[r],h.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,e),n=h.values,d=h.id,c=n.length-1;c>-1;c--)i=n[c],u(e,w,d,i);for(r=v-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(f.prototype._onCollectionChanged,e),n=h.values,d=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,w,d,i);var S=C.getById(i.id);t(S)||(S=y.getById(i.id),t(S)?s(S):(p.id=i.id,S=new o(p)),C.add(S)),S.merge(i)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(r=0;r<E.length;r++)y.add(E[r]);y.resumeEvents()}}function h(e,t){var r=e.indexOf(t);return r}function d(e,t,r){var i=e._collections;if(t=n.clamp(t,0,i.length-1),r=n.clamp(r,0,i.length-1),t!==r){var o=i[t];i[t]=i[r],i[r]=o,c(e)}}var p={id:void 0},m=new Array(2),f=function(r){this._composite=new a,this._suspendCount=0,this._collections=t(r)?r.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1};return r(f.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}}}),f.prototype.addCollection=function(e,r){var i=t(r);i?this._collections.splice(r,0,e):(r=this._collections.length,this._collections.push(e)),c(this)},f.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t?(this._collections.splice(t,1),c(this),!0):!1},f.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},f.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},f.prototype.contains=function(e){return this._composite.contains(e)},f.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},f.prototype.getCollection=function(e){return this._collections[e]},f.prototype.getCollectionsLength=function(){return this._collections.length},f.prototype.raiseCollection=function(e){var t=h(this._collections,e);d(this,t,t+1)},f.prototype.lowerCollection=function(e){var t=h(this._collections,e);d(this,t,t-1)},f.prototype.raiseCollectionToTop=function(e){var t=h(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},f.prototype.lowerCollectionToBottom=function(e){var t=h(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},f.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},f.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},f.prototype.computeAvailability=function(){return this._composite.computeAvailability()},f.prototype.getById=function(e){return this._composite.getById(e)},f.prototype._onCollectionChanged=function(e,r,i){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var h,d,m,f,v=i.length,g=this._eventHash,_=e.id;for(h=0;v>h;h++){var y=i[h];u(this,g,_,y);var C=y.id;for(d=a-1;d>=0;d--)m=n[d].getById(C),t(m)&&(t(f)||(f=c.getById(C),s(f)),f.merge(m));t(f)||c.removeById(C),f=void 0}var w=r.length;for(h=0;w>h;h++){var S=r[h];l(this,g,_,S);var E=S.id;for(d=a-1;d>=0;d--)m=n[d].getById(E),t(m)&&(t(f)||(f=c.getById(E),t(f)?s(f):(p.id=E,f=new o(p),c.add(f))),f.merge(m));f=void 0}c.resumeEvents()},f.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 p=d[r];if(t(p)){if(c){if(c=!1,!t(p.merge)||!t(p.clone)){l=p;
break}l=p.clone(l)}l.merge(p)}}}u&&-1===s.propertyNames.indexOf(r)&&s.addProperty(r),s[r]=l},f}),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/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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";var w=new v(e.WHITE),S=new g(!0),E=new g(!0),b=new g(!1),x=new g(e.BLACK),T=new e,P=function(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},A=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new P(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)};a(A,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),a(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&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}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,a,s=this._entity,l=s.isAvailable(i),u=new d(l&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(i)),a=t.fromColor(h),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:new r(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(r){var n=this._entity,o=n.isAvailable(r),a=C.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);return new c({id:n,geometry:new i(this._options),attributes:{show:new d(o&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),s(this)},A.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"corridor"===t){var r=this._entity.corridor;if(!o(r))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var i=r.fill,a=o(i)&&i.isConstant?i.getValue(h.MINIMUM_VALUE):!0,s=r.outline,l=o(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=r.positions,c=r.show;if(o(c)&&c.isConstant&&!c.getValue(h.MINIMUM_VALUE)||!o(u))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=n(r.material,w),f=d instanceof v;this._materialProperty=d,this._fillProperty=n(i,E),this._showProperty=n(c,S),this._showOutlineProperty=n(r.outline,b),this._outlineColorProperty=l?n(r.outlineColor,x):void 0;var g=r.height,_=r.extrudedHeight,y=r.granularity,T=r.width,P=r.outlineWidth,A=r.cornerType;if(this._isClosed=o(_),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&C.isConstant(g)&&C.isConstant(_)&&C.isConstant(y)&&C.isConstant(T)&&C.isConstant(P)&&C.isConstant(A)){var M=this._options;M.vertexFormat=f?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,M.positions=u.getValue(h.MINIMUM_VALUE,M.positions),M.height=o(g)?g.getValue(h.MINIMUM_VALUE):void 0,M.extrudedHeight=o(_)?_.getValue(h.MINIMUM_VALUE):void 0,M.granularity=o(y)?y.getValue(h.MINIMUM_VALUE):void 0,M.width=o(T)?T.getValue(h.MINIMUM_VALUE):void 0,M.cornerType=o(A)?A.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=o(P)?P.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new M(e,this)};var M=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity)};return M.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 r(h)}),appearance:_,asynchronous:!1}))}if(o(u.outline)&&u.outline.getValue(n)){h.vertexFormat=m.VERTEX_FORMAT;var w=C.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,T),S=C.getValueOrDefault(u.outlineWidth,n,1),E=1!==w.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:new i(h),attributes:{color:t.fromColor(w)}}),appearance:new m({flat:!0,translucent:E,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},M.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},A}),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.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},r}),r("DataSources/CustomDataSource",["../Core/defineProperties","../Core/Event","./DataSource","./EntityCollection"],function(e,t,r,i){"use strict";var n=function(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 i};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){r.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),n}),r("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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w){"use strict";var S=new g(t.WHITE),E=new _(!0),b=new _(!0),x=new _(!1),T=new _(t.BLACK),P=new t,A=function(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},M=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(M.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 A(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)};s(M,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),s(M.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!a(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||!a(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}}}),M.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},M.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},M.prototype.createFillGeometryInstance=function(e){var n,o,s=this._entity,l=s.isAvailable(e),u=new p(l&&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=r.fromColor(c),n={show:u,color:o}}else n={show:u};return new h({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(d.MINIMUM_VALUE),attributes:n})},M.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,o=i.isAvailable(e),a=w.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:i,geometry:new n(this._options),modelMatrix:i._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new p(o&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a)}})},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entitySubscription(),l(this)},M.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var r=e.cylinder;if(!a(r))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var i=r.fill,n=a(i)&&i.isConstant?i.getValue(d.MINIMUM_VALUE):!0,s=r.outline,l=a(s);if(l&&s.isConstant&&(l=s.getValue(d.MINIMUM_VALUE)),!n&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=e.position,c=r.length,h=r.topRadius,p=r.bottomRadius,v=r.show;if(a(v)&&v.isConstant&&!v.getValue(d.MINIMUM_VALUE)||!a(u)||!a(c)||!a(h)||!a(p))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var _=o(r.material,S),y=_ instanceof g;this._materialProperty=_,this._fillProperty=o(i,b),this._showProperty=o(v,E),this._showOutlineProperty=o(r.outline,x),this._outlineColorProperty=l?o(r.outlineColor,T):void 0;var C=r.slices,P=r.outlineWidth,A=r.numberOfVerticalLines;if(this._fillEnabled=n,this._outlineEnabled=l,u.isConstant&&w.isConstant(e.orientation)&&c.isConstant&&h.isConstant&&p.isConstant&&w.isConstant(C)&&w.isConstant(P)&&w.isConstant(A)){var M=this._options;M.vertexFormat=y?f.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,M.length=c.getValue(d.MINIMUM_VALUE),M.topRadius=h.getValue(d.MINIMUM_VALUE),M.bottomRadius=p.getValue(d.MINIMUM_VALUE),M.slices=a(C)?C.getValue(d.MINIMUM_VALUE):void 0,M.numberOfVerticalLines=a(A)?A.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=a(P)?P.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},M.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 A(t._entity)};return I.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)&&w.getValueOrDefault(u.show,e,!0)){var c=this._options,d=l._getModelMatrix(e),p=w.getValueOrUndefined(u.length,e),g=w.getValueOrUndefined(u.topRadius,e),_=w.getValueOrUndefined(u.bottomRadius,e);if(a(d)&&a(p)&&a(g)&&a(_)){if(c.length=p,c.topRadius=g,c.bottomRadius=_,c.slices=w.getValueOrUndefined(u.slices,e),c.numberOfVerticalLines=w.getValueOrUndefined(u.numberOfVerticalLines,e),w.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 i(c),modelMatrix:d}),appearance:S,asynchronous:!1}))}if(w.getValueOrDefault(u.outline,e,!1)){c.vertexFormat=f.VERTEX_FORMAT;var E=w.getValueOrClonedDefault(u.outlineColor,e,t.BLACK,P),b=w.getValueOrDefault(u.outlineWidth,e,1),x=1!==E.alpha;this._outlinePrimitive=o.add(new v({geometryInstances:new h({id:l,geometry:new n(c),modelMatrix:d,attributes:{color:r.fromColor(E)}}),appearance:new f({flat:!0,translucent:x,renderState:{lineWidth:s._scene.clampLineWidth(b)}}),asynchronous:!1}))}}}},I.prototype.getBoundingSphere=function(e,t){return y(e,this._primitive,this._outlinePrimitive,t)},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),l(this)},M}),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","./createRawPropertyDescriptor"],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/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=t.WHITE,u=.1,c=new e(8,8),h=new e(0,0),d=new e(1,1),p=function(e){e=r(e,r.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};return n(p.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")}),p.prototype.getType=function(){return"Grid"},p.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,l,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,u),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,c,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,d,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,h,t.lineOffset),t},p.prototype.equals=function(e){return this===e||e instanceof p&&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)},p}),r("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=e.WHITE,l=.25,u=function(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};return i(u.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")}),u.prototype.getType=function(){return"PolylineGlow"},u.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,s,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,l,t.glowPower),t},u.prototype.equals=function(e){return this===e||e instanceof u&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},u}),r("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=e.WHITE,l=e.BLACK,u=1,c=function(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};return i(c.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")}),c.prototype.getType=function(){return"PolylineOutline"},c.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,s,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,l,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,u),t},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},c}),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/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;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(r=a,n=!1,a=""):n||"."!==u?a+=u:(i.push(a),a="")}return i.push(a),new l(e,r,i)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s(this).getValueInReferenceFrame(e,t,r)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,r=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==r.length)return!1;for(var i=this._targetPropertyNames.length,n=0;i>n;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=[],p=[],m=function(t,i,n,o,a){for(var l,h,m,f,v,g,_=0;_<o.length;){v=c(o[_],t),m=e(i,v,s.compare);var y=0,C=0;if(0>m){for(m=~m,f=m*a,h=void 0,g=i[m];_<o.length&&(v=c(o[_],t),!(r(h)&&s.compare(h,v)>=0||r(g)&&s.compare(v,g)>=0));){for(d[y++]=v,_+=1,l=0;a>l;l++)p[C++]=o[_],_+=1;h=v}y>0&&(p.length=C,u(n,f,p),d.length=y,u(i,m,d))}else{for(l=0;a>l;l++)_++,n[m*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 p=i.length;s=new Array(p);for(var m=0;p>m;m++){var f=i[m];f===Number&&(f=h);var v=f.packedLength;u+=v,c+=t(f.packedInterpolationLength,v),s[m]=f}d=p}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=this._times,o=n.length;if(0===o)return void 0;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 void 0;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,i)}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 void 0;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,i)}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 void 0;var w=0,S=o-1,E=S-w+1;if(C+1>E);else{var b=h-(0|C/2)-1;w>b&&(b=w);var x=b+C;x>S&&(x=S,b=x-C,w>b&&(b=w)),w=b,S=x}for(var T=S-w+1,P=0;T>P;++P)m[P]=s.secondsDifference(n[w+P],n[S]);if(r(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,w,S,f);else for(var A=0,M=this._packedLength,I=w*M,D=(S+1)*M;D>I;)f[A]=c[I],I++,A++;var O,R=s.secondsDifference(t,n[S]);if(0!==_&&r(v.interpolate)){var L=Math.floor(g/(_+1));O=v.interpolate(R,m,f,L,_,_,this._interpolationResult)}else O=v.interpolateOrderZero(R,m,f,g,this._interpolationResult);return r(u.unpackInterpolationResult)?u.unpackInterpolationResult(O,c,w,S,i):u.unpack(O,0,i)}return u.unpack(c,h*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);m(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);m(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.addSamplesPackedArray=function(e,t){m(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=m,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||e instanceof c&&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/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,r,i,n,o,a,s){"use strict";var l=s.HORIZONTAL,u=e.WHITE,c=e.BLACK,h=0,d=1,p=function(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};return i(p.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")}),p.prototype.getType=function(){return"Stripe"},p.prototype.getValue=function(e,t){return r(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,l)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,u,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,c,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,h),t.repeat=a.getValueOrDefault(this._repeat,e,d),t},p.prototype.equals=function(e){return this===e||e instanceof p&&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)},p}),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/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o){"use strict";var a=function(){this._definitionChanged=new i,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,r){var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)&&"function"==typeof i.clone?i.clone(r):i},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}),r("DataSources/CzmlDataSource",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../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","./DataSource","./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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,pt){"use strict";function mt(e,t){return"#"===t[0]&&(t=$t+t),at.fromString(e,t)}function ft(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 vt(e,t){var r=s(e.uri,e);if(l(t)){var i=new L(document.location.href);t=new L(t),r=new L(r).resolve(t.resolve(i)).toString()}return r}function gt(e){var t=e.wsenDegrees;if(l(t)){for(var r=t.length,i=0;r>i;i++)t[i]=E.toRadians(t[i]);return t}return e.wsen}function _t(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)tr.clock=o[0],tr.cone=o[1],t.fromSpherical(tr,er),n=[er.x,er.y,er.z];else{var a=0;for(n=new Array(4*(i/3)),r=0;i>r;r+=4)n[r]=o[a++],tr.clock=o[a++],tr.cone=o[a++],t.fromSpherical(tr,er),n[r+1]=er.x,n[r+2]=er.y,n[r+3]=er.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)rr.longitude=s[0],rr.latitude=s[1],rr.height=s[2],d.WGS84.cartographicToCartesian(rr,er),n=[er.x,er.y,er.z];else for(i=s.length,n=new Array(i),r=0;i>r;r+=4)rr.longitude=s[r+1],rr.latitude=s[r+2],rr.height=s[r+3],d.WGS84.cartographicToCartesian(rr,er),n[r]=s[r],n[r+1]=er.x,n[r+2]=er.y,n[r+3]=er.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new P(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)rr.longitude=E.toRadians(u[0]),rr.latitude=E.toRadians(u[1]),rr.height=u[2],d.WGS84.cartographicToCartesian(rr,er),n=[er.x,er.y,er.z];else for(i=u.length,n=new Array(i),r=0;i>r;r+=4)rr.longitude=E.toRadians(u[r+1]),rr.latitude=E.toRadians(u[r+2]),rr.height=u[r+3],d.WGS84.cartographicToCartesian(rr,er),n[r]=u[r],n[r+1]=er.x,n[r+2]=er.y,n[r+3]=er.z;return n}function yt(e,t){var r=e[t],i=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(r*r+i*i+n*n+o*o);e[t]=r*a,e[t+1]=i*a,e[t+2]=n*a,e[t+3]=o*a}function Ct(e){var t=e.unitQuaternion;if(l(t)){if(4===t.length)return yt(t,0),t;for(var r=1;r<t.length;r+=5)yt(t,r)}return t}function wt(r,i,n){switch(r){case Boolean:return s(i["boolean"],i);case e:return i.cartesian2;case t:return _t(i);case o:return ft(i);case ct:return ct[s(i.stripeOrientation,i)];case D:return D[s(i.horizontalOrigin,i)];case Image:return vt(i,n);case y:return y.fromIso8601(s(i.date,i));case O:return O[s(i.labelStyle,i)];case Number:return s(i.number,i);case String:return s(i.string,i);case Array:return i.array;case b:return Ct(i);case x:return gt(i);case L:return vt(i,n);case R:return R[s(i.verticalOrigin,i)];default:throw new P(r)}}function St(e,t){var r=e.interpolationAlgorithm;(l(r)||l(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:nr[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 Et(e,t,r,i,n,o,a){var u,c=i.interval;l(c)?(or.iso8601=c,u=M.fromIso8601(or),l(n)&&(u=M.intersect(u,n,ir))):l(n)&&(u=n);var h,d,p,m,f=l(i.reference),v=l(u)&&!u.equals(_.MAXIMUM_INTERVAL);if(f||(p=wt(e,i,o),h=s(e.packedLength,1),m=s(p.length,1),d=!l(i.array)&&"string"!=typeof p&&m>h),!d&&!v)return t[r]=f?mt(a,i.reference):l(e.unpack)?new W(e.unpack(p,0)):new W(p),void 0;var g,C=t[r],w=i.epoch;if(l(w)&&(g=y.fromIso8601(w)),d&&!v)return C instanceof lt||(C=new lt(e),t[r]=C),C.addSamplesPackedArray(p,g),St(i,C),void 0;var S;if(!d&&v)return u=u.clone(),u.data=f?mt(a,i.reference):l(e.unpack)?e.unpack(p,0):p,l(C)||(C=f?new k:new dt,t[r]=C),!f&&C instanceof dt?C.intervals.addInterval(u):C instanceof k?(u.data=f?u.data:new W(u.data),C.intervals.addInterval(u)):(S=_.MAXIMUM_INTERVAL.clone(),S.data=C,C=new k,t[r]=C,C.intervals.addInterval(S),u.data=f?u.data:new W(u.data),C.intervals.addInterval(u)),void 0;l(C)||(C=new k,t[r]=C),C instanceof k||(S=_.MAXIMUM_INTERVAL.clone(),S.data=C,C=new k,t[r]=C,C.intervals.addInterval(S));var E=C.intervals;S=E.findInterval(u),l(S)&&S.data instanceof lt||(S=u.clone(),S.data=new lt(e),E.addInterval(S)),S.data.addSamplesPackedArray(p,g),St(i,S.data)}function bt(e,t,r,i,n,o,a){if(l(i))if(g(i))for(var s=0,u=i.length;u>s;s++)Et(e,t,r,i[s],n,o,a);else Et(e,t,r,i,n,o,a)}function xt(e,r,i,n,o,a){var u,c=i.interval;l(c)?(or.iso8601=c,u=M.fromIso8601(or),l(n)&&(u=M.intersect(u,n,ir))):l(n)&&(u=n);var h,d,p,m=!1,f=l(i.cartesianVelocity)?1:0,v=t.packedLength*(f+1),g=l(i.reference),C=l(u)&&!u.equals(_.MAXIMUM_INTERVAL);if(g||(h=s(T[i.referenceFrame],void 0),d=_t(i),p=s(d.length,1),m=p>v),!m&&!C)return e[r]=g?mt(a,i.reference):new U(t.unpack(d),h),void 0;var w,S=e[r],E=i.epoch;if(l(E)&&(w=y.fromIso8601(E)),m&&!C)return(!(S instanceof st)||l(h)&&S.referenceFrame!==h)&&(S=new st(h,f),e[r]=S),S.addSamplesPackedArray(d,w),St(i,S),void 0;var b;if(!m&&C)return u=u.clone(),u.data=g?mt(a,i.reference):t.unpack(d),l(S)||(S=g?new V(h):new ht(h),e[r]=S),!g&&S instanceof ht&&l(h)&&S.referenceFrame===h?S.intervals.addInterval(u):S instanceof V?(u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)):(b=_.MAXIMUM_INTERVAL.clone(),b.data=S,S=new V(S.referenceFrame),e[r]=S,S.intervals.addInterval(b),u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)),void 0;l(S)?S instanceof V||(b=_.MAXIMUM_INTERVAL.clone(),b.data=S,S=new V(S.referenceFrame),e[r]=S,S.intervals.addInterval(b)):(S=new V(h),e[r]=S);var x=S.intervals;b=x.findInterval(u),l(b)&&b.data instanceof st&&(!l(h)||b.data.referenceFrame===h)||(b=u.clone(),b.data=new st(h,f),x.addInterval(b)),b.data.addSamplesPackedArray(d,w),St(i,b.data)}function Tt(e,t,r,i,n,o){if(l(r))if(g(r))for(var a=0,s=r.length;s>a;a++)xt(e,t,r[a],i,n,o);else xt(e,t,r,i,n,o)}function Pt(t,r,i,n,a,s){var u,c=i.interval;l(c)?(or.iso8601=c,u=M.fromIso8601(or),l(n)&&(u=M.intersect(u,n,ir))):l(n)&&(u=n);var h,d,p=t[r];if(l(u)){p instanceof z||(p=new z,t[r]=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(i.solidColor)?(h instanceof B||(h=new B),f=i.solidColor,bt(o,h,"color",f.color,void 0,void 0,s)):l(i.grid)?(h instanceof X||(h=new X),f=i.grid,bt(o,h,"color",f.color,void 0,a,s),bt(Number,h,"cellAlpha",f.cellAlpha,void 0,a,s),bt(e,h,"lineThickness",f.lineThickness,void 0,a,s),bt(e,h,"lineOffset",f.lineOffset,void 0,a,s),bt(e,h,"lineCount",f.lineCount,void 0,a,s)):l(i.image)?(h instanceof Z||(h=new Z),f=i.image,bt(Image,h,"image",f.image,void 0,a,s),bt(e,h,"repeat",f.repeat,void 0,a,s)):l(i.stripe)?(h instanceof ut||(h=new ut),f=i.stripe,bt(ct,h,"orientation",f.orientation,void 0,a,s),bt(o,h,"evenColor",f.evenColor,void 0,a,s),bt(o,h,"oddColor",f.oddColor,void 0,a,s),bt(Number,h,"offset",f.offset,void 0,a,s),bt(Number,h,"repeat",f.repeat,void 0,a,s)):l(i.polylineOutline)?(h instanceof it||(h=new it),f=i.polylineOutline,bt(o,h,"color",f.color,void 0,a,s),bt(o,h,"outlineColor",f.outlineColor,void 0,a,s),bt(Number,h,"outlineWidth",f.outlineWidth,void 0,a,s)):l(i.polylineGlow)&&(h instanceof tt||(h=new tt),f=i.polylineGlow,bt(o,h,"color",f.color,void 0,a,s),bt(Number,h,"glowPower",f.glowPower,void 0,a,s)),l(d)?d.data=h:t[r]=h}function At(e,t,r,i,n,o){if(l(r))if(g(r))for(var a=0,s=r.length;s>a;a++)Pt(e,t,r[a],i,n,o);else Pt(e,t,r,i,n,o)}function Mt(e,t){e.name=s(t.name,e.name)}function It(e,t,r,i){var n=t.description;l(n)&&bt(String,e,"description",n,void 0,i,r)}function Dt(e,t,r,i){var n=t.position;l(n)&&Tt(e,"position",n,void 0,i,r)}function Ot(e,r,i,n){var o=r.viewFrom;l(o)&&bt(t,e,"viewFrom",o,void 0,n,i)}function Rt(e,t,r,i){var n=t.orientation;l(n)&&bt(b,e,"orientation",n,void 0,i,r)}function Lt(e,r,i,n){var o,a,s=i.references;if(l(s)){var u=[];for(o=0,a=s.length;a>o;o++)u.push(mt(n,s[o]));var c=i.interval;if(l(c)){if(c=M.fromIso8601(c),!(e[r]instanceof V)){c.data=new nt(u);var h=new V;h.intervals.addInterval(c),e[r]=h}}else e[r]=new nt(u)}else{var p=[],m=i.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]));i.array=p}else if(m=i.cartographicRadians,l(m)){for(o=0,a=m.length;a>o;o+=3)rr.longitude=m[o],rr.latitude=m[o+1],rr.height=m[o+2],p.push(d.WGS84.cartographicToCartesian(rr));i.array=p}else if(m=i.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]));i.array=p}l(i.array)&&bt(Array,e,r,i,void 0,void 0,n)}}function Nt(e,t,r,i){if(l(r))if(g(r))for(var n=r.length,o=0;n>o;o++)Lt(e,t,r[o],i);else Lt(e,t,r,i)}function Ft(e,t){var r,i=t.availability;if(l(i)){var n;if(g(i))for(var o=i.length,a=0;o>a;a++)l(n)||(n=new I),or.iso8601=i[a],r=M.fromIso8601(or),n.addInterval(r);else or.iso8601=i,r=M.fromIso8601(or),n=new I,n.addInterval(r);e.availability=n}}function Bt(r,i,n,a){var s=i.billboard;if(l(s)){var u,c=s.interval;l(c)&&(or.iso8601=c,u=M.fromIso8601(or));var h=r.billboard;l(h)||(r.billboard=h=new F),bt(o,h,"color",s.color,u,a,n),bt(t,h,"eyeOffset",s.eyeOffset,u,a,n),bt(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),bt(Image,h,"image",s.image,u,a,n),bt(e,h,"pixelOffset",s.pixelOffset,u,a,n),bt(Number,h,"scale",s.scale,u,a,n),bt(Number,h,"rotation",s.rotation,u,a,n),bt(t,h,"alignedAxis",s.alignedAxis,u,a,n),bt(Boolean,h,"show",s.show,u,a,n),bt(R,h,"verticalOrigin",s.verticalOrigin,u,a,n)}}function zt(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 P("Cesium only supports CZML version 1.");t._version=r}}if(!l(t._version))throw new P("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;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 Vt(e,t,r,i){var n=t.ellipse;if(l(n)){var a,s=n.interval;l(s)&&(or.iso8601=s,a=M.fromIso8601(or));var u=e.ellipse;l(u)||(e.ellipse=u=new q),bt(Boolean,u,"show",n.show,a,i,r),bt(Number,u,"rotation",n.rotation,a,i,r),bt(Number,u,"semiMajorAxis",n.semiMajorAxis,a,i,r),bt(Number,u,"semiMinorAxis",n.semiMinorAxis,a,i,r),bt(Number,u,"height",n.height,a,i,r),bt(Number,u,"extrudedHeight",n.extrudedHeight,a,i,r),bt(Number,u,"granularity",n.granularity,a,i,r),bt(Number,u,"stRotation",n.stRotation,a,i,r),At(u,"material",n.material,a,i,r),bt(Boolean,u,"fill",n.fill,a,i,r),bt(Boolean,u,"outline",n.outline,a,i,r),bt(o,u,"outlineColor",n.outlineColor,a,i,r),bt(Number,u,"outlineWidth",n.outlineWidth,a,i,r),bt(Number,u,"numberOfVerticalLines",n.numberOfVerticalLines,a,i,r)}}function kt(e,r,i,n){var a=r.ellipsoid;if(l(a)){var s,u=a.interval;l(u)&&(or.iso8601=u,s=M.fromIso8601(or));var c=e.ellipsoid;l(c)||(e.ellipsoid=c=new j),bt(Boolean,c,"show",a.show,s,n,i),bt(t,c,"radii",a.radii,s,n,i),At(c,"material",a.material,s,n,i),bt(Boolean,c,"fill",a.fill,s,n,i),bt(Boolean,c,"outline",a.outline,s,n,i),bt(o,c,"outlineColor",a.outlineColor,s,n,i),bt(Number,c,"outlineWidth",a.outlineWidth,s,n,i)}}function Ut(r,i,n,a){var s=i.label;if(l(s)){var u,c=s.interval;l(c)&&(or.iso8601=c,u=M.fromIso8601(or));var h=r.label;l(h)||(r.label=h=new J),bt(o,h,"fillColor",s.fillColor,u,a,n),bt(o,h,"outlineColor",s.outlineColor,u,a,n),bt(Number,h,"outlineWidth",s.outlineWidth,u,a,n),bt(t,h,"eyeOffset",s.eyeOffset,u,a,n),bt(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),bt(String,h,"text",s.text,u,a,n),bt(e,h,"pixelOffset",s.pixelOffset,u,a,n),bt(Number,h,"scale",s.scale,u,a,n),bt(Boolean,h,"show",s.show,u,a,n),bt(R,h,"verticalOrigin",s.verticalOrigin,u,a,n),bt(String,h,"font",s.font,u,a,n),bt(O,h,"style",s.style,u,a,n)}}function Wt(e,t,r,i){var n=t.model;if(l(n)){var o,a=n.interval;l(a)&&(or.iso8601=a,o=M.fromIso8601(or));var s=e.model;l(s)||(e.model=s=new Q),bt(Boolean,s,"show",n.show,o,i,r),bt(Number,s,"scale",n.scale,o,i,r),bt(Number,s,"minimumPixelSize",n.minimumPixelSize,o,i,r),bt(L,s,"uri",n.gltf,o,i,r)}}function Gt(e,t,r,i){var n=t.path;if(l(n)){var o,a=n.interval;l(a)&&(or.iso8601=a,o=M.fromIso8601(or));var s=e.path;l(s)||(e.path=s=new K),bt(Boolean,s,"show",n.show,o,i,r),bt(Number,s,"width",n.width,o,i,r),bt(Number,s,"resolution",n.resolution,o,i,r),bt(Number,s,"leadTime",n.leadTime,o,i,r),bt(Number,s,"trailTime",n.trailTime,o,i,r),At(s,"material",n.material,o,i,r)}}function Ht(e,t,r,i){var n=t.point;if(l(n)){var a,s=n.interval;l(s)&&(or.iso8601=s,a=M.fromIso8601(or));var u=e.point;l(u)||(e.point=u=new $),bt(o,u,"color",n.color,a,i,r),bt(Number,u,"pixelSize",n.pixelSize,a,i,r),bt(o,u,"outlineColor",n.outlineColor,a,i,r),bt(Number,u,"outlineWidth",n.outlineWidth,a,i,r),bt(Boolean,u,"show",n.show,a,i,r)}}function qt(e,t,r,i){var n=t.polygon;if(l(n)){var a,s=n.interval;l(s)&&(or.iso8601=s,a=M.fromIso8601(or));var u=e.polygon;l(u)||(e.polygon=u=new et),bt(Boolean,u,"show",n.show,a,i,r),At(u,"material",n.material,a,i,r),bt(Number,u,"height",n.height,a,i,r),bt(Number,u,"extrudedHeight",n.extrudedHeight,a,i,r),bt(Number,u,"granularity",n.granularity,a,i,r),bt(Number,u,"stRotation",n.stRotation,a,i,r),bt(Boolean,u,"fill",n.fill,a,i,r),bt(Boolean,u,"outline",n.outline,a,i,r),bt(o,u,"outlineColor",n.outlineColor,a,i,r),bt(Number,u,"outlineWidth",n.outlineWidth,a,i,r),bt(Boolean,u,"perPositionHeight",n.perPositionHeight,a,i,r),Nt(u,"hierarchy",n.positions,r)}}function jt(e,t,r,i){var n=t.rectangle;if(l(n)){var a,s=n.interval;l(s)&&(or.iso8601=s,a=M.fromIso8601(or));var u=e.rectangle;l(u)||(e.rectangle=u=new ot),bt(Boolean,u,"show",n.show,a,i,r),bt(x,u,"coordinates",n.coordinates,a,i,r),At(u,"material",n.material,a,i,r),bt(Number,u,"height",n.height,a,i,r),bt(Number,u,"extrudedHeight",n.extrudedHeight,a,i,r),bt(Number,u,"granularity",n.granularity,a,i,r),bt(Number,u,"rotation",n.rotation,a,i,r),bt(Number,u,"stRotation",n.stRotation,a,i,r),bt(Boolean,u,"fill",n.fill,a,i,r),bt(Boolean,u,"outline",n.outline,a,i,r),bt(o,u,"outlineColor",n.outlineColor,a,i,r),bt(Number,u,"outlineWidth",n.outlineWidth,a,i,r),bt(Boolean,u,"closeBottom",n.closeBottom,a,i,r),bt(Boolean,u,"closeTop",n.closeTop,a,i,r)}}function Yt(e,t,r,i){var n=t.wall;if(l(n)){var a,s=n.interval;l(s)&&(or.iso8601=s,a=M.fromIso8601(or));var u=e.wall;l(u)||(e.wall=u=new pt),bt(Boolean,u,"show",n.show,a,i,r),At(u,"material",n.material,a,i,r),bt(Array,u,"minimumHeights",n.minimumHeights,a,i,r),bt(Array,u,"maximumHeights",n.maximumHeights,a,i,r),bt(Number,u,"granularity",n.granularity,a,i,r),bt(Boolean,u,"fill",n.fill,a,i,r),bt(Boolean,u,"outline",n.outline,a,i,r),bt(o,u,"outlineColor",n.outlineColor,a,i,r),bt(Number,u,"outlineWidth",n.outlineWidth,a,i,r),Nt(u,"positions",n.positions,r)}}function Xt(e,t,r,i){var n=t.polyline;if(l(n)){var o,a=n.interval;l(a)&&(or.iso8601=a,o=M.fromIso8601(or));var s=e.polyline;l(s)||(e.polyline=s=new rt),bt(Boolean,s,"show",n.show,o,i,r),bt(Number,s,"width",n.width,o,i,r),At(s,"material",n.material,o,i,r),bt(Boolean,s,"followSurface",n.followSurface,o,i,r),bt(Number,s,"granularity",n.granularity,o,i,r),Nt(s,"positions",n.positions,r)}}function Zt(e,t,r,i,n){var o=e.id;if(l(o)||(o=a()),$t=o,!l(n._version)&&"document"!==o)throw new P("The first CZML packet is required to be the document object.");if(e["delete"]===!0)t.removeById(o);else if("document"===o)zt(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)}$t=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(_.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=i.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=i.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),l(r.interval)){or.iso8601=r.interval;var d=M.fromIso8601(or);t.startTime=d.start,t.stopTime=d.stop}return l(r.currentTime)&&(t.currentTime=y.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 Qt(e,t,r,i){r=s(r,s.EMPTY_OBJECT);var n=t,o=r.sourceUri;return"string"==typeof t&&(n=S(t),o=s(o,t)),G.setLoading(e,!0),N(n,function(t){return Kt(e,t,o,i)}).otherwise(function(t){return G.setLoading(e,!1),e._error.raiseEvent(e,t),window.console.log(t),N.reject(t)})}function Kt(e,t,r,i){G.setLoading(e,!0);var n=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new ar,n.removeAll()),sr._processCzml(t,n,r,void 0,e);var o=Jt(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!l(e._name)&&l(r)&&(e._name=f(r),o=!0),G.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}var $t,er=new t,tr=new A,rr=new r,ir=new M,nr={HERMITE:v,LAGRANGE:C,LINEAR:w},or={iso8601:void 0},ar=function(){this.name=void 0,this.clock=void 0},sr=function(e){this._name=e,this._changed=new p,this._error=new p,this._isLoading=!1,this._loading=new p,this._clock=void 0,this._documentPacket=new ar,this._version=void 0,this._entityCollection=new Y};return sr.load=function(e,t){return(new sr).load(e,t)},u(sr.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}}}),sr.updaters=[Bt,Vt,kt,Ut,Wt,Mt,It,Gt,Ht,qt,Xt,jt,Dt,Ot,Yt,Rt,Ft],sr.prototype.process=function(e,t){return"string"==typeof t&&(t={sourceUri:t},c("CzmlDataSource.process.options","Passing a sourceUri string as the second paraameter to CzmlDataSource.process has been deprecated. Pass an options object instead.")),Qt(this,e,t,!1)},sr.prototype.load=function(e,t){return"string"==typeof t&&(t={sourceUri:t},c("CzmlDataSource.process.load","Passing a sourceUri string as the second paraameter to CzmlDataSource.load has been deprecated. Pass an options object instead.")),Qt(this,e,t,!0)},sr.prototype.processUrl=function(e){return c("CzmlDataSource.prototype.processUrl","CzmlDataSource.processUrl has been deprecated.  Use CzmlDataSource.process instead."),this.process(e)
},sr.prototype.loadUrl=function(e){return c("CzmlDataSource.prototype.loadUrl","CzmlDataSource.loadUrl has been deprecated.  Use CzmlDataSource.load instead."),this.load(e)},sr.processPacketData=bt,sr.processPositionPacketData=Tt,sr.processMaterialPacketData=At,sr._processCzml=function(e,t,r,i,n){if(i=l(i)?i:sr.updaters,g(e))for(var o=0,a=e.length;a>o;o++)Zt(e[o],t,i,r,n);else Zt(e,t,i,r,n)},sr}),r("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o};return r(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,r=this._dataSources;return a(e,function(e){return r===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.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},s.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()}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),i(this)},s}),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","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";var w=new v(e.WHITE),S=new g(!0),E=new g(!0),b=new g(!1),x=new g(e.BLACK),T=new e,P=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},A=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new P(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)};n(A,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(A.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)&&C.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)&&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}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,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})},A.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=C.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);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(o)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"position"===t||"ellipse"===t){var n=this._entity.ellipse;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,w),_=g instanceof v;this._materialProperty=g,this._fillProperty=r(o,E),this._showProperty=r(f,S),this._showOutlineProperty=r(n.outline,b),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var y=n.rotation,T=n.height,P=n.extrudedHeight,A=n.granularity,M=n.stRotation,I=n.outlineWidth,D=n.numberOfVerticalLines;if(this._isClosed=i(P),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&c.isConstant&&d.isConstant&&C.isConstant(y)&&C.isConstant(T)&&C.isConstant(P)&&C.isConstant(A)&&C.isConstant(M)&&C.isConstant(I)&&C.isConstant(D)){var O=this._options;O.vertexFormat=_?m.VERTEX_FORMAT:p.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(y)?y.getValue(h.MINIMUM_VALUE):void 0,O.height=i(T)?T.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(D)?D.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=i(I)?I.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new M(e,this)};var M=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity)};return M.prototype.update=function(r){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(r)&&C.getValueOrDefault(u.show,r,!0)){var h=this._options,d=C.getValueOrUndefined(a.position,r,h.center),v=C.getValueOrUndefined(u.semiMajorAxis,r),g=C.getValueOrUndefined(u.semiMinorAxis,r);if(i(d)&&i(v)&&i(g)){if(h.center=d,h.semiMajorAxis=v,h.semiMinorAxis=g,h.rotation=C.getValueOrUndefined(u.rotation,r),h.height=C.getValueOrUndefined(u.height,r),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,r),h.granularity=C.getValueOrUndefined(u.granularity,r),h.stRotation=C.getValueOrUndefined(u.stRotation,r),h.numberOfVerticalLines=C.getValueOrUndefined(u.numberOfVerticalLines,r),C.getValueOrDefault(u.fill,r,!0)){var _=y.getValue(r,o.fillMaterialProperty,this._material);this._material=_;var w=new p({material:_,translucent:_.isTranslucent(),closed:i(h.extrudedHeight)});h.vertexFormat=w.vertexFormat,this._primitive=n.add(new f({geometryInstances:new c({id:a,geometry:new s(h)}),appearance:w,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,r,!1)){h.vertexFormat=m.VERTEX_FORMAT;var S=C.getValueOrClonedDefault(u.outlineColor,r,e.BLACK,T),E=C.getValueOrDefault(u.outlineWidth,r,1),b=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:b,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},M.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),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/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E){"use strict";var b=new y(t.WHITE),x=new C(!0),T=new C(!0),P=new C(!1),A=new C(t.BLACK),M=new e,I=new t,D=new e(1,1,1),O=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},R=function(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(R.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 O(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)};o(R,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),o(R.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}}}),R.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},R.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},R.prototype.createFillGeometryInstance=function(e){var i,o,a=this._entity,s=a.isAvailable(e),u=new m(s&&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=r.fromColor(c),i={show:u,color:o}}else i={show:u};return new h({id:a,geometry:new l(this._options),modelMatrix:a._getModelMatrix(d.MINIMUM_VALUE),attributes:i})},R.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),o=E.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:i,geometry:new u(this._options),modelMatrix:i._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new m(n&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(o)}})},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){this._entitySubscription(),a(this)},R.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var r=e.ellipsoid;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=e.position,c=r.radii,h=r.show;if(n(h)&&h.isConstant&&!h.getValue(d.MINIMUM_VALUE)||!n(u)||!n(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var p=i(r.material,b),m=p instanceof y;this._materialProperty=p,this._fillProperty=i(o,T),this._showProperty=i(h,x),this._showOutlineProperty=i(r.outline,P),this._outlineColorProperty=l?i(r.outlineColor,A):void 0,this._fillEnabled=a,this._outlineEnabled=l;var g=r.stackPartitions,_=r.slicePartitions,C=r.outlineWidth,w=r.subdivisions;if(u.isConstant&&E.isConstant(e.orientation)&&c.isConstant&&E.isConstant(g)&&E.isConstant(_)&&E.isConstant(C)&&E.isConstant(w)){var S=this._options;S.vertexFormat=m?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,S.radii=c.getValue(d.MINIMUM_VALUE,S.radii),S.stackPartitions=n(g)?g.getValue(d.MINIMUM_VALUE):void 0,S.slicePartitions=n(_)?_.getValue(d.MINIMUM_VALUE):void 0,S.subdivisions=n(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=n(C)?C.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},R.prototype.createDynamicUpdater=function(e){return new L(e,this)};var L=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 O(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};return L.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!E.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1),void 0;var s=E.getValueOrUndefined(a.radii,e,M),c=o._getModelMatrix(e,this._modelMatrix);if(!n(c)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1),void 0;var d,y=E.getValueOrDefault(a.fill,e,!0),C=E.getValueOrDefault(a.outline,e,!1),w=E.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,I),x=S.getValue(e,i(a.material,b),this._material);this._material=x;var T=E.getValueOrUndefined(a.stackPartitions,e),P=E.getValueOrUndefined(a.slicePartitions,e),A=E.getValueOrUndefined(a.subdivisions,e),O=E.getValueOrDefault(a.outlineWidth,e,1),R=this._scene.mode,L=R===_.SCENE3D,N=this._options,F=!L||this._lastSceneMode!==R||!n(this._primitive)||N.stackPartitions!==T||N.slicePartitions!==P||N.subdivisions!==A||this._lastOutlineWidth!==O;if(F){var B=this._primitives;B.removeAndDestroy(this._primitive),B.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=O,N.stackPartitions=T,N.slicePartitions=P,N.subdivisions=A,N.radii=L?D:s,d=new f({material:x,translucent:x.isTranslucent(),closed:!0}),N.vertexFormat=d.vertexFormat,this._primitive=B.add(new g({geometryInstances:new h({id:o,geometry:new l(N),modelMatrix:L?void 0:c,attributes:{show:new m(y)}}),appearance:d,asynchronous:!1})),N.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=B.add(new g({geometryInstances:new h({id:o,geometry:new u(N),modelMatrix:L?void 0:c,attributes:{show:new m(C),color:r.fromColor(w)}}),appearance:new v({flat:!0,translucent:1!==w.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(O)}}),asynchronous:!1})),this._lastShow=y,this._lastOutlineShow=C,this._lastOutlineColor=t.clone(w,this._lastOutlineColor)}else if(this._primitive.ready){var z=this._primitive,V=this._outlinePrimitive;z.show=!0,V.show=!0,d=z.appearance,d.material=x;var k=this._attributes;n(k)||(k=z.getGeometryInstanceAttributes(o),this._attributes=k),y!==this._lastShow&&(k.show=m.toValue(y,k.show),this._lastShow=y);var U=this._outlineAttributes;n(U)||(U=V.getGeometryInstanceAttributes(o),this._outlineAttributes=U),C!==this._lastOutlineShow&&(U.show=m.toValue(C,U.show),this._lastOutlineShow=C),t.equals(w,this._lastOutlineColor)||(U.color=r.toValue(w,U.color),t.clone(w,this._lastOutlineColor))}L&&(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)},L.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},R}),r("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState"],function(e,t,r,i,n,o,a){"use strict";var s=new t,l=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.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]};l.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,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 r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}},l.prototype.update=function(e){var a=!0,l=0,u=this.primitive,c=this.primitives;if(this.createPrimitive){i(u)&&(i(this.oldPrimitive)?c.remove(u):this.oldPrimitive=u),this.attributes.removeAll();var h=this.geometry.values;h.length>0&&(u=new o({asynchronous:!0,geometryInstances:h,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),c.add(u),a=!1),this.primitive=u,this.createPrimitive=!1}else if(i(u)&&u.ready){i(this.oldPrimitive)&&(c.remove(this.oldPrimitive),this.oldPrimitive=void 0);for(var d=this.updatersWithAttributes.values,p=d.length,m=0;p>m;m++){var f=d[m],v=this.geometry.get(f.entity.id),g=this.attributes.get(v.id.id);if(i(g)||(g=u.getGeometryInstanceAttributes(v.id),this.attributes.set(v.id.id,g)),!f.fillMaterialProperty.isConstant){var _=f.fillMaterialProperty.color;_.getValue(e,s),t.equals(g._lastColor,s)||(g._lastColor=t.clone(s,g._lastColor),g.color=r.toValue(s,g.color),(this.translucent&&255===g.color[3]||!this.translucent&&255!==g.color[3])&&(this.itemsToRemove[l++]=f))}var y=f.entity.isShowing&&(f.hasConstantFill||f.isFilled(e)),C=1===g.show[0];y!==C&&(g.show=n.toValue(y,g.show))}this.updateShows(u)}else i(u)&&!u.ready&&(a=!1);return this.itemsToRemove.length=l,a},l.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,o=0;r>o;o++){var a=t[o],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=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 r=this.primitive;if(!r.ready)return a.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(t),a.DONE)},l.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)};var u=function(e,t,r){this._solidBatch=new l(e,!1,t,r),this._translucentBatch=new l(e,!0,t,r)};return u.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)},u.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},u.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},u.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},u.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},u}),r("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty"],function(e,t,r,i,n,o){"use strict";var a=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(a.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e};a.prototype.onMaterialChanged=function(){this.invalidated=!0},a.prototype.isMaterial=function(e){var r=this.materialProperty,i=e.fillMaterialProperty;return i===r?!0:t(r)?r.equals(i):!1},a.prototype.add=function(e,t){var r=t.entity.id;if(this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant){var i=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener(function(e,r){"isShowing"===r&&i.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},a.prototype.remove=function(e){var r=e.entity.id,i=this.updaters.remove(r);if(i){this.geometry.remove(r),this.updatersWithAttributes.remove(r);var n=this.subscriptions.get(r);t(n)&&(n(),this.subscriptions.remove(r))}return this.createPrimitive=i,i},a.prototype.update=function(e){var n=!0,a=this.primitive,s=this.primitives,l=this.geometry.values;if(this.createPrimitive)t(a)&&(t(this.oldPrimitive)?s.remove(a):this.oldPrimitive=a),l.length>0&&(this.material=o.getValue(e,this.materialProperty,this.material),a=new i({asynchronous:!0,geometryInstances:l,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed})}),s.add(a),n=!1),this.primitive=a,this.createPrimitive=!1;else if(t(a)&&a.ready){t(this.oldPrimitive)&&(s.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;for(var u=this.updatersWithAttributes.values,c=u.length,h=0;c>h;h++){var d=u[h],p=d.entity,m=this.geometry.get(p.id),f=this.attributes.get(m.id.id);t(f)||(f=a.getGeometryInstanceAttributes(m.id),this.attributes.set(m.id.id,f));var v=p.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=1===f.show[0];v!==g&&(f.show=r.toValue(v,f.show))}this.updateShows(a)}else t(a)&&!a.ready&&(n=!1);return n},a.prototype.updateShows=function(e){for(var i=this.showsUpdated.values,n=i.length,o=0;n>o;o++){var a=i[o],s=a.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);t(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,h=1===u.show[0];c!==h&&(u.show=r.toValue(c,u.show))}this.showsUpdated.removeAll()},a.prototype.contains=function(e){return this.updaters.contains(e.id)},a.prototype.getBoundingSphere=function(e,r){var i=this.primitive;if(!i.ready)return n.PENDING;var o=i.getGeometryInstanceAttributes(e);return!t(o)||!t(o.boundingSphere)||t(o.show)&&0===o.show[0]?n.FAILED:(o.boundingSphere.clone(r),n.DONE)},a.prototype.destroy=function(){var e=this.primitive,r=this.primitives;t(e)&&r.remove(e);var i=this.oldPrimitive;t(i)&&r.remove(i),this.removeMaterialSubscription()};var s=function(e,t,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=r};return s.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;i>n;n++){var o=r[n];if(o.isMaterial(t))return o.add(e,t),void 0}var s=new a(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);s.add(e,t),r.push(s)},s.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}}},s.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},s.prototype.getBoundingSphere=function(e,t){for(var r=this._items,i=r.length,o=0;i>o;o++){var a=r[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,r=0;t>r;r++)e[r].destroy();this._items.length=0},s}),r("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState"],function(e,t,r,i,n,o,a,s){"use strict";var l=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,this.subscriptions=new e,this.showsUpdated=new e};l.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,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 r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}};var u=new t;l.prototype.update=function(e){var s=!0,l=0,c=this.primitive,h=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),i(c)&&(i(this.oldPrimitive)?h.remove(c):this.oldPrimitive=c);var d=this.geometry.values;d.length>0&&(c=new a({asynchronous:!0,geometryInstances:d,appearance:new o({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}})}),h.add(c),s=!1),this.primitive=c,this.createPrimitive=!1}else if(i(c)&&c.ready){i(this.oldPrimitive)&&(h.remove(this.oldPrimitive),this.oldPrimitive=void 0);for(var p=this.updatersWithAttributes.values,m=p.length,f=0;m>f;f++){var v=p[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.outlineColorProperty.isConstant){var y=v.outlineColorProperty;y.getValue(e,u),t.equals(_._lastColor,u)||(_._lastColor=t.clone(u,_._lastColor),_.color=r.toValue(u,_.color),(this.translucent&&255===_.color[3]||!this.translucent&&255!==_.color[3])&&(this.itemsToRemove[l++]=v))}var C=v.entity.isShowing&&(v.hasConstantOutline||v.isOutlineVisible(e)),w=1===_.show[0];C!==w&&(_.show=n.toValue(C,_.show))}this.updateShows(c)}else i(c)&&!c.ready&&(s=!1);return this.itemsToRemove.length=l,s},l.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,o=0;r>o;o++){var a=t[o],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=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 r=this.primitive;if(!r.ready)return s.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(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;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)};var c=function(t,r){this._primitives=t,this._scene=r,this._solidBatches=new e,this._translucentBatches=new e};return c.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 l(this._primitives,!1,a),r.set(a,n)),n.add(t,o)):(r=this._translucentBatches,n=r.get(a),i(n)||(n=new l(this._primitives,!0,a),r.set(a,n)),n.add(t,o))},c.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[t].remove(e))return},c.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 p=o.length;if(p>0)for(h=!0,t=0;p>t;t++)i=o[t],n.remove(i),this.add(e,i)}}while(h);return c},c.prototype.getBoundingSphere=function(e,t){var r,i=this._solidBatches.values,n=i.length;for(r=0;n>r;r++){var o=i[r];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,l=a.length;for(r=0;l>r;r++){var u=a[r];if(u.contains(e))return u.getBoundingSphere(e,t)}return s.FAILED},c.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()},c}),r("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){for(var r=e._batches,i=r.length,n=0;i>n;n++)r[n].remove(t)}function h(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 a?e._closedColorBatch.add(t,r):e._closedMaterialBatch.add(t,r):r.fillMaterialProperty instanceof a?e._openColorBatch.add(t,r):e._openMaterialBatch.add(t,r)),void 0)}var d=[],p=function(t){this._primitives=t,this._dynamicUpdaters=new e};p.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives))},p.prototype.remove=function(e){var t=e.entity.id,i=this._dynamicUpdaters.get(t);r(i)&&(this._dynamicUpdaters.remove(t),i.destroy())},p.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;i>r;r++)t[r].update(e);return!0},p.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;r>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},p.prototype.getBoundingSphere=function(e,t){var i=this._dynamicUpdaters.get(e.id);return r(i)&&r(i.getBoundingSphere)?i.getBoundingSphere(e,t):o.FAILED};var m=function(t,r,i){this._type=t;var n=r.primitives;this._scene=r,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new u(n,r),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 p(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=i,i.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._onCollectionChanged(i,i.values,d)};m.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,d=u.values;for(t=d.length-1;t>-1;t--)r=d[t],i=r.id,n=this._updaters.get(i),n.entity===r?(c(this,n),h(this,e,n)):(l.push(r),a.push(r));for(t=l.length-1;t>-1;t--)r=l[t],i=r.id,n=this._updaters.get(i),c(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._updaters.set(i,n),h(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var p=!0,f=this._batches,v=f.length;for(t=0;v>t;t++)p=f[t].update(e)&&p;return p};var f=[],v=new t;return m.prototype.getBoundingSphere=function(e,r){for(var i=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&&(i[a]=t.clone(n,i[a]),a++)}return 0===a?o.FAILED:(i.length=a,t.fromBoundingSpheres(i,r),o.DONE)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,r=t.length;for(e=0;r>e;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(r=n.length,e=0;r>e;e++)n[e]();return this._subscriptions.removeAll(),i(this)},m._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,n=e.entity,o=n.id;r(t.get(o))||r(i.get(o))||i.set(o,n)},m.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)},m}),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 p(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}var m=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(m.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,p(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)}p(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)}p(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)}}}}}),m.prototype.computeScreenSpacePosition=function(t,r){n(r)||(r=new e);var i=this._labelCollection,o=i.modelMatrix,a=l._computeActualPosition(this._position,t.frameState,o),s=l._computeScreenSpacePosition(o,a,this._eyeOffset,this._pixelOffset,t,r);return s.y=t.canvas.clientHeight-s.y,s},m.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},m.prototype.isDestroyed=function(){return!1},m}),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,p){"use strict";function m(){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===p.BOTTOM?"bottom":a===p.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),p=t._font,y=t._fillColor,C=t._outlineColor,w=t._outlineWidth,S=t._style,E=t._verticalOrigin,b=JSON.stringify([d,p,y.toRgba(),C.toRgba(),w,+S,+E]),x=h[b];if(!r(x)){var T=v(d,p,y,C,w,S,E);x=new f(e,-1,T.dimensions),h[b]=x,T.width>0&&T.height>0&&_(e._textureAtlas,b,T,x)}if(i=l[o],r(i)?-1===x.index?g(e,i):r(i.textureInfo)&&(i.textureInfo=void 0):(i=new m,l[o]=i),i.textureInfo=x,i.dimensions=x.dimensions,-1!==x.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.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),E.x=m*t,E.y=0;var f=e._verticalOrigin;for(l=0;c>l;++l)i=o[l],n=i.dimensions,f===p.BOTTOM||n.height===s?E.y=-n.descent*h:f===p.TOP?E.y=-(s-n.height)*h-n.descent*h:f===p.CENTER&&(E.y=-(s-n.height)/2*h-n.descent*h),E.y*=t,r(i.billboard)&&i.billboard._setTranslate(E),E.x+=n.computedWidth*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 p=h._glyphs.length;h._rebindAllGlyphs&&(y(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(C(h,a),h._repositionAllGlyphs=!1);var m=h._glyphs.length-p;this._totalGlyphCount+=m}}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/NearFarScalar","../Scene/HorizontalOrigin","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p){"use strict";function m(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 f=1,v="30px sans-serif",g=c.FILL,_=i.WHITE,y=i.BLACK,C=1,w=t.ZERO,S=r.ZERO,E=l.CENTER,b=h.CENTER,x=new r,T=new i,P=new i,A=new r,M=new t,I=new s,D=new s,O=function(e){this.entity=e,this.label=void 0,this.index=void 0},R=function(t,r){r.collectionChanged.addEventListener(R.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._labelCollection=void 0,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])};return R.prototype.update=function(e){for(var t=this._items.values,r=this._unusedIndexes,i=0,o=t.length;o>i;i++){var a,s=t[i],l=s.entity,c=l._label,h=s.label,d=l.isShowing&&l.isAvailable(e)&&p.getValueOrDefault(c._show,e,!0);if(d&&(x=p.getValueOrUndefined(l._position,e,x),a=p.getValueOrUndefined(c._text,e),d=n(x)&&n(a)),d){if(!n(h)){var O=this._labelCollection;n(O)||(O=new u,this._labelCollection=O,this._scene.primitives.add(O));var R=r.length;if(R>0){var L=r.pop();s.index=L,h=O.get(L)}else h=O.add(),s.index=O.length-1;h.id=l,s.label=h}h.show=!0,h.position=x,h.text=a,h.scale=p.getValueOrDefault(c._scale,e,f),h.font=p.getValueOrDefault(c._font,e,v),h.style=p.getValueOrDefault(c._style,e,g),h.fillColor=p.getValueOrDefault(c._fillColor,e,_,T),h.outlineColor=p.getValueOrDefault(c._outlineColor,e,y,P),h.outlineWidth=p.getValueOrDefault(c._outlineWidth,e,C),h.pixelOffset=p.getValueOrDefault(c._pixelOffset,e,w,M),h.eyeOffset=p.getValueOrDefault(c._eyeOffset,e,S,A),h.horizontalOrigin=p.getValueOrDefault(c._horizontalOrigin,e,E),h.verticalOrigin=p.getValueOrDefault(c._verticalOrigin,e,b),h.translucencyByDistance=p.getValueOrUndefined(c._translucencyByDistance,e,I),h.pixelOffsetScaleByDistance=p.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,D)}else m(s,r)}return!0},R.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);return n(i)&&n(i.label)?(t.center=r.clone(i.label.position,t.center),t.radius=0,d.DONE):d.FAILED},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(R.prototype._onCollectionChanged,this),n(this._labelCollection)&&this._scene.primitives.remove(this._labelCollection),o(this)},R.prototype._onCollectionChanged=function(e,t,r,i){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 O(a));for(o=i.length-1;o>-1;o--)a=i[o],n(a._label)&&n(a._position)?l.contains(a.id)||l.set(a.id,new O(a)):(m(l.get(a.id),s),l.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],m(l.get(a.id),s),l.remove(a.id)},R}),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={});var i=r.asset;t(i.profile)&&"string"!=typeof i.profile||(i.profile={});var n=i.profile;i.premultipliedAlpha=e(r.asset.premultipliedAlpha,!1),n.api=e(n.api,"WebGL"),n.version=e(n.version,"1.0.2"),i.version=e(r.version,"0.9")}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={});var c=e(u.primitive,WebGLRenderingContext.TRIANGLES);u.mode=e(u.mode,c)}}}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 p(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 m(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(e){return t(e)?(t(e.allExtensions)||(e.allExtensions=[]),r(e),i(e),n(e),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),y(e),C(e),e):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/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","./getModelAccessor"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r){var i=e.gltf,n=i.buffers,o=i.bufferViews,a=o[r.bufferView],l=n[a.buffer],u=a.byteOffset+r.byteOffset,c=r.count*s(r).componentsPerAttribute;return e.cacheKey+"//"+t(l.path,"")+"/"+u+"/"+c}function u(e,t,r){return e.cacheKey+"//"+t+"/"+r}var c=function(){},h={},d=new e;c.getAnimationParameterValues=function(t,i){var n=l(t,i),a=h[n];if(!r(a)){var u,c=t._loadResources.buffers,p=t.gltf,m=p.bufferViews,f=m[i.bufferView],v=i.componentType,g=i.type,_=i.count,y=s(i).createArrayBufferView(c[f.buffer],f.byteOffset+i.byteOffset,_);if(v===WebGLRenderingContext.FLOAT&&"SCALAR"===g)a=y;else if(v===WebGLRenderingContext.FLOAT&&"VEC3"===g)for(a=new Array(_),u=0;_>u;++u)a[u]=e.fromArray(y,3*u);else if(v===WebGLRenderingContext.FLOAT&&"VEC4"===g)for(a=new Array(_),u=0;_>u;++u){var C=4*u;a[u]=o.fromAxisAngle(e.fromArray(y,C,d),y[C+3])}r(t.cacheKey)&&(h[n]=a)}return a};var p={},m=function(e){this._value=e};m.prototype.evaluate=function(){return this._value},c.getAnimationSpline=function(e,t,n,o,s,l){var c=u(e,t,o),h=p[c];if(!r(h)){var d=l[s.input],f=e.gltf.accessors[n.parameters[s.output]],v=l[s.output];if(1===d.length&&1===v.length)h=new m(v[0]);else{var g=f.componentType,_=f.type;"LINEAR"===s.interpolation&&(g===WebGLRenderingContext.FLOAT&&"VEC3"===_?h=new i({times:d,points:v}):g===WebGLRenderingContext.FLOAT&&"VEC4"===_&&(h=new a({times:d,points:v})))}r(e.cacheKey)&&(p[c]=h)}return h};var f={};return c.getSkinInverseBindMatrices=function(e,t){var i=l(e,t),o=f[i];if(!r(o)){var a=e._loadResources.buffers,u=e.gltf,c=u.bufferViews,h=c[t.bufferView],d=t.componentType,p=t.type,m=t.count,v=s(t).createArrayBufferView(a[h.buffer],h.byteOffset+t.byteOffset,m);if(o=new Array(m),d===WebGLRenderingContext.FLOAT&&"MAT4"===p)for(var g=0;m>g;++g)o[g]=n.fromArray(v,16*g);f[i]=o}return o},c}),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","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o){"use strict";var a=function(t,a,s){this._name=t.name,this._startTime=i.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 r,this.update=new r,this.stop=new r,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}),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 p=function(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0};i(p.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),p.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},p.prototype.addAll=function(r){r=t(r,t.EMPTY_OBJECT),r=e(r);for(var i=[],n=this._model._animationIds,o=n.length,a=0;o>a;++a)r.name=n[a],i.push(this.add(r));return i},p.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},p.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])},p.prototype.contains=function(e){return r(e)?-1!==this._scheduledAnimations.indexOf(e):!1},p.prototype.get=function(e){return this._scheduledAnimations[e]};var m=[];return p.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,p=l.length,f=0;p>f;++f){var v=l[f],g=v._runtimeAnimation;r(v._computedStartTime)||(v._computedStartTime=a.addSeconds(t(v.startTime,n),v.delay,new a)),r(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._computedStartTime,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),x=w-b;w=1===b%2?1-x:x}v.reverse&&(w=1-w);var T=w*y*v.speedup;T=s.clamp(T,g.startTime,g.stopTime),h(g,T),v.update.numberOfListeners>0&&(v._updateEventTime=T,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&&m.push(v))}p=m.length;for(var P=0;p>P;++P){var A=m[P];l.splice(l.indexOf(A),1),e.afterRender.push(d(this,o,A))}return m.length=0,i},p}),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._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(e,t,i,n,o){this._model=e,this._runtimeNode=i,this._name=t.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=r.clone(o)};return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=r.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),i.prototype.setMatrix=function(e){r.clone(e,this._matrix)},i}),r("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/clone","../Core/combine","../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","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/ShaderSource","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./getModelAccessor","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./ModelMesh","./ModelNode","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B,z,V){"use strict";
function k(){this.buffersToCreate=new S,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new S,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new S,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 U(e){var t=[];if(s(e)&&s(e.gltf)){var r=e.gltf.animations;for(var i in r)r.hasOwnProperty(i)&&t.push(i)}return t}function W(e,t){e._cachedGltf=t,e._animationIds=U(t)}function G(e,t,r){return e._runtime[t][r]}function H(t){for(var i=t.nodes,n=t.meshes,o=t.accessors,l=t.scenes[t.scene].nodes,u=l.length,c=[],h=new r(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new r(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),p=0;u>p;++p){var m=i[l[p]];for(m._transformToRoot=et(m),c.push(m);c.length>0;){m=c.pop();var f=m._transformToRoot,v=a(m.meshes,s(m.instanceSkin)?m.instanceSkin.meshes:void 0);if(s(v))for(var g=v.length,_=0;g>_;++_)for(var C=n[v[_]].primitives,w=C.length,S=0;w>S;++S){var E=C[S].attributes.POSITION;if(s(E)){var b=o[E],x=r.fromArray(b.min,0,er),T=r.fromArray(b.max,0,tr);s(h)&&s(d)&&(y.multiplyByPoint(f,x,x),y.multiplyByPoint(f,T,T),r.minimumByComponent(h,x,h),r.maximumByComponent(d,T,d))}}for(var P=m.children,A=P.length,M=0;A>M;++M){var I=i[P[M]];I._transformToRoot=et(I),y.multiplyTransformation(f,I._transformToRoot,I._transformToRoot),c.push(I)}delete m._transformToRoot}}var D=e.fromCornerPoints(h,d);return e.transformWithoutScale(D,Xt,D)}function q(e,t,r){return function(){e._loadError=new E("Failed to load external "+t+": "+r),e._state=Jt.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)){var i=t[r];if("arraybuffer"===i.type){++e._loadResources.pendingBufferLoads;var n=new I(i.uri),o=n.resolve(e._baseUri).toString();p(o).then(j(e,r)).otherwise(q(e,"buffer",o))}else"text"===i.type}}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 J(e){var t=e.gltf.shaders;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingShaderLoads;var i=t[r],n=new I(i.uri),o=n.resolve(e._baseUri).toString();f(o).then(Z(e,r)).otherwise(q(e,"shader",o))}}function Q(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=e.gltf.images,r=e.gltf.textures;for(var i in r)if(r.hasOwnProperty(i)){++e._loadResources.pendingTextureLoads;var n=r[i],o=new I(t[n.source].uri),a=o.resolve(e._baseUri).toString();m(a).then(K(e,i)).otherwise(q(e,"image",a))}}function et(e){if(s(e.matrix))return y.fromArray(e.matrix);var t=r.fromArray(e.rotation,0,rr);return y.fromTranslationQuaternionRotationScale(r.fromArray(e.translation,0,ir),w.fromAxisAngle(t,e.rotation[3],nr),r.fromArray(e.scale,0,or))}function tt(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesNames,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new y,computedMatrix:new y,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:l.jointName,children:[],parents:[],publicNode:void 0};u.publicNode=new B(e,l,u,a,et(l)),t[a]=u,r[l.name]=u,s(l.instanceSkin)&&(n.push(a),i.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function rt(e){var t={},r={},i=e.gltf.materials,n=e._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 N(e,a,o);t[a.name]=s,r[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=r}function it(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 F(o,r,n)}e._runtime.meshesByName=t}function nt(e){e._loadRendererResourcesFromCache||(Y(e),X(e),J(e),Q(e),$(e)),rt(e),it(e),tt(e)}function ot(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){for(var i,n,o=e.gltf.bufferViews,a=r.buffers,l=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,b.STATIC_DRAW);c.vertexArrayDestroyable=!1,l[u]=c}}var h=e.gltf.accessors;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];if(n=o[p.bufferView],n.target===WebGLRenderingContext.ELEMENT_ARRAY_BUFFER&&!s(l[p.bufferView])){i=new Uint8Array(a[n.buffer],n.byteOffset,n.byteLength);var m=t.createIndexBuffer(i,b.STATIC_DRAW,p.componentType);m.vertexArrayDestroyable=!1,l[p.bufferView]=m}}}}function at(e){for(var t={},r=e.length,i=0;r>i;++i)t[e[i]]=i;return t}function st(e,t,r){var i=t.gltf.programs,n=t._loadResources.shaders,o=i[e],a=at(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 T({sources:[l],pickColorQualifier:"uniform"});t._rendererResources.pickPrograms[e]=r.createShaderProgram(s,u,a)}}function lt(e,t){var r,i=e._loadResources;if(0===i.pendingShaderLoads)if(e.asynchronous)i.programsToCreate.length>0&&(r=i.programsToCreate.dequeue(),st(r,e,t));else for(;i.programsToCreate.length>0;)r=i.programsToCreate.dequeue(),st(r,e,t)}function ut(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 ct(e,t,r){var i=t.gltf.textures,n=i[e.name],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===P.NEAREST_MIPMAP_NEAREST||a.minificationFilter===P.NEAREST_MIPMAP_LINEAR||a.minificationFilter===P.LINEAR_MIPMAP_NEAREST||a.minificationFilter===P.LINEAR_MIPMAP_LINEAR,l=s||a.wrapS===A.REPEAT||a.wrapS===A.MIRRORED_REPEAT||a.wrapT===A.REPEAT||a.wrapT===A.MIRRORED_REPEAT,u=e.image,c=!v.isPowerOfTwo(u.width)||!v.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=v.nextPowerOfTwo(u.width),h.height=v.nextPowerOfTwo(u.height);var d=h.getContext("2d");d.drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}var p;n.target===WebGLRenderingContext.TEXTURE_2D&&(p=r.createTexture2D({source:u,pixelFormat:n.internalFormat,pixelDatatype:n.type,flipY:!1})),s&&p.generateMipmap(),p.sampler=a,t._rendererResources.textures[e.name]=p}function ht(e,t){var r,i=e._loadResources;if(e.asynchronous)i.texturesToCreate.length>0&&(r=i.texturesToCreate.dequeue(),ct(r,e,t));else for(;i.texturesToCreate.length>0;)r=i.texturesToCreate.dequeue(),ct(r,e,t)}function dt(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 h)if(h.hasOwnProperty(d)){var p=s[c[d]];o[p.semantic]=h[d].index}return o}function pt(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 p=[],m=h.skeletons,f=m.length,v=0;f>v;++v)p.push(o[m[v]]);for(var g=i[h.skin].jointNames,_=g.length,y=0;_>y;++y){var C=g[y];c.joints.push(pt(p,C))}}}function ft(e){var t=e._loadResources;if(t.finishedBuffersCreation()&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=r.accessors,n=r.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=i[l.inverseBindMatrices];y.equals(l.bindShapeMatrix,y.IDENTITY)||(s=y.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:R.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}mt(e,o)}}function vt(e,t,r,i){return function(n){t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber}}function gt(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]=R.getAnimationParameterValues(e,o[u[r]]));for(var d=Number.MAX_VALUE,p=-Number.MAX_VALUE,m=l.length,f=new Array(m),v=0;m>v;++v){var g=l[v],_=g.target,y=c[g.sampler],C=h[y.input];d=Math.min(d,C[0]),p=Math.max(p,C[C.length-1]);var w=R.getAnimationSpline(e,a,s,g.sampler,y,h);f[v]=vt(e,i[_.id],_.path,w)}e._runtime.animations[a]={startTime:d,stopTime:p,channelEvaluators:f}}}}function _t(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,l=o.meshes;for(var u in l)if(l.hasOwnProperty(u))for(var c=l[u].primitives,h=c.length,d=0;h>d;++d){var p=c[d],m=dt(e,p),f=[],v=p.attributes;for(var g in v)if(v.hasOwnProperty(g)){var _=m[g];if(s(_)){var y=a[v[g]];f.push({index:_,vertexBuffer:i[y.bufferView],componentsPerAttribute:O(y).componentsPerAttribute,componentDatatype:y.componentType,normalize:!1,offsetInBytes:y.byteOffset,strideInBytes:y.byteStride})}}var C=a[p.indices],w=i[C.bufferView];n[u+".primitive."+d]=t.createVertexArray(f,w)}}}function yt(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 Ct(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 l=n[o],u=l.passes[l.pass],c=u.states,h=yt(c),d=a(c.functions,a.EMPTY_OBJECT),p=a(d.blendColor,[0,0,0,0]),m=a(d.blendEquationSeparate,[WebGLRenderingContext.FUNC_ADD,WebGLRenderingContext.FUNC_ADD]),f=a(d.blendFuncSeparate,[WebGLRenderingContext.ONE,WebGLRenderingContext.ONE,WebGLRenderingContext.ZERO,WebGLRenderingContext.ZERO]),v=a(d.colorMask,[!0,!0,!0,!0]),g=a(d.depthRange,[0,1]),_=a(d.polygonOffset,[0,0]),y=a(d.scissor,[0,0,0,0]);i[o]=t.createRenderState({frontFace:s(d.frontFace)?d.frontFace[0]:WebGLRenderingContext.CCW,cull:{enabled:h[WebGLRenderingContext.CULL_FACE],face:s(d.cullFace)?d.cullFace[0]:WebGLRenderingContext.BACK},lineWidth:s(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:s(d.depthFunc)?d.depthFunc[0]:WebGLRenderingContext.LESS},colorMask:{red:v[0],green:v[1],blue:v[2],alpha:v[3]},depthMask:s(d.depthMask)?d.depthMask[0]:!0,blending:{enabled:h[WebGLRenderingContext.BLEND],color:{red:p[0],green:p[1],blue:p[2],alpha:p[3]},equationRgb:m[0],equationAlpha:m[1],functionSourceRgb:f[0],functionSourceAlpha:f[1],functionDestinationRgb:f[2],functionDestinationAlpha:f[3]}})}}}function wt(e){var t={value:e,clone:function(e){return e},func:function(){return t.value}};return t}function St(e){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function Et(e){var t={value:r.fromArray(e),clone:r.clone,func:function(){return t.value}};return t}function bt(e){var t={value:i.fromArray(e),clone:i.clone,func:function(){return t.value}};return t}function xt(e){var t={value:g.fromColumnMajorArray(e),clone:g.clone,func:function(){return t.value}};return t}function Tt(e){var t={value:_.fromColumnMajorArray(e),clone:_.clone,func:function(){return t.value}};return t}function Pt(e){var t={value:y.fromColumnMajorArray(e),clone:y.clone,func:function(){return t.value}};return t}function At(e,t){var r={value:t._rendererResources.textures[e],clone:function(e){return e},func:function(){return r.value}};return r}function Mt(e,t){var r=t._runtime.nodes[e];return function(){return r.computedMatrix}}function It(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._uniformMaps;for(var l in n)if(n.hasOwnProperty(l)){var u,c=n[l],h=c.instanceTechnique,d=h.values,p=o[h.technique],m=p.parameters,f=p.passes[p.pass],v=f.instanceProgram,g=v.uniforms,_={},y={};for(var C in g)if(g.hasOwnProperty(C)){var w=g[C],S=m[w];if(s(d[w])){var E=sr[S.type](d[w],e);_[C]=E.func,y[w]=E}else if(s(S.semantic))"JOINTMATRIX"!==S.semantic?_[C]=ar[S.semantic](t.uniformState):u=C;else if(s(S.source))_[C]=Mt(S.source,e);else if(s(S.value)){var b=sr[S.type](S.value,e);_[C]=b.func,y[w]=b}}var x=a[l];x.uniformMap=_,x.values=y,x.jointMatrixUniformName=u}}}function Dt(e){return function(){return e}}function Ot(e){return function(){return e.computedJointMatrices}}function Rt(t,i,n,l){var u=t._nodeCommands,c=t._pickIds,h=t.allowPicking,p=t._runtime.meshesByName;t.debugShowBoundingVolume;for(var m=t._rendererResources,f=m.vertexArrays,v=m.programs,g=m.pickPrograms,_=m.renderStates,C=t._uniformMaps,w=t.gltf,S=w.accessors,E=w.meshes,b=w.techniques,T=w.materials,P=s(i.meshes)?i.meshes:i.instanceSkin.meshes,A=P.length,M=0;A>M;++M)for(var I=P[M],D=E[I],O=D.primitives,R=O.length,L=0;R>L;++L){var N,F=O[L],B=S[F.indices],V=T[F.material].instanceTechnique,k=b[V.technique],U=k.passes[k.pass],W=U.instanceProgram,G=F.attributes.POSITION;if(s(G)){var H=S[G];N=e.fromCornerPoints(r.fromArray(H.min),r.fromArray(H.max))}var q=f[I+".primitive."+L],j=B.count,Y=B.byteOffset/d.getSizeInBytes(B.componentType),X=C[F.material],Z=X.uniformMap;if(s(X.jointMatrixUniformName)){var J={};J[X.jointMatrixUniformName]=Ot(n),Z=o(Z,J)}var Q,K=_[V.technique],$=K.blending.enabled,et={primitive:a(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[D.name]},tt=new x({boundingVolume:new e,modelMatrix:new y,primitiveType:F.mode,vertexArray:q,count:j,offset:Y,shaderProgram:v[W.program],uniformMap:Z,renderState:K,owner:et,pass:$?z.TRANSLUCENT:z.OPAQUE});if(h){var rt=l.createPickId(et);c.push(rt);var it=o(Z,{czm_pickColor:Dt(rt.color)});Q=new x({boundingVolume:new e,modelMatrix:new y,primitiveType:F.mode,vertexArray:q,count:j,offset:Y,shaderProgram:g[W.program],uniformMap:it,renderState:K,owner:et,pass:$?z.TRANSLUCENT:z.OPAQUE})}var nt={show:!0,boundingSphere:N,command:tt,pickCommand:Q};n.commands.push(nt),u.push(nt)}}function Lt(e,t){var i=e._loadResources;if(i.finishedPendingLoads()&&i.finishedResourceCreation()&&i.createRuntimeNodes){i.createRuntimeNodes=!1;for(var n=[],o=e._runtime.nodes,a=e.gltf,l=a.nodes,u=a.scenes[a.scene],c=u.nodes,h=c.length,d=[],p=new r,m=0;h>m;++m)for(d.push({parentRuntimeNode:void 0,gltfNode:l[c[m]],id:c[m]});d.length>0;){var f=d.pop(),v=f.parentRuntimeNode,g=f.gltfNode,_=o[f.id];0===_.parents.length&&(s(g.matrix)?_.matrix=y.fromColumnMajorArray(g.matrix):(p=r.fromArray(g.rotation,0,p),_.translation=r.fromArray(g.translation),_.rotation=w.fromAxisAngle(p,g.rotation[3]),_.scale=r.fromArray(g.scale))),s(v)?(v.children.push(_),_.parents.push(v)):n.push(_),(s(g.meshes)||s(g.instanceSkin))&&Rt(e,g,_,t);for(var C=g.children,S=C.length,E=0;S>E;++E)d.push({parentRuntimeNode:_,gltfNode:l[C[E]],id:C[E]})}e._runtime.rootNodes=n,e._runtime.nodes=o}}function Nt(e,t){if(e._loadRendererResourcesFromCache){var r=e._rendererResources,i=e._cachedRendererResources;r.buffers=i.buffers,r.vertexArrays=i.vertexArrays,r.programs=i.programs,r.pickPrograms=i.pickPrograms,r.textures=i.textures,r.samplers=i.samplers,r.renderStates=i.renderStates}else ot(e,t),lt(e,t),ut(e,t),ht(e,t);ft(e),gt(e),e._loadRendererResourcesFromCache||(_t(e,t),Ct(e,t)),It(e,t),Lt(e,t)}function Ft(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&s(i)?y.clone(i,t):s(e.matrix)?y.clone(e.matrix,t):(y.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),r.setMatrix(t))}function Bt(t,r,i){for(var n=t._maxDirtyNumber,o=t.allowPicking,a=t._runtime.rootNodes,s=a.length,l=lr,u=t._computedModelMatrix,c=0;s>c;++c){var h=a[c];for(Ft(h,h.transformToRoot),l.push(h);l.length>0;){h=l.pop();var d=h.transformToRoot,p=h.commands;if(h.dirtyNumber===n||r||i){var m=p.length;if(m>0)for(var f=0;m>f;++f){var v=p[f],g=v.command;if(y.multiplyTransformation(u,d,g.modelMatrix),e.transform(v.boundingSphere,g.modelMatrix,g.boundingVolume),o){var _=v.pickCommand;y.clone(g.modelMatrix,_.modelMatrix),e.clone(g.boundingVolume,_.boundingVolume)}}else h.computedMatrix=y.multiplyTransformation(u,d,h.computedMatrix)}for(var C=h.children,w=C.length,S=0;w>S;++S){var E=C[S];E.dirtyNumber=Math.max(E.dirtyNumber,h.dirtyNumber),(E.dirtyNumber===n||i)&&(Ft(E,E.transformToRoot),y.multiplyTransformation(d,E.transformToRoot,E.transformToRoot)),l.push(E)}}}++t._maxDirtyNumber}function zt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;r>i;++i){var n=t[i];ur=y.inverseTransformation(n.transformToRoot,ur);for(var o=n.computedJointMatrices,a=n.joints,l=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)s(o[h])||(o[h]=new y),o[h]=y.multiplyTransformation(ur,a[h].transformToRoot,o[h]),o[h]=y.multiplyTransformation(o[h],u[h],o[h]),s(l)&&(o[h]=y.multiplyTransformation(o[h],l,o[h]))}}function Vt(e){for(var t=e._runtime.rootNodes,r=t.length,i=lr,n=0;r>n;++n){var o=t[n];for(o.computedShow=o.publicNode.show,i.push(o);i.length>0;){o=i.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,i.push(p)}}}}function kt(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 Ut(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?C.LINES:C.TRIANGLES,r=e._nodeCommands,i=r.length,n=0;i>n;++n)r[n].command.primitiveType=t}}function Wt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,r=e._nodeCommands,i=r.length,n=0;i>n;n++)r[n].command.debugShowBoundingVolume=t}}function Gt(e,t,i,n){var o=n.camera,a=o.frustum,s=r.subtract(o.positionWC,e,hr),l=r.multiplyByScalar(o.directionWC,r.dot(s,o.directionWC),dr),u=Math.max(a.near,r.magnitude(l)-t);cr.x=i.drawingBufferWidth,cr.y=i.drawingBufferHeight;var c=a.getPixelSize(cr,u),h=Math.max(c.x,c.y);return h}function Ht(e,t,r){var i=e.scale;if(0!==e.minimumPixelSize){var n=Math.max(t.drawingBufferWidth,t.drawingBufferHeight),o=e.modelMatrix;pr.x=o[12],pr.y=o[13],pr.z=o[14];var a=e.boundingSphere.radius,s=Gt(pr,a,t,r),l=1/s,u=Math.min(l*2*a,n);u<e.minimumPixelSize&&(i=e.minimumPixelSize*s/(2*e._initialRadius))}return i}function qt(e){s(e._cacheKey)&&s(e._cachedGltf)&&0===--e._cachedGltf.count&&delete Kt[e._cacheKey],e._cachedGltf=void 0}function jt(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function Yt(e){jt(e.buffers),jt(e.vertexArrays),jt(e.programs),jt(e.pickPrograms),jt(e.textures)}var Xt=y.fromRotationTranslation(_.fromRotationX(v.PI_OVER_TWO)),Zt=new r,Jt={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};k.prototype.finishedPendingLoads=function(){return 0===this.pendingBufferLoads&&0===this.pendingShaderLoads&&0===this.pendingTextureLoads},k.prototype.finishedResourceCreation=function(){return 0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.texturesToCreate.length},k.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},k.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},k.prototype.finishedTextureCreation=function(){return 0===this.pendingTextureLoads&&0===this.texturesToCreate.length};var Qt=function(e){this._gltf=M(e.gltf),this.ready=e.ready,this.modelsToLoad=[],this.count=0};l(Qt.prototype,{gltf:{set:function(e){this._gltf=M(e)},get:function(){return this._gltf}}});var Kt={},$t=function(t){t=a(t,a.EMPTY_OBJECT);var r=t.cacheKey;this._cacheKey=r,this._cachedGltf=void 0,this._releaseGltfJson=a(t.releaseGltfJson,!1),this._animationIds=void 0;var i;s(r)&&s(Kt[r])&&Kt[r].ready?(i=Kt[r],++i.count):s(t.gltf)&&(i=new Qt({gltf:t.gltf,ready:!0}),i.count=1,s(r)&&(Kt[r]=i)),W(this,i),this._basePath=a(t.basePath,"");var n=new I(document.location.href),o=new I(this._basePath);this._baseUri=o.resolve(n),this.show=a(t.show,!0),this.modelMatrix=y.clone(a(t.modelMatrix,y.IDENTITY)),this._modelMatrix=y.clone(this.modelMatrix),this.scale=a(t.scale,1),this._scale=this.scale,this.minimumPixelSize=a(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.id=t.id,this._id=t.id,this.pickPrimitive=t.pickPrimitive,this._allowPicking=a(t.allowPicking,!0),this._ready=!1,this._readyPromise=D.defer(),this.activeAnimations=new L(this),this._asynchronous=a(t.asynchronous,!0),this.debugShowBoundingVolume=a(t.debugShowBoundingVolume,!1),this._debugShowBoudingVolume=!1,this.debugWireframe=a(t.debugWireframe,!1),this._debugWireframe=!1,this._computedModelMatrix=new y,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=Jt.NEEDS_LOAD,this._loadError=void 0,this._loadResources=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!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=[]};l($t.prototype,{gltf:{get:function(){return s(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=y.getScale(this.modelMatrix,Zt);r.multiplyByScalar(e,this.scale,e);var t=this._scaledBoundingSphere;return t.center=r.multiplyComponents(this._boundingSphere.center,e,t.center),t.radius=r.maximumComponent(e)*this._initialRadius,t}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}}}),$t.fromGltf=function(e){var t=e.url,r="",i=t.lastIndexOf("/");-1!==i&&(r=t.substring(0,i+1));var o=e.cacheKey;if(!s(o)){var a=new I(document.location.href),l=new I(t);o=l.resolve(a).toString()}e=n(e),e.basePath=r,e.cacheKey=o;var u=new $t(e),c=Kt[o];return s(c)?c.ready||(++c.count,c.modelsToLoad.push(u)):(c=new Qt({ready:!1}),c.count=1,c.modelsToLoad.push(u),W(u,c),Kt[o]=c,f(t,e.headers).then(function(e){c.gltf=JSON.parse(e);for(var t=c.modelsToLoad,r=t.length,i=0;r>i;++i){var n=t[i];n.isDestroyed()||W(n,c)}c.modelsToLoad=void 0,c.ready=!0}).otherwise(q(u,"gltf",t))),u},$t._gltfCache=Kt,$t.prototype.getNode=function(e){var t=G(this,"nodesByName",e);return s(t)?t.publicNode:void 0},$t.prototype.getMesh=function(e){return G(this,"meshesByName",e)},$t.prototype.getMaterial=function(e){return G(this,"materialsByName",e)};var er=new r,tr=new r,rr=new r,ir=new r,nr=new w,or=new r,ar={MODEL:function(e){return function(){return e.model}},VIEW:function(e){return function(){return e.view}},PROJECTION:function(e){return function(){return e.projection}},MODELVIEW:function(e){return function(){return e.modelView}},MODELVIEWPROJECTION:function(e){return function(){return e.modelViewProjection}},MODELINVERSE:function(e){return function(){return e.inverseModel}},VIEWINVERSE:function(e){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e){return function(){return e.inverseTranposeModel}},MODELVIEWINVERSETRANSPOSE:function(e){return function(){return e.normal}},VIEWPORT:function(e){return function(){return e.viewportCartesian4}}},sr={};"undefined"!=typeof WebGLRenderingContext&&(sr[WebGLRenderingContext.FLOAT]=wt,sr[WebGLRenderingContext.FLOAT_VEC2]=St,sr[WebGLRenderingContext.FLOAT_VEC3]=Et,sr[WebGLRenderingContext.FLOAT_VEC4]=bt,sr[WebGLRenderingContext.INT]=wt,sr[WebGLRenderingContext.INT_VEC2]=St,sr[WebGLRenderingContext.INT_VEC3]=Et,sr[WebGLRenderingContext.INT_VEC4]=bt,sr[WebGLRenderingContext.BOOL]=wt,sr[WebGLRenderingContext.BOOL_VEC2]=St,sr[WebGLRenderingContext.BOOL_VEC3]=Et,sr[WebGLRenderingContext.BOOL_VEC4]=bt,sr[WebGLRenderingContext.FLOAT_MAT2]=xt,sr[WebGLRenderingContext.FLOAT_MAT3]=Tt,sr[WebGLRenderingContext.FLOAT_MAT4]=Pt,sr[WebGLRenderingContext.SAMPLER_2D]=At);var lr=[],ur=new y,cr=new t,hr=new r,dr=new r,pr=new r,mr=function(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};return mr.prototype.release=function(){return 0===--this.count?(s(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],Yt(this),u(this)):void 0},$t.prototype.update=function(e,t,r){if(t.mode===V.SCENE3D){if(this._state===Jt.NEEDS_LOAD&&s(this.gltf)){var i,n=this.cacheKey;if(s(n)){e.cache.modelRendererResourceCache=a(e.cache.modelRendererResourceCache,{});var o=e.cache.modelRendererResourceCache;if(i=o[this.cacheKey],s(i)){if(!i.ready)return;++i.count,this._loadRendererResourcesFromCache=!0}else i=new mr(e,n),i.count=1,o[this.cacheKey]=i;this._cachedRendererResources=i}else i=new mr(e),i.count=1,this._cachedRendererResources=i;this._state=Jt.LOADING,this._boundingSphere=H(this.gltf),this._initialRadius=this._boundingSphere.radius,this._loadResources=new k,nt(this)}var l=!1;if(this._state===Jt.FAILED)throw this._loadError;if(this._state===Jt.LOADING){Nt(this,e);var u=this._loadResources;if(u.finishedPendingLoads()&&u.finishedResourceCreation()){this._state=Jt.LOADED,this._loadResources=void 0;var c=this._rendererResources,h=this._cachedRendererResources;h.buffers=c.buffers,h.vertexArrays=c.vertexArrays,h.programs=c.programs,h.pickPrograms=c.pickPrograms,h.textures=c.textures,h.samplers=c.samplers,h.renderStates=c.renderStates,h.ready=!0,this.releaseGltfJson&&qt(this),l=!0}}var d=this.show&&0!==this.scale;if(d&&this._state===Jt.LOADED||l){var p=this.activeAnimations.update(t)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1;var m=!y.equals(this._modelMatrix,this.modelMatrix)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize;if(m||l){y.clone(this.modelMatrix,this._modelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize;var f=Ht(this,e,t),v=this._computedModelMatrix;y.multiplyByUniformScale(this.modelMatrix,f,v),y.multiplyTransformation(v,Xt,v)}(p||m||l)&&(Bt(this,m,l),(p||l)&&zt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,Vt(this)),kt(this,e),Ut(this),Wt(this)}if(l){var g=this;return t.afterRender.push(function(){g._ready=!0,g.readyPromise.resolve(g)}),void 0}if(d){var _,C,w=t.passes,S=this._nodeCommands,E=S.length;if(w.render)for(_=0;E>_;++_)C=S[_],C.show&&r.push(C.command);if(w.pick)for(_=0;E>_;++_)C=S[_],C.show&&r.push(C.pickCommand)}}},$t.prototype.isDestroyed=function(){return!1},$t.prototype.destroy=function(){this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,r=0;t>r;++r)e[r].destroy();return qt(this),u(this)},$t}),r("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/Model","../Scene/ModelAnimationLoop","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function d(e){e.activeAnimations.addAll({loop:l.REPEAT})}function p(e){console.error(e)}var m=1,f=0,v=function(t,r){r.collectionChanged.addEventListener(v.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=r,this._modelHash={},this._entitiesToVisualize=new e,this._modelMatrixScratch=new a,this._onCollectionChanged(r,r.values,[],[])};return v.prototype.update=function(e){this._scene.context;var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives;this._scene;for(var o=0,l=t.length;l>o;o++){var u,h,v=t[o],g=v._model,_=r[v.id],y=v.isShowing&&v.isAvailable(e)&&c.getValueOrDefault(g._show,e,!0);if(y&&(h=v._getModelMatrix(e,this._modelMatrixScratch),u=c.getValueOrUndefined(g._uri,e),y=i(h)&&i(u)),y){var C=i(_)?_.modelPrimitive:void 0;i(C)&&u===_.uri||(i(C)&&(n.removeAndDestroy(C),delete r[v.id]),C=s.fromGltf({url:u}),C.readyPromise.then(d).otherwise(p),C.id=v,n.add(C),_={modelPrimitive:C,uri:u},r[v.id]=_),C.show=!0,C.scale=c.getValueOrDefault(g._scale,e,m),C.minimumPixelSize=c.getValueOrDefault(g._minimumPixelSize,e,f),C.modelMatrix=a.clone(h,C.modelMatrix)}else i(_)&&(_.modelPrimitive.show=!1)}return!0},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(v.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,r=this._primitives,i=e.length-1;i>-1;i--)h(this,e[i],t,r);return n(this)},v.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return u.FAILED;var o=n.modelPrimitive;return i(o)&&o.show?o.ready?(t.transform(o.boundingSphere,o.modelMatrix,r),u.DONE):u.PENDING:u.FAILED},v.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)?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)},v}),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,p=h.WIDTH_INDEX=1,m=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,m),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,p))}},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[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!==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/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","../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,p,m,f,v,g,_,y,C,w,S,E,b,x,T){"use strict";function P(t,r,i,n,o,a,l){for(var u=n.length,c=0,h=!0,d=t._vertexArrays,p=t.debugShowBoundingVolume,m=d.length,f=0;m>f;++f)for(var v=d[f],_=v.buckets,y=_.length,C=0;y>C;++C){for(var w,S,E,x=_[C],P=x.offset,A=l?x.bucket.shaderProgram:x.bucket.pickShaderProgram,M=x.bucket.polylines,D=M.length,O=0,R=0;D>R;++R){var L=M[R],N=I(L._material);if(N!==w){if(s(w)&&O>0){var F=S.isTranslucent();c>=u?(E=new g({owner:t}),n.push(E)):E=n[c],++c,E.boundingVolume=e.clone(Y,E.boundingVolume),E.modelMatrix=a,E.shaderProgram=A,E.vertexArray=v.va,E.renderState=F?t._translucentRS:t._opaqueRS,E.pass=F?b.TRANSLUCENT:b.OPAQUE,E.debugShowBoundingVolume=l?p:!1,E.uniformMap=S._uniforms,E.count=O,E.offset=P,P+=O,O=0,h=!0,o.push(E)}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?s(L._boundingVolume2D)&&(U=e.clone(L._boundingVolume2D,X),U.center.x=0):s(L._boundingVolumeWC)&&s(L._boundingVolume2D)&&(U=e.union(L._boundingVolumeWC,L._boundingVolume2D,X)),h?(h=!1,e.clone(U,Y)):e.union(U,Y,Y)}s(w)&&O>0&&(c>=u?(E=new g({owner:t}),n.push(E)):E=n[c],++c,E.boundingVolume=e.clone(Y,E.boundingVolume),E.modelMatrix=a,E.shaderProgram=A,E.vertexArray=v.va,E.renderState=S.isTranslucent()?t._translucentRS:t._opaqueRS,E.pass=S.isTranslucent()?b.TRANSLUCENT:b.OPAQUE,E.debugShowBoundingVolume=l?p:!1,E.uniformMap=S._uniforms,E.count=O,E.offset=P,h=!0,o.push(E)),w=void 0}n.length=c}function A(e){for(var t=e._buffersUsage,r=!1,i=e._propertiesChanged,n=0;H-2>n;++n){var o=t[n];i[n]?o.bufferUsage!==v.STREAM_DRAW?(r=!0,o.bufferUsage=v.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==v.STATIC_DRAW&&(0===o.frameCount?(r=!0,o.bufferUsage=v.STATIC_DRAW):o.frameCount--)}return r}function M(e,t,r){e._createVertexArray=!1,L(e),N(e),D(e);var i,n,a=[[]],l=a[0],u=[0],c=0,h=[[]],p=0,f=e._polylineBuckets;for(i in f)f.hasOwnProperty(i)&&(n=f[i],n.updateShader(t),p+=n.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 f)if(f.hasOwnProperty(i)){n=f[i],n.write(y,C,w,S,E,b,t,r),_===T.MORPHING&&(s(g)||(g=new Float32Array(3*6*p)),n.writeForMorph(g,S));var x=n.lengthOfPositions;S+=3*6*x,E+=4*x,b+=4*x,c=n.updateIndices(a,u,h,c)}var P=e._buffersUsage[U].bufferUsage,A=e._buffersUsage[V].bufferUsage,M=e._buffersUsage[k].bufferUsage,I=A===v.STREAM_DRAW||M===v.STREAM_DRAW?v.STREAM_DRAW:v.STATIC_DRAW;e._positionBuffer=t.createVertexBuffer(y,P);var O;s(g)&&(O=t.createVertexBuffer(g,P)),e._pickColorBuffer=t.createVertexBuffer(C,v.STATIC_DRAW),e._texCoordExpandWidthAndShowBuffer=t.createVertexBuffer(w,I);for(var R=4*Uint8Array.BYTES_PER_ELEMENT,F=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,z=0,W=a.length,G=0;W>G;++G)if(l=a[G],l.length>0){var H=new Uint16Array(l),j=t.createIndexBuffer(H,v.STATIC_DRAW,d.UNSIGNED_SHORT);z+=u[G];var Y,X,J,Q,K=6*(G*F*m.SIXTY_FOUR_KILOBYTES-z*F),$=F+K,et=F+$,tt=F+et,rt=F+tt,it=F+rt,nt=G*R*m.SIXTY_FOUR_KILOBYTES-z*R,ot=G*B*m.SIXTY_FOUR_KILOBYTES-z*B,at=[{index:q.position3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:K,strideInBytes:6*F},{index:q.position3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*F},{index:q.position2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:K,strideInBytes:6*F},{index:q.position2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*F},{index:q.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:et,strideInBytes:6*F},{index:q.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:tt,strideInBytes:6*F},{index:q.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:et,strideInBytes:6*F},{index:q.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:tt,strideInBytes:6*F},{index:q.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:rt,strideInBytes:6*F},{index:q.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:it,strideInBytes:6*F},{index:q.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:rt,strideInBytes:6*F},{index:q.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:it,strideInBytes:6*F},{index:q.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:o.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:ot},{index:q.pickColor,componentsPerAttribute:4,componentDatatype:o.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:nt,normalize:!0}];_===T.SCENE3D?(Y=e._positionBuffer,X="vertexBuffer",J=Z,Q="value"):_===T.SCENE2D||_===T.COLUMBUS_VIEW?(Y=Z,X="value",J=e._positionBuffer,Q="vertexBuffer"):(Y=O,X="vertexBuffer",J=e._positionBuffer,Q="vertexBuffer"),at[0][X]=Y,at[1][X]=Y,at[2][Q]=J,at[3][Q]=J,at[4][X]=Y,at[5][X]=Y,at[6][Q]=J,at[7][Q]=J,at[8][X]=Y,at[9][X]=Y,at[10][Q]=J,at[11][Q]=J;var st=t.createVertexArray(at,j);e._vertexArrays.push({va:st,buckets:h[G]})}}}function I(e){var t=E._uniformList[e.type],r=t.length;J.length=2*r;for(var i=0,n=0;r>n;++n){var o=t[n];J[i]=o,J[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(J)}function D(e){for(var t=e._mode,r=e._modelMatrix,i=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=i[u.type];s(c)||(c=i[u.type]=new Q(u,t,r)),c.addPolyline(l)}}}function O(e,t){var r=t.mode;e._mode===r&&f.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._modelMatrix=f.clone(e.modelMatrix),e._createVertexArray=!0)}function R(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];s(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function L(e){for(var t=e._polylines,r=t.length,i=0;r>i;++i)if(s(t[i])){var n=t[i]._bucket;s(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function N(e){for(var t=e._vertexArrays.length,r=0;t>r;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function F(e){for(var t=e._polylines,r=t.length,i=0;r>i;++i)s(t[i])&&t[i]._destroy()}function B(e,t,r){this.count=e,this.offset=t,this.bucket=r}function z(e){return t.dot(t.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersect(r.UNIT_Y)===p.INTERSECTING}var V=x.SHOW_INDEX,k=x.WIDTH_INDEX,U=x.POSITION_INDEX,W=x.MATERIAL_INDEX,G=x.POSITION_SIZE_INDEX,H=x.NUMBER_OF_PROPERTIES,q={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},j=function(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(H),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:v.STATIC_DRAW,frameCount:0},{bufferUsage:v.STATIC_DRAW,frameCount:0},{bufferUsage:v.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0};l(j.prototype,{length:{get:function(){return R(this),this._polylines.length}}}),j.prototype.add=function(e){var t=new x(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},j.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},j.prototype.removeAll=function(){L(this),F(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},j.prototype.contains=function(e){return s(e)&&e._polylineCollection===this},j.prototype.get=function(e){return R(this),this._polylines[e]},j.prototype.update=function(e,t,r){if(R(this),0!==this._polylines.length){O(this,t);var i,n=t.mapProjection,o=this._propertiesChanged;if(this._createVertexArray||A(this))M(this,e,n);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==T.SCENE3D)for(var l=a.length,u=0;l>u;++u)i=a[u],i.update();if(o[G]||o[W])M(this,e,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[U]||o[V]||o[k])&&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;H>g;++g)o[g]=0;var _=f.IDENTITY;t.mode===T.SCENE3D&&(_=this.modelMatrix);var y=t.passes,C=0!==t.morphTime;if(s(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===C||(this._opaqueRS=e.createRenderState({depthMask:C,depthTest:{enabled:C}})),s(this._translucentRS)&&this._translucentRS.depthTest.enabled===C||(this._translucentRS=e.createRenderState({blending:S.ALPHA_BLEND,depthMask:!C,depthTest:{enabled:C}})),y.render){var w=this._colorCommands;P(this,e,t,w,r,_,!0)}if(y.pick){var E=this._pickCommands;P(this,e,t,E,r,_,!1)}}};var Y=new e,X=new e;j.prototype.isDestroyed=function(){return!1},j.prototype.destroy=function(){return N(this),L(this),F(this),u(this)};var Z=[0,0,0],J=[];j.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(!s(this.shaderProgram)){var t=new _({sources:[y,w]}),r=new _({sources:[this.material.shaderSource,C]}),i=new _({sources:r.sources,pickColorQualifier:"varying"});this.shaderProgram=e.createShaderProgram(t,r,q),this.pickShaderProgram=e.createShaderProgram(t,i,q)}},Q.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===T.SCENE3D||!z(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 K=new t,$=new t,et=new t,tt=new t;Q.prototype.write=function(e,r,i,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,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=tt,t.subtract(C[0],C[1],f),t.add(C[0],f,f)):f=C[P-1],$.x=f.x,$.y=f.y,$.z=c!==T.SCENE2D?f.z:0,f=C[P],K.x=f.x,K.y=f.y,K.z=c!==T.SCENE2D?f.z:0,P===S-1?v._loop?f=C[1]:(f=tt,t.subtract(C[S-1],C[S-2],f),t.add(C[S-1],f,f)):f=C[P+1],et.x=f.x,et.y=f.y,et.z=c!==T.SCENE2D?f.z:0;var A=w[b];P===x+A&&(x+=A,++b);for(var M=0===P-x,I=P===x+w[b]-1,D=M?2:0,O=I?2:4,R=D;O>R;++R){h.writeElements(K,e,o),h.writeElements($,e,o+6),h.writeElements(et,e,o+12),r[a]=n.floatToByte(E.red),r[a+1]=n.floatToByte(E.green),r[a+2]=n.floatToByte(E.blue),r[a+3]=n.floatToByte(E.alpha);var L=0>R-2?-1:1;i[s]=P/(S-1),i[s+1]=2*(R%2)-1,i[s+2]=L*g,i[s+3]=_,o+=18,a+=4,s+=4}}};var rt=new t,it=new t,nt=new t,ot=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,c=l.length,d=0,p=0,m=0;c>m;++m){var v;0===m?s._loop?v=l[c-2]:(v=ot,t.subtract(l[0],l[1],v),t.add(l[0],v,v)):v=l[m-1],v=f.multiplyByPoint(i,v,it);var g,_=f.multiplyByPoint(i,l[m],rt);m===c-1?s._loop?g=l[1]:(g=ot,t.subtract(l[c-1],l[c-2],g),t.add(l[c-1],g,g)):g=l[m+1],g=f.multiplyByPoint(i,g,nt);var y=u[d];m===p+y&&(p+=y,++d);for(var C=0===m-p,w=m===p+u[d]-1,S=C?2:0,E=w?2:4,b=S;E>b;++b)h.writeElements(_,e,r),h.writeElements(v,e,r+6),h.writeElements(g,e,r+12),r+=18}};var at=new Array(1);Q.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new B(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=at;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 B(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 B(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 st={positions:void 0,lengths:void 0},lt=new Array(1),ut=new t,ct=new i;Q.prototype.getSegments=function(r,i){var n=r._actualPositions;if(this.mode===T.SCENE3D)return lt[0]=n.length,st.positions=n,st.lengths=lt,st;z(r)&&(n=r._segments.positions);for(var o,a=i.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=ut,h=0;u>h;++h)o=n[h],c=f.multiplyByPoint(l,o,c),s.push(i.project(a.cartesianToCartographic(c,ct)));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 st.positions=s,st.lengths=r._segments.lengths,st};var ht,dt;return Q.prototype.writeUpdate=function(e,r,i,n,o){var a=this.mode,l=r._actualLength;if(l){e+=this.getPolylineStartIndex(r);var u=ht,c=dt,d=3*6*l;!s(u)||u.length<d?(u=ht=new Float32Array(d),c=dt=new Float32Array(4*l)):u.length>d&&(u=new Float32Array(u.buffer,0,d),c=new Float32Array(c.buffer,0,4*l));var p,m=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?p=g[l-2]:(p=tt,t.subtract(g[0],g[1],p),t.add(g[0],p,p)):p=g[E-1],$.x=p.x,$.y=p.y,$.z=a!==T.SCENE2D?p.z:0,p=g[E],K.x=p.x,K.y=p.y,K.z=a!==T.SCENE2D?p.z:0,E===l-1?r._loop?p=g[1]:(p=tt,t.subtract(g[l-1],g[l-2],p),t.add(g[l-1],p,p)):p=g[E+1],et.x=p.x,et.y=p.y,et.z=a!==T.SCENE2D?p.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,I=A;M>I;++I){h.writeElements(K,u,m),h.writeElements($,u,m+6),h.writeElements(et,u,m+12);var D=0>I-2?-1:1;c[f]=E/(l-1),c[f+1]=2*(I%2)-1,c[f+2]=D*w,c[f+3]=S,m+=18,f+=4}}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},j}),r("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(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,r,n){return e(this._value)?(n=this._value.getValueInReferenceFrame(t,r,n),e(n)?i.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}),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","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function w(e,t,i,n,a,s,l,u,c){var h,d=u;h=e.getValueInReferenceFrame(t,s,c[d]),r(h)&&(c[d++]=h);for(var p,m,f,v=!r(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,i),g=0,_=n.length,y=n[g],C=i,w=!1;_>g;){if(!v&&o.greaterThanOrEquals(y,a)&&(h=e.getValueInReferenceFrame(a,s,c[d]),r(h)&&(c[d++]=h),v=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(h=e.getValueInReferenceFrame(y,s,c[d]),r(h)&&(c[d++]=h)),_-1>g){if(l>0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),m=0,f=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&p>m){y=o.addSeconds(y,f,new o),m++;continue}}w=!1,g++,y=n[g]}return h=e.getValueInReferenceFrame(i,s,c[d]),r(h)&&(c[d++]=h),d}function S(e,t,i,n,a,s,l,u){for(var c,h=0,d=l,p=t,m=Math.max(s,60),f=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i);o.lessThan(p,i);)!f&&o.greaterThanOrEquals(p,n)&&(f=!0,c=e.getValueInReferenceFrame(n,a,u[d]),r(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(p,a,u[d]),r(c)&&(u[d]=c,d++),h++,p=o.addSeconds(t,m*h,new o);return c=e.getValueInReferenceFrame(i,a,u[d]),r(c)&&(u[d]=c,d++),d}function E(e,t,i,n,a,s,l,c){O.start=t,O.stop=i;for(var h=l,d=e.intervals,p=0;p<d.length;p++){var m=d.get(p);if(!u.intersect(m,O,I).isEmpty){var f=m.start;m.isStartIncluded||(f=m.isStopIncluded?m.stop:o.addSeconds(m.start,o.secondsDifference(m.stop,m.start)/2,new o));var v=e.getValueInReferenceFrame(f,a,c[h]);r(v)&&(c[h]=v,h++)}}return h}function b(e,t,i,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return r(u)&&(l[s++]=u),s}function x(e,t,r,i,n,a,s,l){D.start=t,D.stop=r;for(var c=s,h=e.intervals,d=0;d<h.length;d++){var p=h.get(d);if(!u.intersect(p,D,I).isEmpty){var m=p.start,f=p.stop,v=t;o.greaterThan(m,v)&&(v=m);var g=r;o.lessThan(f,g)&&(g=f),c=T(p.data,v,g,i,n,a,c,l)}}return c}function T(e,t,r,i,n,o,a,s){for(var l=e;l instanceof g||l instanceof y;)l instanceof g&&(l=l.resolvedProperty),l instanceof y&&(l=l._value);if(l instanceof _){var u=l._property._times;a=w(e,t,r,u,i,n,o,a,s)}else a=l instanceof p?x(e,t,r,i,n,o,a,s):l instanceof C?E(e,t,r,i,n,o,a,s):l instanceof m?b(e,t,r,i,n,o,a,s):S(e,t,r,i,n,o,a,s);return a}function P(e,t,i,n,o,a,s){r(s)||(s=[]);var l=T(e,t,i,n,o,a,0,s);return s.length=l,s}var A=60,M=1,I=new u,D=new u,O=new u,R=function(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0},L=new a,N=function(e,t){this._unusedIndexes=[],this._polylineCollection=new h,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)};N.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var i=c.computeIcrfToFixedMatrix(e,L);r(i)||(i=c.computeTemeToPseudoFixedMatrix(e,L)),s.fromRotationTranslation(i,t.ZERO,this._polylineCollection.modelMatrix)}},N.prototype.updateObject=function(e,t){var i,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,h=a.isShowing&&(!r(u)||u.getValue(e));if(h){var d=v.getValueOrUndefined(s._leadTime,e),p=v.getValueOrUndefined(s._trailTime,e),m=a._availability,g=r(m),_=r(d),y=r(p);if(h=g||_&&y){if(y&&(i=o.addSeconds(e,-p,new o)),_&&(n=o.addSeconds(e,d,new o)),g){var C=m.start,w=m.stop;(!y||o.greaterThan(C,i))&&(i=C),(!_||o.lessThan(w,n))&&(n=w)}h=o.lessThan(i,n)}}if(!h)return r(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0),void 0;if(!r(c)){var S=this._unusedIndexes,E=S.length;if(E>0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var x=v.getValueOrDefault(s._resolution,e,A);c.show=!0,c.positions=P(l,i,n,e,this._referenceFrame,x,c.positions),c.material=f.getValue(e,s._material,c.material),c.width=v.getValueOrDefault(s._width,e,M)},N.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)},N.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i(this)};var F=function(t,r){r.collectionChanged.addEventListener(F.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])};return F.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=s.updater,p=l.FIXED;this._scene.mode===d.SCENE3D&&(p=c.referenceFrame);var m=this._updaters[p];h===m&&r(m)?m.updateObject(e,s):(r(h)&&h.removeObject(s),r(m)||(m=new N(this._scene,p),m.update(e),this._updaters[p]=m),s.updater=m,r(m)&&m.updateObject(e,s))}return!0},F.prototype.isDestroyed=function(){return!1},F.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(F.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return i(this)},F.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 R(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 R(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))},F._subSample=P,F}),r("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/BillboardCollection","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(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 h(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 d=r.WHITE,p=r.BLACK,m=0,f=1,v=new r,g=new t,_=new r,y=new a,C=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},w=function(t,r){r.collectionChanged.addEventListener(w.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._entityCollection=r,this._billboardCollection=void 0,this._items=new e,this._onCollectionChanged(r,r.values,[],[])};return w.prototype.update=function(e){for(var t=this._items.values,n=this._unusedIndexes,o=0,a=t.length;a>o;o++){var l=t[o],C=l.entity,w=C._point,S=l.billboard,E=C.isShowing&&C.isAvailable(e)&&u.getValueOrDefault(w._show,e,!0);if(E&&(g=u.getValueOrUndefined(C._position,e,g),E=i(g)),E){var b=!1,x=!1;if(!i(S)){b=!0;var T=this._billboardCollection;i(T)||(T=new s,this._billboardCollection=T,this._scene.primitives.add(T));var P=n.length;S=P>0?T.get(n.pop()):T.add(),S.id=C,S.image=void 0,l.billboard=S,x=!0}S.show=!0,S.position=g,S.scaleByDistance=u.getValueOrUndefined(w._scaleByDistance,e,y);var A=w._color,M=w._outlineColor,I=u.getValueOrDefault(A,e,d,v),D=u.getValueOrDefault(M,e,p,_),O=Math.round(u.getValueOrDefault(w._outlineWidth,e,m)),R=Math.max(1,Math.round(u.getValueOrDefault(w._pixelSize,e,f)));
if(O>0?(S.scale=1,x=x||O!==l.outlineWidth||R!==l.pixelSize||!r.equals(I,l.color)||!r.equals(D,l.outlineColor)):(S.scale=R/50,R=50,x=x||O!==l.outlineWidth||!r.equals(I,l.color)||!r.equals(D,l.outlineColor)),x){l.color=r.clone(I,l.color),l.outlineColor=r.clone(D,l.outlineColor),l.pixelSize=R,l.outlineWidth=O;var L=I.alpha,N=I.toCssColorString(),F=D.toCssColorString(),B=JSON.stringify([N,R,F,O]);S.setImage(B,h(L,N,F,O,R))}}else c(l,n)}return!0},w.prototype.getBoundingSphere=function(e,r){var n=this._items.get(e.id);return i(n)&&i(n.billboard)?(r.center=t.clone(n.billboard.position,r.center),r.radius=0,l.DONE):l.FAILED},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(w.prototype._onCollectionChanged,this),i(this._billboardCollection)&&this._scene.primitives.remove(this._billboardCollection),n(this)},w.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],i(a._point)&&i(a._position)&&l.set(a.id,new C(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._point)&&i(a._position)?l.contains(a.id)||l.set(a.id,new C(a)):(c(l.get(a.id),s),l.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],c(l.get(a.id),s),l.remove(a.id)},w}),r("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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S){"use strict";var E=new _(e.WHITE),b=new y(!0),x=new y(!0),T=new y(!1),P=new y(e.BLACK),A=new e,M=function(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},I=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(I.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 M(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)};n(I,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),n(I.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(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||!i(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}}}),I.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},I.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},I.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new m(s&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof _){var c=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(r)),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})},I.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);return new l({id:i,geometry:new p(this._options),attributes:{show:new m(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o)}})},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){this._entitySubscription(),o(this)},I.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"polygon"===t){var n=this._entity.polygon;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(c.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(c.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var h=n.hierarchy,p=n.show;if(i(p)&&p.isConstant&&!p.getValue(c.MINIMUM_VALUE)||!i(h))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var m=r(n.material,E),g=m instanceof _;this._materialProperty=m,this._fillProperty=r(o,x),this._showProperty=r(p,b),this._showOutlineProperty=r(n.outline,T),this._outlineColorProperty=l?r(n.outlineColor,P):void 0;var y=n.height,C=n.extrudedHeight,w=n.granularity,A=n.stRotation,M=n.outlineWidth,I=n.perPositionHeight;if(this._fillEnabled=a,this._outlineEnabled=l,h.isConstant&&S.isConstant(y)&&S.isConstant(C)&&S.isConstant(w)&&S.isConstant(A)&&S.isConstant(M)&&S.isConstant(I)){var D=this._options;D.vertexFormat=g?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat;var O=h.getValue(c.MINIMUM_VALUE);u(O)&&(O=new d(O));var R=i(y)?y.getValue(c.MINIMUM_VALUE):void 0,L=i(C)?C.getValue(c.MINIMUM_VALUE):void 0;D.polygonHierarchy=O,D.height=R,D.extrudedHeight=L,D.granularity=i(w)?w.getValue(c.MINIMUM_VALUE):void 0,D.stRotation=i(A)?A.getValue(c.MINIMUM_VALUE):void 0,D.perPositionHeight=i(I)?I.getValue(c.MINIMUM_VALUE):void 0,this._outlineWidth=i(M)?M.getValue(c.MINIMUM_VALUE):1,this._isClosed=i(L)&&L!==R,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},I.prototype.createDynamicUpdater=function(e){return new D(e,this)};var D=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new M(t._entity)};return D.prototype.update=function(r){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(r)&&S.getValueOrDefault(s.show,r,!0)){var c=this._options,m=S.getValueOrUndefined(s.hierarchy,r);if(i(m)){if(c.polygonHierarchy=u(m)?new d(m):m,c.height=S.getValueOrUndefined(s.height,r),c.extrudedHeight=S.getValueOrUndefined(s.extrudedHeight,r),c.granularity=S.getValueOrUndefined(s.granularity,r),c.stRotation=S.getValueOrUndefined(s.stRotation,r),c.perPositionHeight=S.getValueOrUndefined(s.perPositionHeight,r),S.getValueOrDefault(s.fill,r,!0)){var _=w.getValue(r,o.fillMaterialProperty,this._material);this._material=_;var y=new f({material:_,translucent:_.isTranslucent(),closed:i(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,r,!1)){c.vertexFormat=v.VERTEX_FORMAT;var C=S.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,A),E=S.getValueOrDefault(s.outlineWidth,r,1),b=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:b,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},D.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},I}),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=a.getDefaultRenderState(r,i,t.renderState),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=s.getDefaultRenderState(i,n,r.renderState),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/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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S){"use strict";var E={},b=new y(t.WHITE),x=new C(!0),T=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},P=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)};o(P,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&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}}}),P.prototype.isOutlineVisible=function(){return!1},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(e){var i,o,a=this._entity,s=a.isAvailable(e),l=new m(s&&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)),i=r.fromColor(u),o={show:l,color:i}}else o={show:l};return new c({id:a,geometry:new d(this._options),attributes:o})},P.prototype.createOutlineGeometryInstance=function(){},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),a(this)},P.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"polyline"===t){var r=this._entity.polyline;if(!n(r))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=r.positions,a=r.show;if(n(a)&&a.isConstant&&!a.getValue(h.MINIMUM_VALUE)||!n(o))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var s=i(r.material,b),l=s instanceof y;this._materialProperty=s,this._showProperty=i(a,x),this._fillEnabled=!0;var u=r.width,c=r.followSurface,d=r.granularity;if(o.isConstant&&S.isConstant(u)&&S.isConstant(c)&&S.isConstant(d)){var p=this._options,m=o.getValue(h.MINIMUM_VALUE,p.positions);if(!n(m)||m.length<2)return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;p.vertexFormat=l?v.VERTEX_FORMAT:g.VERTEX_FORMAT,p.positions=m,p.width=n(u)?u.getValue(h.MINIMUM_VALUE):void 0,p.followSurface=n(c)?c.getValue(h.MINIMUM_VALUE):void 0,p.granularity=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e){return new A(e,this)};var A=function(e,t){var r=t._scene.id,i=E[r];!n(i)||i.isDestroyed()?(i=new f,E[r]=i,e.add(i)):e.contains(i)||e.add(i);var o=i.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[]},M={positions:void 0,granularity:void 0,height:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,r=t._entity,i=r.polyline,o=this._line;if(!r.isShowing||!r.isAvailable(e)||!S.getValueOrDefault(i._show,e,!0))return o.show=!1,void 0;var a=i.positions,s=S.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return o.show=!1,void 0;var l=S.getValueOrDefault(i._followSurface,e,!0);l&&(M.positions=s,M.granularity=S.getValueOrUndefined(i._granularity,e),M.height=p.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=p.generateCartesianArc(M)),o.show=!0,o.positions=s,o.material=w.getValue(e,t.fillMaterialProperty,o.material),o.width=S.getValueOrDefault(i._width,e,1)},A.prototype.getBoundingSphere=function(t,r){var i=this._line;return i.show&&i.positions.length>0?(e.fromPoints(i.positions,r),_.DONE):_.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,r=E[t];r.remove(this._line),0===r.length&&(this._primitives.removeAndDestroy(r),delete E[t]),a(this)},P}),r("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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";var w=new v(e.WHITE),S=new g(!0),E=new g(!0),b=new g(!1),x=new g(e.BLACK),T=new e,P=function(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0},A=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.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 P(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)};n(A,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(A.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)&&C.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)&&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}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,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})},A.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=C.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);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(o)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"polylineVolume"===t){var n=this._entity.polylineVolume;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.shape,d=n.show;if(!i(c)||!i(h)||i(d)&&d.isConstant&&!d.getValue(u.MINIMUM_VALUE))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var f=r(n.material,w),g=f instanceof v;this._materialProperty=f,this._fillProperty=r(o,E),this._showProperty=r(d,S),this._showOutlineProperty=r(n.outline,b),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var _=n.granularity,y=n.outlineWidth,T=n.cornerType;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&h.isConstant&&C.isConstant(_)&&C.isConstant(y)&&C.isConstant(T)){var P=this._options;P.vertexFormat=g?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,P.polylinePositions=c.getValue(u.MINIMUM_VALUE,P.polylinePositions),P.shapePositions=h.getValue(u.MINIMUM_VALUE,P.shape),P.granularity=i(_)?_.getValue(u.MINIMUM_VALUE):void 0,P.cornerType=i(T)?T.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=i(y)?y.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new M(e,this)};var M=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity)};return M.prototype.update=function(r){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(r)&&C.getValueOrDefault(s.show,r,!0)){var u=this._options,d=C.getValueOrUndefined(s.positions,r,u.polylinePositions),v=C.getValueOrUndefined(s.shape,r);if(i(d)&&i(v)){if(u.polylinePositions=d,u.shapePositions=v,u.granularity=C.getValueOrUndefined(s.granularity,r),u.cornerType=C.getValueOrUndefined(s.cornerType,r),!i(s.fill)||s.fill.getValue(r)){var g=y.getValue(r,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(i(s.outline)&&s.outline.getValue(r)){u.vertexFormat=m.VERTEX_FORMAT;var w=C.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,T),S=C.getValueOrDefault(s.outlineWidth,r,1),E=1!==w.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(w)}}),appearance:new m({flat:!0,translucent:E,renderState:{lineWidth:o._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},M.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),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","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";var w=new v(e.WHITE),S=new g(!0),E=new g(!0),b=new g(!1),x=new g(e.BLACK),T=new e,P=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},A=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new 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 P(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)};n(A,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(A.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)&&C.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)&&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}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,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})},A.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=C.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);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(o)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"rectangle"===t){var n=this._entity.rectangle;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,w),f=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,E),this._showProperty=r(h,S),this._showOutlineProperty=r(n.outline,b),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var g=n.height,_=n.extrudedHeight,y=n.granularity,T=n.stRotation,P=n.rotation,A=n.outlineWidth,M=n.closeBottom,I=n.closeTop;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&C.isConstant(g)&&C.isConstant(_)&&C.isConstant(y)&&C.isConstant(T)&&C.isConstant(P)&&C.isConstant(A)&&C.isConstant(M)&&C.isConstant(I)){var D=this._options;D.vertexFormat=f?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,D.rectangle=c.getValue(u.MINIMUM_VALUE,D.rectangle),D.height=i(g)?g.getValue(u.MINIMUM_VALUE):void 0,D.extrudedHeight=i(_)?_.getValue(u.MINIMUM_VALUE):void 0,D.granularity=i(y)?y.getValue(u.MINIMUM_VALUE):void 0,D.stRotation=i(T)?T.getValue(u.MINIMUM_VALUE):void 0,D.rotation=i(P)?P.getValue(u.MINIMUM_VALUE):void 0,D.closeBottom=i(M)?M.getValue(u.MINIMUM_VALUE):void 0,D.closeTop=i(I)?I.getValue(u.MINIMUM_VALUE):void 0,this._isClosed=i(_)&&i(D.closeTop)&&i(D.closeBottom)&&D.closeTop&&D.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))}},A.prototype.createDynamicUpdater=function(e){return new M(e,this)};var M=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity)};return M.prototype.update=function(r){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(r)&&C.getValueOrDefault(s.show,r,!0)){var u=this._options,d=C.getValueOrUndefined(s.coordinates,r,u.rectangle);if(i(d)){if(u.rectangle=d,u.height=C.getValueOrUndefined(s.height,r),u.extrudedHeight=C.getValueOrUndefined(s.extrudedHeight,r),u.granularity=C.getValueOrUndefined(s.granularity,r),u.stRotation=C.getValueOrUndefined(s.stRotation,r),u.rotation=C.getValueOrUndefined(s.rotation,r),u.closeBottom=C.getValueOrUndefined(s.closeBottom,r),u.closeTop=C.getValueOrUndefined(s.closeTop,r),C.getValueOrDefault(s.fill,r,!0)){var v=y.getValue(r,o.fillMaterialProperty,this._material);
this._material=v;var g=new p({material:v,translucent:v.isTranslucent(),closed:i(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,r,!1)){u.vertexFormat=m.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,T),w=C.getValueOrDefault(s.outlineWidth,r,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(w)}}),asynchronous:!1}))}}}},M.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),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","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";var w=new v(e.WHITE),S=new g(!0),E=new g(!0),b=new g(!1),x=new g(e.BLACK),T=new e,P=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},A=function(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.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 P(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)};n(A,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(A.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)&&C.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)&&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}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,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})},A.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=C.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);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(o)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"wall"===t){var n=this._entity.wall;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,w),f=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,E),this._showProperty=r(h,S),this._showOutlineProperty=r(n.outline,b),this._outlineColorProperty=l?r(n.outlineColor,x):void 0;var g=n.minimumHeights,_=n.maximumHeights,y=n.outlineWidth,T=n.granularity;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&C.isConstant(g)&&C.isConstant(_)&&C.isConstant(y)&&C.isConstant(T)){var P=this._options;P.vertexFormat=f?m.VERTEX_FORMAT:p.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(T)?T.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=i(y)?y.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new M(e,this)};var M=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity)};return M.prototype.update=function(r){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(r)&&C.getValueOrDefault(s.show,r,!0)){var u=this._options,c=C.getValueOrUndefined(s.positions,r,u.positions);if(i(c)){if(u.positions=c,u.minimumHeights=C.getValueOrUndefined(s.minimumHeights,r,u.minimumHeights),u.maximumHeights=C.getValueOrUndefined(s.maximumHeights,r,u.maximumHeights),u.granularity=C.getValueOrUndefined(s.granularity,r),C.getValueOrDefault(s.fill,r,!0)){var v=y.getValue(r,o.fillMaterialProperty,this._material);this._material=v;var g=new p({material:v,translucent:v.isTranslucent(),closed:i(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,r,!1)){u.vertexFormat=m.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,T),w=C.getValueOrDefault(s.outlineWidth,r,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(w)}}),asynchronous:!1}))}}}},M.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),r("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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b){"use strict";var x=function(e){var r=e.scene,i=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=i,this._scene=r,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=i.length;o>n;n++)this._onDataSourceAdded(i,i.get(n));var s=new h;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s};x.defaultVisualizersCallback=function(e,t){var r=t.entities;return[new s(e,r),new f(u,e,r),new f(d,e,r),new f(c,e,r),new f(p,e,r),new f(m,e,r),new f(C,e,r),new f(w,e,r),new f(S,e,r),new f(E,e,r),new f(b,e,r),new v(e,r),new g(e,r),new y(e,r),new _(e,r)]},i(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,r=e.length;r>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,i,n,o,a=!0,s=this._dataSourceCollection,l=s.length;for(t=0;l>t;t++){var u=s.get(t);for(r(u.update)&&(a=u.update(e)&&a),n=u._visualizers,o=n.length,i=0;o>i;i++)a=n[i].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,i=0;o>i;i++)a=n[i].update(e)&&a;return a};var T=[],P=new e;return x.prototype.getBoundingSphere=function(t,i,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(!r(s))return l.FAILED;var h=T,d=P,p=0,m=l.DONE,f=s._visualizers,v=f.length;for(o=0;v>o;o++){var g=f[o];if(r(g.getBoundingSphere)){if(m=f[o].getBoundingSphere(t,d),!i&&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 r=this._visualizersCallback(this._scene,t);t._visualizers=r},x.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},x}),r("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),r("Scene/HeadingPitchRange",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";var r=function(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.range=e(i,0)};return r.clone=function(e,i){return t(e)?(t(i)||(i=new r),i.heading=e.heading,i.pitch=e.pitch,i.range=e.range,i):void 0},r}),r("DataSources/EntityView",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/HeadingPitchRange","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,r,n,o,a,c){var d=!1,m=o.getValue(a,e._lastCartesian);if(i(m)){var P,A,M,I=!1,D=e.scene.mode;if(D===p.SCENE3D){x=s.addSeconds(a,.001,x);var O=o.getValue(x,y);if(i(O)){var R,L=h.computeFixedToIcrfMatrix(a,f),N=h.computeFixedToIcrfMatrix(x,v);i(L)&&i(N)?R=u.transpose(L,g):(R=h.computeTemeToPseudoFixedMatrix(a,g),L=u.transpose(R,f),N=h.computeTemeToPseudoFixedMatrix(x,v),u.transpose(N,N));var F=u.multiplyByVector(L,m,E),B=u.multiplyByVector(N,O,b);t.subtract(F,B,S);var z=1e3*t.magnitude(S),V=3986004418e5,k=-V/(z*z-2*V/t.magnitude(F));0>k||k>T*c.maximumRadius?(P=C,t.normalize(m,P),t.negate(P,P),M=t.clone(t.UNIT_Z,w),A=t.cross(M,P,y),t.magnitude(A)>l.EPSILON7&&(t.normalize(P,P),t.normalize(A,A),M=t.cross(P,A,w),t.normalize(M,M),I=!0)):t.equalsEpsilon(m,O,l.EPSILON7)||(M=C,t.normalize(F,M),t.normalize(B,B),A=t.cross(M,B,w),t.equalsEpsilon(A,t.ZERO,l.EPSILON7)||(P=t.cross(A,M,y),u.multiplyByVector(R,P,P),u.multiplyByVector(R,A,A),u.multiplyByVector(R,M,M),t.normalize(P,P),t.normalize(A,A),t.normalize(M,M),I=!0))}}i(e._boundingSphereOffset)&&t.add(e._boundingSphereOffset,m,m);var U=_;I?(U[0]=P.x,U[1]=P.y,U[2]=P.z,U[3]=0,U[4]=A.x,U[5]=A.y,U[6]=A.z,U[7]=0,U[8]=M.x,U[9]=M.y,U[10]=M.z,U[11]=0,U[12]=m.x,U[13]=m.y,U[14]=m.z,U[15]=0):h.eastNorthUpToFixedFrame(m,c,U);var W;W=D===p.SCENE2D&&0===e._offset2D.range||D!==p.SCENE2D&&t.equals(e._offset3D,t.ZERO)?void 0:D===p.SCENE2D?e._offset2D:e._offset3D,r.lookAtTransform(U,W),d=!0}n&&!d&&r.lookAtTransform(r.transform,e.scene.mode===p.SCENE2D?e._offset2D:e._offset3D)}var f=new u,v=new u,g=new u,_=new c,y=new t,C=new t,w=new t,S=new t,E=new t,b=new t,x=new s,T=1.25,P=function(i,n,o,s){this.entity=i,this.scene=n,this.ellipsoid=r(o,a.WGS84),this.boundingSphere=e.clone(s),this._boundingSphereOffset=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new t,this._defaultOffset3D=void 0,this._defaultOffset2D=void 0,this._offset3D=new t,this._offset2D=new d};return n(P,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=t.clone(e,new t),this._defaultOffset2D=new d(0,0,t.magnitude(this._defaultOffset3D))}}}),P.defaultOffset3D=new t(-14e3,3500,3500),P.prototype.update=function(e){var r=this.scene,n=this.entity,o=this.ellipsoid,a=r.mode;if(a!==p.MORPHING){var s=n.position,l=n!==this._lastEntity,u=a!==this._mode,c=this._offset3D,h=this._offset2D,f=r.camera,v=l||u;if(l){var g=n.viewFrom,_=i(g),y=this.boundingSphere;if(this._boundingSphereOffset=void 0,!_&&i(y)){var C=r.screenSpaceCameraController;C.minimumZoomDistance=Math.min(C.minimumZoomDistance,.5*y.radius),f.viewBoundingSphere(y),this._boundingSphereOffset=t.subtract(y.center,n.position.getValue(e),new t),v=!1}else _&&i(g.getValue(e,c))?(h.heading=0,h.range=t.magnitude(c)):(d.clone(P._defaultOffset2D,h),t.clone(P._defaultOffset3D,c))}else u||r.mode===p.MORPHING||(this._mode===p.SCENE2D?(h.heading=f.heading,h.range=f.frustum.right-f.frustum.left):(this._mode===p.SCENE3D||this._mode===p.COLUMBUS_VIEW)&&t.clone(f.position,c));this._lastEntity=n,this._mode=r.mode!==p.MORPHING?r.mode:this._mode,r.mode!==p.MORPHING&&m(this,f,v,s,e,o)}},P}),!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,p=t.arcs.length;p>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]<t?r=n+1:i=n}return r}function c(e){function t(e,t){e.forEach(function(e){0>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 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 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=p),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,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],d&&(d.next=p,d[2]=a[2],r(d)),p&&(p.previous=d,p[0]=a[0],r(p))}e.forEach(n)}),e}function d(e){for(var t,r=-1,i=e.length,n=e[i-1],o=0;++r<i;)t=n,n=e[r],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function p(e){var t=e[0],r=e[1],i=e[2];return Math.abs((t[0]-i[0])*(r[1]-t[1])-(t[0]-r[0])*(i[1]-t[1]))}function m(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var r=(t+1>>1)-1,n=i[r];if(m(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&&m(i[o],s)<0&&(s=i[a=o]),n>r&&m(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],(m(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/definedNotNull","../Core/defineProperties","../Core/deprecationWarning","../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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function A(e,t){var r="";for(var i in e)if(e.hasOwnProperty(i)){if(i===t||-1!==ot.indexOf(i))continue;var n=e[i];o(n)&&(r+="object"==typeof n?"<tr><th>"+i+"</th><td>"+A(n)+"</td></tr>":"<tr><th>"+i+"</th><td>"+n+"</td></tr>")}return r.length>0&&(r='<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>"),r}function M(e,t){var r;return function(){return n(r)||(r=A(e,t)),r}}function I(e,t){var i=e.id;if(o(i)&&"Feature"===e.type){for(var a=2,s=i;n(t.getById(s));)s=i+"_"+a,a++;i=s}else i=r();var l=t.getOrCreateEntity(i),u=e.properties;if(o(u)){l.addProperty("properties"),l.properties=u;var c,h=u.title;if(o(h))l.name=h,c="title";else{var d=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var m=p.toLowerCase();if(d>1&&"title"===m){d=1,c=p;break}d>2&&"name"===m?(d=2,c=p):d>3&&/title/i.test(p)?(d=3,c=p):d>4&&/name/i.test(p)&&(d=4,c=p)}o(c)&&(l.name=u[c])}var f=u.description;n(f)?null!==f&&(l.description=new S(f)):l.description=new y(M(u,c),!0)}return l}function D(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++)r[i]=t(e[i]);return r}function O(e,t,r,i,a){if(!n(t.geometry))throw new m("feature.geometry is required.");if(null===t.geometry)I(t,e._entityCollection);else{var s=t.geometry.type,l=lt[s];if(!o(l))throw new m("Unknown geometry type: "+s);l(e,t,t.geometry,i,a)}}function R(e,t,r,i,n){for(var o=t.features,a=0,s=o.length;s>a;a++)O(e,o[a],void 0,i,n)}function L(e,t,r,i,n){for(var a=r.geometries,s=0,l=a.length;l>s;s++){var u=a[s],c=u.type,h=lt[c];if(!o(h))throw new m("Unknown geometry type: "+c);h(e,t,u,i,n)}}function N(e,r,a,s,l){var u=l.markerSymbol,c=l.markerColor,h=l.markerSize,d=r.properties;if(o(d)){var p=d["marker-color"];o(p)&&(c=t.fromCssColorString(p)),h=i(nt[d["marker-size"]],h);var m=d["marker-symbol"];o(m)&&(u=m)}at[0]=u,at[1]=c,at[2]=h,JSON.stringify(at);var v;v=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(g(v,function(t){var i=new _;i.verticalOrigin=new S(f.BOTTOM),i.image=new S(t);var n=I(r,e._entityCollection);n.billboard=i,n.position=new w(a(s))}))}function F(e,t,r,i,n){N(e,t,i,r.coordinates,n)}function B(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)N(e,t,i,o[a],n)}function z(e,r,i,a,s){var l=s.strokeMaterialProperty,u=s.strokeWidthProperty,c=r.properties;if(o(c)){var h=c["stroke-width"];o(h)&&(u=new S(h));var d,p=c.stroke;o(p)&&(d=t.fromCssColorString(p));var m=c["stroke-opacity"];o(m)&&1!==m&&(n(d)||(d=l.color.clone()),d.alpha=m),n(d)&&(l=new C(d))}var f=new T;f.material=l,f.width=u,f.positions=new S(D(a,i));var v=I(r,e._entityCollection);v.polyline=f}function V(e,t,r,i,n){z(e,t,i,r.coordinates,n)}function k(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)z(e,t,i,o[a],n)}function U(e,r,i,a,s){if(0!==a.length&&0!==a[0].length){var l=s.strokeMaterialProperty.color,u=s.fillMaterialProperty,c=s.strokeWidthProperty,h=r.properties;if(o(h)){var d=h["stroke-width"];o(d)&&(c=new S(d));var m,f=h.stroke;o(f)&&(m=t.fromCssColorString(f));var v=h["stroke-opacity"];o(v)&&1!==v&&(n(m)||(m=s.strokeMaterialProperty.color.clone()),m.alpha=v),n(m)&&(l=new S(m));var g,_=h.fill;o(_)&&(g=t.fromCssColorString(_),g.alpha=u.color.alpha),v=h["fill-opacity"],o(v)&&v!==u.color.alpha&&(n(g)||(g=u.color.clone()),g.alpha=v),n(g)&&(u=new C(g))}var y=new x;y.outline=new S(!0),y.outlineColor=l,y.outlineWidth=c,y.material=u;for(var w=[],E=1,b=a.length;b>E;E++)w.push(new p(D(a[E],i)));var T=a[0];y.hierarchy=new S(new p(D(T,i),w)),T[0].length>2&&(y.perPositionHeight=new S(!0));var P=I(r,e._entityCollection);P.polygon=y}}function W(e,t,r,i,n){U(e,t,i,r.coordinates,n)}function G(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)U(e,t,i,o[a],n)}function H(e,t,r,i,n){for(var o in r.objects)if(r.objects.hasOwnProperty(o)){var a=v.feature(r,r.objects[o]),s=st[a.type];s(e,a,a,i,n)}}function q(e,t,r,i){var o;n(i)&&(o=c(i)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=st[t.type];if(!n(a))throw new m("Unsupported GeoJSON object type: "+t.type);var s=P,l=t.crs;if(n(l)){if(null===l)throw new m("crs is null.");if(!n(l.properties))throw new m("crs.properties is undefined.");var u=l.properties;if("name"===l.type){if(s=Y[u.name],!n(s))throw new m("Unknown crs name: "+u.name)}else if("link"===l.type){var h=X[u.href];if(n(h)||(h=Z[u.type]),!n(h))throw new m("Unable to resolve crs link: "+JSON.stringify(u));s=h(u)}else{if("EPSG"!==l.type)throw new m("Unknown crs type: "+l.type);if(s=Y["EPSG:"+u.code],!n(s))throw new m("Unknown crs EPSG code: "+u.code)}}return g(s,function(i){return e._entityCollection.removeAll(),a(e,t,t,i,r),g.all(e._promises,function(){return e._promises.length=0,E.setLoading(e,!1),e})})}var j,Y={"urn:ogc:def:crs:OGC:1.3:CRS84":P,"EPSG:4326":P},X={},Z={},J=48,Q=t.ROYALBLUE,K=t.YELLOW,$=2,et=t.fromBytes(255,255,0,100),tt=new S($),rt=new C(K),it=new C(et),nt={small:24,medium:48,large:64},ot=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],at=new Array(4),st={Feature:O,FeatureCollection:R,GeometryCollection:L,LineString:V,MultiLineString:k,MultiPoint:B,MultiPolygon:G,Point:F,Polygon:W,Topology:H},lt={GeometryCollection:L,LineString:V,MultiLineString:k,MultiPoint:B,MultiPolygon:G,Point:F,Polygon:W,Topology:H},ut=function(e){this._name=e,this._changed=new u,this._error=new u,this._isLoading=!1,this._loading=new u,this._entityCollection=new b,this._promises=[],this._pinBuilder=new d};return ut.fromUrl=function(e,t){s("GeoJsonDataSource.fromUrl","GeoJsonDataSource.fromUrl has been deprecated.  Use GeoJsonDataSource.load instead.");var r=new ut;return r.load(e,t),r},ut.load=function(e,t){return(new ut).load(e,t)},a(ut,{markerSize:{get:function(){return J},set:function(e){J=e}},markerSymbol:{get:function(){return j},set:function(e){j=e}},markerColor:{get:function(){return Q},set:function(e){Q=e}},stroke:{get:function(){return K},set:function(e){K=e,rt.color.setValue(e)}},strokeWidth:{get:function(){return $},set:function(e){$=e,tt.setValue(e)}},fill:{get:function(){return et},set:function(e){et=e,it=new C(et)}},crsNames:{get:function(){return Y}},crsLinkHrefs:{get:function(){return X}},crsLinkTypes:{get:function(){return Z}}}),a(ut.prototype,{name:{get:function(){return this._name}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),ut.prototype.loadUrl=function(e,t){return s("GeoJsonDataSource.prototype.loadUrl","GeoJsonDataSource.loadUrl has been deprecated.  You can now pass a url to GeoJsonDataSource.load."),this.load(e,t)},ut.prototype.load=function(e,t){E.setLoading(this,!0);var r=e;t=i(t,i.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),r=h(e)),t={markerSize:i(t.markerSize,J),markerSymbol:i(t.markerSymbol,j),markerColor:i(t.markerColor,Q),strokeWidthProperty:new S(i(t.strokeWidth,$)),strokeMaterialProperty:new C(i(t.stroke,K)),fillMaterialProperty:new C(i(t.fill,et))};var a=this;return g(r,function(e){return q(a,e,t,o)}).otherwise(function(e){return E.setLoading(a,!1),a._error.raiseEvent(a,e),window.console.log(e),g.reject(e)})},ut}),r("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(r.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError},outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),r.prototype.isOutlineVisible=t.throwInstantiationError,r.prototype.isFilled=t.throwInstantiationError,r.prototype.createFillGeometryInstance=t.throwInstantiationError,r.prototype.createOutlineGeometryInstance=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r.prototype.createDynamicUpdater=t.throwInstantiationError,r}),function(e,t){"function"==typeof r&&r.amd?r("ThirdParty/Autolinker",[],function(){return e.returnExportsGlobal=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,className:"",htmlCharacterEntitiesRegex:/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,i=/(?:www\.)/,n=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,o=/\.(?: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/,a=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;
return new RegExp(["(",e.source,")","|","(",t.source,n.source,o.source,")","|","(","(?:","(",r.source,n.source,")","|","(?:","(.?//)?",i.source,n.source,")","|","(?:","(.?//)?",n.source,o.source,")",")","(?:"+a.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,link:function(t){var r=this,i=this.getHtmlParser(),n=this.htmlCharacterEntitiesRegex,o=0,a=[];return i.parse(t,{processHtmlNode:function(e,t,r){"a"===t&&(r?o=Math.max(o-1,0):o++),a.push(e)},processTextNode:function(t){if(0===o)for(var i=e.Util.splitAndCapture(t,n),s=0,l=i.length;l>s;s++){var u=i[s],c=r.processTextNode(u);a.push(c)}else a.push(t)}}),a.join("")},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.HtmlParser),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},processTextNode:function(e){var t=this;return e.replace(this.matcherRegex,function(e,r,i,n,o,a,s,l,u){var c=t.processCandidateMatch(e,r,i,n,o,a,s,l,u);if(c){var h=t.createMatchReturnVal(c.match,c.matchStr);return c.prefixStr+h+c.suffixStr}return e})},processCandidateMatch:function(t,r,i,n,o,a,s,l,u){var c,h=l||u,d="",p="";if(r&&!this.twitter||o&&!this.email||a&&!this.urls||!this.matchValidator.isValidMatch(a,s,h))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),p=")"),o)c=new e.match.Email({matchedText:t,email:o});else if(r)i&&(d=i,t=t.slice(1)),c=new e.match.Twitter({matchedText:t,twitterHandle:n});else{if(h){var m=h.match(this.charBeforeProtocolRelMatchRegex)[1]||"";m&&(d=m,t=t.slice(1))}c=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!h,stripPrefix:this.stripPrefix})}return{prefixStr:d,suffixStr:p,matchStr:t,match:c}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var r=e.match(/\(/g),i=e.match(/\)/g),n=r&&r.length||0,o=i&&i.length||0;if(o>n)return!0}return!1},createMatchReturnVal:function(t,r){var i;if(this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i)return i;if(i===!1)return r;if(i instanceof e.HtmlTag)return i.toString();var n=this.getTagBuilder(),o=n.build(t);return o.toString()}},e.link=function(t,r){var i=new e(r);return i.link(t)},e.match={},e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var i=t.prototype,n=function(){};n.prototype=i;var o;o=r.hasOwnProperty("constructor")?r.constructor:function(){i.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=i,delete r.constructor,e.Util.assign(a,r),o},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,i=e.length;i>r;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,i=[],n=0;r=t.exec(e);)i.push(e.substring(n,r.index)),i.push(r[0]),n=r.index+r[0].length;return i.push(e.substring(n)),i}},e.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,i=t.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",i,"|",r.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",i,")*","\\s*/?",">",")"].join(""),"gi")}(),parse:function(e,t){t=t||{};for(var r,i=t.processHtmlNode||function(){},n=t.processTextNode||function(){},o=this.htmlRegex,a=0;null!==(r=o.exec(e));){var s=r[0],l=r[1]||r[3],u=!!r[2],c=e.substring(a,r.index);c&&n(c),i(s,l.toLowerCase(),u),a=r.index+s.length}if(a<e.length){var h=e.substring(a);h&&n(h)}}}),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 r=this.getAttrs();return r[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);r=s.shift();)-1===o(a,r)&&a.push(r);return this.getAttrs()["class"]=a.join(" "),this},removeClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);a.length&&(r=s.shift());){var l=o(a,r);-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||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),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,r){return t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r)?!1:!0},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0];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.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var r=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return r},createAttrs:function(e,t){var r={href:t},i=this.createCssClass(e);return i&&(r["class"]=i),this.newWindow&&(r.target="_blank"),r},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.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.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(/&amp;/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}),r("ThirdParty/zip",["../Core/buildModuleUrl"],function(e){var t={};return function(t){function r(){var e=-1,t=this;t.append=function(r){var i,n=t.table;for(i=0;i<r.length;i++)e=e>>>8^n[255&(e^r[i])]},t.get=function(){return~e}}function i(e,t,r){return e.slice?e.slice(t,t+r):e.webkitSlice?e.webkitSlice(t,t+r):e.mozSlice?e.mozSlice(t,t+r):e.msSlice?e.msSlice(t,t+r):void 0}function n(e,t){var r,i;return r=new ArrayBuffer(e),i=new Uint8Array(r),t&&i.set(t,0),{buffer:r,array:i,view:new DataView(r)}}function o(){}function a(e){function t(t,r){var o=new Blob([e],{type:V});i=new l(o),i.init(function(){n.size=i.size,t()},r)}function r(e,t,r,n){i.readUint8Array(e,t,r,n)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function s(e){function t(t){for(var r=e.length;"="==e.charAt(r-1);)r--;i=e.indexOf(",")+1,o.size=Math.floor(.75*(r-i)),t()}function r(t,r,o){var a,s=n(r),l=4*Math.floor(t/3),u=4*Math.ceil((t+r)/3),c=window.atob(e.substring(l+i,u+i)),h=t-3*Math.floor(l/4);for(a=h;h+r>a;a++)s.array[a-h]=c.charCodeAt(a);o(s.array)}var i,o=this;o.size=0,o.init=t,o.readUint8Array=r}function l(e){function t(t){this.size=e.size,t()}function r(t,r,n,o){var a=new FileReader;a.onload=function(e){n(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(i(e,t,r))}var n=this;n.size=0,n.init=t,n.readUint8Array=r}function u(){}function c(e){function t(e){n=new Blob([],{type:V}),e()}function r(e,t){n=new Blob([n,P?e:e.buffer],{type:V}),t()}function i(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=r,i.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function h(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function r(e,t){var r,i=a.length,n=a;for(a="",r=0;r<3*Math.floor((i+e.length)/3)-i;r++)n+=String.fromCharCode(e[r]);for(;r<e.length;r++)a+=String.fromCharCode(e[r]);n.length>2?o+=window.btoa(n):a=n,t()}function i(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=r,n.getData=i}function d(e){function t(t){n=new Blob([],{type:e}),t()}function r(t,r){n=new Blob([n,P?t:t.buffer],{type:e}),r()}function i(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function p(e,t,r,i,n,o,a,s,l,u){function c(){e.removeEventListener(k,h,!1),s(m)}function h(e){var t=e.data,i=t.data;t.onappend&&(m+=i.length,r.writeUint8Array(i,function(){o(!1,i),d()},u)),t.onflush&&(i?(m+=i.length,r.writeUint8Array(i,function(){o(!1,i),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function d(){p=f*F,n>p?t.readUint8Array(i+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),f++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,m,f=0;m=0,e.addEventListener(k,h,!1),d()}function m(e,t,r,i,n,o,a,s,l,u){function c(){var m;h=d*F,n>h?t.readUint8Array(i+h,Math.min(F,n-h),function(t){var s=e.append(t,function(){a&&a(i+h,n)});p+=s.length,o(!0,t),r.writeUint8Array(s,function(){o(!1,s),d++,setTimeout(c,1)},u),a&&a(h,n)},l):(m=e.flush(),m?(p+=m.length,r.writeUint8Array(m,function(){o(!1,m),s(p)},u)):s(p))}var h,d=0,p=0;c()}function f(e,i,n,o,a,s,l,u,c){function h(e,t){a&&!e&&v.append(t)}function d(e){s(e,v.get())}var f,v=new r;return t.zip.useWebWorkers?(f=new Worker(t.zip.workerScriptsPath+B),p(f,e,i,n,o,h,l,d,u,c)):m(new t.zip.Inflater,e,i,n,o,h,l,d,u,c),f}function v(e,i,n,o,a,s,l){function u(e,t){e&&f.append(t)}function c(e){o(e,f.get())}function h(){d.removeEventListener(k,h,!1),p(d,e,i,0,e.size,u,a,c,s,l)}var d,f=new r;return t.zip.useWebWorkers?(d=new Worker(t.zip.workerScriptsPath+z),d.addEventListener(k,h,!1),d.postMessage({init:!0,level:n})):m(new t.zip.Deflater,e,i,0,e.size,u,a,c,s,l),d}function g(e,t,i,n,o,a,s,l,u){function c(){var r=h*F;n>r?e.readUint8Array(i+r,Math.min(F,n-r),function(e){o&&d.append(e),s&&s(r,n,e),t.writeUint8Array(e,function(){h++,c()},u)},l):a(n,d.get())}var h=0,d=new r;c()}function _(e){var t,r,i="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","�?","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","�?","Ê","Ë","È","i","�?","Î","�?","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","�?","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r=255&e.charCodeAt(t),i+=r>127?n[r-128]:String.fromCharCode(r);return i}function y(e){return decodeURIComponent(escape(e))}function C(e){var t,r="";for(t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r}function w(e){var t=(4294901760&e)>>16,r=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&r)>>11,(2016&r)>>5,2*(31&r),0)}catch(i){}}function S(e,t,r,i,n){return e.version=t.view.getUint16(r,!0),e.bitFlag=t.view.getUint16(r+2,!0),e.compressionMethod=t.view.getUint16(r+4,!0),e.lastModDateRaw=t.view.getUint32(r+6,!0),e.lastModDate=w(e.lastModDateRaw),1===(1&e.bitFlag)?(n(M),void 0):((i||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(r+10,!0),e.compressedSize=t.view.getUint32(r+14,!0),e.uncompressedSize=t.view.getUint32(r+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?(n(I),void 0):(e.filenameLength=t.view.getUint16(r+22,!0),e.extraFieldLength=t.view.getUint16(r+24,!0),void 0))}function E(e,t){function r(){}function i(r,o){e.readUint8Array(e.size-r,r,function(e){var t=n(e.length,e).view;1347093766!=t.getUint32(0)?i(r+1,o):o(t)},function(){t(D)})}return r.prototype.getData=function(r,i,o,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=n(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():r.getData(function(e){s(i,e)})}function c(){s(t,L)}function h(){s(t,R)}var d,p=this;e.readUint8Array(p.offset,30,function(i){var s,l=n(i.length,i);return 1347093252!=l.view.getUint32(0)?(t(A),void 0):(S(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,r.init(function(){0===p.compressionMethod?g(e,r,s,p.compressedSize,a,u,o,c,h):d=f(e,r,s,p.compressedSize,a,u,o,c,h)},h),void 0)},c)},{getEntries:function(o){return e.size<22?(t(A),void 0):(i(22,function(i){var a,s;a=i.getUint32(16,!0),s=i.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var i,a,l,u,c=0,h=[],d=n(e.length,e);for(i=0;s>i;i++){if(a=new r,1347092738!=d.view.getUint32(c))return t(A),void 0;S(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=C(d.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?y(l):_(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=C(d.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?y(u):_(u),h.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}o(h)},function(){t(D)})}),void 0)},close:function(e){e&&e()}}}function b(e){return unescape(encodeURIComponent(e))}function x(e){var t,r=[];for(t=0;t<e.length;t++)r.push(e.charCodeAt(t));return r}function T(e,t,r){function i(e,t){s&&s.terminate(),s=null,e&&e(t)}function o(){i(t,O)}function a(){i(t,L)}var s,l={},u=[],c=0;return{add:function(h,d,p,m,f){function _(t){var i;E=f.lastModDate||new Date,w=n(26),l[h]={headerArray:w.array,directory:f.directory,filename:S,offset:c,comment:x(b(f.comment||""))},w.view.setUint32(0,335546376),f.version&&w.view.setUint8(0,f.version),r||0===f.level||f.directory||w.view.setUint16(4,2048),w.view.setUint16(6,(E.getHours()<<6|E.getMinutes())<<5|E.getSeconds()/2,!0),w.view.setUint16(8,(E.getFullYear()-1980<<4|E.getMonth()+1)<<5|E.getDate(),!0),w.view.setUint16(22,S.length,!0),i=n(30+S.length),i.view.setUint32(0,1347093252),i.array.set(w.array,4),i.array.set(S,30),c+=i.array.length,e.writeUint8Array(i.array,t,o)}function y(t,r){var a=n(16);c+=t||0,a.view.setUint32(0,1347094280),"undefined"!=typeof r&&(w.view.setUint32(10,r,!0),a.view.setUint32(4,r,!0)),d&&(a.view.setUint32(8,t,!0),w.view.setUint32(14,t,!0),a.view.setUint32(12,d.size,!0),w.view.setUint32(18,d.size,!0)),e.writeUint8Array(a.array,function(){c+=16,i(p)},o)}function C(){return f=f||{},h=h.trim(),f.directory&&"/"!=h.charAt(h.length-1)&&(h+="/"),l.hasOwnProperty(h)?(t(N),void 0):(S=x(b(h)),u.push(h),_(function(){d?r||0===f.level?g(d,e,0,d.size,!0,y,m,a,o):s=v(d,e,f.level,y,m,a,o):y()},o),void 0)}var w,S,E;d?d.init(C,a):C()},close:function(t){var r,a,s,h=0,d=0;for(a=0;a<u.length;a++)s=l[u[a]],h+=46+s.filename.length+s.comment.length;for(r=n(h+22),a=0;a<u.length;a++)s=l[u[a]],r.view.setUint32(d,1347092738),r.view.setUint16(d+4,5120),r.array.set(s.headerArray,d+6),r.view.setUint16(d+32,s.comment.length,!0),s.directory&&r.view.setUint8(d+38,16),r.view.setUint32(d+42,s.offset,!0),r.array.set(s.filename,d+46),r.array.set(s.comment,d+46+s.filename.length),d+=46+s.filename.length+s.comment.length;r.view.setUint32(d,1347093766),r.view.setUint16(d+8,u.length,!0),r.view.setUint16(d+10,u.length,!0),r.view.setUint32(d+12,h,!0),r.view.setUint32(d+16,c,!0),e.writeUint8Array(r.array,function(){i(function(){e.getData(t)})},o)}}}var P,A="File format is not recognized.",M="File contains encrypted entry.",I="File is using Zip64 (4gb+ file size).",D="Error while reading zip file.",O="Error while writing zip file.",R="Error while writing file data.",L="Error while reading file data.",N="File already exists.",F=524288,B="inflate.js",z="deflate.js",V="text/plain",k="message";try{P=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(U){}r.prototype.table=function(){var e,t,r,i=[];for(e=0;256>e;e++){for(r=e,t=0;8>t;t++)1&r?r=3988292384^r>>>1:r>>>=1;i[e]=r}return i}(),a.prototype=new o,a.prototype.constructor=a,s.prototype=new o,s.prototype.constructor=s,l.prototype=new o,l.prototype.constructor=l,u.prototype.getData=function(e){e(this.data)},c.prototype=new u,c.prototype.constructor=c,h.prototype=new u,h.prototype.constructor=h,d.prototype=new u,d.prototype.constructor=d,t.zip={Reader:o,Writer:u,BlobReader:l,Data64URIReader:s,TextReader:a,BlobWriter:d,Data64URIWriter:h,TextWriter:c,createReader:function(e,t,r){e.init(function(){t(E(e,r))},r)},createWriter:function(e,t,r,i){e.init(function(){t(T(e,r,i))},r)},workerScriptsPath:e("ThirdParty/Workers/"),useWebWorkers:!0}}(t),t.zip}),r("DataSources/KmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z){"use strict";function J(e){var t=e.slice(0,Math.min(4,e.size)),r=I.defer(),i=new FileReader;return i.addEventListener("load",function(){r.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){r.reject(i.error)}),i.readAsArrayBuffer(t),r}function Q(e){var t=I.defer(),r=new FileReader;return r.addEventListener("load",function(){t.resolve(r.result)}),r.addEventListener("error",function(){t.reject(r.error)}),r.readAsText(e),t}function K(e,t,r,i){t.getData(new D.TextWriter,function(e){r.kml=Kt.parseFromString(e,"application/xml"),i.resolve()})}function $(e,t,r,i){var n=s(Qt.detectFromFilename(t.filename),"application/octet-stream");t.getData(new D.Data64URIWriter(n),function(e){r[t.filename]=e,i.resolve()})}function et(e,t,r,i){for(var n=i.keys,o=new M("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(r),c=new M(u).resolve(o).toString(),h=n.indexOf(c);if(-1!==h){var d=n[h];l.setAttribute(r,i[d]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",d)}}}function tt(e,t){return l(t)&&new M(e).isAbsolute()&&(e=t.getURL(e)),e}function rt(e,t){var r=st(e,"id");r=l(r)?r:a();var i=t.getOrCreateEntity(r);return l(i.kml)||(i.addProperty("kml"),i.kml=new cr),i}function it(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function nt(e){if(!l(e))return void 0;var t=e.match(/[^\s,\n]+/g);if(2!==t.length&&3!==t.length)return window.console.log("KML - Invalid coordinates: "+e),void 0;var i=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return i=isNaN(i)?0:i,n=isNaN(n)?0:n,o=isNaN(o)?0:o,r.fromDegrees(i,n,o)}function ot(e){if(!l(e))return void 0;for(var t=e.textContent.match(/[^\s\n]+/g),r=t.length,i=new Array(r),n=0,o=0;r>o;o++)i[n++]=nt(t[o]);return i}function at(e,t){if(!l(e))return void 0;var r=e.getAttribute(t);if(null!==r){var i=parseFloat(r);return isNaN(i)?void 0:i}return void 0}function st(e,t){if(!l(e))return void 0;var r=e.getAttribute(t);return null!==r?r:void 0}function lt(e,t,r){if(!l(e))return void 0;for(var i=e.childNodes,n=i.length,o=0;n>o;o++){var a=i[o];if(a.localName===t&&-1!==r.indexOf(a.namespaceURI))return a}return void 0}function ut(e,t,r){if(!l(e))return void 0;for(var i=[],n=e.getElementsByTagName(t),o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==r.indexOf(s.namespaceURI)&&i.push(s)}return i}function ct(e,t,r){if(!l(e))return[];for(var i=[],n=e.childNodes,o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==r.indexOf(s.namespaceURI)&&i.push(s)}return i}function ht(e,t,r){var i=lt(e,t,r);if(l(i)){var n=parseFloat(i.textContent);return isNaN(n)?void 0:n}return void 0}function dt(e,t,r){var i=lt(e,t,r);return l(i)?i.textContent.trim():void 0}function pt(e,t,r){var i=lt(e,t,r);return l(i)?"1"===i.textContent:void 0}function mt(e,t,r,i){if(!l(e))return void 0;var n=!1;if(l(i)){var o=i[e];l(o)&&(n=!0,e=o)}if(!n&&l(r)){var a=new M(document.location.href);r=new M(r),e=new M(e).resolve(r.resolve(a)).toString(),e=tt(e,t)}return e}function ft(e,t){if(!l(e))return void 0;"#"===e[0]&&(e=e.substring(1));var r=parseInt(e.substring(0,2),16)/255,i=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?or.maximumRed=a:or.red=0,n>0?or.maximumGreen=n:or.green=0,i>0?or.maximumBlue=i:or.blue=0,or.alpha=r,o.fromRandom(or)):new o(a,n,i,r)}function vt(e,t,r){var i=dt(e,t,r);return l(i)?ft(i,"random"===dt(e,"colorMode",r)):void 0}function gt(e){var t=lt(e,"TimeStamp",nr.kmlgx),r=dt(t,"when",nr.kmlgx);if(!l(t)||!l(r)||0===r.length)return void 0;var i=f.fromIso8601(r),n=new x;return n.addInterval(new b({start:i,stop:m.MAXIMUM_VALUE})),n}function _t(e){var t=lt(e,"TimeSpan",nr.kmlgx);if(!l(t))return void 0;var r,i=lt(t,"begin",nr.kmlgx),n=l(i)?f.fromIso8601(i.textContent):void 0,o=lt(t,"end",nr.kmlgx),a=l(o)?f.fromIso8601(o.textContent):void 0;if(l(n)&&l(a)){if(f.lessThan(a,n)){var s=n;n=a,a=s}r=new x,r.addInterval(new b({start:n,stop:a}))}else l(n)?(r=new x,r.addInterval(new b({start:n,stop:m.MAXIMUM_VALUE}))):l(a)&&(r=new x,r.addInterval(new b({start:m.MINIMUM_VALUE,stop:a})));return r}function yt(){var e=new O;return e.width=er,e.height=er,e.scaleByDistance=new y(2414016,1,16093e3,.1),e}function Ct(){var e=new U;return e.outline=!0,e.outlineColor=o.WHITE,e}function wt(){var e=new V;return e.translucencyByDistance=new y(3e6,1,5e6,0),e.pixelOffset=new t(17,0),e.horizontalOrigin=T.LEFT,e.font="16px sans-serif",e.style=P.FILL_AND_OUTLINE,e}function St(i,n,o,a,u){var c=ht(n,"scale",nr.kml),h=ht(n,"heading",nr.kml),d=vt(n,"color",nr.kml),p=lt(n,"Icon",nr.kml),m=dt(p,"href",nr.kml),f=mt(m,i._proxy,a,u),v=ht(p,"x",nr.gx),g=ht(p,"y",nr.gx),y=ht(p,"w",nr.gx),C=ht(p,"h",nr.gx),w=lt(n,"hotSpot",nr.kml),S=at(w,"x"),E=at(w,"y"),b=st(w,"xunits"),x=st(w,"yunits"),T=o.billboard;l(T)||(T=yt(i),o.billboard=T),T.image=f,T.scale=c,T.color=d,(l(v)||l(g)||l(y)||l(C))&&(T.imageSubRegion=new e(v,g,y,C)),l(h)&&0!==h&&(T.rotation=_.toRadians(-h),T.alignedAxis=r.UNIT_Z),c=s(c,1);var P,A;l(S)&&("pixels"===b?P=-S*c:"insetPixels"===b?P=(S-er)*c:"fraction"===b&&(P=-er*c*S),P+=.5*er*c),l(E)&&("pixels"===x?A=E:"insetPixels"===x?A=-E:"fraction"===x&&(A=E*er),A-=.5*er*c),(l(P)||l(A))&&(T.pixelOffset=new t(P,A))}function Et(e,t,r,i,n){for(var a=0,u=t.childNodes.length;u>a;a++){var c=t.childNodes.item(a);if("IconStyle"===c.nodeName)St(e,c,r,i,n);else if("LabelStyle"===c.nodeName){var h=r.label;l(h)||(h=wt(),r.label=h),h.scale=s(ht(c,"scale",nr.kml),h.scale),h.fillColor=s(vt(c,"color",nr.kml),h.fillColor),h.text=r.name}else if("LineStyle"===c.nodeName){var d=r.polyline;l(d)||(d=new W,r.polyline=d),d.width=ht(c,"width",nr.kml),d.material=vt(c,"color",nr.kml)}else if("PolyStyle"===c.nodeName){var p=r.polygon;l(p)||(p=Ct(),r.polygon=p),p.material=s(vt(c,"color",nr.kml),p.material),p.fill=s(pt(c,"fill",nr.kml),p.fill),p.outline=s(pt(c,"outline",nr.kml),p.outline)}else if("BalloonStyle"===c.nodeName){var m=s(ft(dt(c,"bgColor",nr.kml)),o.WHITE),f=s(ft(dt(c,"textColor",nr.kml)),o.BLACK),v=dt(c,"text",nr.kml);r.addProperty("balloonStyle"),r.balloonStyle={bgColor:m,textColor:f,text:v}}}}function bt(e,t,r,i,n,o){var a=new B,s=ct(r,"Style",nr.kml),u=s.length;u>0&&Et(t,s[u-1],a,n,o);var c=dt(r,"styleUrl",nr.kml);if(l(c)){var h=c,d=i.getById(h);l(d)||(d=i.getById("#"+h)),l(d)&&a.merge(d)}return a}function xt(e,t,r){return I(g(tt(t,e._proxy)),function(i){return Tt(e,i,r,t,!0)})}function Tt(e,t,r,i,n,o){var a,s,u,c,h=ut(t,"Style",nr.kml);if(l(h)){var d=h.length;for(a=0;d>a;a++)c=h[a],s=st(c,"id"),l(s)&&(s="#"+s,n&&l(i)&&(s=i+s),l(r.getById(s))||(u=new B({id:s}),r.add(u),Et(e,c,u,i,o)))}var p=ut(t,"StyleMap",nr.kml);if(l(p)){var m=p.length;for(a=0;m>a;a++){var f=p[a];if(s=st(f,"id"),l(s))for(var v=ct(f,"Pair",nr.kml),g=0;g<v.length;g++){var _=v[g];if("normal"===dt(_,"key",nr.kml)){if(s="#"+s,n&&l(i)&&(s=i+s),!l(r.getById(s))){u=r.getOrCreateEntity(s);var y=dt(_,"styleUrl",nr.kml);if(l(y)){var C=r.getOrCreateEntity(y);l(C)&&u.merge(C)}else c=lt(_,"Style",nr.kml),Et(e,c,u,i,o)}break}}}}var w={},S=[],E=t.getElementsByTagName("styleUrl"),b=E.length;for(a=0;b>a;a++){var x=E[a].textContent;if("#"!==x[0]){var T=x.split("#");if(2===T.length){var P=T[0];if(!l(w[P])){if(l(i)){var A=new M(document.location.href);i=new M(i),P=new M(P).resolve(i.resolve(A)).toString()}S.push(xt(e,P,r,i))}}}}return S}function Pt(e,t,r){var i=new q(e._entityCollection,t.id,["position"]),n=new Y(t.position);t.polyline=l(r.polyline)?r.polyline.clone():new W,t.polyline.positions=new G([i,n])}function At(e,t,r){return"relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t?e:((l(t)&&"clampToGround"!==t||l(r)&&"clampToSeaFloor"!==r)&&window.console.log("KML - Unknown altitudeMode: "+s(t,r)),new Y(e))}function Mt(e,t,r){if(!l(e))return void 0;if("relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t)return e;(l(t)&&"clampToGround"!==t||l(r)&&"clampToSeaFloor"!==r)&&window.console.log("KML - Unknown altitudeMode: "+s(t,r));for(var i=e.length,n=0;i>n;n++){var o=e[n];h.WGS84.scaleToGeodeticSurface(o,o)}return e}function It(e,r,i){var n=r.label;l(n)||(n=l(i.label)?i.label.clone():wt(),r.label=n),n.text=r.name;var a=r.billboard;if(l(a)||(a=l(i.billboard)?i.billboard.clone():yt(),r.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 Dt(e,t,r){var i=t.path;l(i)||(i=new k,i.leadTime=0,t.path=i);var n=r.polyline;l(n)&&(i.material=n.material,i.width=n.width)}function Ot(e,t,r,i){var n=dt(t,"coordinates",nr.kml),o=dt(t,"altitudeMode",nr.kml),a=dt(t,"altitudeMode",nr.gx),s=pt(t,"extrude",nr.kml),u=nt(n);l(u)&&(r.position=At(new L(u),o,a),It(e,r,i),s&&it(o,a)&&Pt(e,r,i))}function Rt(e,t,r,i){var n=lt(t,"coordinates",nr.kml),a=dt(t,"altitudeMode",nr.kml),s=dt(t,"altitudeMode",nr.gx),u=pt(t,"extrude",nr.kml),c=pt(t,"tessellate",nr.kml),h=it(a,s),d=ot(n),p=i.polyline;if(h&&u){var m=new Z;r.wall=m,m.positions=d;var f=i.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 W,r.polyline=p,p.positions=Mt(d,a,s),(!c||h)&&(p.followSurface=!1)}function Lt(e,t,r,i){var n=lt(t,"outerBoundaryIs",nr.kml),a=lt(n,"LinearRing",nr.kml),s=lt(a,"coordinates",nr.kml),u=ot(s),c=pt(t,"extrude",nr.kml),h=dt(t,"altitudeMode",nr.kml),d=dt(t,"altitudeMode",nr.gx),p=it(h,d),m=l(i.polygon)?i.polygon.clone():Ct(),f=i.polyline;if(l(f)&&(m.outlineColor=l(f.material)?f.material.color:o.WHITE,m.outlineWidth=f.width),r.polygon=m,p&&(m.perPositionHeight=!0,m.extrudedHeight=c?0:void 0),l(u)){for(var v=new w(u),g=ct(t,"innerBoundaryIs",nr.kml),_=0;_<g.length;_++){a=ct(g[_],"LinearRing",nr.kml);for(var y=0;y<a.length;y++)s=lt(a[y],"coordinates",nr.kml),u=ot(s),l(u)&&v.holes.push(new w(u))}m.hierarchy=v}}function Nt(e,t,r,i){for(var n=dt(t,"altitudeMode",nr.kml),o=dt(t,"altitudeMode",nr.gx),a=ct(t,"coord",nr.gx),s=ct(t,"when",nr.kml),u=pt(t,"extrude",nr.kml),c=it(n,o),h=Math.min(a.length,s.length),d=[],p=[],m=0;h>m;m++){var v=nt(a[m].textContent);l(v)&&(d.push(v),p.push(f.fromIso8601(s[m].textContent)))}var g=new j;g.addSamples(p,d),r.position=At(g,n,o),It(e,r,i),Dt(e,r,i),r.availability=new x,s.length>0&&r.availability.addInterval(new b({start:p[0],stop:p[p.length-1]})),c&&u&&Pt(e,r,i)}function Ft(e,t,r,i,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new j;h.addSamples(e,t),r.intervals.addInterval(new b({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:At(h,a,s)})),i.addInterval(new b({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new b({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Bt(e,t,r,i){for(var n,o,a,s=pt(t,"interpolate",nr.gx),u=ct(t,"Track",nr.gx),c=!1,h=new X,d=new x,p=new R,m=0,v=u.length;v>m;m++){var g=u[m],_=ct(g,"when",nr.kml),y=ct(g,"coord",nr.gx),C=dt(g,"altitudeMode",nr.kml),w=dt(g,"altitudeMode",nr.gx),S=it(C,w),E=pt(g,"extrude",nr.kml),b=Math.min(y.length,_.length),T=[];n=[];for(var P=0;b>P;P++){var A=nt(y[P].textContent);l(A)&&(T.push(A),n.push(f.fromIso8601(_[P].textContent)))}s&&(l(o)&&Ft([o,n[0]],[a,T[0]],p,d,h,!1,"absolute",void 0,!1),o=n[b-1],a=T[T.length-1]),Ft(n,T,p,d,h,S&&E,C,w,!0),c=c||S&&E}r.availability=d,r.position=p,It(e,r,i),Dt(e,r,i),c&&(Pt(e,r,i),r.polyline.show=h)}function zt(e,t,r,i){for(var n=t.childNodes,o=0,a=n.length;a>o;o++){var s=n.item(o),u=sr[s.localName];if(l(u)){var c=rt(s,e._entityCollection);c.parent=r,c.name=r.name,c.availability=r.availability,c.description=r.description,c.kml=r.kml,u(e,s,c,i)}}}function Vt(e,t){var r=lt(e,"ExtendedData",nr.kml);if(!l(r))return void 0;var i={},n=ct(r,"Data",nr.kml);if(l(n))for(var o=n.length,a=0;o>a;a++){var s=n[a],u=st(s,"name");l(u)&&(i[u]={displayName:dt(s,"displayName",nr.kml),value:dt(s,"value",nr.kml)})}t.kml.extendedData=i}function kt(e,t,r,i){var n,a,u,c=t.kml,h=c.extendedData,d=dt(e,"description",nr.kml),p=s(t.balloonStyle,r.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),w=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=h[C],l(g)&&(g=w?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='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',n=0;n<u.length;n++)a=u[n],g=h[a],v+="<tr><th>"+s(g.displayName,a)+"</th><td>"+s(g.value,"")+"</td></tr>";v+="</tbody></table>"}if(l(v)){v=$t.link(v),ar.innerHTML=v;var S=ar.querySelectorAll("a");for(n=0;n<S.length;n++)S[n].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(et(ar,"a","href",i),et(ar,"img","src",i));var E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+="background-color:"+m.toCssColorString()+";",E+="color:"+f.toCssColorString()+";",E+='">',E+=ar.innerHTML+"</div>",ar.innerHTML="",t.description=E}}function Ut(e,t,r,i,n,o,a){var u=rt(r,i),c=u.kml,h=bt(u,e,r,n,o,a),d=dt(r,"name",nr.kml);u.name=d,u.parent=t;var p=_t(r);l(p)||(p=gt(r)),u.availability=p;var m=pt(r,"visibility",nr.kml);u.show=s(m,!0);var f=lt(r,"author",nr.atom),v=c.author;v.name=dt(f,"name",nr.atom),v.uri=dt(f,"uri",nr.atom),v.email=dt(f,"email",nr.atom);var g=lt(r,"link",nr.atom),_=c.link;return _.href=st(g,"href"),_.hreflang=st(g,"hreflang"),_.rel=st(g,"rel"),_.type=st(g,"type"),_.title=st(g,"title"),_.length=st(g,"length"),c.address=dt(r,"address",nr.kml),c.phoneNumber=dt(r,"phoneNumber",nr.kml),c.snippet=dt(r,"Snippet",nr.kml),Vt(r,u),kt(r,u,h,a),{entity:u,styleEntity:h}}function Wt(e,t,r,i,n,o,a){for(var s=Object.keys(lr),l=s.length,u=0;l>u;u++)for(var c=s[u],h=lr[c],d=r.childNodes,p=d.length,m=0;p>m;m++){var f=d[m];f.localName===c&&-1!==nr.kml.indexOf(f.namespaceURI)&&h(e,t,f,i,n,o,a)}}function Gt(e,t,r,i,n,o,a){var s=Ut(e,t,r,i,n,o,a);Wt(e,s.entity,r,i,n,o,a)}function Ht(e,t,r,i,n,o,a){for(var s=Ut(e,t,r,i,n,o,a),u=s.entity,c=s.styleEntity,h=!1,d=r.childNodes,p=0,m=d.length;m>p&&!h;p++){var f=d.item(p),v=sr[f.localName];l(v)&&(v(e,f,u,c),h=!0)}h||(u.merge(c),It(e,u,c))}function qt(e,t,r,i,n,o,a){var s=Ut(e,t,r,i,n,o,a),u=s.entity;s.stylEntity;var c,h=!1,d=ot(lt(r,"LatLonQuad",nr.gx));if(l(d))c=Ct(),c.hierarchy=new w(d),u.polygon=c,h=!0;else{c=new H,u.rectangle=c;var p=lt(r,"LatLonBox",nr.kml);if(l(p)){var m=ht(p,"west",nr.kml),f=ht(p,"south",nr.kml),v=ht(p,"east",nr.kml),g=ht(p,"north",nr.kml);l(m)&&(m=_.negativePiToPi(_.toRadians(m))),l(f)&&(f=_.negativePiToPi(_.toRadians(f))),l(v)&&(v=_.negativePiToPi(_.toRadians(v))),l(g)&&(g=_.negativePiToPi(_.toRadians(g))),c.coordinates=new S(m,f,v,g);var y=ht(p,"rotation",nr.kml);l(y)&&(c.rotation=_.toRadians(y))}}var C=lt(r,"Icon",nr.kml),E=dt(C,"href",nr.kml);l(E)?(h&&window.console.log("KML - gx:LatLonQuad Icon does not support texture projection."),c.material=mt(E,e._proxy,o,a)):c.material=vt(r,"color",nr.kml);var b=dt(r,"altitudeMode",nr.kml);l(b)?"absolute"===b?c.height=ht(r,"altitude",nr.kml):"clampToGround"===b||window.console.log("KML - Unknown altitudeMode: "+b):(b=dt(r,"altitudeMode",nr.gx),"relativeToSeaFloor"===b?(window.console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),c.height=ht(r,"altitude",nr.kml)):"clampToSeaFloor"===b?window.console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(b)&&window.console.log("KML - Unknown altitudeMode: "+b))}function jt(e,t,r){window.console.log("KML - Unsupported feature: "+r.nodeName)}function Yt(e,t,r,i,n,o,a){var s=Ut(e,t,r,i,n,o,a),u=s.entity,c=lt(r,"Link",nr.kml);if(l(c)){var h=dt(c,"href",nr.kml);if(l(h)){h=mt(h,void 0,o,a);var d=new ur(e._proxy),p=I(d.load(h),function(){for(var t=d.entities.values,r=0;r<t.length;r++)e._entityCollection.suspendEvents(),t[r].parent=u,e._entityCollection.add(t[r]),e._entityCollection.resumeEvents()});e._promises.push(p)}}}function Xt(e,t,r,i,n,o,a){var s=lr[t.nodeName];l(s)?s(e,r,t,i,n,o,a):window.console.log("KML - Unsupported feature node: "+t.nodeName)}function Zt(e,t,r,o){var a=e._entityCollection;e._promises=[],a.removeAll();var s=t.documentElement,u="Document"===s.localName?s:lt(s,"Document",nr.kml),c=dt(u,"name",nr.kml);!l(c)&&l(r)&&(c=p(r));var h=new z;return I.all(Tt(e,t,h,r,!1,o),function(){var s=t.documentElement;return"kml"===s.nodeName&&(s=s.firstElementChild),Xt(e,s,void 0,a,h,r,o),I.all(e._promises,function(){var t,r=a.computeAvailability(),o=r.start,s=r.stop,l=f.equals(o,m.MINIMUM_VALUE),u=f.equals(s,m.MAXIMUM_VALUE);if(!l||!u){var h;l&&(h=new Date,h.setHours(0,0,0,0),o=f.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),s=f.fromDate(h)),t=new F,t.startTime=o,t.stopTime=s,t.currentTime=f.clone(o),t.clockRange=i.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=Math.round(Math.min(Math.max(f.secondsDifference(s,o)/60,1),31556900))}var d=!1;return e._name!==c&&(e._name=c,d=!0),t!==e._clock&&(d=!0,e._clock=t),d&&e._changed.raiseEvent(e),N.setLoading(e,!1),e})})}function Jt(e,t,r){var i=I.defer();return D.createReader(new D.BlobReader(t),function(t){t.getEntries(function(n){for(var o=[],a=!1,s={},u=0;u<n.length;u++){var c=n[u];if(!c.directory){var h=I.defer();o.push(h.promise),!a&&/\.kml$/i.test(c.filename)?(a=!0,K(t,c,s,h)):$(t,c,s,h)}}I.all(o).then(function(){return t.close(),l(s.kml)?(s.keys=Object.keys(s),Zt(e,s.kml,r,s)):(i.reject(new E("KMZ file does not contain a KML document.")),void 0)}).then(i.resolve).otherwise(i.reject)})},function(e){i.reject(e)}),i}var Qt={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=t.substr(t.lastIndexOf(".")+1),Qt[t]}},Kt=new DOMParser,$t=new A({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){return t.protocolUrlMatch?void 0:!1}}),er=32,tr=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],rr=["http://www.google.com/kml/ext/2.2"],ir=["http://www.w3.org/2005/Atom"],nr={kml:tr,gx:rr,atom:ir,kmlgx:tr.concat(rr)},or={},ar=document.createElement("div"),sr={Point:Ot,LineString:Rt,LinearRing:Rt,Polygon:Lt,Track:Nt,MultiTrack:Bt,MultiGeometry:zt},lr={Document:Wt,Folder:Gt,Placemark:Ht,NetworkLink:Yt,GroundOverlay:qt,PhotoOverlay:jt,ScreenOverlay:jt},ur=function(e){this._changed=new d,this._error=new d,this._loading=new d,this._clock=void 0,this._entityCollection=new z,this._name=void 0,this._isLoading=!1,this._proxy=e,this._pinBuilder=new C,this._promises=[]};ur.load=function(e,t){t=s(t,s.EMPTY_OBJECT);var r=new ur(t.proxy);return r.load(e,t)},u(ur.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}}}),ur.prototype.load=function(e,t){N.setLoading(this,!0),t=s(t,s.EMPTY_OBJECT);var r=t.sourceUri,i=e;"string"==typeof e&&(i=v(tt(e,this._proxy)),r=s(r,e));var n=this;return I(i,function(e){return e instanceof Blob?J(e).then(function(t){return t?Jt(n,e,r):I(Q(e)).then(function(e){var t,i;try{t=Kt.parseFromString(e,"application/xml")}catch(o){i=o.toString()}if(l(i)||t.body||"parsererror"===t.documentElement.tagName){var a=l(i)?i:t.documentElement.firstChild.nodeValue;throw a||(a=t.body.innerText),new E(a)}return Zt(n,t,r,void 0)})}):I(Zt(n,e,r,void 0))}).otherwise(function(e){return N.setLoading(n,!1),n._error.raiseEvent(n,e),window.console.log(e),I.reject(e)})};var cr=function(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0};return ur}),r("DataSources/PolylineArrowMaterialProperty",["../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 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"PolylineArrow"},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}),r("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,r,i,n,o){"use strict";var a=function(e){this._value=void 0,this._definitionChanged=new i,this._eventHelper=new n,this.setValue(e)};return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var r=t.length,i=0;r>i;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/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,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e,r){this._position=void 0,this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new a,this.position=e,this.ellipsoid=t(r,o.WGS84)};i(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&&(r(t)&&this._subscription(),this._position=e,r(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,i){var n=this._position;if(h.isConstant(n))return void 0;var o=n.getValue(t,p),a=n.getValue(s.addSeconds(t,_,v),m);if(!r(o))return void 0;if(!r(a)&&(a=o,o=n.getValue(s.addSeconds(t,-_,v),m),!r(o)))return void 0;if(e.equals(o,a))return void 0;var l=e.subtract(a,o,f);return e.normalize(l,l),c.rotationMatrixFromPositionVelocity(o,l,this._ellipsoid,g),u.fromRotationMatrix(g,i)},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}),r("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=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 p=a.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,u=0;c>u;++u)l=p[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),p=0,m=0,f=0,v=-1,g=0;c>g;++g){if(p>=-h&&h>=p&&m>=-d&&d>=m){var _=4*((d-m)*n+p+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(p===m||0>p&&-p===m||p>0&&p===1-m){var C=f;f=-v,v=C}p+=f,m+=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 p(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function m(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 p=r.backOperation,m=p.fail,f=p.zFail,v=p.zPass;e.stencilOpSeparate(e.BACK,m,f,v)}}function C(e,t,r){var n=t.viewport;i(n)||(n=x,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(p),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&r.push(m),(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,{}),p=r(l.depthRange,{}),m=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(p.near,0),far:r(p.far,1)},this.depthTest={enabled:r(m.enabled,!1),func:r(m.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.lineWidth<n.minimumAliasedLineWidth||this.lineWidth>n.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)},x=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),p(e,t),m(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/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function h(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function d(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function p(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function m(e,t,r,i){this.name=r,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}function f(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function v(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function g(e,r,i,n){this.name=i,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function _(e,t,i,n){this.name=i,this.value=void 0,this._value=new r,this._gl=e,this._location=n}function y(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=i}function C(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=i}function w(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=i}var S=function(e,t,r,i){switch(t.type){case e.FLOAT:return new c(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new d(e,t,r,i);case e.FLOAT_VEC4:return new p(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new f(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new v(e,t,r,i);
case e.INT_VEC3:case e.BOOL_VEC3:return new g(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new _(e,t,r,i);case e.FLOAT_MAT2:return new y(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new w(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}};return c.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},h.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))},d.prototype.set=function(){var e=this.value;if(n(e.red))i.equals(e,this._value)||(this._value=i.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))}},p.prototype.set=function(){var e=this.value;if(n(e.red))i.equals(e,this._value)||(this._value=i.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+'".');r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w))}},m.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},m.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},f.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},v.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))},g.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))},_.prototype.set=function(){var e=this.value;r.equals(e,this._value)||(r.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},y.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},C.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},w.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},S}),r("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,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=i[0]}function d(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=i[0]}function p(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=i[0]}function m(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function f(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}function v(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=i[0]}function g(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=i[0]}function _(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=i[0]}function y(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=i[0]}function C(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function w(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=i[0]}function S(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=i[0]}var E=function(e,t,r,i){switch(t.type){case e.FLOAT:return new h(e,t,r,i);case e.FLOAT_VEC2:return new d(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new m(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,r,i);case e.INT:case e.BOOL:return new v(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new C(e,t,r,i);case e.FLOAT_MAT3:return new w(e,t,r,i);case e.FLOAT_MAT4:return new S(e,t,r,i);default:throw new c("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}};return h.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;t>n;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1fv(this._location,r)},d.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;r>a;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,i)},p.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,o=!1,s=0,l=0;r>l;++l){var u=e[l];if(n(u.red))(u.red!==i[s]||u.green!==i[s+1]||u.blue!==i[s+2])&&(i[s]=u.red,i[s+1]=u.green,i[s+2]=u.blue,o=!0);else{if(!n(u.x))throw new a("Invalid vec3 value.");t.equalsArray(u,i,s)||(t.pack(u,i,s),o=!0)}s+=3}o&&this._gl.uniform3fv(this._location,i)},m.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))i.equalsArray(c,o,l)||(i.pack(c,o,l),s=!0);else{if(!n(c.x))throw new a("Invalid vec4 value.");r.equalsArray(c,o,l)||(r.pack(c,o,l),s=!0)}l+=4}s&&this._gl.uniform4fv(this._location,o)},f.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,r=this.value,i=r.length,n=0;i>n;++n){var o=r[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},f.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,r=t.length,i=0;r>i;++i){var n=e+i;this._gl.uniform1i(t[i],n)}return e+r},v.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;t>n;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1iv(this._location,r)},g.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;r>a;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,i)},_.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,n=!1,o=0,a=0;r>a;++a){var s=e[a];t.equalsArray(s,i,o)||(t.pack(s,i,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,i)},y.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,n=!1,o=0,a=0;t>a;++a){var s=e[a];r.equalsArray(s,i,o)||(r.pack(s,i,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,i)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;t>o;++o){var a=e[o];s.equalsArray(a,r,n)||(s.pack(a,r,n),i=!0),n+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,r)},w.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;t>o;++o){var a=e[o];l.equalsArray(a,r,n)||(l.pack(a,r,n),i=!0),n+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,r)},S.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;t>o;++o){var a=e[o];u.equalsArray(a,r,n)||(u.pack(a,r,n),i=!0),n+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,r)},E}),r("Renderer/ShaderProgram",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./createUniform","./createUniformArray"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r){var i=r._vertexShaderText,o=r._fragmentShaderText,a=t.createShader(t.VERTEX_SHADER);t.shaderSource(a,i),t.compileShader(a);var s=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(s,o),t.compileShader(s);var l=t.createProgram();t.attachShader(l,a),t.attachShader(l,s),t.deleteShader(a),t.deleteShader(s);var u=r._attributeLocations;if(e(u))for(var c in u)u.hasOwnProperty(c)&&t.bindAttribLocation(l,u[c],c);t.linkProgram(l);var h;if(!t.getProgramParameter(l,t.LINK_STATUS)){var d=r._debugShaders;if(!t.getShaderParameter(s,t.COMPILE_STATUS)){if(h=t.getShaderInfoLog(s),console.error(v+"Fragment shader compile log: "+h),e(d)){var p=d.getTranslatedShaderSource(s);""!==p?console.error(v+"Translated fragment shader source:\n"+p):console.error(v+"Fragment shader translation failed.")}throw t.deleteProgram(l),new n("Fragment shader failed to compile.  Compile log: "+h)}if(!t.getShaderParameter(a,t.COMPILE_STATUS)){if(h=t.getShaderInfoLog(a),console.error(v+"Vertex shader compile log: "+h),e(d)){var m=d.getTranslatedShaderSource(a);""!==m?console.error(v+"Translated vertex shader source:\n"+m):console.error(v+"Vertex shader translation failed.")}throw t.deleteProgram(l),new n("Vertex shader failed to compile.  Compile log: "+h)}throw h=t.getProgramInfoLog(l),console.error(v+"Shader program link log: "+h),e(d)&&(console.error(v+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(a)),console.error(v+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(s))),t.deleteProgram(l),new n("Program failed to link.  Link log: "+h)}var f=r._logShaderCompilation;return f&&(h=t.getShaderInfoLog(a),e(h)&&h.length>0&&console.log(v+"Vertex shader compile log: "+h)),f&&(h=t.getShaderInfoLog(s),e(h)&&h.length>0&&console.log(v+"Fragment shader compile log: "+h)),f&&(h=t.getProgramInfoLog(l),e(h)&&h.length>0&&console.log(v+"Shader program link log: "+h)),l}function u(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 c(t,r){for(var i={},n=[],o=[],l=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),u=0;l>u;++u){var c=t.getActiveUniform(r,u),h="[0]",d=-1!==c.name.indexOf(h,c.name.length-h.length)?c.name.slice(0,c.name.length-3):c.name;if(0!==d.indexOf("gl_"))if(c.name.indexOf("[")<0){var p=t.getUniformLocation(r,d);if(null!==p){var m=a(t,c,d,p);i[d]=m,n.push(m),m._setSampler&&o.push(m)}}else{var f,v,g,_,y=d.indexOf("[");if(y>=0){if(f=i[d.slice(0,y)],!e(f))continue;v=f._locations,v.length<=1&&(g=f.value,_=t.getUniformLocation(r,d),null!==_&&(v.push(_),g.push(t.getUniform(r,_))))}else{v=[];for(var C=0;C<c.size;++C)_=t.getUniformLocation(r,d+"["+C+"]"),null!==_&&v.push(_);f=s(t,c,d,v),i[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:i,uniforms:n,samplerUniforms:o}}function h(e){var t=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var n=o[i];n?t.push({uniform:e[i],automaticUniform:n}):r.push(e[i])}return{automaticUniforms:t,manualUniforms:r}}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 p(t){if(!e(t._program)){var r=t._gl,i=l(r,t,t._debugShaders),n=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),o=c(r,i),a=h(o.uniformsByName);t._program=i,t._numberOfVertexAttributes=n,t._vertexAttributes=u(r,i,n),t._uniformsByName=o.uniformsByName,t._uniforms=o.uniforms,t._automaticUniforms=a.automaticUniforms,t._manualUniforms=a.manualUniforms,t.maximumTextureUnitIndex=d(r,i,o.samplerUniforms)}}var m=0,f=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=m++};t(f.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return p(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return p(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return p(this),this._uniformsByName}}});var v="[Cesium WebGL] ";return f.prototype._bind=function(){p(this),this._gl.useProgram(this._program)},f.prototype._setUniforms=function(t,r,n){var o,a;if(e(t)){var s=this._manualUniforms;for(o=s.length,a=0;o>a;++a){var l=s[a];l.value=t[l.name]()}}var u=this._automaticUniforms;for(o=u.length,a=0;o>a;++a){var c=u[a];c.uniform.value=c.automaticUniform.getValue(r)}var h=this._uniforms;for(o=h.length,a=0;o>a;++a)h[a].set();if(n){var d=this._gl,p=this._program;if(d.validateProgram(p),!d.getProgramParameter(p,d.VALIDATE_STATUS))throw new i("Program validation failed.  Program info log: "+d.getProgramInfoLog(p))}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._cachedShader.cache.releaseShaderProgram(this),void 0},f.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),r(this)},f}),r("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,r,i,n){"use strict";var o=function(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,r,i,n){return e(t)&&t.destroy(),this.getShaderProgram(r,i,n)},o.prototype.getShaderProgram=function(e,t,r){"string"==typeof e&&(e=new n({sources:[e]})),"string"==typeof t&&(t=new n({sources:[t]}));var o,a=e.createCombinedVertexShader(),s=t.createCombinedFragmentShader(),l=a+s+JSON.stringify(r);if(this._shaders[l])o=this._shaders[l],delete this._shadersToRelease[l];else{var u=this._context,c=new i({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:e,vertexShaderText:a,fragmentShaderSource:t,fragmentShaderText:s,attributeLocations:r});o={cache:this,shaderProgram:c,keyword:l,count:0},c._cachedShader=o,this._shaders[l]=o,++this._numberOfShaders}return++o.count,o.shaderProgram},o.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._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(e){if(e){var t=e._cachedShader;t&&0===--t.count&&(this._shadersToRelease[t.keyword]=t)}},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 r(this)},o}),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,p){"use strict";function m(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!==p.SCENE2D&&e._mode!==p.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 x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function T(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 I(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 D(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 m=H;m.x=e.y,m.y=e.z,m.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===p.SCENE2D&&(m.z=.5*a);var _=u.unproject(m,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,J);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===p.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 I(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return x(this),this._inverseModelView}},inverseModelView3D:{get:function(){return T(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 D(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;m(this,i.viewMatrix),f(this,i.inverseViewMatrix),_(this,i),t.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),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,J=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;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}r(i)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i._getBuffer())}var l=function(t,i,n,l){var u,c=[],h=1;for(u=0;u<n.length;++u)a(c,n[u],u);for(u=0;u<c.length;++u){var d=c[u];if(r(d.vertexBuffer)){var p=d.strideInBytes||d.componentsPerAttribute*e.getSizeInBytes(d.componentDatatype);h=d.vertexBuffer.sizeInBytes/p;break}}for(var m={},f=0;f<c.length;++f){var v=c[f].index;if(m[v])throw new o("Index "+v+" is used by more than one attribute.");m[v]=!0}var g;r(i)&&(g=i.createVertexArrayOES(),i.bindVertexArrayOES(g),s(t,c,l),i.bindVertexArrayOES(null)),this._numberOfVertices=h,this._gl=t,this._vaoExtension=i,this._vao=g,this._attributes=c,this._indexBuffer=l};return i(l.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),l.prototype.getAttribute=function(e){return this._attributes[e]},l.prototype._bind=function(){r(this._vao)?this._vaoExtension.bindVertexArrayOES(this._vao):s(this._gl,this._attributes,this._indexBuffer)},l.prototype._unBind=function(){if(r(this._vao))this._vaoExtension.bindVertexArrayOES(null);else{for(var e=this._attributes,t=this._gl,i=0;i<e.length;++i){var n=e[i];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var i=e[t].vertexBuffer;r(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()
}var o=this._indexBuffer;return r(o)&&!o.isDestroyed()&&o.vertexArrayDestroyable&&o.destroy(),r(this._vao)&&this._vaoExtension.deleteVertexArrayOES(this._vao),n(this)},l}),r("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/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Core/RuntimeError","../Shaders/ViewportQuadVS","./Buffer","./BufferUsage","./ClearCommand","./CubeMap","./DrawCommand","./Framebuffer","./PassState","./PickFramebuffer","./PixelDatatype","./Renderbuffer","./RenderbufferFormat","./RenderState","./ShaderCache","./Texture","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./UniformState","./VertexArray"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B){"use strict";function z(e,t){var r="WebGL Error:  ";switch(t){case e.INVALID_ENUM:r+="INVALID_ENUM";break;case e.INVALID_VALUE:r+="INVALID_VALUE";break;case e.INVALID_OPERATION:r+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:r+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:r+="CONTEXT_LOST_WEBGL lost";break;default:r+="Unknown ("+t+")"}return r}function V(e,t,r,i){for(var n=z(e,i)+": "+t.name+"(",o=0;o<r.length;++o)0!==o&&(n+=", "),n+=r[o];return n+=");"}function k(e,t,r){var i=e.getError();if(i!==e.NO_ERROR)throw new g(V(e,t,r,i))}function U(e,t,r){return{get:function(){var i=e[t];return r(e,"get: "+t,i),e[t]},set:function(i){e[t]=i,r(e,"set: "+t,i)}}}function W(e,t){function r(r){return function(){var i=r.apply(e,arguments);return t(e,r,arguments),i}}if(!t)return e;var i={};for(var n in e){var o=e[n];"function"==typeof o?i[n]=r(o):Object.defineProperty(i,n,U(e,n,t))}return i}function G(e,t){for(var r=t.length,i=0;r>i;++i){var n=e.getExtension(t[i]);if(n)return n}return void 0}function H(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 y(e,t,n,i,o)}function q(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 j(e,t,r){var i=e._currentRenderState;i!==t&&(e._currentRenderState=t,I.partialApply(e._gl,i,t,r))}function Y(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var r=nt;if(o(t))t._bind(),q(e,t),r=t._getActiveColorAttachments();else{var i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e._drawBuffers.drawBuffersWEBGL(r)}}function X(e,t,r,i,o,a){var s=n(n(o,r.renderState),e._defaultRenderState);Y(e,t);var l=n(a,r.shaderProgram);l._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,l.maximumTextureUnitIndex),j(e,s,i)}function Z(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 J(e){return e.values.length/e.componentsPerAttribute}function Q(e){return r.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function K(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=J(e[a[0]]),t=1;l>t;++t){var u=J(e[a[t]]);if(u!==s)throw new g("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),p=c%d;0!==p&&(c+=d-p);var m=s*c,f=new ArrayBuffer(m),v={};for(t=0;l>t;++t){i=a[t];var _=r.getSizeInBytes(e[i].componentDatatype);v[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=v[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 $(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var et=function(r,a){if("undefined"==typeof WebGLRenderingContext)throw new g("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.failIfMajorPerformanceCaveat=n(s.failIfMajorPerformanceCaveat,!0),u.isFirefox()&&u.isWindows()){var l=u.firefoxVersion();35===l[0]&&(s.alpha=!0)}if(this._originalGLContext=r.getContext("webgl",s)||r.getContext("experimental-webgl",s)||void 0,!o(this._originalGLContext))throw new g("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 c=this._gl=this._originalGLContext;this._version=c.getParameter(c.VERSION),this._shadingLanguageVersion=c.getParameter(c.SHADING_LANGUAGE_VERSION),this._vendor=c.getParameter(c.VENDOR),this._renderer=c.getParameter(c.RENDERER),this._redBits=c.getParameter(c.RED_BITS),this._greenBits=c.getParameter(c.GREEN_BITS),this._blueBits=c.getParameter(c.BLUE_BITS),this._alphaBits=c.getParameter(c.ALPHA_BITS),this._depthBits=c.getParameter(c.DEPTH_BITS),this._stencilBits=c.getParameter(c.STENCIL_BITS),this._maximumCombinedTextureImageUnits=c.getParameter(c.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._maximumCubeMapSize=c.getParameter(c.MAX_CUBE_MAP_TEXTURE_SIZE),this._maximumFragmentUniformVectors=c.getParameter(c.MAX_FRAGMENT_UNIFORM_VECTORS),this._maximumTextureImageUnits=c.getParameter(c.MAX_TEXTURE_IMAGE_UNITS),this._maximumRenderbufferSize=c.getParameter(c.MAX_RENDERBUFFER_SIZE),this._maximumTextureSize=c.getParameter(c.MAX_TEXTURE_SIZE),this._maximumVaryingVectors=c.getParameter(c.MAX_VARYING_VECTORS),this._maximumVertexAttributes=c.getParameter(c.MAX_VERTEX_ATTRIBS),this._maximumVertexTextureImageUnits=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._maximumVertexUniformVectors=c.getParameter(c.MAX_VERTEX_UNIFORM_VECTORS),this._aliasedLineWidthRange=c.getParameter(c.ALIASED_LINE_WIDTH_RANGE),this._aliasedPointSizeRange=c.getParameter(c.ALIASED_POINT_SIZE_RANGE),this._maximumViewportDimensions=c.getParameter(c.MAX_VIEWPORT_DIMS),this._antialias=c.getContextAttributes().antialias,this._standardDerivatives=G(c,["OES_standard_derivatives"]),this._elementIndexUint=G(c,["OES_element_index_uint"]),this._depthTexture=G(c,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=G(c,["OES_texture_float"]);var h=a.allowTextureFilterAnisotropic?G(c,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=h,this._maximumTextureFilterAnisotropy=o(h)?c.getParameter(h.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,this._vertexArrayObject=G(c,["OES_vertex_array_object"]),this._fragDepth=G(c,["EXT_frag_depth"]),this._drawBuffers=G(c,["WEBGL_draw_buffers"]),this._maximumDrawBuffers=o(this._drawBuffers)?c.getParameter(this._drawBuffers.MAX_DRAW_BUFFERS_WEBGL):1,this._maximumColorAttachments=o(this._drawBuffers)?c.getParameter(this._drawBuffers.MAX_COLOR_ATTACHMENTS_WEBGL):1,this._debugShaders=G(c,["WEBGL_debug_shaders"]);var d=c.getParameter(c.COLOR_CLEAR_VALUE);this._clearColor=new t(d[0],d[1],d[2],d[3]),this._clearDepth=c.getParameter(c.DEPTH_CLEAR_VALUE),this._clearStencil=c.getParameter(c.STENCIL_CLEAR_VALUE);var p=new F,m=new x(this),f=this.createRenderState();this._defaultPassState=m,this._defaultRenderState=f,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=p,this._currentRenderState=f,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},I.apply(c,f,m)},tt={};a(et.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=W(this._originalGLContext,e?k: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 tt}}}),et.prototype.replaceShaderProgram=function(e,t,r,i){return this._shaderCache.replaceShaderProgram(e,t,r,i)},et.prototype.createShaderProgram=function(e,t,r){return this._shaderCache.getShaderProgram(e,t,r)},et.prototype.createVertexBuffer=function(e,t){return H(this._gl,this._gl.ARRAY_BUFFER,e,t)},et.prototype.createIndexBuffer=function(e,t,r){if(r===d.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=d.getSizeInBytes(r),n=this._gl,o=H(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},et.prototype.createVertexArray=function(e,t){return new B(this._gl,this._vertexArrayObject,e,t)},et.prototype.createTexture2D=function(e){return new O(this,e)},et.prototype.createTexture2DFromFramebuffer=function(e,t,r,i,a,s){var l=this._gl;e=n(e,f.RGB),t=n(t,0),r=n(r,0),i=n(i,l.drawingBufferWidth),a=n(a,l.drawingBufferHeight);var u=new O(this,{width:i,height:a,pixelFormat:e,source:{framebuffer:o(s)?s:this.defaultFramebuffer,xOffset:t,yOffset:r,width:i,height:a}});return u},et.prototype.createCubeMap=function(e){function t(e,t){t.arrayBufferView?m.texImage2D(e,0,c,u,u,0,c,h,t.arrayBufferView):m.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,f.RGBA),h=n(e.pixelDatatype,P.UNSIGNED_BYTE);if(h===P.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===f.RGB||c===f.LUMINANCE,p=n(e.flipY,!0),m=this._gl,v=m.TEXTURE_CUBE_MAP,g=m.createTexture();return m.activeTexture(m.TEXTURE0),m.bindTexture(v,g),o(a)?(m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,p),t(m.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),t(m.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),t(m.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),t(m.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),t(m.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),t(m.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,u,u,0,c,h,null),m.texImage2D(m.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,u,u,0,c,h,null),m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,u,u,0,c,h,null),m.texImage2D(m.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,u,u,0,c,h,null),m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,u,u,0,c,h,null),m.texImage2D(m.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,u,u,0,c,h,null)),m.bindTexture(v,null),new S(m,this._textureFilterAnisotropic,v,g,c,h,u,d,p)},et.prototype.createFramebuffer=function(e){return new b(this._gl,this._maximumColorAttachments,e)},et.prototype.createRenderbuffer=function(e){var t=this._gl;e=n(e,n.EMPTY_OBJECT);var r=n(e.format,M.RGBA4),i=o(e.width)?e.width:t.drawingBufferWidth,a=o(e.height)?e.height:t.drawingBufferHeight;return new A(t,r,i,a)};var rt=0,it={};et.prototype.createRenderState=function(e){var t=JSON.stringify(e),r=it[t];if(o(r))return r;var i=new I(this,e),n=JSON.stringify(i);return r=it[n],o(r)||(i.id=rt++,r=i,it[n]=r),it[t]=r,r},et.prototype.createSampler=function(e){var t={wrapS:n(e.wrapS,N.CLAMP_TO_EDGE),wrapT:n(e.wrapT,N.CLAMP_TO_EDGE),minificationFilter:n(e.minificationFilter,L.LINEAR),magnificationFilter:n(e.magnificationFilter,R.LINEAR),maximumAnisotropy:o(e.maximumAnisotropy)?e.maximumAnisotropy:1};return t};var nt;"undefined"!=typeof WebGLRenderingContext&&(nt=[WebGLRenderingContext.BACK]);var ot=new w;et.prototype.clear=function(e,r){e=n(e,ot),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);j(this,c,r);var h=n(e.framebuffer,r.framebuffer);Y(this,h),i.clear(a)},et.prototype.draw=function(e,t,r,i){t=n(t,this._defaultPassState);var o=n(e.framebuffer,t.framebuffer);X(this,o,e,t,r,i),Z(this,e,i)},et.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null),this.drawBuffers&&this._drawBuffers.drawBuffersWEBGL(nt);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)},et.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 Y(this,a),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s},et.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,C.DYNAMIC_DRAW),u=n(e.attributeLocations,n.EMPTY_OBJECT),h=n(e.interleave,!1),m=e.vertexArrayAttributes,f=o(m)?m:[],v=s.attributes;if(h){var g=K(v);if(o(g)){a=this.createVertexBuffer(g.buffer,l);var _=g.offsetsInBytes,y=g.vertexSizeInBytes;for(t in v)v.hasOwnProperty(t)&&o(v[t])&&(i=v[t],o(i.values)?f.push({index:u[t],vertexBuffer:a,componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,offsetInBytes:_[t],strideInBytes:y}):f.push({index:u[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:u[t],vertexBuffer:a,value:i.value,componentDatatype:w,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize})}var S,E=s.indices;return o(E)&&(S=c.computeNumberOfVertices(s)>p.SIXTY_FOUR_KILOBYTES&&this.elementIndexUint?this.createIndexBuffer(new Uint32Array(E),l,d.UNSIGNED_INT):this.createIndexBuffer(new Uint16Array(E),l,d.UNSIGNED_SHORT)),this.createVertexArray(f,S)};var at={position:0,textureCoordinates:1};return et.prototype.createViewportQuadCommand=function(e,t){var i=this.cache.viewportQuad_vertexArray;if(!o(i)){var a=new c({attributes:{position:new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new h({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:v.TRIANGLES});i=this.createVertexArrayFromGeometry({geometry:a,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:C.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=i}return t=n(t,n.EMPTY_OBJECT),new E({vertexArray:i,primitiveType:v.TRIANGLES,renderState:t.renderState,shaderProgram:this.createShaderProgram(_,e,at),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},et.prototype.createPickFramebuffer=function(){return new T(this)},et.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a($.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),$.prototype.destroy=function(){return delete this._pickObjects[this.key],void 0},et.prototype.createPickId=function(e){++this._nextPickColor[0];var r=this._nextPickColor[0];if(0===r)throw new g("Out of unique Pick IDs.");return this._pickObjects[r]=e,new $(this._pickObjects,r,t.fromRgba(r))},et.prototype.isDestroyed=function(){return!1},et.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)},et}),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,p=r[d+3];p>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 p=h+d;if(a[p]!==o[p])return!1}return!0},a}),r("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";var t=function(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0};return t.prototype.configureNameFromProperties=function(t){var r,i=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();i>1&&"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='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"<tr><td>"+n+"</td><td>"+r(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return i+="</table>"}this.description=r(t)},t}),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(r,n):o(r,i)},a}),r("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Math","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/jsonp","../Core/loadJson","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w){"use strict";function S(e,t,r,i){var n;if(e._useTiles)n=e._url+"/tile/"+i+"/"+r+"/"+t;else{var o=e._tilingScheme.tileXYToNativeRectangle(t,r,i),s=o.west+"%2C"+o.south+"%2C"+o.east+"%2C"+o.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof h?"&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._proxy;return a(l)&&(n=l.getURL(n)),n}var E=function(t){function r(t){var r=t.tileInfo;if(a(r)){if(c._tileWidth=r.rows,c._tileHeight=r.cols,102100===r.spatialReference.wkid||102113===r.spatialReference.wkid)c._tilingScheme=new g;else{if(4326!==t.tileInfo.spatialReference.wkid){var i="Tile spatial reference WKID "+t.tileInfo.spatialReference.wkid+" is not supported.";return l=f.handleError(l,c,c._errorEvent,i,void 0,void 0,void 0,s),void 0}c._tilingScheme=new h}if(c._maximumLevel=t.tileInfo.lods.length-1,a(t.fullExtent)){if(a(t.fullExtent.spatialReference)&&a(t.fullExtent.spatialReference.wkid))if(102100===t.fullExtent.spatialReference.wkid||102113===t.fullExtent.spatialReference.wkid){var o=new v,u=o.unproject(new e(t.fullExtent.xmin,t.fullExtent.ymin)),d=o.unproject(new e(t.fullExtent.xmax,t.fullExtent.ymax));c._rectangle=new m(u.longitude,u.latitude,d.longitude,d.latitude)}else{if(4326!==t.fullExtent.spatialReference.wkid){var p="fullExtent.spatialReference WKID "+t.fullExtent.spatialReference.wkid+" is not supported.";return l=f.handleError(l,c,c._errorEvent,p,void 0,void 0,void 0,s),void 0}c._rectangle=m.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax)}}else c._rectangle=c._tilingScheme.rectangle;a(c._tileDiscardPolicy)||(c._tileDiscardPolicy=new y({missingImageUrl:S(c,0,0,c._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),c._useTiles=!0}else c._useTiles=!1;a(t.copyrightText)&&t.copyrightText.length>0&&(c._credit=new n(t.copyrightText)),c._ready=!0,f.handleSuccess(l)}function i(){var e="An error occurred while accessing "+c._url+".";l=f.handleError(l,c,c._errorEvent,e,void 0,void 0,void 0,s)}function s(){var e=d(c._url,{parameters:{f:"json"},proxy:c._proxy});_(e,r,i)}t=o(t,{}),this._url=t.url,this._tileDiscardPolicy=t.tileDiscardPolicy,this._proxy=t.proxy,this._tileWidth=o(t.tileWidth,256),this._tileHeight=o(t.tileHeight,256),this._maximumLevel=void 0,this._tilingScheme=o(t.tilingScheme,new h),this._credit=void 0,this._useTiles=o(t.usePreCachedTilesIfAvailable,!0),this._rectangle=o(t.rectangle,this._tilingScheme.rectangle),this._layers=t.layers,this._enablePickFeatures=o(t.enablePickFeatures,!0),this._errorEvent=new u,this._ready=!1;var l,c=this;this._useTiles?s():this._ready=!0};return s(E.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}},layers:{get:function(){return this._layers}},enablePickFeatures:{get:function(){return this._enablePickFeatures}}}),E.prototype.getTileCredits=function(){return void 0},E.prototype.requestImage=function(e,t,r){var i=S(this,e,t,r);return w.loadImage(this,i)},E.prototype.pickFeatures=function(e,n,o,s,l){if(!this._enablePickFeatures)return void 0;var u,c,d,m=this._tilingScheme.tileXYToNativeRectangle(e,n,o);if(this._tilingScheme instanceof h)u=i.toDegrees(s),c=i.toDegrees(l),d="4326";else{var f=this._tilingScheme.projection.project(new r(s,l,0));u=f.x,c=f.y,d="3857"}var g=this._url+"/identify?f=json&tolerance=2&layers=visible&geometryType=esriGeometryPoint";return g+="&geometry="+u+","+c,g+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+d,p(g).then(function(e){var i=[],n=e.results;if(!a(n))return i;for(var o=0;o<n.length;++o){var s=n[o],l=new C;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=r.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new v;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}i.push(l)}return i})},E}),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,p,m,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=[],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(r,p.bbox,w);n(m)&&(u=!0)}}u&&i.push(s.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 p=s[l];p.credit=new r(p.attribution);for(var m=p.coverageAreas,v=0,_=p.coverageAreas.length;_>v;++v){var C=m[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});p(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,m.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===m.AERIAL||this._mapStyle===m.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<<n,a=0;0!==(e&o)&&(a|=1),0!==(t&o)&&(a|=2),i+=a}return i},y.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];0!==(1&a)&&(t|=o),0!==(2&a)&&(r|=o)}return{x:t,y:r,level:i}};var w=new c;return y}),r("Scene/CullingVolume",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect"],function(e,t,r,i){"use strict";var n=function(t){this.planes=e(t,[])};return n.prototype.computeVisibility=function(e){for(var t=this.planes,r=!1,n=0,o=t.length;o>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,p=new t,m=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=p;t.multiplyByScalar(i,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 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,p,m,f,v,g){"use strict";function _(e,r,i){return t.cross(e,r,I),t.cross(I,e,D),M[0]=I.x,M[1]=D.x,M[2]=-e.x,M[3]=I.y,M[4]=D.y,M[5]=-e.y,M[6]=I.z,M[7]=D.z,M[8]=-e.z,p.fromRotationMatrix(M,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,m,f=r.maximumRadius,v=e.frustum,g=y(v,f,f),_=t.dot(t.normalize(i,O),t.normalize(a,R));if(t.magnitude(i)>g)d=f+.6*(g-f),m=.35;else{var C=t.subtract(i,a,O);d=t.magnitude(t.add(t.multiplyByScalar(C,.5,R),a,R));var w=t.magnitude(t.multiplyByScalar(n,t.dot(C,n),R)),S=t.magnitude(t.multiplyByScalar(o,t.dot(C,o),R));d+=y(v,w,S),m=c.clamp(_+1,.25,.5)}var E,b,x,T=t.multiplyByScalar(t.normalize(a,R),d,R),P=t.multiplyByScalar(t.normalize(i,O),d,O),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,T,A),.5,A),T,A),u=[i,A,a];else{u=[i],b=c.acosClamped(t.dot(t.normalize(P,L),t.normalize(T,N))),E=t.cross(T,P,L),t.equalsEpsilon(E,t.ZERO,c.EPSILON6)&&(E=t.UNIT_Z);for(var M=m*b,I=b-M,D=I;D>0;D-=M)x=h.fromQuaternion(p.fromAxisAngle(E,D),F),u.push(h.multiplyByVector(x,T,new t));u.push(a)}for(var B=new Array(u.length),z=s/(u.length-1),V=0;V<u.length;++V)B[V]=V*z;return l.createNaturalCubic({points:u,times:B})}function w(e,r,i,n,a){var s=e.points,l=new Array(s.length);l[0]=_(r,i);for(var u,c=s.length-1,h=1;c>h;++h)u=s[h],t.normalize(t.negate(u,B),B),t.normalize(t.cross(B,t.UNIT_Z,z),z),t.cross(z,B,V),l[h]=_(B,V,k);return u=s[c],o(n)&&o(a)?l[c]=_(n,a):(t.normalize(t.negate(u,B),B),t.normalize(t.cross(B,t.UNIT_Z,z),z),t.cross(z,B,V),l[c]=_(B,V,k)),new m({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,U),u=a.cameraToWorldCoordinatesVector(a.direction,W),c=a.cameraToWorldCoordinatesVector(a.up,G),p=t.cross(u,c,H),m=C(a,s,l,c,p,r,i),f=w(m,u,c,n,o),v=function(e){var r=e.time,i=f.evaluate(r);h.fromQuaternion(i,A),d.clone(a.transform,q),a._setTransform(d.IDENTITY),a.position=m.evaluate(r,a.position),a.right=h.getRow(A,0,a.right),a.up=h.getRow(A,1,a.up),a.direction=t.negate(h.getRow(A,2,a.direction),a.direction),a._setTransform(q)};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,p=r.frustum,m=y(p,Math.PI*d,c.PI_OVER_TWO*d),f=.5;if(n.z>m)h=.6*m;else{var v=t.subtract(n,o,j);h=y(p,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>m)C=t.add(t.multiplyByScalar(t.subtract(n,o,C),.5,C),o,C),s=[n,C,o];else if(n.z>m)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,j),S=t.magnitude(w);t.normalize(w,w);for(var E=f*S,b=S-E,x=b;x>0;x-=E){var T=new t;s.push(t.add(t.multiplyByScalar(w,x,T),g,T))}s.push(o)}for(var P=new Array(s.length),A=a/(s.length-1),M=0;M<s.length;++M)P[M]=M*A;return l.createNaturalCubic({points:s,times:P})}function b(e,t,r,i){var n=t.points,a=new Array(n.length);a[0]=_(e.direction,e.up);for(var s=n.length-1,l=1;s>l;++l)a[l]=J;return a[s]=o(r)&&o(i)?_(r,i):J,new m({points:a,times:t.times})}function x(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,A),d.clone(a.transform,q),a._setTransform(d.IDENTITY),a.position=l.evaluate(r,a.position),a.right=h.getRow(A,0,a.right),a.up=h.getRow(A,1,a.up),a.direction=t.negate(h.getRow(A,2,a.direction),a.direction),a._setTransform(q)};return c}function T(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,p=function(e){var r=e.time,i=c.evaluate(r);h.fromQuaternion(i,A),a.position=u.evaluate(r);var n=a.position.z;a.position.z=d,a.right=h.getRow(A,0,a.right),a.up=h.getRow(A,1,a.up),a.direction=t.negate(h.getRow(A,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 p}var P={};new t;var A=new h,M=new h,I=new t,D=new t,O=new t,R=new t,L=new t,N=new t,F=new h,B=new t,z=new t,V=new t,k=new p,U=new t,W=new t,G=new t,H=new t,q=new d,j=new t,Y=t.negate(t.UNIT_Z,new t),X=new t;X=t.normalize(t.cross(Y,t.UNIT_Y,X),X);var Z=t.cross(X,Y,new t),J=_(Y,Z),Q=new t,K=new t,$=new t,et=new r,tt=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,p=d.ellipsoid;p.cartesianToCartographic(a,et),a=d.project(et,tt)}var m=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>=m){var b=function(){var e=a;if(r.mode===g.SCENE3D?(o(i.direction)||o(i.up)?(Q=i.direction,K=t.normalize(t.cross(Q,i.up,K),K)):(Q=t.normalize(t.negate(e,Q),Q),K=t.normalize(t.cross(Q,t.UNIT_Z,K),K)),$=n(i.up,t.cross(K,Q,$))):(o(i.direction)||o(i.up)?(Q=i.direction,K=t.normalize(t.cross(Q,i.up,K),K)):(Q=t.negate(t.UNIT_Z,Q),K=t.normalize(t.cross(Q,t.UNIT_Y,K),K)),$=n(i.up,t.cross(K,Q,$))),t.clone(e,C.position),t.clone(Q,C.direction),t.clone($,C.up),t.clone(K,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,m,l,u):r.mode===g.SCENE2D?T(r,a,m,l,u):x(r,a,m,l,u),{duration:m,easingFunction:s.SINUSOIDAL_IN_OUT,startObject:{time:0},stopObject:{time:m},update:P,complete:_,cancel:y}},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","./HeadingPitchRange","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w){"use strict";function S(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,p.multiply(a,e._actualInvTransform,e._viewMatrix),p.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function E(e){var i=e._projection,n=i.ellipsoid,o=p.getColumn(e._transform,3,J),a=n.cartesianToCartographic(o,Y),s=i.project(a,X),l=Q;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.add(p.getColumn(e._transform,0,Z),o,Z);n.cartesianToCartographic(u,a),i.project(a,s);var c=K;c.x=s.z,c.y=s.x,c.z=s.y,c.w=0,t.subtract(c,l,c);var h=r.add(p.getColumn(e._transform,1,Z),o,Z);n.cartesianToCartographic(h,a),i.project(a,s);var d=$;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d);var m=et;t.cross(c,d,m),t.normalize(m,m),t.cross(d,m,c),t.normalize(c,c),t.cross(m,c,d),t.normalize(d,d),p.setColumn(e._actualTransform,0,c,e._actualTransform),p.setColumn(e._actualTransform,1,d,e._actualTransform),p.setColumn(e._actualTransform,2,m,e._actualTransform),p.setColumn(e._actualTransform,3,l,e._actualTransform)}function b(e){var i=e._projection,n=i.ellipsoid,o=p.getColumn(e._transform,3,J),a=n.cartesianToCartographic(o,Y),s=i.project(a,X),l=Q;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,et),c=r.add(p.getColumn(e._transform,0,Z),o,Z);n.cartesianToCartographic(c,a),i.project(a,s);var d=K;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d),d.x=0;var m=$;if(t.magnitudeSquared(d)>h.EPSILON10)t.cross(u,d,m);else{var f=r.add(p.getColumn(e._transform,1,Z),o,Z);n.cartesianToCartographic(f,a),i.project(a,s),m.x=s.z,m.y=s.x,m.z=s.y,m.w=0,t.subtract(m,l,m),m.x=0,t.magnitudeSquared(m)<h.EPSILON10&&(r.clone(r.UNIT_Y,d),r.clone(r.UNIT_Z,m))}t.cross(m,u,d),t.normalize(d,d),t.cross(u,d,m),t.normalize(m,m),p.setColumn(e._actualTransform,0,d,e._actualTransform),p.setColumn(e._actualTransform,1,m,e._actualTransform),p.setColumn(e._actualTransform,2,u,e._actualTransform),p.setColumn(e._actualTransform,3,l,e._actualTransform)}function x(e){var r=e._position,i=!t.equals(r,e.position);i&&(r=t.clone(e.position,e._position));var n=e._direction,o=!t.equals(n,e.direction);o&&(n=t.clone(e.direction,e._direction));var a=e._up,s=!t.equals(a,e.up);s&&(a=t.clone(e.up,e._up));var l=e._right,u=!t.equals(l,e.right);u&&(l=t.clone(e.right,e._right));var c=e._transformChanged||e._modeChanged;e._transformChanged=!1,c&&(p.inverseTransformation(e._transform,e._invTransform),e._mode===w.COLUMBUS_VIEW||e._mode===w.SCENE2D?p.equals(p.IDENTITY,e._transform)?p.clone(j.TRANSFORM_2D,e._actualTransform):e._mode===w.COLUMBUS_VIEW?E(e):b(e):p.clone(e._transform,e._actualTransform),p.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var d=e._actualTransform;if(i||c){e._positionWC=p.multiplyByPoint(d,r,e._positionWC);var m=e._mode;if(m===w.SCENE3D||m===w.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=tt;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,m===w.SCENE2D&&(f.z=.5*(e.frustum.right-e.frustum.left)),e._projection.unproject(f,e._positionCartographic)}}if(o||s||u){var v=t.dot(n,t.cross(a,l,tt));if(Math.abs(1-v)>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,_,tt);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=p.multiplyByPointAsVector(d,n,e._directionWC)),(s||c)&&(e._upWC=p.multiplyByPointAsVector(d,a,e._upWC)),(u||c)&&(e._rightWC=p.multiplyByPointAsVector(d,l,e._rightWC)),(i||o||s||u||c)&&S(e)}function T(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 P(e,r){var i=e.position,n=t.normalize(i,_t);if(o(e.constrainedAxis)){var a=t.equalsEpsilon(n,e.constrainedAxis,h.EPSILON2),s=t.equalsEpsilon(n,t.negate(e.constrainedAxis,wt),h.EPSILON2);if(a||s)(a&&0>r||s&&r>0)&&e.rotate(e.right,r);else{var l=t.normalize(e.constrainedAxis,yt),u=t.dot(n,l),c=h.acosClamped(u);r>0&&r>c&&(r=c-h.EPSILON4),u=t.dot(n,t.negate(l,wt)),c=h.acosClamped(u),0>r&&-r>c&&(r=-c+h.EPSILON4);var d=t.cross(l,n,Ct);e.rotate(d,r)}}else e.rotate(e.right,r)}function A(e,t){o(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function M(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 I(e,t){e.move(e.direction,t)}function D(e,r,i){r=h.clamp(r,-h.PI_OVER_TWO,h.PI_OVER_TWO),e=h.zeroToTwoPi(e)-h.PI_OVER_TWO;var n=m.fromAxisAngle(t.UNIT_Y,-r,bt),o=m.fromAxisAngle(t.UNIT_Z,-e,xt),a=m.multiply(o,n,o),s=d.fromQuaternion(a,Tt),l=t.clone(t.UNIT_X,Et);return d.multiplyByVector(s,l,l),t.negate(l,l),t.multiplyByScalar(l,i,l),l}function O(e,r,i,n,a){o(n)||(n=new t);var s=e;a&&(s=Rt);var l=r.north,u=r.south,c=r.east,d=r.west;d>c&&(c+=h.TWO_PI);var p=Pt;p.longitude=c,p.latitude=l;var m=i.cartographicToCartesian(p,At);p.latitude=u;var f=i.cartographicToCartesian(p,Dt);p.longitude=d;var v=i.cartographicToCartesian(p,Mt);p.latitude=l;var g=i.cartographicToCartesian(p,It),_=t.subtract(m,v,Ot);t.multiplyByScalar(_,.5,_),t.add(v,_,_);var y=t.magnitude(_);y<h.EPSILON6&&(p.longitude=.5*(c+d),p.latitude=.5*(l+u),i.cartographicToCartesian(p,_)),t.subtract(g,_,g),t.subtract(f,_,f),t.subtract(m,_,m),t.subtract(v,_,v);var C=t.negate(_,s.direction);t.normalize(C,C);var w=t.cross(C,t.UNIT_Z,s.right);t.normalize(w,w);var S=t.cross(w,C,s.up),E=Math.max(Math.abs(t.dot(S,g)),Math.abs(t.dot(S,f)),Math.abs(t.dot(S,m)),Math.abs(t.dot(S,v))),b=Math.max(Math.abs(t.dot(w,g)),Math.abs(t.dot(w,f)),Math.abs(t.dot(w,m)),Math.abs(t.dot(w,v))),x=Math.tan(.5*e.frustum.fovy),T=e.frustum.aspectRatio*x,P=Math.max(b/T,E/x),A=y+P;return t.normalize(_,_),t.multiplyByScalar(_,A,n)}function R(e,r,i,n,a){var s=r.north,l=r.south,u=r.east,c=r.west,h=e._actualTransform,d=e._actualInvTransform,m=Lt;m.longitude=u,m.latitude=s;var f=i.project(m,Nt);p.multiplyByPoint(h,f,f),p.multiplyByPoint(d,f,f),m.longitude=c,m.latitude=l;var v=i.project(m,Ft);p.multiplyByPoint(h,v,v),p.multiplyByPoint(d,v,v);var g=Math.tan(.5*e.frustum.fovy),_=e.frustum.aspectRatio*g;if(o(n)||(n=new t),n.x=.5*(f.x-v.x)+v.x,n.y=.5*(f.y-v.y)+v.y,n.z=.5*Math.max((f.x-v.x)/_,(f.y-v.y)/g),!a){var y=t.clone(t.UNIT_Z,e.direction);t.negate(y,y),t.clone(t.UNIT_X,e.right),t.clone(t.UNIT_Y,e.up)}return n}function L(e,r,i,n,a){var s=r.north,l=r.south,u=r.east,c=r.west,h=Bt;h.longitude=u,h.latitude=s;var d=i.project(h,zt);h.longitude=c,h.latitude=l;var p,m,f=i.project(h,Vt),v=.5*Math.abs(d.x-f.x),g=.5*Math.abs(d.y-f.y),_=e.frustum.right/e.frustum.top,y=g*_;if(v>y?(p=v,m=p/_):(m=g,p=y),g=Math.max(2*p,2*m),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=p,C.left=-p,C.top=m,C.bottom=-m;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 N(e,t,r,i){r=n(r,u.WGS84);var o=e.getPickRay(t,kt),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 F(e,t,r,i){var n=e.getPickRay(t,Ut),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 B(e,r,i,n){var o=e.getPickRay(r,Wt),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 z(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 p=t.multiplyByScalar(e.directionWC,u,Gt);t.add(d,p,p);var m=t.multiplyByScalar(e.rightWC,c*u*l,Ht),f=t.multiplyByScalar(e.upWC,h*u*s,qt),v=t.add(p,m,i.direction);return t.add(v,f,v),t.subtract(v,d,v),t.normalize(v,v),i}function V(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,jt),t.add(jt,u,u),t.multiplyByScalar(e.up,l,jt),t.add(jt,u,u),t.clone(e.directionWC,i.direction),i}function k(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,p=s.left,m=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,m.top,r.time),e.frustum.bottom=h.lerp(c,m.bottom,r.time),e.frustum.right=h.lerp(d,m.right,r.time),e.frustum.left=h.lerp(p,m.left,r.time))};return{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:g}}return void 0}function U(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 W(e,r){var i=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(t.UNIT_X,Yt),a=-t.dot(o,i)/t.dot(o,n),s=t.add(i,t.multiplyByScalar(n,a,Xt),Xt);e.cameraToWorldCoordinatesPoint(s,s),i=e.cameraToWorldCoordinatesPoint(e.position,Zt);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,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),v=Math.max(d-m,m);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 U(e,i,s,f,v,r)}return void 0}function G(e,t){var r=e.frustum,i=Math.tan(.5*r.fovy),n=r.aspectRatio*i;return Math.max(t/n,t/i)}function H(e,t){var r,i,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(r=t,i=r/o):(i=t,r=a),1.5*Math.max(r,i)}function q(e,t,r){o(r)||(r=y.clone(nr));var i=r.range;if(!o(i)||0===i){var n=t.radius;r.range=0===n?or:e._mode===w.SCENE2D?H(e,n):G(e,n)}return r}var j=function(e){this._scene=e,this._transform=p.clone(p.IDENTITY),this._invTransform=p.clone(p.IDENTITY),this._actualTransform=p.clone(p.IDENTITY),this._actualInvTransform=p.clone(p.IDENTITY),this._transformChanged=!1,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 C,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 p,this._invViewMatrix=new p,S(this),this._mode=w.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(j.DEFAULT_VIEW_RECTANGLE);var n=t.magnitude(this.position);n+=n*j.DEFAULT_VIEW_FACTOR,t.normalize(this.position,this.position),t.multiplyByScalar(this.position,n,this.position)};j.TRANSFORM_2D=new p(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),j.TRANSFORM_2D_INVERSE=p.inverseTransformation(j.TRANSFORM_2D,new p),j.DEFAULT_VIEW_RECTANGLE=v.fromDegrees(-95,-20,-70,90),j.DEFAULT_VIEW_FACTOR=.5;var Y=new i,X=new t,Z=new t,J=new r,Q=new r,K=new r,$=new r,et=new r,tt=new t,rt=new p,it=new p;
a(j.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return x(this),this._invTransform}},viewMatrix:{get:function(){return x(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return x(this),this._invViewMatrix}},positionCartographic:{get:function(){return x(this),this._positionCartographic}},positionWC:{get:function(){return x(this),this._positionWC}},directionWC:{get:function(){return x(this),this._directionWC}},upWC:{get:function(){return x(this),this._upWC}},rightWC:{get:function(){return x(this),this._rightWC}},heading:{get:function(){if(this._mode!==w.MORPHING){this.positionWC;var e=this._projection.ellipsoid,t=p.clone(this._transform,rt),r=g.eastNorthUpToFixedFrame(this.positionWC,e,it);this._setTransform(r);var i,n=this.direction,o=this.up;return i=h.equalsEpsilon(Math.abs(n.z),1,h.EPSILON3)?Math.atan2(o.y,o.x)-h.PI_OVER_TWO:Math.atan2(n.y,n.x)-h.PI_OVER_TWO,this._setTransform(t),h.TWO_PI-h.zeroToTwoPi(i)}return void 0}},pitch:{get:function(){if(this._mode!==w.MORPHING){this.positionWC;var e=this._projection.ellipsoid,t=p.clone(this._transform,rt),r=g.eastNorthUpToFixedFrame(this.positionWC,e,it);this._setTransform(r);var i=h.PI_OVER_TWO-h.acosClamped(this.direction.z);return this._setTransform(t),i}return void 0}},roll:{get:function(){if(this._mode!==w.MORPHING){this.positionWC;var e=this._projection.ellipsoid,t=p.clone(this._transform,rt),r=g.eastNorthUpToFixedFrame(this.positionWC,e,it);this._setTransform(r);var i=this.up,n=this.right,o=this.direction,a=0;return h.equalsEpsilon(Math.abs(o.z),1,h.EPSILON3)||(a=Math.atan2(-n.z,i.z),a=h.zeroToTwoPi(a+h.TWO_PI)),this._setTransform(t),a}return void 0}}}),j.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 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 nt=new t,ot=new t,at=new t;j.prototype._setTransform=function(e){var r=t.clone(this.positionWC,nt),i=t.clone(this.upWC,ot),n=t.clone(this.directionWC,at);p.clone(e,this._transform),this._transformChanged=!0,x(this);var o=this._actualInvTransform;p.multiplyByPoint(o,r,this.position),p.multiplyByPointAsVector(o,n,this.direction),p.multiplyByPointAsVector(o,i,this.up),t.cross(this.direction,this.up,this.right)};var st=new t,lt=new p,ut=new p,ct=new m,ht=new d,dt=new i;j.prototype.setView=function(r){if(this._mode!==w.MORPHING){r=n(r,n.EMPTY_OBJECT);var i=this._mode===w.SCENE2D,a=n(r.heading,this.heading),s=i?-h.PI_OVER_TWO:n(r.pitch,this.pitch),l=i?0:n(r.roll,this.roll),u=r.position,c=r.positionCartographic,f=this._projection,v=f.ellipsoid;o(u)||(u=o(c)?v.cartographicToCartesian(c,st):t.clone(this.positionWC,st));var _=p.clone(this.transform,lt),y=g.eastNorthUpToFixedFrame(u,v,ut);if(this._setTransform(y),i){e.clone(t.ZERO,this.position);var C=v.cartesianToCartographic(u,dt),S=.5*-C.height,E=-S,b=this.frustum;if(E>S){var x=b.top/b.right;b.right=E,b.left=S,b.top=b.right*x,b.bottom=-b.top}}else t.clone(t.ZERO,this.position);var T=m.fromHeadingPitchRoll(a-h.PI_OVER_TWO,s,l,ct),P=d.fromQuaternion(T,ht);d.getColumn(P,0,this.direction),d.getColumn(P,2,this.up),t.cross(this.direction,this.up,this.right),this._setTransform(_)}},j.prototype.worldToCameraCoordinates=function(e,t){return o(t)||(t=new r),x(this),p.multiplyByVector(this._actualInvTransform,e,t)},j.prototype.worldToCameraCoordinatesPoint=function(e,r){return o(r)||(r=new t),x(this),p.multiplyByPoint(this._actualInvTransform,e,r)},j.prototype.worldToCameraCoordinatesVector=function(e,r){return o(r)||(r=new t),x(this),p.multiplyByPointAsVector(this._actualInvTransform,e,r)},j.prototype.cameraToWorldCoordinates=function(e,t){return o(t)||(t=new r),x(this),p.multiplyByVector(this._actualTransform,e,t)},j.prototype.cameraToWorldCoordinatesPoint=function(e,r){return o(r)||(r=new t),x(this),p.multiplyByPoint(this._actualTransform,e,r)},j.prototype.cameraToWorldCoordinatesVector=function(e,r){return o(r)||(r=new t),x(this),p.multiplyByPointAsVector(this._actualTransform,e,r)};var pt=new t;j.prototype.move=function(e,r){var i=this.position;t.multiplyByScalar(e,r,pt),t.add(i,pt,i),this._mode===w.SCENE2D&&T(this,i)},j.prototype.moveForward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,e)},j.prototype.moveBackward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,-e)},j.prototype.moveUp=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,e)},j.prototype.moveDown=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,-e)},j.prototype.moveRight=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,e)},j.prototype.moveLeft=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,-e)},j.prototype.lookLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,-e)},j.prototype.lookRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,e)},j.prototype.lookUp=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,-e)},j.prototype.lookDown=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,e)};var mt=new m,ft=new d;j.prototype.look=function(e,t){var r=n(t,this.defaultLookAmount),i=m.fromAxisAngle(e,-r,mt),o=d.fromQuaternion(i,ft),a=this.direction,s=this.up,l=this.right;d.multiplyByVector(o,a,a),d.multiplyByVector(o,s,s),d.multiplyByVector(o,l,l)},j.prototype.twistLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,e)},j.prototype.twistRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,-e)};var vt=new m,gt=new d;j.prototype.rotate=function(e,r){var i=n(r,this.defaultRotateAmount),o=m.fromAxisAngle(e,-i,vt),a=d.fromQuaternion(o,gt);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)},j.prototype.rotateDown=function(e){e=n(e,this.defaultRotateAmount),P(this,e)},j.prototype.rotateUp=function(e){e=n(e,this.defaultRotateAmount),P(this,-e)};var _t=new t,yt=new t,Ct=new t,wt=new t;j.prototype.rotateRight=function(e){e=n(e,this.defaultRotateAmount),A(this,-e)},j.prototype.rotateLeft=function(e){e=n(e,this.defaultRotateAmount),A(this,e)},j.prototype.zoomIn=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?M(this,e):I(this,e)},j.prototype.zoomOut=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?M(this,-e):I(this,-e)},j.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 St=new p;new p,j.prototype.lookAt=function(e,t){var r=g.eastNorthUpToFixedFrame(e,u.WGS84,St);this.lookAtTransform(r,t)};var Et=new t,bt=new m,xt=new m,Tt=new d;j.prototype.lookAtTransform=function(r,i){if(this._setTransform(r),o(i)){var n;if(n=o(i.heading)?D(i.heading,i.pitch,i.range):i,this._mode===w.SCENE2D){e.clone(e.ZERO,this.position),t.negate(n,this.up),this.up.z=0,t.magnitudeSquared(this.up)<h.EPSILON10&&t.clone(t.UNIT_Y,this.up),t.normalize(this.up,this.up),this._setTransform(p.IDENTITY),t.negate(t.UNIT_Z,this.direction),t.cross(this.direction,this.up,this.right),t.normalize(this.right,this.right);var a=this.frustum,s=a.top/a.right;return a.right=.5*t.magnitude(n),a.left=-a.right,a.top=s*a.right,a.bottom=-a.top,this._setTransform(r),void 0}t.clone(n,this.position),t.negate(this.position,this.direction),t.normalize(this.direction,this.direction),t.cross(this.direction,t.UNIT_Z,this.right),t.magnitudeSquared(this.right)<h.EPSILON10&&t.clone(t.UNIT_X,this.right),t.normalize(this.right,this.right),t.cross(this.right,this.direction,this.up),t.normalize(this.up,this.up)}};var Pt=new i,At=new t,Mt=new t,It=new t,Dt=new t,Ot=new t,Rt={direction:new t,right:new t,up:new t},Lt=new i,Nt=new t,Ft=new t,Bt=new i,zt=new t,Vt=new t;j.prototype.getRectangleCameraCoordinates=function(e,t){return this._mode===w.SCENE3D?O(this,e,this._projection.ellipsoid,t,!0):this._mode===w.COLUMBUS_VIEW?R(this,e,this._projection,t,!0):this._mode===w.SCENE2D?L(this,e,this._projection,t,!0):void 0},j.prototype.viewRectangle=function(e,t){t=n(t,u.WGS84),this._mode===w.SCENE3D?O(this,e,t,this.position):this._mode===w.COLUMBUS_VIEW?R(this,e,this._projection,this.position):this._mode===w.SCENE2D&&L(this,e,this._projection,this.position)};var kt=new f,Ut=new f,Wt=new f;j.prototype.pickEllipsoid=function(e,r,i){if(o(i)||(i=new t),r=n(r,u.WGS84),this._mode===w.SCENE3D)i=N(this,e,r,i);else if(this._mode===w.SCENE2D)i=F(this,e,this._projection,i);else{if(this._mode!==w.COLUMBUS_VIEW)return void 0;i=B(this,e,this._projection,i)}return i};var Gt=new t,Ht=new t,qt=new t,jt=new t;j.prototype.getPickRay=function(e,t){o(t)||(t=new f);var r=this.frustum;return o(r.aspectRatio)&&o(r.fov)&&o(r.near)?z(this,e,t):V(this,e,t)};var Yt=new t,Xt=new t,Zt=new t,Jt=new t;j.prototype.createCorrectPositionTween=function(e){return this._mode===w.SCENE2D?k(this,e):this._mode===w.COLUMBUS_VIEW?W(this,e):void 0};var Qt=new t,Kt=new m,$t=new d,er=new t,tr=new t,rr=new p,ir={destination:void 0,direction:void 0,up:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0};j.prototype.flyTo=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.destination,r=this._scene,i=o(t.west);i&&(t=r.camera.getRectangleCameraCoordinates(t,Qt));var a,s,l=n(e.orientation,n.EMPTY_OBJECT);if(o(l.heading)){var u=n(l.heading,0),c=n(l.pitch,-h.PI_OVER_TWO),f=n(l.roll,0),v=m.fromHeadingPitchRoll(u-h.PI_OVER_TWO,c,f,Kt),y=d.fromQuaternion(v,$t);a=d.getColumn(y,0,er),s=d.getColumn(y,2,tr);var C=this._projection.ellipsoid,w=g.eastNorthUpToFixedFrame(t,C,rr);p.multiplyByPointAsVector(w,a,a),p.multiplyByPointAsVector(w,s,s)}else o(l.direction)&&(a=l.direction,s=l.up);ir.destination=t,ir.direction=a,ir.up=s,ir.duration=e.duration,ir.complete=e.complete,ir.cancel=e.cancel,ir.endTransform=e.endTransform,ir.convert=i?!1:e.convert,r.tweens.add(_.createTween(r,ir))};var nr=new y(0,-h.PI_OVER_FOUR,0),or=100;j.prototype.viewBoundingSphere=function(e,t){if(this._mode===w.MORPHING)throw new s("viewBoundingSphere is not supported while morphing.");t=q(this,e,t),this.lookAt(e.center,t)};var ar=new p,sr=new t,lr=new t,ur=new t,cr=new t;return j.prototype.flyToBoundingSphere=function(e,r){r=n(r,n.EMPTY_OBJECT);var i=this._mode===w.SCENE2D||this._mode===w.COLUMBUS_VIEW;this._setTransform(p.IDENTITY);var o,a=q(this,e,r.offset);o=i?t.multiplyByScalar(t.UNIT_Z,a.range,sr):D(a.heading,a.pitch,a.range);var s=g.eastNorthUpToFixedFrame(e.center,u.WGS84,ar);p.multiplyByPoint(s,o,o);var l,c;if(!i){l=t.subtract(e.center,o,lr),t.normalize(l,l),c=p.multiplyByPointAsVector(s,t.UNIT_Z,ur);var h=t.cross(l,c,cr);t.cross(h,l,c),t.normalize(c,c)}this.flyTo({destination:o,orientation:{direction:l,up:c},duration:r.duration,complete:r.complete,cancel:r.cancel,endTransform:r.endTransform})},j.prototype.clone=function(){var e=new j(this._scene);return e.position=t.clone(this.position),e.direction=t.clone(this.direction),e.up=t.clone(this.up),e.right=t.clone(this.right),e._transform=p.clone(this.transform),e._transformChanged=!0,e.frustum=this.frustum.clone(),e},j}),r("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),r("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){var i=e;return t(r)&&(i+="+"+r),i}function h(t,r){e.clone(t.distance.startPosition,r.distance.startPosition),e.clone(t.distance.endPosition,r.distance.endPosition),e.clone(t.angleAndHeight.startPosition,r.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,r.angleAndHeight.endPosition)}function d(r,i,n){var o=c(u.PINCH,i),a=r._update,s=r._isDown,d=r._eventStartPosition,p=r._pressTime,m=r._releaseTime;a[o]=!0,s[o]=!1,d[o]=new e;var f=r._movement[o];t(f)||(f=r._movement[o]={}),f.distance={startPosition:new e,endPosition:new e},f.angleAndHeight={startPosition:new e,endPosition:new e},f.prevAngle=0,r._eventHandler.setInputAction(function(){r._buttonsDown++,s[o]=!0,p[o]=new Date},l.PINCH_START,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),s[o]=!1,m[o]=new Date},l.PINCH_END,i),r._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var r=f.angleAndHeight.endPosition.x,i=f.prevAngle,l=2*Math.PI;r>=i+Math.PI;)r-=l;for(;r<i-Math.PI;)r+=l;f.angleAndHeight.endPosition.x=-r*n.clientWidth/12,f.angleAndHeight.startPosition.x=-i*n.clientWidth/12}},l.PINCH_MOVE,i)}function p(r,i){var n=c(u.WHEEL,i),o=r._update;o[n]=!0;var s=r._movement[n];t(s)||(s=r._movement[n]={}),s.startPosition=new e,s.endPosition=new e,r._eventHandler.setInputAction(function(t){var r=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=r,o[n]=!1):s.endPosition.y=s.endPosition.y+r},l.WHEEL,i)}function m(r,i,n){var o=c(n,i),a=r._isDown,s=r._eventStartPosition,h=r._pressTime,d=r._releaseTime;a[o]=!1,s[o]=new e;var p=r._lastMovement[o];t(p)||(p=r._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var m,f;n===u.LEFT_DRAG?(m=l.LEFT_DOWN,f=l.LEFT_UP):n===u.RIGHT_DRAG?(m=l.RIGHT_DOWN,f=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(m=l.MIDDLE_DOWN,f=l.MIDDLE_UP),r._eventHandler.setInputAction(function(t){r._buttonsDown++,p.valid=!1,a[o]=!0,h[o]=new Date,e.clone(t.position,s[o])},m,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),a[o]=!1,d[o]=new Date},f,i)}function f(t,r){e.clone(t.startPosition,r.startPosition),e.clone(t.endPosition,r.endPosition)}function v(r,i){var n=r._update,o=r._movement,a=r._lastMovement,s=r._isDown;for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var p=c(d,i);n[p]=!0,t(r._lastMovement[p])||(r._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(r._movement[p])||(r._movement[p]={startPosition:new e,endPosition:new e})}}r._eventHandler.setInputAction(function(l){for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var p=c(d,i);s[p]&&(n[p]?(f(o[p],a[p]),a[p].valid=!0,f(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,r._currentMousePosition)},l.MOUSE_MOVE,i)}var g=function(r){this._eventHandler=new s(r,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,p(this,void 0),d(this,void 0,r),m(this,void 0,u.LEFT_DRAG),m(this,void 0,u.RIGHT_DRAG),m(this,void 0,u.MIDDLE_DRAG),v(this,void 0);for(var i in o)if(o.hasOwnProperty(i)){var n=o[i];t(n)&&(p(this,n),d(this,n,r),m(this,n,u.LEFT_DRAG),m(this,n,u.RIGHT_DRAG),m(this,n,u.MIDDLE_DRAG),v(this,n))}};return r(g.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),g.prototype.isMoving=function(e,t){var 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||e===u.PINCH)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 i,o,a,l=e._displayedCredits.textCredits;for(i=0;i<t.length;i++)a=t[i],r(a)&&(o=l.indexOf(a),-1===o?n(a,e._textContainer,e._delimiter):l.splice(o,1));for(i=0;i<l.length;i++)a=l[i],r(a)&&s(a)}function u(e,t){var i,n,a,l=e._displayedCredits.imageCredits;for(i=0;i<t.length;i++)a=t[i],r(a)&&(n=l.indexOf(a),-1===n?o(a,e._imageContainer):l.splice(n,1));for(i=0;i<l.length;i++)a=l[i],r(a)&&s(a)}var c=function(e,r){var i=document.createElement("span");i.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(i),e.appendChild(n),this._delimiter=t(r," • "),this._container=e,this._textContainer=n,this._imageContainer=i,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]}};return c.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;a(this._defaultImageCredits,e)||(t[e.id]=e)}else{var r=this._currentFrameCredits.textCredits;a(this._defaultTextCredits,e)||(r[e.id]=e)}},c.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;a(t,e)||t.push(e)}else{var r=this._defaultTextCredits;a(r,e)||r.push(e)}},c.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?(t=this._defaultImageCredits.indexOf(e),-1!==t&&this._defaultImageCredits.splice(t,1)):(t=this._defaultTextCredits.indexOf(e),-1!==t&&this._defaultTextCredits.splice(t,1))},c.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},c.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);l(this,e),u(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},c.prototype.destroy=function(){return this._container.removeChild(this._textContainer),this._container.removeChild(this._imageContainer),i(this)},c.prototype.isDestroyed=function(){return!1},c}),r("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,r,i,n){"use strict";var o=function(t){t=e(t,e.EMPTY_OBJECT);var r,o=t.attributeName,a=e(t.glslDatatype,"vec3"),s="v_"+o;if("normal"===o||"binormal"===o|"tangent"===o)r="vec4 getColor() { return vec4(("+s+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===o&&(a="vec2"),a){case"float":r="vec4 getColor() { return vec4(vec3("+s+"), 1.0); }\n";break;case"vec2":r="vec4 getColor() { return vec4("+s+", 0.0, 1.0); }\n";break;case"vec3":r="vec4 getColor() { return vec4("+s+", 1.0); }\n";break;case"vec4":r="vec4 getColor() { return "+s+"; }\n";break;default:throw new i("options.glslDatatype must be float, vec2, vec3, or vec4.")}var l="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute "+a+" "+o+";\n"+"varying "+a+" "+s+";\n"+"void main()\n"+"{\n"+"vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+s+" = "+o+";\n"+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n"+"}",u="varying "+a+" "+s+";\n"+r+"\n"+"void main()\n"+"{\n"+"gl_FragColor = getColor();\n"+"}";this.material=void 0,this.translucent=e(t.translucent,!1),this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=n.getDefaultRenderState(!1,!1,t.renderState),this._closed=e(t.closed,!1),this._attributeName=o,this._glslDatatype=a};return r(o.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),r("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(e){e=r(e,r.EMPTY_OBJECT),this.length=r(e.length,1e7),this._length=void 0,this.width=r(e.width,2),this._width=void 0,this.show=r(e.show,!0),this.modelMatrix=a.clone(r(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0};return c.prototype.update=function(r,n,c){if(this.show){if(!i(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,i(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var h=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),d=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),p=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[h,d,p],appearance:new l,asynchronous:!1})}this._primitive.update(r,n,c)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),r("Scene/DepthFunction",["../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("Shaders/EllipsoidFS",[],function(){"use strict";return"#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),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,p,m,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,x=this._colorCommand;(S||E||u)&&(b=new d({sources:[this.material.shaderSource,p]}),this.onlySunLighting&&b.defines.push("ONLY_SUN_LIGHTING"),!s&&t.fragmentDepth&&b.defines.push("WRITE_DEPTH"),this._sp=t.replaceShaderProgram(this._sp,m,b,w),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=i(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=s);var T=n.passes;if(T.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=s?_.TRANSLUCENT:_.OPAQUE,a.push(x)),T.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,p],pickColorQualifier:"uniform"}),this.onlySunLighting&&b.defines.push("ONLY_SUN_LIGHTING"),!s&&t.fragmentDepth&&b.defines.push("WRITE_DEPTH"),this._pickSP=t.replaceShaderProgram(this._pickSP,m,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 = 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"}),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=a.getDefaultRenderState(i,!l,r.renderState),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]<r;)e._frameTimes.shift();var i=(t-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/i;var n=1e3/(t>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","./Pass"],function(e,t){"use strict";var r=function(r,i){this.near=e(r,0),this.far=e(i,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 r}),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#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);\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 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"}),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 vec3 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(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#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\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/SceneMode","../Scene/terrainAttributeLocations"],function(e,t,r,i){"use strict";function n(e,t,r){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=r}function o(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._attributeLocations=i,this._shadersByTexturesFlags=[]}return o.prototype.getShaderProgram=function(t,i,o,a,s,l,u,c,h,d,p,m,f,v,g){var _=i|s<<2|l<<3|u<<4|c<<5|h<<6|d<<7|p<<8|m<<9|f<<10|v<<11|g<<12,y=o.surfaceShader;if(e(y)&&y.numberOfDayTextures===a&&y.flags===_)return y.shaderProgram;var C=this._shadersByTexturesFlags[a];if(e(C)||(C=this._shadersByTexturesFlags[a]=[]),y=C[_],!e(y)){var w=this.baseVertexShaderSource.clone(),S=this.baseFragmentShaderSource.clone();S.defines.push("TEXTURE_UNITS "+a),s&&S.defines.push("APPLY_BRIGHTNESS"),l&&S.defines.push("APPLY_CONTRAST"),u&&S.defines.push("APPLY_HUE"),c&&S.defines.push("APPLY_SATURATION"),h&&S.defines.push("APPLY_GAMMA"),d&&S.defines.push("APPLY_ALPHA"),p&&(S.defines.push("SHOW_REFLECTIVE_OCEAN"),w.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&S.defines.push("SHOW_OCEAN_WAVES"),f&&(v?(w.defines.push("ENABLE_VERTEX_LIGHTING"),S.defines.push("ENABLE_VERTEX_LIGHTING")):(w.defines.push("ENABLE_DAYNIGHT_SHADING"),S.defines.push("ENABLE_DAYNIGHT_SHADING")));for(var E="    vec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates)\n    {\n        vec4 color = initialColor;\n",b=0;a>b;++b)E+="    color = sampleAndBlend(\n        color,\n        u_dayTextures["+b+"],\n        textureCoordinates,\n        u_dayTextureTexCoordsRectangle["+b+"],\n        u_dayTextureTranslationAndScale["+b+"],\n        "+(d?"u_dayTextureAlpha["+b+"]":"1.0")+",\n        "+(s?"u_dayTextureBrightness["+b+"]":"0.0")+",\n        "+(l?"u_dayTextureContrast["+b+"]":"0.0")+",\n        "+(u?"u_dayTextureHue["+b+"]":"0.0")+",\n        "+(c?"u_dayTextureSaturation["+b+"]":"0.0")+",\n        "+(h?"u_dayTextureOneOverGamma["+b+"]":"0.0")+"\n    );\n";E+="        return color;\n    }",S.sources.push(E);var x,T="vec4 getPosition(vec3 position3DWC) { return getPosition3DMode(position3DWC); }",P="vec4 getPosition(vec3 position3DWC) { return getPosition2DMode(position3DWC); }",A="vec4 getPosition(vec3 position3DWC) { return getPositionColumbusViewMode(position3DWC); }",M="vec4 getPosition(vec3 position3DWC) { return getPositionMorphingMode(position3DWC); }";switch(i){case r.SCENE3D:x=T;break;case r.SCENE2D:x=P;break;case r.COLUMBUS_VIEW:x=A;break;case r.MORPHING:x=M}w.sources.push(x);var I,D="float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }",O="float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }";I=g?O:D,w.sources.push(I);var R=t.createShaderProgram(w,S,this._attributeLocations);y=C[_]=new n(a,_,R)}return o.surfaceShader=y,y.shaderProgram},o.prototype.destroy=function(){var r=this._shadersByTexturesFlags;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];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)},o}),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 p(e,t,n){var a,l,h=r.FLOAT,d=e.mesh.vertices,p=t.createVertexBuffer(d,s.STATIC_DRAW);n.hasVertexNormals?(a=7*r.getSizeInBytes(h),l=3):(a=6*r.getSizeInBytes(h),l=2);var m=4,f=[{index:u.position3DAndHeight,vertexBuffer:p,componentDatatype:h,componentsPerAttribute:m,offsetInBytes:0,strideInBytes:a},{index:u.textureCoordAndEncodedNormals,vertexBuffer:p,componentDatatype:h,componentsPerAttribute:l,offsetInBytes:m*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 m=function(e){this.state=c.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e};return m.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())}},m.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},m.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&&p(this,e,t,r,i,n)},m.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,m=a.level;if(this.data=s.upsample(t.tilingScheme,u,h,m,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&&p(this,e,t,r,n,o)},m}),r("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/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_){"use strict";function y(e,r,i,n,a,s){if(t.unpack(i,a*n,s),t.add(e.center,s,s),o(r)&&r.mode!==v.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 C(e,r,i){var n=e.data,a=S(e);o(a)&&(n.upsampledTerrain=new _(a)),x(e,r)&&(n.loadedTerrain=new _);for(var s=0,l=i.length;l>s;++s){var c=i.get(s);c.show&&c._createTileImagerySkeletons(e,r)}var h=e.tilingScheme.ellipsoid,d=e.rectangle;h.cartographicToCartesian(u.southwest(d),n.southwestCornerCartesian),h.cartographicToCartesian(u.northeast(d),n.northeastCornerCartesian),z.longitude=d.west,z.latitude=.5*(d.south+d.north),z.height=0;var p=h.cartographicToCartesian(z,F),m=t.cross(p,t.UNIT_Z,L);t.normalize(m,n.westNormal),z.longitude=d.east;var f=h.cartographicToCartesian(z,B),v=t.cross(t.UNIT_Z,f,L);t.normalize(v,n.eastNormal);var g=h.geodeticSurfaceNormalCartographic(u.southeast(d),N),y=t.subtract(p,f,L),C=t.cross(g,y,N);t.normalize(C,n.southNormal);var w=h.geodeticSurfaceNormalCartographic(u.northwest(d),N),E=t.cross(y,w,N);t.normalize(E,n.northNormal)}function w(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>=g.RECEIVED&&(i.terrainData!==a.data&&(i.terrainData=a.data,P(t,i),b(e)),l=!0),a.state===g.READY?(a.publishToTile(e),i.pickTerrain=n(i.loadedTerrain,i.upsampledTerrain),i.loadedTerrain=void 0,i.upsampledTerrain=void 0):a.state===g.FAILED&&(i.loadedTerrain=void 0)),!l&&o(s)&&(s.processUpsampleStateMachine(t,r,e.x,e.y,e.level),s.state>=g.RECEIVED&&i.terrainData!==s.data&&(i.terrainData=s.data,r.hasWaterMask&&A(e),E(e)),s.state===g.READY?(s.publishToTile(e),i.pickTerrain=i.upsampledTerrain,i.upsampledTerrain=void 0):s.state===g.FAILED&&(i.upsampledTerrain=void 0))}function S(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 E(e){var t=e.data;if(o(e._children))for(var r=0;4>r;++r){var i=e._children[r];if(i.state!==f.START){var n=i.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new _({data:t.terrainData,x:e.x,y:e.y,level:e.level}),i.state=f.LOADING}}}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!==f.START){var n=i.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new _({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 _)),i.state=f.LOADING}}}function x(e,t){var r=t.getTileDataAvailable(e.x,e.y,e.level);if(o(r))return r;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 T(e){var t=e.cache.tile_waterMaskData;if(!o(t)){var r=e.createTexture2D({pixelFormat:l.LUMINANCE,pixelDatatype:c.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:d.LINEAR,magnificationFilter:h.LINEAR});t={allWaterTexture:r,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function P(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=T(e),u=n.length;if(1===u){if(0===n[0])return;a=s.allWaterTexture}else{var h=Math.sqrt(u);a=e.createTexture2D({pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:n}}),a.referenceCount=0,a.sampler=s.sampler}++a.referenceCount,t.waterMaskTexture=a,r.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function A(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.width,s=n.height,l=a/i.width,u=s/i.height;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 M=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,this.surfaceShader=void 0};a(M.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=o(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),r=this.upsampledTerrain,i=o(r)&&(r.state===g.RECEIVING||r.state===g.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!==m.TRANSITIONING}return n}}});var I=new t,D=new t,O=new t,R=new t;M.prototype.pick=function(e,r,i,n){var a=this.pickTerrain;if(!o(a))return void 0;var l=a.mesh;if(!o(l))return void 0;for(var u=l.vertices,c=l.stride,h=l.indices,d=h.length,p=0;d>p;p+=3){var m=h[p],f=h[p+1],v=h[p+2],g=y(this,r,u,c,m,I),_=y(this,r,u,c,f,D),C=y(this,r,u,c,v,O),w=s.rayTriangle(e,g,_,C,i,R);if(o(w))return t.clone(w,n)}return void 0},M.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()},M.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()))},M.processStateMachine=function(e,t,r,i){var n=e.data;o(n)||(n=e.data=new M),e.state===f.START&&(C(e,r,i),e.state=f.LOADING),e.state===f.LOADING&&w(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===m.PLACEHOLDER){var p=d.loadingImagery.imageryLayer;if(p.imageryProvider.ready){d.freeResources(),u.splice(c,1),p._createTileImagerySkeletons(e,r,c),--c,h=u.length;continue}l=!1}var v=d.processStateMachine(e,t);s=s&&v,a=a&&(v||o(d.readyImagery)),l=l&&o(d.loadingImagery)&&(d.loadingImagery.state===m.FAILED||d.loadingImagery.state===m.INVALID)}else l=!1}e.upsampledFromParent=l,c===h&&(a&&(e.renderable=!0),s&&(e.state=f.DONE))};var L=new t,N=new t,F=new t,B=new t,z=new i;return M}),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;\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"}),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.prototype.processStateMachine=function(e){this.state===r.UNLOADED&&(this.state=r.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===r.RECEIVED&&(this.state=r.TRANSITIONING,this.imageryLayer._createTexture(e,this)),this.state===r.TEXTURE_LOADED&&(this.state=r.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this))},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.processStateMachine(i),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,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(r,this))),n.state===t.FAILED||n.state===t.INVALID?e(a)?(a.processStateMachine(i),!1):!0:!1},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/IndexDatatype","../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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D){"use strict";function O(e,t,r){return JSON.stringify([e,t,r])}function R(t,r,n,o){var s=r.cache.imageryLayer_reproject;if(!a(s)){s=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 l=new Float32Array(256),u=0,c=0;64>c;++c){var p=c/63;l[u++]=0,l[u++]=p,l[u++]=1,l[u++]=p}var f={position:0,webMercatorT:1},g=v.getRegularGridIndices(2,64),A=r.createIndexBuffer(g,_.STATIC_DRAW,h.UNSIGNED_SHORT);s.vertexArray=r.createVertexArray([{index:f.position,vertexBuffer:r.createVertexBuffer(l,_.STATIC_DRAW),componentsPerAttribute:2},{index:f.webMercatorT,vertexBuffer:r.createVertexBuffer(512,_.STREAM_DRAW),componentsPerAttribute:1}],A);var M=new S({sources:[P]});s.shaderProgram=r.createShaderProgram(M,T,f),s.sampler=r.createSampler({wrapS:x.CLAMP_TO_EDGE,wrapT:x.CLAMP_TO_EDGE,minificationFilter:b.LINEAR,magnificationFilter:E.LINEAR})}n.sampler=s.sampler;var I=n.width,D=n.height;V.textureDimensions.x=I,V.textureDimensions.y=D,V.texture=n;var O=Math.sin(o.south),R=.5*Math.log((1+O)/(1-O));O=Math.sin(o.north);var L=.5*Math.log((1+O)/(1-O)),N=1/(L-R),F=r.createTexture2D({width:I,height:D,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});F.generateMipmap(w.NICEST),a(s.framebuffer)&&s.framebuffer.destroy(),s.framebuffer=r.createFramebuffer({colorTextures:[F]}),s.framebuffer.destroyAttachments=!1;for(var B=o.south,z=o.north,U=k,W=0,G=0;64>G;++G){var H=G/63,q=d.lerp(B,z,H);O=Math.sin(q);var j=.5*Math.log((1+O)/(1-O)),Y=(j-R)*N;U[W++]=Y,U[W++]=Y}s.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(U);var X=new y({color:i.BLACK,framebuffer:s.framebuffer});X.execute(r),a(s.renderState)&&s.renderState.viewport.width===I&&s.renderState.viewport.height===D||(s.renderState=r.createRenderState({viewport:new e(0,0,I,D)}));var Z=new C({framebuffer:s.framebuffer,shaderProgram:s.shaderProgram,renderState:s.renderState,primitiveType:m.TRIANGLES,vertexArray:s.vertexArray,uniformMap:V});return Z.execute(r),F}function L(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.width*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,h=Math.log(u)/Math.log(2),d=Math.round(h);return 0|d}var N=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 D(M.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0};s(N.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),N.DEFAULT_BRIGHTNESS=1,N.DEFAULT_CONTRAST=1,N.DEFAULT_HUE=0,N.DEFAULT_SATURATION=1,N.DEFAULT_GAMMA=1,N.prototype.isBaseLayer=function(){return this._isBaseLayer},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return l(this)};var F=new f,B=new f,z=new f;N.prototype._createTileImagerySkeletons=function(e,t,i){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(i)||(i=n.imagery.length),!o.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),n.imagery.splice(i,0,this._skeletonPlaceholder),!0;var s=f.intersection(o.rectangle,this._rectangle,F),l=f.intersection(e.rectangle,s,B);if(!a(l)){if(!this.isBaseLayer())return!1;var u=s,c=e.rectangle;l=B,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,p=d*t.getLevelMaximumGeometricError(e.level),m=L(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),w=e.rectangle.height/512,S=e.rectangle.width/512,E=_.tileXYToRectangle(y.x,y.y,m);Math.abs(E.south-e.rectangle.north)<S&&y.y<C.y&&++y.y,Math.abs(E.east-e.rectangle.west)<w&&y.x<C.x&&++y.x;var b=_.tileXYToRectangle(C.x,C.y,m);Math.abs(b.north-e.rectangle.south)<S&&C.y>y.y&&--C.y,Math.abs(b.west-e.rectangle.east)<w&&C.x>y.x&&--C.x;var x,T,P=e.rectangle,A=_.tileXYToRectangle(y.x,y.y,m),M=f.intersection(A,s,z),I=0,O=1;!this.isBaseLayer()&&Math.abs(M.west-e.rectangle.west)>=w&&(I=Math.min(1,(M.west-P.west)/P.width)),!this.isBaseLayer()&&Math.abs(M.north-e.rectangle.north)>=S&&(O=Math.max(0,(M.north-P.south)/P.height));for(var R=O,N=y.x;N<=C.x;N++){x=I,A=_.tileXYToRectangle(N,y.y,m),M=f.intersection(A,s,z),I=Math.min(1,(M.east-P.west)/P.width),N===C.x&&(this.isBaseLayer()||Math.abs(M.east-e.rectangle.east)<w)&&(I=1),O=R;for(var V=y.y;V<=C.y;V++){T=O,A=_.tileXYToRectangle(N,V,m),M=f.intersection(A,s,z),O=Math.max(0,(M.south-P.south)/P.height),V===C.y&&(this.isBaseLayer()||Math.abs(M.south-e.rectangle.south)<S)&&(O=0);var k=new r(x,O,I,T),U=this.getImageryFromCache(N,V,m,A);n.imagery.splice(i,0,new D(U,k)),++i}}return!0},N.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyImagery.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/i.width,l=a/i.height;return new r(s*(n.west-i.west)/o,l*(n.south-i.south)/a,s,l)},N.prototype._requestImagery=function(e){function t(t){return a(t)?(e.image=t,e.state=I.RECEIVED,g.handleSuccess(o._requestImageError),void 0):r()}function r(){e.state=I.FAILED;var t="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";o._requestImageError=g.handleError(o._requestImageError,n,n.errorEvent,t,e.x,e.y,e.level,i)}function i(){e.state=I.TRANSITIONING;var i=n.requestImage(e.x,e.y,e.level);return a(i)?(a(n.getTileCredits)&&(e.credits=n.getTileCredits(e.x,e.y,e.level)),A(i,t,r),void 0):(e.state=I.UNLOADED,void 0)}var n=this._imageryProvider,o=this;i()},N.prototype._createTexture=function(e,t){var r=this._imageryProvider;if(a(r.tileDiscardPolicy)){var i=r.tileDiscardPolicy;if(a(i)){if(!i.isReady())return t.state=I.RECEIVED,void 0;if(i.shouldDiscardImage(t.image))return t.state=I.INVALID,void 0}}var n=e.createTexture2D({source:t.image,pixelFormat:r.hasAlphaChannel?p.RGBA:p.RGB});t.texture=n,t.image=void 0,t.state=I.TEXTURE_LOADED},N.prototype._reprojectTexture=function(e,t){var r=t.texture,i=t.rectangle;if(!(this._imageryProvider.tilingScheme instanceof c)&&i.width/r.width>1e-5){var n=R(this,e,r,t.rectangle);r.destroy(),t.texture=r=n}if(d.isPowerOfTwo(r.width)&&d.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:b.LINEAR_MIPMAP_LINEAR,magnificationFilter:E.LINEAR,maximumAnisotropy:Math.min(l,o(this._maximumAnisotropy,l))})}r.generateMipmap(w.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:b.LINEAR,magnificationFilter:E.LINEAR})),r.sampler=u}t.state=I.READY},N.prototype.getImageryFromCache=function(e,t,r,i){var n=O(e,t,r),o=this._imageryCache[n];return a(o)||(o=new M(this,e,t,r,i),this._imageryCache[n]=o),o.addReference(),o},N.prototype.removeImageryFromCache=function(e){var t=O(e.x,e.y,e.level);delete this._imageryCache[t]};var V={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 N}),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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M){"use strict";function I(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 D(){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 m,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,p=t.hasWaterMask&&o(d),g=t.oceanNormalMap,y=p&&o(g),w=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals;p&&--h,y&&--h;var S=u.center,b=V,x=0,A=0,I=0,R=0,L=0,N=!1;if(s.mode!==M.SCENE3D){var F=s.mapProjection,H=F.project(v.southwest(n.rectangle),W),q=F.project(v.northeast(n.rectangle),G);if(b.x=H.x,b.y=H.y,b.z=q.x,b.w=q.y,s.mode!==M.MORPHING&&(S=k,S.x=0,S.y=.5*(b.z+b.x),S.z=.5*(b.w+b.y),b.x-=S.y,b.y-=S.z,b.z-=S.y,b.w-=S.z),F instanceof _){x=n.rectangle.south,A=n.rectangle.north;var j=_.geodeticLatitudeToMercatorAngle(x),Y=_.geodeticLatitudeToMercatorAngle(A);B[0]=j,I=B[0],R=j-B[0],L=1/(Y-j),N=!0}}var X=U;X.x=S.x,X.y=S.y,X.z=S.z,X.w=1,m.multiplyByVector(c,X,X),m.setColumn(c,3,X,z);var J=u.imagery,Q=0,K=J.length,$=t._renderState,et=t._blendRenderState,tt=$,rt=t._firstPassInitialColor;do{var it,nt,ot=0;t._drawCommands.length<=t._usedDrawCommands?(it=new C,it.owner=n,it.cull=!1,it.boundingVolume=new e,nt=D(),t._drawCommands.push(it),t._uniformMaps.push(nt)):(it=t._drawCommands[t._usedDrawCommands],nt=t._uniformMaps[t._usedDrawCommands]),it.owner=n,++t._usedDrawCommands,it.debugShowBoundingVolume=n===t._debug.boundingSphereTile,i.clone(rt,nt.initialColor),nt.oceanNormalMap=g,nt.lightingFadeDistance.x=t.lightingFadeOutDistance,nt.lightingFadeDistance.y=t.lightingFadeInDistance,nt.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,nt.center3D=u.center,i.clone(b,nt.tileRectangle),nt.southAndNorthLatitude.x=x,nt.southAndNorthLatitude.y=A,nt.southMercatorYLowAndHighAndOneOverHeight.x=R,nt.southMercatorYLowAndHighAndOneOverHeight.y=I,nt.southMercatorYLowAndHighAndOneOverHeight.z=L,m.clone(z,nt.modifiedModelView);for(var at=!1,st=!1,lt=!1,ut=!1,ct=!1,ht=!1;h>ot&&K>Q;){var dt=J[Q],pt=dt.readyImagery;if(++Q,o(pt)&&pt.state===P.READY&&0!==pt.imageryLayer.alpha){var mt=pt.imageryLayer;if(o(dt.textureTranslationAndScale)||(dt.textureTranslationAndScale=mt._calculateTextureTranslationAndScale(n,dt)),nt.dayTextures[ot]=pt.texture,nt.dayTextureTranslationAndScale[ot]=dt.textureTranslationAndScale,nt.dayTextureTexCoordsRectangle[ot]=dt.textureCoordinateRectangle,nt.dayTextureAlpha[ot]=mt.alpha,ht=ht||1!==nt.dayTextureAlpha[ot],nt.dayTextureBrightness[ot]=mt.brightness,at=at||nt.dayTextureBrightness[ot]!==T.DEFAULT_BRIGHTNESS,nt.dayTextureContrast[ot]=mt.contrast,st=st||nt.dayTextureContrast[ot]!==T.DEFAULT_CONTRAST,nt.dayTextureHue[ot]=mt.hue,lt=lt||nt.dayTextureHue[ot]!==T.DEFAULT_HUE,nt.dayTextureSaturation[ot]=mt.saturation,ut=ut||nt.dayTextureSaturation[ot]!==T.DEFAULT_SATURATION,nt.dayTextureOneOverGamma[ot]=1/mt.gamma,ct=ct||nt.dayTextureOneOverGamma[ot]!==1/T.DEFAULT_GAMMA,o(pt.credits))for(var ft=s.creditDisplay,vt=pt.credits,gt=0,_t=vt.length;_t>gt;++gt)ft.addCredit(vt[gt]);++ot}}nt.dayTextures.length=ot,nt.waterMask=d,i.clone(u.waterMaskTranslationAndScale,nt.waterMaskTranslationAndScale),it.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s.mode,u,ot,at,st,lt,ut,ct,ht,p,y,t.enableLighting,w,N),it.renderState=tt,it.primitiveType=f.TRIANGLES,it.vertexArray=u.vertexArray,it.uniformMap=nt,it.pass=E.GLOBE,t._debug.wireframe&&(O(a,t,n),o(u.wireframeVertexArray)&&(it.vertexArray=u.wireframeVertexArray,it.primitiveType=f.LINES));var yt=it.boundingVolume;s.mode!==M.SCENE3D?(e.fromRectangleWithHeights2D(n.rectangle,s.mapProjection,u.minimumHeight,u.maximumHeight,yt),r.fromElements(yt.center.z,yt.center.x,yt.center.y,yt.center),s.mode===M.MORPHING&&(yt=e.union(u.boundingSphere3D,yt,yt))):e.clone(u.boundingSphere3D,yt),l.push(it),tt=et,rt=Z}while(K>Q)}var N=function J(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._errorEvent=new u,this._imageryLayers.layerAdded.addEventListener(J.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(J.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(J.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(J.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(I)}));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){x.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===p.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 m,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,p=t.camera.positionCartographic,m=r.subtract(d,n,X),f=r.dot(m,a),g=r.dot(m,s),_=r.subtract(d,o,X),y=r.dot(_,l),C=r.dot(_,u);h=t.mode===M.SCENE3D?p.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<o.length;++u){var c=o[u];s.contains(c.rectangle,n)&&(a=c)}if(!t(a))return void 0;a.rectangle;for(var h=a.data.imagery,d=[],p=h.length-1;p>=0;--p){var m=h[p],f=m.readyImagery;if(t(f)){var v=f.imageryLayer.imageryProvider;if(t(v.pickFeatures)&&s.contains(f.rectangle,n)){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;i<e.length;++i){var o=e[i];if(t(o)&&o.length>0)for(var a=0;a<o.length;++a){var s=o[a];t(s.position)||(s.position=n),r.push(s)}}return r})},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this.removeAll(!0),i(this)},d.prototype._update=function(){for(var e,r,i=!0,n=this._layers,o=0,a=n.length;a>o;++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.state<i.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),n.prototype.freeResources=function(){if(this.state=i.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),e(this._children)){for(var t=0,r=this._children.length;r>t;++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,m=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&&m.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),p(e,r,i,d)<e.maximumScreenSpaceError)f(e,d);else if(v(e,d)){var C=d.children;for(o=0,s=C.length;s>o;++o)m.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 p(e,t,r,i){if(r.mode===c.SCENE2D)return m(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 m(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){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;i<r.length;++i)r[i].freeResources();this._levelZeroTiles=void 0},w.prototype.forEachLoadedTile=function(e){for(var r=this._tileReplacementQueue.head;t(r);)r.state!==u.START&&e(r),r=r.replacementNext},w.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,r=0,i=t.length;i>r;++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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,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,p=n.multiplyByScalar(l,d,st),m=n.multiplyByScalar(u,d,lt),f=n.add(h,m,ut);n.subtract(f,p,f),n.multiplyComponents(r,f,f),n.pack(f,ot,0);var v=n.subtract(h,m,ut);n.subtract(v,p,v),n.multiplyComponents(r,v,v),n.pack(v,ot,3);var g=n.add(h,m,ut);n.add(g,p,g),n.multiplyComponents(r,g,g),n.pack(g,ot,6);var _=n.subtract(h,m,ut);return n.add(_,p,_),n.multiplyComponents(r,_,_),n.pack(_,ot,9),ot}function J(t,r,i,o,a,s){pt.longitude=0,pt.latitude=o;var l=t._ellipsoid.cartographicToCartesian(pt,mt);pt.longitude=Math.PI;var u=t._ellipsoid.cartographicToCartesian(pt,ft),c=.5*n.magnitude(n.subtract(l,u,ct),ct);pt.longitude=0,pt.latitude=i;var h,d=t._ellipsoid.cartographicToCartesian(pt,mt),p=r.camera.direction;h=1-n.dot(dt,p)<S.EPSILON6?n.UNIT_X:n.normalize(n.cross(p,n.UNIT_Z,ct),ct);var m=n.add(d,n.multiplyByScalar(h,c,ct),ct),f=n.add(d,n.multiplyByScalar(n.normalize(n.cross(n.UNIT_Z,h,ht),ht),c,ht),ht);A.pointToGLWindowCoordinates(a,s,d,d),A.pointToGLWindowCoordinates(a,s,m,m),A.pointToGLWindowCoordinates(a,s,f,f);var v=Math.floor(Math.max(n.distance(f,d),n.distance(m,d))),g=v;return new e(Math.floor(d.x)-v,Math.floor(d.y)-g,2*v,2*g)}function Q(e,r,i){var n=e.terrainProvider;if(i.mode===j.SCENE3D&&n.ready){var o=n.tilingScheme.rectangle,l=r.uniformState.viewProjection,c=vt;c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;var h,d,p,m,f,v,C,w=E.computeViewportTransformation(c,0,1,gt),x=.05,T=e._occluder;o.north<S.PI_OVER_TWO&&(h=new P(-Math.PI,o.north,Math.PI,S.PI_OVER_TWO),d=t.fromRectangle3D(h,e._ellipsoid),p=i.cullingVolume.computeVisibility(d)===y.OUTSIDE,m=b.computeOccludeePointFromRectangle(h,e._ellipsoid),f=m&&!T.isPointVisible(m,0)||!T.isBoundingSphereVisible(d),e._drawNorthPole=!p&&!f,e._drawNorthPole&&(C=J(e,i,h.north,h.south-x,l,w),_t[0]=C.x,_t[1]=C.y,_t[2]=C.x+C.width,_t[3]=C.y,_t[4]=C.x+C.width,_t[5]=C.y+C.height,_t[6]=C.x,_t[7]=C.y+C.height,u(e._northPoleCommand.vertexArray)?e._northPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(_t):(e._northPoleCommand.boundingVolume=t.fromRectangle3D(h,e._ellipsoid),v=new g({attributes:{position:new _({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:_t})}}),e._northPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:v,attributeLocations:{position:0},bufferUsage:M.STREAM_DRAW})))),o.south>-S.PI_OVER_TWO&&(h=new P(-Math.PI,-S.PI_OVER_TWO,Math.PI,o.south),d=t.fromRectangle3D(h,e._ellipsoid),p=i.cullingVolume.computeVisibility(d)===y.OUTSIDE,m=b.computeOccludeePointFromRectangle(h,e._ellipsoid),f=m&&!T.isPointVisible(m)||!T.isBoundingSphereVisible(d),e._drawSouthPole=!p&&!f,e._drawSouthPole&&(C=J(e,i,h.south,h.north+x,l,w),_t[0]=C.x,_t[1]=C.y,_t[2]=C.x+C.width,_t[3]=C.y,_t[4]=C.x+C.width,_t[5]=C.y+C.height,_t[6]=C.x,_t[7]=C.y+C.height,u(e._southPoleCommand.vertexArray)?e._southPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(_t):(e._southPoleCommand.boundingVolume=t.fromRectangle3D(h,e._ellipsoid),v=new g({attributes:{position:new _({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:_t})}}),e._southPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:v,attributeLocations:{position:0},bufferUsage:M.STREAM_DRAW}))));var A=0,I=e._imageryLayerCollection.length>0?e._imageryLayerCollection.get(0):void 0;u(I)&&u(I.imageryProvider)&&u(I.imageryProvider.getPoleIntensity)&&(A=I.imageryProvider.getPoleIntensity());var D={u_dayIntensity:function(){return A}};if(!u(e._northPoleCommand.uniformMap)){var O=a(D,{u_color:function(){return e.northPoleColor}});e._northPoleCommand.uniformMap=a(O,e._drawUniforms)}if(!u(e._southPoleCommand.uniformMap)){var R=a(D,{u_color:function(){return e.southPoleColor}});e._southPoleCommand.uniformMap=a(R,e._drawUniforms)}}}var K=function(e){e=l(e,p.WGS84);var o=new m({ellipsoid:e}),a=new G;this._ellipsoid=e,this._imageryLayerCollection=a,this._surfaceShaderSet=new U,this._surfaceShaderSet.baseVertexShaderSource=new O({sources:[F]}),this._surfaceShaderSet.baseFragmentShaderSource=new O({sources:[R]}),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 I({depth:1,stencil:0,owner:this}),this._depthCommand=new D({boundingVolume:new t(n.ZERO,e.maximumRadius),pass:H.OPAQUE,owner:this}),this._northPoleCommand=new D({pass:H.OPAQUE,owner:this}),this._southPoleCommand=new D({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.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5,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 p=l.data;if(u(p)){var m=p.pickBoundingSphere;o!==j.SCENE3D?(t.fromRectangleWithHeights2D(l.rectangle,a,p.minimumHeight,p.maximumHeight,m),n.fromElements(m.center.z,m.center.x,m.center.y,m.center)):t.clone(p.boundingSphere3D,m);var f=C.raySphere(e,m,et);u(f)&&s.push(p)}}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 T;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),pt=new o(0,0),mt=new n,ft=new n,vt=new e,gt=new E,_t=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;t.mapProjection;var a=!1;this._mode===o&&u(this._rsColor)||(a=!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._mode=o;var l=this._northPoleCommand,c=this._southPoleCommand;l.renderState=this._rsColorWithoutDepthTest,c.renderState=this._rsColorWithoutDepthTest;var h=Z(this,t);if(this._depthCommand.vertexArray)this._depthCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(h);else{var d=new g({attributes:{position:new _({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:h})},indices:[0,1,2,2,1,3],primitiveType:x.TRIANGLES});this._depthCommand.vertexArray=e.createVertexArrayFromGeometry({geometry:d,attributeLocations:{position:0},bufferUsage:M.DYNAMIC_DRAW})}u(this._depthCommand.shaderProgram)||(this._depthCommand.shaderProgram=e.createShaderProgram(B,L,{position:0}));var p=this._surface,m=p.tileProvider,f=this.terrainProvider,v=this.showWaterEffect&&f.ready&&f.hasWaterMask;if(v&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var y=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=y,u(y)){var C=this;V(w(y),function(t){y===C.oceanNormalMapUrl&&(C._oceanNormalMap=C._oceanNormalMap&&C._oceanNormalMap.destroy(),C._oceanNormalMap=e.createTexture2D({source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}if(!u(l.shaderProgram)||!u(c.shaderProgram)){var S=e.replaceShaderProgram(l.shaderProgram,z,N,Y);l.shaderProgram=S,c.shaderProgram=S}this._occluder.cameraPosition=t.camera.positionWC,Q(this,e,t);var E=t.passes;E.render&&(o===j.SCENE3D&&(this._drawNorthPole&&r.push(l),this._drawSouthPole&&r.push(c)),this._zoomedOutOceanSpecularIntensity=o===j.SCENE3D?.5:0,p.maximumScreenSpaceError=this.maximumScreenSpaceError,p.tileCacheSize=this.tileCacheSize,m.terrainProvider=this.terrainProvider,m.lightingFadeOutDistance=this.lightingFadeOutDistance,m.lightingFadeInDistance=this.lightingFadeInDistance,m.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,m.hasWaterMask=v,m.oceanNormalMap=this._oceanNormalMap,m.enableLighting=this.enableLighting,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)))),E.pick&&o===j.SCENE3D&&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,p){"use strict";function m(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;o<t.layers.length;o++)if(t.layers[o].id===_._channel){n=t.layers[o];break}var s;if(!r(n))throw s="Could not find layer with channel (id) of "+_._channel+".",f=c.handleError(f,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(!r(n.version))throw s="Could not find a version in channel (id) "+_._channel+".",f=c.handleError(f,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(_._version=n.version,r(t.projection)&&"flat"===t.projection)_._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI)});else{if(r(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",f=c.handleError(f,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);_._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2})}_._imageUrlTemplate=_._imageUrlTemplate.replace("{request}",_._requestType).replace("{channel}",_._channel).replace("{version}",_._version),_._ready=!0,c.handleSuccess(f)}function p(){var e="An error occurred while accessing "+g+".";f=c.handleError(f,_,_._errorEvent,e,void 0,void 0,void 0,m)}function m(){var e=r(_._proxy)?_._proxy.getURL(g):g,t=s(e);d(t,n,p)}i=t(i,{}),this._url=i.url,this._path=t(i.path,"/default_map"),this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._channel=i.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",v._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=t(i.maximumLevel,23),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;var f,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",_=this;m()};return i(f.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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),f.prototype.getTileCredits=function(){return void 0},f.prototype.requestImage=function(e,t,r){var i=m(this,e,t,r);return p.loadImage(this,i)},f.prototype.pickFeatures=function(){return void 0},f._logoData="data:image/png;base64, ",f}),r("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme"],function(e,t,r,i,n,o){"use strict";var a=new e(1,1,1,.4),s=new e(0,1,0,.05),l=new e(0,.5,0,.2),u=function(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new o,this._cells=t(e.cells,8),this._color=t(e.color,a),this._glowColor=t(e.glowColor,s),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,l),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()};return i(u.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}}}),u.prototype._drawGrid=function(e){for(var t=0,r=this._canvasSize,i=0;i<=this._cells;++i){var n=i/this._cells,o=1+n*(r-1);e.moveTo(o,t),e.lineTo(o,r),e.moveTo(t,o),e.lineTo(r,o)}e.stroke()},u.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,r=this._canvasSize,i=e.getContext("2d"),n=this._backgroundColor.toCssColorString();i.fillStyle=n,i.fillRect(t,t,r,r);var o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,r,r),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(t,t,r,r),this._drawGrid(i);var a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(t,t,r,r),i.lineWidth=1,this._drawGrid(i),e},u.prototype.getTileCredits=function(){return void 0},u.prototype.requestImage=function(){return this._canvas},u.prototype.pickFeatures=function(){return void 0},u}),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,p){"use strict";var m=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:p.fromType(p.ImageType),_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,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)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},m}),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 p(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 m(e){d(e),p(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){p(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)&&(p(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||(m(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,I,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,D)}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 x(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 p=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,p);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,p);n.framebuffer=h}function T(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,p=h.oit.translucentShaderProgram;i(h,r,a,n,d,p,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},I={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},D="    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?(T(this,e,t,r,i),void 0):(x(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(){m(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 p=t(r.credit,h);"string"==typeof p&&(p=new e(p)),this._credit=p};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,p=new t;return u.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 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,p),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,p),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,p),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 p=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(p.prototype,{positions:{get:function(){return this._positions},set:function(e){this._positions=e,this._polygonHierarchy=void 0,this._createPrimitive=!0}}}),p.prototype.configureFromPolygonHierarchy=function(e){this._positions=void 0,this._polygonHierarchy=e,this._createPrimitive=!0},p.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)}},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},p}),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.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,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;n<i.length;++n)i[n].update(e,t,r)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),r("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return r.computeDefaultLevelZeroMaximumGeometricError=function(e){return.25*2*e.ellipsoid.maximumRadius*Math.PI/(65*e.getNumberOfXTilesAtLevel(0))},e(r.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),r.prototype.beginUpdate=t.throwInstantiationError,r.prototype.endUpdate=t.throwInstantiationError,r.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,r.prototype.loadTile=t.throwInstantiationError,r.prototype.computeTileVisibility=t.throwInstantiationError,r.prototype.showTileThisFrame=t.throwInstantiationError,r.prototype.computeDistanceToTile=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r}),r("Scene/RectanglePrimitive",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/GeometryInstance","../Core/Math","../Core/Rectangle","../Core/RectangleGeometry","./EllipsoidSurfaceAppearance","./Material","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var p=function(r){r=t(r,t.EMPTY_OBJECT),this.ellipsoid=t(r.ellipsoid,o.WGS84),this._ellipsoid=void 0,this.rectangle=l.clone(r.rectangle),this._rectangle=void 0,this.granularity=t(r.granularity,s.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(r.height,0),this._height=void 0,this.rotation=t(r.rotation,0),this._rotation=void 0,this.textureRotationAngle=t(r.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(r.show,!0);var i=h.fromType(h.ColorType,{color:new e(1,1,0,.5)});this.material=t(r.material,i),this.id=r.id,this._id=void 0,this.asynchronous=t(r.asynchronous,!0),this.debugShowBoundingVolume=t(r.debugShowBoundingVolume,!1),this._primitive=void 0};return p.prototype.update=function(e,t,i){if(this.show&&r(this.rectangle)){if(!l.equals(this._rectangle,this.rectangle)||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._rotation!==this.rotation||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){this._rectangle=l.clone(this.rectangle,this._rectangle),this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._rotation=this.rotation,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id;var n=new a({geometry:new u({rectangle:this.rectangle,vertexFormat:c.VERTEX_FORMAT,ellipsoid:this.ellipsoid,granularity:this.granularity,height:this.height,rotation:this.rotation,stRotation:this.textureRotationAngle}),id:this.id,pickPrimitive:this});r(this._primitive)&&this._primitive.destroy(),this._primitive=new d({geometryInstances:n,appearance:new c({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i)}},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i(this)},p}),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,p,m){"use strict";function f(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);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;r<t.length;++r)t[r].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function g(t,r,i,n){var a=t._scene,s=a.camera;s._setTransform(l.IDENTITY);var u=s.position,c=s.direction,h=s.up,d=e.clone(t._camera2D.position),p=e.clone(t._camera2D.direction),m=e.clone(t._camera2D.up),f=function(t){s.position=y(u,d,t.time),s.direction=y(c,p,t.time),s.up=y(h,m,t.time),s.right=e.cross(s.direction,s.up,s.right),e.normalize(s.right,s.right)},v=a.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f});t._currentTweens.push(v),T(t,a,0,1,r,n)}function _(e,t,r,i){t*=.5;var n=e._scene.camera;n._setTransform(l.IDENTITY),E(e,t,r,function(){n.frustum=e._cameraCV.frustum.clone(),g(e,t,r,i)})}function y(t,r,i){return e.lerp(t,r,i,new e)}function C(t,r,i){var n=t._scene,a=n.camera,l=a.position,u=a.frustum.fov,c=.5*s.RADIANS_PER_DEGREE,h=e.magnitude(l)*Math.tan(.5*u);a.frustum.far=h/Math.tan(.5*c)+1e7;var d=function(t){a.frustum.fov=s.lerp(u,c,t.time);var r=h/Math.tan(.5*a.frustum.fov),i=new e;a.position=e.multiplyByScalar(e.normalize(a.position,i),r,i)},p=n.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:d,complete:function(){a.frustum=t._camera2D.frustum.clone(),i(t)}});t._currentTweens.push(p)}function w(t,r,i,n){var a=t._scene,s=a.camera;s._setTransform(l.IDENTITY);var u=i.maximumRadius,c=e.clone(s.position),h=e.clone(s.direction),d=e.clone(s.up),p=Math.tan(.5*t._cameraCV.frustum.fovy),m=t._cameraCV.frustum.aspectRatio*p,f=u*Math.PI/m,v=new e;v=e.multiplyByScalar(e.normalize(t._camera2D.position,v),f,v);var g=e.clone(t._camera2D.direction),_=e.clone(t._camera2D.up),w=function(t){s.position=y(c,v,t.time),s.direction=y(h,g,t.time),s.up=y(d,_,t.time),s.right=e.cross(s.direction,s.up,s.right),e.normalize(s.right,s.right)};r*=.5;var S=a.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:w,complete:function(){C(t,r,n)}});t._currentTweens.push(S)}function S(t,r,i,n){r*=.5;var o=i.maximumRadius,a=Math.tan(.5*t._camera3D.frustum.fovy),s=t._camera3D.frustum.aspectRatio*a,l=o*Math.PI/s,u={},c=new e;u.position2D=e.multiplyByScalar(e.normalize(t._camera2D.position2D,c),l,c),u.direction2D=e.clone(t._camera2D.direction2D),u.up2D=e.clone(t._camera2D.up2D);var h=function(){C(t,r,n)};x(t,r,u,h)}function E(t,r,i,n){var a=t._scene,l=a.camera,u=i.maximumRadius,c=Math.tan(.5*t._cameraCV.frustum.fovy),h=t._cameraCV.frustum.aspectRatio*c,d=u*Math.PI/h,p=new e;p=e.multiplyByScalar(e.normalize(t._camera2D.position,p),d,p);var m=l.frustum.top,f=l.frustum.bottom,v=l.frustum.right,g=l.frustum.left,_=t._camera2D.frustum,C=t._cameraCV.frustum,w=e.clone(l.position),S=function(e){l.position=y(w,p,e.time),l.frustum.top=s.lerp(m,_.top,e.time),l.frustum.bottom=s.lerp(f,_.bottom,e.time),l.frustum.right=s.lerp(v,_.right,e.time),l.frustum.left=s.lerp(g,_.left,e.time)},E=(v-g)/(2*u*Math.PI),b=1;E>b&&(E=0);var x=(b-E)*r;if(x<s.EPSILON6){if(e.equalsEpsilon(w,p,s.EPSILON6))return l.position=p,l.frustum=C.clone(),n(t),void 0;x=r,E=0,b=1}var T=a.tweens.add({easingFunction:o.QUARTIC_OUT,duration:x,startObject:{time:E},stopObject:{time:b},update:S,complete:function(){l.frustum=C.clone(),n(t)}});t._currentTweens.push(T)}function b(t,r,i,n){var a=t._scene,s=a.camera;s._setTransform(l.IDENTITY),r*=.5;var u=function(){var i=e.clone(s.position),l=e.clone(s.direction),u=e.clone(s.up),c=e.clone(t._cameraCV.position),h=e.clone(t._cameraCV.direction),d=e.clone(t._cameraCV.up),p=function(t){s.position=y(i,c,t.time),s.direction=y(l,h,t.time),s.up=y(u,d,t.time),s.right=e.cross(s.direction,s.up,s.right),e.normalize(s.right,s.right)},m=a.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){n(t)}});t._currentTweens.push(m)};E(t,r,i,u)}function x(t,r,i,n){var a=t._scene,s=a.camera;s._setTransform(l.IDENTITY);var u=e.clone(s.position),c=e.clone(s.direction),h=e.clone(s.up),d=e.clone(i.position2D),p=e.clone(i.direction2D),m=e.clone(i.up2D),f=function(t){s.position=y(u,d,t.time),s.direction=y(c,p,t.time),s.up=y(h,m,t.time),s.right=e.cross(s.direction,s.up,s.right),e.normalize(s.right,s.right)},v=a.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.position=d,s.direction=p,s.up=m,s.right=e.cross(p,m,s.right),e.normalize(s.right,s.right)}});t._currentTweens.push(v),T(t,a,1,0,r,n)}function T(e,t,i,n,a,s){var l={object:t,property:"morphTime",startValue:i,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};r(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function P(e){var t=e._scene,r=t.drawingBufferHeight/t.drawingBufferWidth,i=e._camera2D.frustum;i.top=i.right*r,i.bottom=-i.top,r=1/r,i=e._cameraCV.frustum,i.aspectRatio=r,i=e._camera3D.frustum,i.aspectRatio=r;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 A(t){var i=t._scene;if(i.mode=m.SCENE3D,i.morphTime=m.getMorphTime(m.SCENE3D),v(t),P(t),t._previousMode!==m.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=i.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=r(t._completeMorph);t._completeMorph=void 0,t._scene.morphComplete.raiseEvent(t,t._previousMode,m.SCENE3D,o)}function M(t){var i=t._scene;i.mode=m.SCENE2D,i.morphTime=m.getMorphTime(m.SCENE2D),v(t),P(t);var n=i.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=r(t._completeMorph);t._completeMorph=void 0,t._scene.morphComplete.raiseEvent(t,t._previousMode,m.SCENE2D,o)}function I(t){var i=t._scene;if(i.mode=m.COLUMBUS_VIEW,i.morphTime=m.getMorphTime(m.COLUMBUS_VIEW),v(t),P(t),t._previousModeMode!==m.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=i.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=r(t._completeMorph);t._completeMorph=void 0,t._scene.morphComplete.raiseEvent(t,t._previousMode,m.COLUMBUS_VIEW,o)}var D=function(r,i){this._scene=r,i=t(i,a.WGS84);var n=i.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*(r.drawingBufferHeight/r.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=r.drawingBufferWidth/r.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};return D.prototype.completeMorph=function(){r(this._completeMorph)&&this._completeMorph()},D.prototype.morphTo2D=function(e,t){r(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._previousMode!==m.SCENE2D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE2D,!0),P(this),i.mode=m.MORPHING,f(this,M),this._previousMode===m.COLUMBUS_VIEW?w(this,e,t,M):S(this,e,t,M),0===e&&r(this._completeMorph)&&this._completeMorph())},D.prototype.morphToColumbusView=function(e,t){r(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._previousMode!==m.COLUMBUS_VIEW&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.COLUMBUS_VIEW,!0),P(this),i.mode=m.MORPHING,f(this,I),this._previousMode===m.SCENE2D?b(this,e,t,I):x(this,e,this._cameraCV,I),0===e&&r(this._completeMorph)&&this._completeMorph())},D.prototype.morphTo3D=function(e,t){r(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._previousMode!==m.SCENE3D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE3D,!0),P(this),i.mode=m.MORPHING,f(this,A),this._previousMode===m.SCENE2D?_(this,e,t,A):g(this,e,t,A),0===e&&r(this._completeMorph)&&this._completeMorph())},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return v(this),i(this)},D}),r("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(t,r,i,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=r,this._startObject=e(i),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};i(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)};var c=function(){this._tweens=[]};return i(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(i){if(i=t(i,t.EMPTY_OBJECT),0===i.duration)return r(i.complete)&&i.complete(),new u(this);var n=i.duration/s.SECONDS_PER_MILLISECOND,a=t(i.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(i.easingFunction,o.LINEAR_NONE),d=i.startObject,p=new l.Tween(d);p.to(e(i.stopObject),n),p.delay(c),p.easing(h),r(i.update)&&p.onUpdate(function(){i.update(d)}),p.onComplete(t(i.complete,null)),p.repeat(t(i._repeat,0));var m=new u(this,p,i.startObject,i.stopObject,i.duration,a,h,i.update,i.complete,i.cancel);return this._tweens.push(m),m},c.prototype.addProperty=function(e){function r(e){i[n]=e.value}e=t(e,t.EMPTY_OBJECT);var i=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:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function i(e){for(var t=o.length,r=0;t>r;++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;t<e.length;++t){var i=e[t];i.tweenjs.stop(),r(i.cancel)&&i.cancel()}e.length=0},c.prototype.contains=function(e){return r(e)&&-1!==this._tweens.indexOf(e)},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,i=0;for(e=r(e)?e/s.SECONDS_PER_MILLISECOND:a();i<t.length;){var n=t[i],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?i++:(o.stop(),t.splice(i,1))}},c}),r("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","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S){"use strict";function E(e,t){if(0>e)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 x(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,p=new Date,m=h&&(p.getTime()-h.getTime())/1e3;if(c&&h&&J>d){var f=E(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(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 T(e,t,r,i,n,a){if(o(r)){var s=e._aggregator;c(r)||(Q[0]=r,r=Q);for(var l=r.length,u=0;l>u;++u){var h=r[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?i(e,f,m):1>n&&x(s,d,p,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 p=r.endPosition.y-r.startPosition.y,m=p/e._scene.canvas.clientHeight;m=Math.min(m,e.maximumMovementRatio);var f=h*m;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 I(t,r,i){if(o(i.angleAndHeight))return D(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 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 D(e,t,r){var i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(r.endPosition.x-r.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=4*i*s*Math.PI;o.twistRight(l)}function O(e){var t=e._tweens;e._aggregator.anyButtonDown&&t.removeAll();var r=e._scene,i=r.camera;if(t.contains(e._tween)||(m.equals(m.IDENTITY,i.transform)?(T(e,e.enableTranslate,e.translateEventTypes,A,e.inertiaTranslate,"_lastInertiaTranslateMovement"),T(e,e.enableZoom,e.zoomEventTypes,M,e.inertiaZoom,"_lastInertiaZoomMovement"),T(e,e.enableRotate,e.tiltEventTypes,I,e.inertiaSpin,"_lastInertiaTiltMovement")):(T(e,e.enableRotate,e.translateEventTypes,I,e.inertiaSpin,"_lastInertiaSpinMovement"),T(e,e.enableZoom,e.zoomEventTypes,M,e.inertiaZoom,"_lastInertiaZoomMovement"))),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||t.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=t.add(n))}t.update()}function R(r,i,n){if(t.equals(i,r._translateMousePosition)||(r._looking=!1),r._looking)return j(r,i,n),void 0;var a=r._scene,s=a.camera,l=e.clone(n.startPosition,ht),c=e.clone(n.endPosition,dt),h=s.getPickRay(l,nt),p=t.clone(t.ZERO,ut),m=t.UNIT_X;if(o(r._globe)&&s.position.z<r.minimumPickingTerrainHeight){var v=r._globe.pick(h,a,at);o(v)&&(p.x=v.x)}if(p.x>s.position.z){var g=l.y;l.y=c.y,c.y=g}var _=f.fromPointNormal(p,m,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=pt;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,mt),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 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),x=r._globe,T=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var P=m.clone(s.transform,Et);s._setTransform(b),k(r,i,n,t.UNIT_Z),s._setTransform(P),r._globe=x,r._ellipsoid=T;var A=T.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,mt),o(r._globe)&&g.position.z<r.minimumPickingTerrainHeight&&(a=r._globe.pick(s,h,ft)),!o(a)){var C,w=s.origin,S=s.direction,E=t.dot(y,S);if(Math.abs(E)>d.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,x=pt;x.x=b.clientWidth/2,x.y=r._tiltCenterMousePosition.y,s=g.getPickRay(x,mt);var T=t.clone(t.ZERO,yt);T.x=a.x;var P=f.fromPointNormal(T,y,Ct),A=u.rayPlane(s,P,vt),M=g._projection;c=M.ellipsoid,t.fromElements(a.y,a.z,a.x,a);var I=M.unproject(a,St);c.cartographicToCartesian(I,a);var D,O=_.eastNorthUpToFixedFrame(a,c,gt);o(A)?(t.fromElements(A.y,A.z,A.x,A),I=M.unproject(A,St),c.cartographicToCartesian(I,A),D=_.eastNorthUpToFixedFrame(A,c,_t)):D=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=m.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(D),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,Kt);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(D),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),J=p.fromQuaternion(Z,xt);p.multiplyByVector(J,g.direction,g.direction),p.multiplyByVector(J,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=Tt;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,Pt);
o(e._globe)&&a.position.z<e.minimumPickingTerrainHeight&&(u=e._globe.pick(c,n,At));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)}P(e,r,i,e._zoomFactor,h)}function z(e){var t=e._scene,r=t.camera;if(m.equals(m.IDENTITY,r.transform)){var i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),T(e,e.enableTilt,e.tiltEventTypes,L,e.inertiaSpin,"_lastInertiaTiltMovement"),T(e,e.enableTranslate,e.translateEventTypes,R,e.inertiaTranslate,"_lastInertiaTranslateMovement"),T(e,e.enableZoom,e.zoomEventTypes,B,e.inertiaZoom,"_lastInertiaZoomMovement"),T(e,e.enableLook,e.lookEventTypes,j),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||i.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=i.add(n))}i.update()}else T(e,e.enableRotate,e.rotateEventTypes,k,e.inertiaSpin,"_lastInertiaSpinMovement"),T(e,e.enableZoom,e.zoomEventTypes,W,e.inertiaZoom,"_lastInertiaZoomMovement")}function V(r,i,n){var a=r._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return k(r,i,n),void 0;var u,c,h,d=r._ellipsoid.geodeticSurfaceNormal(s.position,Nt);if(e.equals(i,r._rotateMousePosition))return r._looking?j(r,i,n,d):r._rotating?k(r,i,n):(u=t.magnitude(r._rotateStartPosition),c=Rt,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Lt),U(r,i,n,h)),void 0;r._looking=!1,r._rotating=!1;var p=r._ellipsoid.cartesianToCartographic(s.positionWC,Dt).height;if(o(r._globe)&&p<r.minimumPickingTerrainHeight){var f=s.getPickRay(n.startPosition,It),v=r._globe.pick(f,a,Ot);o(v)?(u=t.magnitude(v),c=Rt,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Lt),U(r,i,n,h),t.clone(v,r._rotateStartPosition)):(r._looking=!0,j(r,i,n,d))}else o(s.pickEllipsoid(n.startPosition,r._ellipsoid,Mt))?(U(r,i,n,r._ellipsoid),t.clone(Mt,r._rotateStartPosition)):p>r.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 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=(i.startPosition.x-i.endPosition.x)/h.clientWidth,v=(i.startPosition.y-i.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),v=Math.min(v,e.maximumMovementRatio);var g=2*m*f*Math.PI,_=m*v*Math.PI;s||c.rotateRight(g),l||c.rotateUp(_),c.constrainedAxis=d}function U(r,i,n,a){var s=r._scene,u=s.camera,c=t.magnitude(u.position),h=e.clone(n.startPosition,Wt),p=e.clone(n.endPosition,Gt);if(c<a.maximumRadius){h.y=p.y,p.y=n.startPosition.y;var m=c+2*(a.maximumRadius-c),f=Rt;f.x=f.y=f.z=m,a=l.fromCartesian3(f,a)}var v=u.pickEllipsoid(h,a,Ft),g=u.pickEllipsoid(p,a,Bt);if(!o(v)||!o(g))return r._rotating=!0,k(r,i,n),void 0;if(v=u.worldToCameraCoordinates(v,v),g=u.worldToCameraCoordinates(g,g),o(u.constrainedAxis)){var _=u.constrainedAxis,y=t.mostOrthogonalAxis(_,zt);t.cross(y,_,y),t.normalize(y,y);var C=t.cross(_,y,Vt),w=t.magnitude(v),S=t.dot(_,v),E=Math.acos(S/w),b=t.multiplyByScalar(_,S,kt);t.subtract(v,b,b),t.normalize(b,b);var x=t.magnitude(g),T=t.dot(_,g),P=Math.acos(T/x),A=t.multiplyByScalar(_,T,Ut);t.subtract(g,A,A),t.normalize(A,A);var M=Math.acos(t.dot(b,y));t.dot(b,C)<0&&(M=d.TWO_PI-M);var I=Math.acos(t.dot(A,y));t.dot(A,C)<0&&(I=d.TWO_PI-I);var D,O=M-I;D=t.equalsEpsilon(_,u.position,d.EPSILON2)?u.right:t.cross(_,u.position,zt);var R,L=t.cross(_,D,zt),N=t.dot(L,t.subtract(v,_,Vt)),F=t.dot(L,t.subtract(g,_,Vt));R=N>0&&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=Tt;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,Pt),d=n.cartesianToCartographic(s.position,qt).height;o(e._globe)&&d<e.minimumPickingTerrainHeight&&(c=e._globe.pick(h,a,At));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,Ht);P(e,r,i,e._zoomFactor,p,t.dot(m,s.direction))}function G(t,r,i){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,ir);return j(t,r,i,s),void 0}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,rr);t._tiltOnEllipsoid||u.height>t.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,p=a.cartesianToCartographic(c.positionWC,nr).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,v=jt;v.x=f.clientWidth/2,v.y=f.clientHeight/2;var y,C=c.getPickRay(v,Yt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,Xt);else{if(!(p>r.minimumTrackBallHeight)){r._looking=!0;var S=r._ellipsoid.geodeticSurfaceNormal(c.position,ir);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,rr);b.height=0,y=a.cartographicToCartesian(b,Xt)}var x=_.eastNorthUpToFixedFrame(y,a,Jt),T=r._globe,P=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var A=m.clone(c.transform,$t);c._setTransform(x),k(r,i,n,t.UNIT_Z),c._setTransform(A),r._globe=T,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,Xt);else{if(s=y.getPickRay(i,Yt),o(r._globe)&&(a=r._globe.pick(s,f,Xt)),!o(a)){if(c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,rr);if(C.height<=r.minimumTrackBallHeight){r._looking=!0;var w=r._ellipsoid.geodeticSurfaceNormal(y.position,ir);j(r,i,n,w),e.clone(i,r._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Xt)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var S=f.canvas,E=jt;E.x=S.clientWidth/2,E.y=r._tiltCenterMousePosition.y,s=y.getPickRay(E,Yt);var b=t.magnitude(a),x=t.fromElements(b,b,b,Rt),T=l.fromCartesian3(x,Lt);if(c=u.rayEllipsoid(s,T),o(c)){var P=t.magnitude(s.origin)>b?c.start:c.stop,A=g.getPoint(s,P,Zt),M=_.eastNorthUpToFixedFrame(a,h,Jt),I=_.eastNorthUpToFixedFrame(A,T,Qt),D=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=m.clone(y.transform,$t);y._setTransform(M);var N=t.cross(A,y.positionWC,Kt),F=t.dot(y.rightWC,N);if(k(r,i,n,R,!1,!0),y._setTransform(I),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,Kt);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=D,r._ellipsoid=O;var V=O.maximumRadius;r._rotateFactor=1/V,r._rotateRateRangeAdjustment=V;var U=t.clone(y.positionWC,Kt);if(X(r),!t.equals(y.positionWC,U)){y._setTransform(I),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,er),Y=p.fromQuaternion(q,tr);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(L)}}}function j(e,r,i,a){var s=e._scene,l=s.camera,u=or;u.x=i.startPosition.x,u.y=0;var c=ar;c.x=i.endPosition.x,c.y=0;var h=l.getPickRay(u,sr).direction,p=l.getPickRay(c,lr).direction,m=0,f=t.dot(h,p);1>f&&(m=Math.acos(f)),m=i.startPosition.x>i.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=i.startPosition.y,c.x=0,c.y=i.endPosition.y,h=l.getPickRay(u,sr).direction,p=l.getPickRay(c,lr).direction,m=0,f=t.dot(h,p),1>f&&(m=Math.acos(f)),m=i.startPosition.y>i.endPosition.y?-m:m,a=n(a,v),o(a)){var g=l.direction,_=t.negate(a,ur),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 w=d.acosClamped(f);m>0&&m>w&&(m=w-d.EPSILON4),f=t.dot(g,_),w=d.acosClamped(f),0>m&&-m>w&&(m=-w+d.EPSILON4);var S=t.cross(a,g,cr);l.look(S,m)}}else l.lookUp(m)}function Y(e){T(e,e.enableRotate,e.rotateEventTypes,V,e.inertiaSpin,"_lastInertiaSpinMovement"),T(e,e.enableZoom,e.zoomEventTypes,W,e.inertiaZoom,"_lastInertiaZoomMovement"),T(e,e.enableTilt,e.tiltEventTypes,G,e.inertiaSpin,"_lastInertiaTiltMovement"),T(e,e.enableLook,e.lookEventTypes,j)}function X(e){if(e.enableCollisionDetection){var r=e._scene,i=r.mode,n=r.globe;if(o(n)&&i!==w.SCENE2D&&i!==w.MORPHING){var a,s,l=r.camera,u=n.ellipsoid,c=r.mapProjection;m.equals(l.transform,m.IDENTITY)||(a=m.clone(l.transform),s=t.magnitude(l.position),l._setTransform(m.IDENTITY));var h=hr;if(i===w.SCENE3D?u.cartesianToCartographic(l.position,h):c.unproject(l.position,h),h.height<e.minimumCollisionTerrainHeight){var d=n.getHeight(h);o(d)&&(d+=e.minimumZoomDistance,h.height<d&&(h.height=d,i===w.SCENE3D?u.cartographicToCartesian(h,l.position):c.project(h,l.position)))}o(a)&&(l._setTransform(a),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 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.enableCollisionDetection=!0,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},J=.4,Q=[],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,pt=new e,mt=new g,ft=new t,vt=new t,gt=new m,_t=new m,yt=new t,Ct=new f(t.ZERO,0),wt=new t,St=new i,Et=new m,bt=new v,xt=new p,Tt=new e,Pt=new g,At=new t,Mt=new t,It=new g,Dt=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 i,jt=new e,Yt=new g,Xt=new t,Zt=new t,Jt=new m,Qt=new m,Kt=new t,$t=new m,er=new v,tr=new p,rr=new i,ir=new t,nr=new i,or=new e,ar=new e,sr=new g,lr=new g,ur=new t,cr=new t,hr=new i;return Z.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);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._aggregator=this._aggregator&&this._aggregator.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,p,m,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,x=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 T=1,P=2;y={delta:function(){return T},sigma:function(){return P},direction:function(){return 0}},this._blurXCommand=e.createViewportQuadCommand(g,{renderState:d,uniformMap:y,owner:this}),y={delta:function(){return T},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),I=Math.max(A,M),D=C;D.width=r,D.height=n;var O=w;O.width=I,O.height=I;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/I;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:p.UNSIGNED_SHORT})}):e.createFramebuffer({colorTextures:N,depthRenderbuffer:e.createRenderbuffer({format:m.DEPTH_COMPONENT16})}),this._downSampleFBO1=e.createFramebuffer({colorTextures:[e.createTexture2D({width:I,height:I})]}),this._downSampleFBO2=e.createFramebuffer({colorTextures:[e.createTexture2D({width:I,height:I})]}),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(D,0,1,x),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,x),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,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,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 J(e){e.render=!1,e.pick=!1}function Q(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),J(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.stop<s)break;var c=t instanceof x?F.OPAQUE:t.pass,h=a.indices[c]++;if(a.commands[c][h]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=l(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function et(e){var r=e._commandList,i=e._overlayCommandList,n=e._frameState.cullingVolume,o=e._camera,a=o.directionWC,s=o.positionWC;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var u=e._frustumCommandsList,c=u.length,h=F.NUMBER_OF_PASSES,d=0;c>d;++d)for(var p=0;h>p;++p)u[d].indices[p]=0;i.length=0;var m,f=Number.MAX_VALUE,v=Number.MIN_VALUE,_=!1;e._frameState.mode===G.SCENE3D&&(m=e._frameState.occluder);for(var y=yt.planes,C=0;5>C;++C)y[C]=n.planes[C];n=yt;for(var w=r.length,S=0;w>S;++S){var E=r[S],b=E.pass;if(b===F.OVERLAY)i.push(E);else{var T=E.boundingVolume;if(l(T)){if(E.cull&&(n.computeVisibility(T)===g.OUTSIDE||l(m)&&!m.isBoundingSphereVisible(T)))continue;Ct=t.computePlaneDistances(T,s,a,Ct),f=Math.min(f,Ct.start),v=Math.max(v,Ct.stop)}else Ct.start=o.frustum.near,Ct.stop=o.frustum.far,_=!(E instanceof x);$(e,E,Ct)}}_?(f=o.frustum.near,v=o.frustum.far):(f=Math.min(Math.max(f,o.frustum.near),o.frustum.far),v=Math.max(Math.min(v,o.frustum.far),f));var P=e.farToNearRatio,A=Math.ceil(Math.log(v/f)/Math.log(P));f!==Number.MAX_VALUE&&(A!==c||0!==u.length&&(f<u[0].near||v>u[c-1].far))&&(K(f,v,P,A,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",p=4&e.debugOverlappingFrustums?"1.0":"0.0";u+="    gl_FragColor.rgb *= vec3("+h+", "+d+", "+p+"); \n"}u+="}",a.sources.push(u);var m=tt(o);return i.createShaderProgram(o.vertexShaderSource,a,m)}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,p=h.radius,m=h.center,g=v.toWireframe(d.createGeometry(new d({radii:new i(p,p,p),vertexFormat:z.FLAT_VERTEX_FORMAT})));if(c.mode!==G.SCENE3D){m=w.multiplyByPoint(wt,m,m);var _=c.mapProjection,y=_.unproject(m);m=_.ellipsoid.cartographicToCartesian(y)}t._debugSphere=new U({geometryInstances:new f({geometry:g,modelMatrix:w.multiplyByTranslation(w.IDENTITY,m,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,s,u=e._frameState,c=e._camera,h=e.context,d=h.uniformState;s=l(c.frustum.fov)?c.frustum.clone(St):l(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(Et):c.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 p=u.passes.render&&l(e.skyBox)?e.skyBox.update(h,u):void 0,m=u.passes.render&&l(e.skyAtmosphere)?e.skyAtmosphere.update(h,u):void 0,f=u.passes.render&&l(e.sun)?e.sun.update(e):void 0,v=ot(f,u),g=e._clearColorCommand;n.clone(r,g.color),g.execute(h,t);var _=!1,y=e._frustumCommandsList,C=y.length;for(o=0;C>o;++o)if(y[o].indices[F.TRANSLUCENT]>0){_=!0;break}var w=!i&&_&&l(e._oit)&&e._oit.isSupported();w&&(e._oit.update(h),e._oit.clear(h,t,r),w=w&&e._oit.isSupported());var S=!i&&(e.fxaa||w&&e.fxaaOrderIndependentTranslucency);S&&(e._fxaa.update(h),e._fxaa.clear(h,t,r));var E=t.framebuffer;w?E=e._oit.getColorFramebuffer():S&&(E=e._fxaa.getColorFramebuffer()),t.framebuffer=v&&e.sunBloom?e._sunPostProcess.update(h):E,s.near=c.frustum.near,s.far=c.frustum.far,d.updateFrustum(s),l(p)&&nt(p,e,h,t),l(m)&&nt(m,e,h,t),l(f)&&v&&(f.execute(h,t),e.sunBloom&&(e._sunPostProcess.execute(h,E),t.framebuffer=E));var b,x=e._depthClearCommand;for(w?(l(e._executeOITFunction)||(e._executeOITFunction=function(e,t,r,i){e._oit.executeCommands(e,t,r,i)}),b=e._executeOITFunction):b=st,o=0;C>o;++o){var T=C-o-1,P=y[T];s.near=P.near,s.far=P.far,0!==T&&(s.near*=.99),d.updateFrustum(s),x.execute(h,t);for(var A,M,I=F.TRANSLUCENT,D=0;I>D;++D)for(A=P.commands[D],M=P.indices[D],a=0;M>a;++a)nt(A[a],e,h,t);s.near=P.near,d.updateFrustum(s),A=P.commands[F.TRANSLUCENT],A.length=P.indices[F.TRANSLUCENT],b(e,nt,t,A)}w&&(t.framebuffer=S?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(h,t)),S&&(t.framebuffer=void 0,e._fxaa.execute(h,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);Q(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 pt(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=w.clone(r.transform,It);r._setTransform(w.IDENTITY);var c=i.clone(r.position,Tt);i.multiplyByScalar(r.right,s,Pt),i.add(Pt,c,c),i.multiplyByScalar(r.up,l,Pt),i.add(Pt,c,c),r._setTransform(u),i.fromElements(c.z,c.x,c.y,c),At.x=o,At.y=a;var h=n.getPixelSize(At,void 0,Mt),d=xt;return d.right=.5*h.x,d.left=-d.right,d.top=.5*h.y,d.bottom=-d.top,d.near=n.near,d.far=n.far,d.computeCullingVolume(c,r.directionWC,r.upWC)}function mt(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,p=h*a*c,m=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=m+g,_.bottom=m-g,_.right=p+v,_.left=p-v,_.near=a,_.far=o.far,_.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function ft(e,t,r,i){return e._mode===G.SCENE2D?pt(e,t,r,i):mt(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 T(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 D(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 x({color:new n,owner:this}),this._depthClearCommand=new x({depth:1,owner:this}),this._transitioner=new q(this),this._renderError=new p,this._preRender=new p,this._postRender=new p,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new p,this.morphComplete=new p,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 m,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),Q(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}},maximumCubeMapSize:{get:function(){return this._context.maximumCubeMapSize}},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 I,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 xt=new N,Tt=new i,Pt=new i,At=new r,Mt=new r,It=new w,Dt=new k,Ot=3,Rt=3,Lt=new e(0,0,Ot,Rt),Nt=new n(0,0,0,0),Ft=new r;return vt.prototype.pick=function(e){var t=this._context,r=t.uniformState,i=this._frameState,n=H.transformWindowToDrawingBuffer(this,e,Ft);l(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),Q(this,i.frameNumber,i.time),i.cullingVolume=ft(this,n,Ot,Rt),i.passes.pick=!0,r.update(t,i),this._commandList.length=0,ct(this),et(this),Lt.x=n.x-.5*(Ot-1),Lt.y=this.drawingBufferHeight-n.y-.5*(Rt-1),lt(this,this._pickFramebuffer.begin(Lt),Nt,!0);var o=this._pickFramebuffer.end(Lt);return t.endFrame(),ht(i),o},vt.prototype.drillPick=function(e){for(var t,r,i=[],n=[],o=[],a=this.pick(e);l(a)&&l(a.primitive);){i.push(a);var s=a.primitive,u=!1;"function"==typeof s.getGeometryInstanceAttributes&&l(a.id)&&(r=s.getGeometryInstanceAttributes(a.id),l(r)&&l(r.show)&&(u=!0,r.show=b.toValue(!1,r.show),o.push(r))),u||(s.show=!1,n.push(s)),a=this.pick(e)}for(t=0;t<n.length;++t)n[t].show=!0;for(t=0;t<o.length;++t)r=o[t],r.show=b.toValue(!0,r.show);return i},vt.prototype.completeMorph=function(){this._transitioner.completeMorph()},vt.prototype.morphTo2D=function(e){var t,r=this.globe;t=l(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=s(e,2),this._transitioner.morphTo2D(e,t)},vt.prototype.morphToColumbusView=function(e){var t,r=this.globe;t=l(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=s(e,2),this._transitioner.morphToColumbusView(e,t)},vt.prototype.morphTo3D=function(e){var t,r=this.globe;t=l(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=s(e,2),this._transitioner.morphTo3D(e,t)},vt.prototype.isDestroyed=function(){return!1},vt.prototype.destroy=function(){return this._tweens.removeAll(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.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._transitioner.destroy(),l(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),c(this)},vt}),r("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=function(i){function n(e){C._image=e,C._tileWidth=e.width,C._tileHeight=e.height,C._ready=!0,u.handleSuccess(C._errorEvent)}function h(){var e="Failed to load image "+g+".";y=u.handleError(y,C,C._errorEvent,e,0,0,0,d)}function d(){c(s(g),n,h)}i=t(i,{});var p=i.url;this._url=p;var m=i.proxy;this._proxy=m;var f=t(i.rectangle,l.MAX_VALUE),v=new a({rectangle:f,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1});this._tilingScheme=v,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1;var g=p;r(m)&&(g=m.getURL(g));var _=i.credit;"string"==typeof _&&(_=new e(_)),this._credit=_;var y,C=this;d()};return i(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 0}},minimumLevel:{get:function(){return 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 this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(){return void 0},h.prototype.requestImage=function(){return this._image},h.prototype.pickFeatures=function(){return void 0},h}),r("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{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(v_positionEC);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection)) {\ndiscard;\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"}),r("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;\nvarying vec3 v_positionEC;\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;\nv_positionEC = (czm_modelView * position).xyz;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),r("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/ShaderSource","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";var g=function(r){r=t(r,o.WGS84),this.show=!0,this._ellipsoid=r,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(r.radii,1.025,new e));var i=r.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 i},fScale:function(){return 1/(a._outerRadius-i)},fScaleDepth:function(){return n},fScaleOverScaleDepth:function(){return 1/(a._outerRadius-i)/n}}};return i(g.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),g.prototype.update=function(t,i){if(!this.show)return void 0;if(i.mode!==v.SCENE3D&&i.mode!==v.MORPHING)return void 0;if(!i.passes.render)return void 0;var n=this._command;if(!r(n.vertexArray)){var o=a.createGeometry(new a({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:l.POSITION_ONLY}));n.vertexArray=t.createVertexArrayFromGeometry({geometry:o,attributeLocations:s.createAttributeLocations(o),bufferUsage:u.STATIC_DRAW}),n.renderState=t.createRenderState({cull:{enabled:!0,face:f.FRONT},blending:m.ALPHA_BLEND});var c=new h({defines:["SKY_FROM_SPACE"],sources:[p]});this._spSkyFromSpace=t.createShaderProgram(c,d),c=new h({defines:["SKY_FROM_ATMOSPHERE"],sources:[p]}),this._spSkyFromAtmosphere=t.createShaderProgram(c,d)}var g=i.camera.positionWC;return this._fCameraHeight2=e.magnitudeSquared(g),this._fCameraHeight=Math.sqrt(this._fCameraHeight2),n.shaderProgram=this._fCameraHeight>this._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,p,m,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(p,d,g),s.renderState=r.createRenderState({blending:m.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,p,m,f,v,g,_,y,C,w,S,E){"use strict";var b=function(){this.show=!0,this._command=new g({primitiveType:m.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 x=new r,T=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 m=l.mode;if(m===S.SCENE2D||m===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:p.RGBA});var I=u.createFramebuffer({colorTextures:[this._texture]});I.destroyAttachments=!1;var D=new v({color:new o(0,0,0,0),framebuffer:I}),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:I,owner:this});D.execute(u),N.execute(u),N.shaderProgram.destroy(),I.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,m===S.SCENE3D?t.clone(H,F.boundingVolume):m===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 J=d.multiplyByVector(X,Z,A),Q=E.clipToDrawingBufferCoordinates(n,J,x);Z.x=h.SOLAR_RADIUS;var K=d.multiplyByVector(X,Z,A),$=E.clipToDrawingBufferCoordinates(n,K,T);return this._size=Math.ceil(r.magnitude(r.subtract($,Q,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/appendForwardSlash","../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,p,m,f){"use strict";function v(e,t,r,i){var n=e._tilingScheme.getNumberOfYTilesAtLevel(i),a=e._url+i+"/"+t+"/"+(n-r-1)+"."+e._fileExtension,s=e._proxy;return o(s)&&(a=s.getURL(a)),a}var g=function(a){function s(e){for(var i,a,s,l,c=/tileformat/i,m=/tileset/i,f=/tilesets/i,_=/boundingbox/i,w=/srs/i,S=[],E=e.childNodes[0].childNodes,b=0;b<E.length;b++)if(c.test(E.item(b).nodeName))i=E.item(b);else if(f.test(E.item(b).nodeName)){s=E.item(b);for(var x=E.item(b).childNodes,T=0;T<x.length;T++)m.test(x.item(T).nodeName)&&S.push(x.item(T))}else _.test(E.item(b).nodeName)?a=E.item(b):w.test(E.item(b).nodeName)&&(l=E.item(b).textContent);C._fileExtension=n(C._fileExtension,i.getAttribute("extension")),C._tileWidth=n(C._tileWidth,parseInt(i.getAttribute("width"),10)),C._tileHeight=n(C._tileHeight,parseInt(i.getAttribute("height"),10)),C._minimumLevel=n(C._minimumLevel,parseInt(S[0].getAttribute("order"),10)),C._maximumLevel=n(C._maximumLevel,parseInt(S[S.length-1].getAttribute("order"),10));var P=s.getAttribute("profile"),A=!1;if(("geodetic"===P||"mercator"===P)&&(A=!0),!o(C._tilingScheme))if("geodetic"===P||"global-geodetic"===P)C._tilingScheme=new u;else{if("mercator"!==P&&"global-mercator"!==P){var M=g+"tilemapresource.xml specifies an unsupported profile attribute, "+P+".";return y=d.handleError(y,C,C._errorEvent,M,void 0,void 0,void 0,v),void 0}C._tilingScheme=new p}var I=C._tilingScheme;if(!o(C._rectangle)){var D,O,R,L;if(A)D=new t(parseFloat(a.getAttribute("miny")),parseFloat(a.getAttribute("minx"))),O=new t(parseFloat(a.getAttribute("maxy")),parseFloat(a.getAttribute("maxx"))),R=r.fromDegrees(D.x,D.y),L=r.fromDegrees(O.x,O.y);else if(D=new t(parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny"))),O=new t(parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))),C._tilingScheme instanceof u)R=r.fromDegrees(D.x,D.y),L=r.fromDegrees(O.x,O.y);else{var N=C._tilingScheme.projection;R=N.unproject(D),L=N.unproject(O)}C._rectangle=new h(R.longitude,R.latitude,L.longitude,L.latitude)}C._rectangle.west<I.rectangle.west&&(C._rectangle.west=I.rectangle.west),C._rectangle.east>I.rectangle.east&&(C._rectangle.east=I.rectangle.east),C._rectangle.south<I.rectangle.south&&(C._rectangle.south=I.rectangle.south),C._rectangle.north>I.rectangle.north&&(C._rectangle.north=I.rectangle.north);var F=I.positionToTileXY(h.southwest(C._rectangle),C._minimumLevel),B=I.positionToTileXY(h.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=I,C._ready=!0}function f(){C._fileExtension=n(a.fileExtension,"png"),C._tileWidth=n(a.tileWidth,256),C._tileHeight=n(a.tileHeight,256),C._minimumLevel=n(a.minimumLevel,0),C._maximumLevel=n(a.maximumLevel,18),C._tilingScheme=o(a.tilingScheme)?a.tilingScheme:new p,C._rectangle=n(a.rectangle,C._tilingScheme.rectangle),C._ready=!0}function v(){var e=g+"tilemapresource.xml",t=C._proxy;o(t)&&(e=t.getURL(e)),m(c(e),s,f)}a=n(a,{});var g=e(a.url);this._url=g,this._ready=!1,this._proxy=a.proxy,this._tileDiscardPolicy=a.tileDiscardPolicy,this._errorEvent=new l,this._fileExtension=a.fileExtension,this._tileWidth=a.tileWidth,this._tileHeight=a.tileHeight,this._minimumLevel=a.minimumLevel,this._maximumLevel=a.maximumLevel,this._rectangle=h.clone(a.rectangle),this._tilingScheme=a.tilingScheme;var _=a.credit;"string"==typeof _&&(_=new i(_)),this._credit=_;var y,C=this;v()};return a(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=v(this,e,t,r);return f.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,p,m,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),s.query=m(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),c.query=m(h);var p=c.toString(),v=e._proxy;return o(v)&&(p=v.getURL(p)),p}function x(e){for(var r=[],i=e.features,n=0;n<i.length;++n){var o=i[n],a=new C;if(a.data=o,a.configureNameFromProperties(o.properties),a.configureDescriptionFromProperties(o.properties),"Point"===o.geometry.type){var s=o.geometry.coordinates[0],l=o.geometry.coordinates[1];a.position=t.fromDegrees(s,l)}r.push(a)}return r}function T(e){var t=e.documentElement;return"MultiFeatureCollection"===t.localName&&t.namespaceURI===R?P(e):"FeatureInfoResponse"===t.localName&&t.namespaceURI===L?A(e):"ServiceExceptionReport"===t.localName?void 0:M(e)}function P(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(R,"Feature"),n=0;n<i.length;++n){for(var o=i[n],a={},s=o.getElementsByTagNameNS(R,"Val"),l=0;l<s.length;++l){var u=s[l];if(u.hasAttribute("ref")){var c=u.getAttribute("ref"),h=u.textContent.trim();a[c]=h}}var d=new C;d.data=o,d.configureNameFromProperties(a),d.configureDescriptionFromProperties(a),t.push(d)}return t}function A(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(L,"FIELDS"),n=0;n<i.length;++n){for(var o=i[n],a={},s=o.attributes,l=0;l<s.length;++l){var u=s[l];a[u.name]=u.value}var c=new C;c.data=o,c.configureNameFromProperties(a),c.configureDescriptionFromProperties(a),t.push(c)}return t}function M(e){var t=(new XMLSerializer).serializeToString(e),r=document.createElement("div"),i=document.createElement("pre");i.textContent=t,r.appendChild(i);var n=new C;return n.data=e,n.description=r.innerHTML,[n]}var I=function N(e){e=n(e,n.EMPTY_OBJECT),this._url=e.url,this._tileDiscardPolicy=e.tileDiscardPolicy,this._proxy=e.proxy,this._layers=e.layers,this._enablePickFeatures=n(e.enablePickFeatures,!0),this._getFeatureInfoAsGeoJson=n(e.getFeatureInfoAsGeoJson,!0),this._getFeatureInfoAsXml=n(e.getFeatureInfoAsXml,!0),this._parameters=r(S(n(e.parameters,n.EMPTY_OBJECT)),N.DefaultParameters),this._getFeatureInfoParameters=r(S(n(e.getFeatureInfoParameters,n.EMPTY_OBJECT)),N.GetFeatureInfoDefaultParameters),this._tileWidth=n(e.tileWidth,256),this._tileHeight=n(e.tileHeight,256),this._minimumLevel=n(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=n(e.rectangle,v.MAX_VALUE),this._tilingScheme=o(e.tilingScheme)?e.tilingScheme:new c,this._rectangle=v.intersection(this._rectangle,this._tilingScheme.rectangle);var t=e.credit;"string"==typeof t&&(t=new i(t)),this._credit=t,this._errorEvent=new l,this._ready=!0};a(I.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},layers:{get:function(){return this._layers}},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}}}),I.prototype.getTileCredits=function(){return void 0},I.prototype.requestImage=function(e,t,r){var i=E(this,e,t,r);return w.loadImage(this,i)};var D=new t,O=new e;I.prototype.pickFeatures=function(e,t,r,i,n){if(!this._enablePickFeatures)return void 0;var o,a=this._tilingScheme.tileXYToNativeRectangle(e,t,r);if(this._tilingScheme instanceof c)o=O,o.x=p.toDegrees(i),o.y=p.toDegrees(n);else{var s=D;s.longitude=i,s.latitude=n,o=this._tilingScheme.projection.project(s,O)}var l,u=0|this._tileWidth*(o.x-a.west)/a.width,m=0|this._tileHeight*(a.north-o.y)/a.height;if(this._getFeatureInfoAsGeoJson){l=b(this,"application/json",e,t,r,u,m);var f=this;return y(h(l),function(e){return x(e)},function(i){return f._getFeatureInfoAsXml?(l=b(f,"text/xml",e,t,r,u,m),y(d(l),function(e){return T(e)})):y.reject(i)})}return this._getFeatureInfoAsXml?(l=b(this,"text/xml",e,t,r,u,m),y(d(l),function(e){return T(e)})):void 0},I.DefaultParameters=u({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),I.GetFeatureInfoDefaultParameters=u({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});var R="http://www.mapinfo.com/mxp",L="http://www.esri.com/wms";return I}),r("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","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t,n,o,a){var s,c=t._tileMatrixLabels,h=i(c)?c[a]:a.toString();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());else{var p=new d(t._url),m=u(r(p.query,""));m=e(v,m),m.tilematrix=h,m.layer=t._layer,m.style=t._style,m.tilerow=o,m.tilecol=n,m.tilematrixset=t._tileMatrixSetID,m.format=t._format,p.query=l(m),s=p.toString()}var f=t._proxy;return i(f)&&(s=f.getURL(s)),s}var f=function(e){if(e=r(e,r.EMPTY_OBJECT),!i(e.url))throw new o("options.url is required.");if(!i(e.layer))throw new o("options.layer is required.");if(!i(e.style))throw new o("options.style is required.");if(!i(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=r(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new h,this._tileWidth=r(e.tileWidth,256),this._tileHeight=r(e.tileHeight,256),this._minimumLevel=r(e.minimumLevel,0),this._maximumLevel=r(e.maximumLevel,18),this._rectangle=r(e.rectangle,this._tilingScheme.rectangle);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},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:{value:!0},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),f.prototype.getTileCredits=function(){return void 0},f.prototype.requestImage=function(e,t,r){var i=m(this,e,t,r);return p.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";var u=function(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)),p=t(i.length,1e4);return r(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),r(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",p),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),r(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}),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 p?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;n<r.length-1;n++)i=i[r[n]];i[r[r.length-1]]=t},d.A=function(e,t,r){e[t]=r},d.version="3.2.0",d.b("version",d.version),d.a=function(){function t(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])}function r(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);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 r=0,i=t.length;i>r;r++)h[t[r]]=e});var p={propertychange:!0},m=n&&function(){for(var t=3,r=n.createElement("div"),i=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",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(0<r.length){for(var i=r[0],n=i.parentNode,o=0,a=t.length;a>o;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(1<e.length){var r=e[0],i=e[e.length-1];for(e.length=0;r!==i;)if(e.push(r),r=r.nextSibling,!r)return;e.push(i)}}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,r){var i=m&&p[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>=m)try{e.mergeAttributes(n.createElement("<input name='"+e.name+"'/>"),!1)}catch(r){}},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 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===m,zc:7===m,L:m,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 p in r)e=n.createElement("input"),e.type="hidden",e.name=p,e.value=d.a.eb(d.a.c(r[p])),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;n<i.length;n++)i[n](e);if(d.a.e.clear(e),d.a.w.cleanExternalData(e),o[e.nodeType])for(i=e.firstChild;e=i;)i=e.nextSibling,8===e.nodeType&&r(e)}var i=d.a.e.F(),n={1:!0,8:!0,9:!0},o={1:!0,9:!0};return{da:function(e,r){if("function"!=typeof r)throw Error("Callback must be a function");t(e,!0).push(r)},Kb:function(r,n){var o=t(r,!1);o&&(d.a.ua(o,n),0==o.length&&d.a.e.set(r,i,e))},R:function(e){if(n[e.nodeType]&&(r(e),o[e.nodeType])){var t=[];d.a.ga(t,e.getElementsByTagName("*"));for(var i=0,a=t.length;a>i;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,"<table>","</table>"]||!r.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!r.indexOf("<td")||!r.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""],e="ignored<div>"+r[1]+e+r[2]+"</div>","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;n<i.length;n++)t.appendChild(i[n])}}(),d.b("utils.parseHtmlFragment",d.a.ba),d.b("utils.setHtml",d.a.$a),d.D=function(){function t(e,r){if(e)if(8==e.nodeType){var i=d.D.Gb(e.nodeValue);null!=i&&r.push({bc:e,mc:i})}else if(1==e.nodeType)for(var i=0,n=e.childNodes,o=n.length;o>i;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,"<!--[ko_memo:"+t+"]-->"},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 p={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 m="change",f={U:function(e,t,r){var i=this;r=r||m;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||m,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!==m?"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<arguments.length?(t.Pa(r,arguments[0])&&(t.X(),r=arguments[0],t.W()),this):(d.k.Jb(t),r)}var r=e;return d.P.call(t),d.a.Aa(t,d.p.fn),t.v=function(){return r},t.W=function(){t.notifySubscribers(r)},t.X=function(){t.notifySubscribers(r,"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,r){return null===t||t===e||t[v]===e?!1:t[v]===r?!0:d.Ma(t[v],r)},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(),r=[],i="function"!=typeof e||d.C(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];i(o)&&(0===r.length&&this.X(),r.push(o),t.splice(n,1),n--)}return r.length&&this.W(),r},removeAll:function(t){if(t===e){var r=this.v(),i=r.slice(0);return this.X(),r.splice(0,r.length),this.W(),i}return t?this.remove(function(e){return 0<=d.a.m(t,e)}):[]},destroy:function(e){var t=this.v(),r="function"!=typeof e||d.C(e)?function(t){return t===e}:e;this.X();for(var i=t.length-1;i>=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!==m||++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=[],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}i=s}}}},d.s=d.j=function(t,r,i){function n(){d.a.G(x,function(e,t){t.K()}),x={}}function o(){n(),T=0,v=!0,p=!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(m){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(m=!0,y)try{var i={};d.k.Ea({wa:function(e,t){i[t]||(i[t]=1,++T)},s:l,ma:e}),T=0,h=g.call(r)}finally{d.k.end(),m=!1}else try{var n=x,o=T;d.k.Ea({wa:function(e,t){v||(o&&n[t]?(x[t]=n[t],++T,delete n[t],--o):x[t]||(x[t]=e.U(a),++T))},s:l,ma:_?e:!T}),x={},T=0;try{var s=r?g.call(r):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}T||b()}}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(r,arguments),this}return d.k.Jb(l),p&&s(!0),h}function u(){return p&&!T&&s(!0),h}function c(){return p||T>0}var h,p=!0,m=!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,x={},T=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 T},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),p=!0,l.lb(l)}},i.pure?(y=_=!0,l.va=function(){y&&(y=!1,s(!0))},l.nb=function(){l.yb()||(n(),y=p=!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;r<e.length;r++)t(r);"function"==typeof e.toJSON&&t("toJSON")}else for(r in e)t(r)}function i(){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,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<t.size)&&(t.selectedIndex=o);break;default:(null===r||r===e)&&(r=""),t.value=r}}}}(),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,r,a=[],s=e.match(i),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(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<u.length)(h=s[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),s=e.match(i),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&&!r){t=34===h||39===h?u.slice(1,-1):u;continue}r?r.push(u):r=[u]}}return a}var t=["true","false","null","undefined"],r=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,i=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(i,n){function o(e,i){var n;if(!c){var h=d.getBindingHandler(e);if(h&&h.preprocess&&!(i=h.preprocess(i,e,o)))return;(h=a[e])&&(n=i,0<=d.a.m(t,n)?n=!1:(h=n.match(r),n=null===h?!1:h[1]?"Object("+h[1]+")"+h[2]:n),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(i="function(){return "+i+" }"),s.push("'"+e+"':"+i)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof i?e(i):i;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 r=0;r<e.length;r++)if(e[r].key==t)return!0;return!1},pa:function(e,t,r,i,n){e&&d.C(e)?!d.Ra(e)||n&&e.v()===i||e(i):(e=t.get("_ko_property_writers"))&&e[r]&&e[r](i)}}}(),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 r(r,i){for(var n=r,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!i)throw Error("Cannot find closing comment tag to match: "+r.nodeValue);return null}function i(e,t){var i=r(e,t);return i?0<i.length?i[i.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)?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;s<o.length;s++)a?r.insertBefore(o[s],a):r.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 r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e):null;return d.g.mb(r,e,t,!1)},getBindingAccessors:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e,{valueAccessors:!0}):null;return d.g.mb(r,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,r,i){try{var n,o=this.Yb,a=e+(i&&i.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+d.h.ya(e,i)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,r)}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 r(e){return e()}function n(e){return d.a.na(d.k.B(e),function(t,r){return function(){return e()[r]}})}function o(e,t){return n(this.getBindings.bind(this,e,t))}function s(e,t,r){var i,n=d.f.firstChild(t),o=d.J.instance,a=o.preprocessNode;if(a){for(;i=n;)n=d.f.nextSibling(i),a.call(o,i);n=d.f.firstChild(t)}for(;i=n;)n=d.f.nextSibling(i),l(e,i,r)}function l(e,t,r){var i=!0,n=1===t.nodeType;n&&d.f.Fb(t),(n&&r||d.J.instance.nodeHasBindings(t))&&(i=c(t,null,e,r).shouldBindDescendants),i&&!p[d.a.t(t)]&&s(e,t,!n)}function u(e){var t=[],r={},i=[];return d.a.G(e,function n(o){if(!r[o]){var a=d.getBindingHandler(o);a&&(a.after&&(i.push(o),d.a.u(a.after,function(t){if(e[t]){if(-1!==d.a.m(i,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+i.join(", "));n(t)}}),i.length--),t.push({key:o,zb:a})),r[o]=!0}}),t}function c(t,i,n,a){var s=d.a.e.get(t,m);if(!i){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(i&&"function"!=typeof i)l=i;else{var c=d.J.instance,h=c.getBindingAccessors||o,p=d.j(function(){return(l=i?i(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 r(p()[e])}}:function(e){return l[e]},g=function(){return d.a.na(p?p():l,r)};g.get=function(e){return l[e]&&r(v(e))},g.has=function(e){return e in l},a=u(l),d.a.u(a,function(r){var i=r.zb.init,o=r.zb.update,a=r.key;if(8===t.nodeType&&!d.f.Q[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof i&&d.k.B(function(){var r=i(t,v(a),g,n.$data,n);if(r&&r.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,r,i,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 r?(r.I&&r.I(),d.a.extend(a,r),l&&(a.I=l)):(a.$parents=[],a.$root=o,a.ko=d),a.$rawData=e,a.$data=o,i&&(a[i]=o),n&&n(a,r,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,r){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),r&&r(e)})},d.N.prototype.extend=function(e){return new d.N(this.I||this.$data,this,null,function(t,r){t.$rawData=r.$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),t.I&&t.I.Tb(e),void 0)},d.ra=function(e,t,r){return 1===e.nodeType&&d.f.Fb(e),c(e,t,h(r),!0)},d.Wb=function(e,r,i){return i=h(i),d.ra(e,"function"==typeof r?n(r.bind(null,i,e)):d.a.na(r,t),i)},d.Ca=function(e,t){1!==t.nodeType&&8!==t.nodeType||s(h(e),t,!0)},d.pb=function(e,t){if(!a&&i.jQuery&&(a=i.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||i.document.body,l(h(e),t,!0)},d.Ha=function(t){switch(t.nodeType){case 1:case 8:var r=d.Ob(t);if(r)return r;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,i){var a,s=n.hasOwnProperty(t)?n[t]:e;s||(s=n[t]=new d.P,r(t,function(e){o[t]=e,delete n[t],a?s.notifySubscribers(e):setTimeout(function(){s.notifySubscribers(e)},0)}),a=!0),s.U(i)}function r(e,t){i("getConfig",[e],function(r){r?i("loadComponent",[e,r],function(e){t(e)}):t(null)})}function i(t,r,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,r.concat(function(e){l?n(null):null!==e?n(e):i(t,r,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else i(t,r,n,o)}else n(null)}var n={},o={};d.g={get:function(r,i){var n=o.hasOwnProperty(r)?o[r]:e;n?setTimeout(function(){i(n)},0):t(r,i)},tb:function(e){delete o[e]},jb:i},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,r,i){function n(){0===--a&&i(o)}var o={},a=2,l=r.template;r=r.viewModel,l?s(t,l,function(t){d.g.jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),r?s(t,r,function(t){d.g.jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function t(e,r,i){if("function"==typeof r)i(function(e){return new r(e)});else if("function"==typeof r[c])i(r[c]);else if("instance"in r){var n=r.instance;i(function(){return n})}else"viewModel"in r?t(e,r.viewModel,i):e("Unknown viewModel value: "+r)}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 i.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function s(e,t,n){"string"==typeof t.require?r||i.require?(r||i.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,r,i){var n=l(t);s(n,r,function(r){e(t,n,r,i)})},loadTemplate:function(e,t,r){if(e=l(e),"string"==typeof t)r(d.a.ba(t));else if(t instanceof Array)r(t);else if(a(t))r(d.a.S(t.childNodes));else if(t.element)if(t=t.element,i.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)r(o(t));else if("string"==typeof t){var s=n.getElementById(t);s?r(o(s)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,r,i){t(l(e),r,i)}};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,r){var i=e.getAttribute("params");if(i){var i=t.parseBindingsString(i,r,e,{valueAccessors:!0,bindingParams:!0}),i=d.a.na(i,function(t){return d.s(t,null,{o:e})}),n=d.a.na(i,function(t){return t.Z()?d.s(function(){return d.a.c(t())},null,{o:e}):t.v()});return n.hasOwnProperty("$raw")||(n.$raw=i),n}return{$raw:{}}}d.g.getComponentNameForNode=function(e){return e=d.a.t(e),d.g.Qa(e)&&e},d.g.mb=function(t,r,i,n){if(1===r.nodeType){var o=d.g.getComponentNameForNode(r);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(r,i)};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,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(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,r,i){function n(){return d.a.ta(t.options,function(e){return e.selected})}function o(e,t,r){var i=typeof t;return"function"==i?t(e):"string"==i?e[t]:r}function a(e,r){if(h.length){var i=0<=d.a.m(h,d.i.q(r[0]));d.a.Nb(r[0],i),p&&!i&&d.k.B(d.a.oa,null,[t,"change"])}}var s=0!=t.length&&t.multiple?t.scrollTop:null,l=d.a.c(r()),u=i.get("optionsIncludeDestroyed");r={};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)}),i.has("optionsCaption")&&(l=d.a.c(i.get("optionsCaption")),null!==l&&l!==e&&c.unshift(y)));var p=!1;r.beforeRemove=function(e){t.removeChild(e)},l=a,i.has("optionsAfterRender")&&(l=function(t,r){a(0,r),d.k.B(i.get("optionsAfterRender"),null,[r[0],t!==y?t:e])}),d.a.Za(t,c,function(r,n,a){return a.length&&(h=a[0].selected?[d.i.q(a[0])]:[],p=!0),n=t.ownerDocument.createElement("option"),r===y?(d.a.bb(n,i.get("optionsCaption")),d.i.ca(n,e)):(a=o(r,i.get("optionsValue"),r),d.i.ca(n,d.a.c(a)),r=o(r,i.get("optionsText"),a),d.a.bb(n,r)),[n]},r,l),d.k.B(function(){i.get("valueAllowUnset")&&i.has("value")?d.i.ca(t,d.a.c(i.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,r){d.a.n(e,"change",function(){var i=t(),n=[];d.a.u(e.getElementsByTagName("option"),function(e){e.selected&&n.push(d.i.q(e))}),d.h.pa(i,r,"selectedOptions",n)})},update:function(e,t){if("select"!=d.a.t(e))throw Error("values binding applies only to SELECT elements");var r=d.a.c(t());r&&"number"==typeof r.length&&d.a.u(e.getElementsByTagName("option"),function(e){var t=0<=d.a.m(r,d.i.q(e));d.a.Nb(e,t)})}},d.h.V.selectedOptions=!0,d.d.style={update:function(t,r){var i=d.a.c(r()||{});d.a.G(i,function(r,i){i=d.a.c(i),(null===i||i===e||!1===i)&&(i=""),t.style[r]=i})}},d.d.submit={init:function(e,t,r,i,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");d.a.n(e,"submit",function(r){var i,o=t();try{i=o.call(n.$data,e)}finally{!0!==i&&(r.preventDefault?r.preventDefault():r.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(i&&i.navigator)var t=function(e){return e?parseFloat(e[1]):void 0},r=i.opera&&i.opera.version&&parseInt(i.opera.version()),n=i.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 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=""),m!==e&&r===m?setTimeout(l,4):t.value!==r&&(f=r,t.value=r)}function u(){p||(m=t.value,p=setTimeout(h,4))}function h(){clearTimeout(p),m=p=e;var r=t.value;f!==r&&(f=r,d.h.pa(i(),n,"textInput",r))}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>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<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 r="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+d.h.ya(e,{valueAccessors:!0})+" } })()},'"+r.toLowerCase()+"')",i.createJavaScriptEvaluatorBlock(r)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,r=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{ec:function(e,t,r){t.isTemplateRewritten(e,r)||t.rewriteTemplate(e,function(e){return d.fb.nc(e,t)},r)},nc:function(i,n){return i.replace(t,function(t,r,i,o,a){return e(a,r,i,n)}).replace(r,function(t,r){return e(r,"<!-- ko -->","#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:0<e.length?e[0]:null}function n(e,t,n,a,s){s=s||{};var l=e&&i(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&&(r(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,r,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=i(s);return d.j(function(){var e=r&&r instanceof d.N?r:new d.N(d.a.c(r)),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=i(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,r,a,e,"replaceNode")})},d.uc=function(t,i,o,a,s){function l(e,t){r(t,c),o.afterRender&&o.afterRender(t,e)}function u(e,r){c=s.createChildContext(e,o.as,function(e){e.$index=r});var i=d.C(t)?t():"function"==typeof t?t(e,c):t;return n(null,"ignoreTargetNode",i,c,o)}var c;return d.j(function(){var t=d.a.c(i)||[];"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 r=d.a.c(t());return"string"==typeof r||r.name?d.f.ja(e):(r=d.f.childNodes(e),r=d.a.oc(r),new d.r.fa(e).nodes(r)),{controlsDescendantBindings:!0}},update:function(t,r,i,n,o){var s,l=r();r=d.a.c(l),i=!0,n=null,"string"==typeof r?r={}:(l=r.name,"if"in r&&(i=d.a.c(r["if"])),i&&"ifnot"in r&&(i=!d.a.c(r.ifnot)),s=d.a.c(r.data)),"foreach"in r?n=d.uc(l||t,i&&r.foreach||[],r,t,o):i?(o="data"in r?o.createChildContext(s,r.as):o,n=d.Ya(l||t,o,r,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,r){if(e.length&&t.length){var i,n,o,a,s;for(i=n=0;(!r||r>i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),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,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:r,value:t[--a],index:a}):o&&f===p[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*m),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))||[];0<a.length&&(d.a.Lb(a,e),n&&d.k.B(n,null,[i,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 r=d.a.e.F();d.a.Za=function(i,n,o,a,s){function l(e,t){C=h[t],g!==t&&(E[e]=C),C.Na(g++),d.a.ka(C.$,i),f.push(C),y.push(C)}function u(e,t){if(e)for(var r=0,i=t.length;i>r;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)||[],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,w,S,E=[],p=[],b=0;w=m[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||(p[b]=C))}u(a.beforeMove,E),d.a.u(_,a.beforeRemove?d.R:d.removeNode);for(var x,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;m=C.$[v];c=m.nextSibling,x=m,v++)m!==c&&d.f.Bb(i,m,x);!C.ic&&s&&(s(C.sa,C.$,C.Na),C.ic=!0)}u(a.beforeRemove,n),u(a.afterMove,E),u(a.afterAdd,p),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("<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)}()})}()}(),r("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,r){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 r=r||Object.getOwnPropertyNames(e),r.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var r=e[t],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&i(n,s)}}),e}function t(e,t){var r=e[h];return!r&&t&&(r={},Object.defineProperty(e,h,{value:r})),r}function r(t,r,i){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof i)o.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.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=i.get,o.write=i.set}return t[r]=n.computed(o),e.call(n,t,[r]),t}function i(e,t){var r=null;e.computed(function(){r&&(r.dispose(),r=null);var i=t();i instanceof Array&&(r=n(e,t,i))})}function n(e,t,r){var i=o(e,r);return i.subscribe(t)}function o(e,t){var r=t[d];if(!r){r=new e.subscribable,Object.defineProperty(t,d,{value:r});var i={};a(t,r,i),s(e,t,r,i)}return r}function a(e,t,r){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var n=e[i];e[i]=function(){var e=n.apply(this,arguments);return r.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,r,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return r.notifySubscribers(t),o}})})}function l(e,r){if(!e)return null;var i=t(e,!1);return i&&i[r]||null}function u(e,t){var r=l(e,t);r&&r.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=r}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),r("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",r={register:function(r){r.bindingHandlers.cesiumSvgPath={init:function(i,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),r.virtualElements.setDomNodeChildren(i,[o]),r.computed({read:function(){var e=r.unwrap(n());a.setAttribute("d",r.unwrap(e.path));var i=r.unwrap(e.width),s=r.unwrap(e.height);o.setAttribute("width",i),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+i+" "+s),e.css&&o.setAttribute("class",t+" "+r.unwrap(e.css))},disposeWhenNodeIsRemoved:i}),{controlsDescendantBindings:!0}}},r.virtualElements.allowedBindings.cesiumSvgPath=!0}};return r}),r("ThirdParty/knockout",["./knockout-3.2.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,r){"use strict";return t.attachToKo(e),r.register(e),e}),r("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";var t=function(t,r,i,n,o){return i.call(n,t[r]),e.getObservable(t,r).subscribe(i,n,o)};return t}),r("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,r,i,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var r in e)if(e.hasOwnProperty(r)&&"tagName"!==r)if("children"===r){var i,n=e.children.length;for(i=0;n>i;++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 T.red=e.red*i+t.red*r,T.green=e.green*i+t.green*r,T.blue=e.blue*i+t.blue*r,T.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 p(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 m(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||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=r.shuttleRingAngle;i||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(f=e,r.shuttleRingDragging=!0,r.shuttleRingAngle=p):m>p?r.slower():p>m&&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)"),x=e.fromCssColorString("rgba(0,0,0,0.5)"),T=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='<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=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(p(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,x=function(e){m(b,e)};this._mouseCallback=x,f.addEventListener("mousedown",x,!0),f.addEventListener("touchstart",x,!0),_.addEventListener("mousedown",x,!0),_.addEventListener("touchstart",x,!0),document.addEventListener("mousemove",x,!0),document.addEventListener("touchmove",x,!0),document.addEventListener("mouseup",x,!0),document.addEventListener("touchend",x,!0),this._shuttleRingPointer.addEventListener("mousedown",x,!0),this._shuttleRingPointer.addEventListener("touchstart",x,!0),this._knobOuter.addEventListener("mousedown",x,!0),this._knobOuter.addEventListener("touchstart",x,!0);var T,A=this._knobTime.childNodes[0],M=this._knobDate.childNodes[0],I=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){T!==e&&(T=e,T?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){I.textContent!==e&&(I.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,x)},{tagName:"stop",offset:"100%","stop-color":h(a,x)}]},{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 p(e,t){return e-t}function m(t,r){var i=e(r,t,p);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[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=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 p=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(p,{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=m(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=m(r,t)+1;n<t.length&&(e.multiplier=t[n])})};return C.defaultDateFormatter=function(e){var t=a.toGregorianDate(e);return g[t.month-1]+" "+t.day+" "+t.year},C.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],C.defaultTimeFormatter=function(e,t){var r=a.toGregorianDate(e),i=Math.round(r.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",r.hour,r.minute,r.second,i):l("%02d:%02d:%02d UTC",r.hour,r.minute,r.second)},C.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},C.prototype.setShuttleRingTicks=function(e){var t,r,i,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,r=e.length;r>t;++t)i=e[t],n.hasOwnProperty(i)||(n[i]=!0,o.push(i));o.sort(p);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","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,t){e=a(e);var r=new s(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 l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),i.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(r,i),o.applyBindings(r,u),this._viewModel=r,this._container=e,this._element=i,this._dropPanel=u,this._closeDropDown=function(e){i.contains(e.target)||u.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))};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),r(this)},l}),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:"//assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),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+="<br>&nbsp;&nbsp;&nbsp;&nbsp;"+i[n]+" in frustum "+o}r+="<br>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.shaderCacheText="",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","shaderCacheText","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 p;this._showTileCoordinates=u(function(){return i.tileCoordinates&&!t(p)?p=e.imageryLayers.addImageryProvider(new s({tilingScheme:e.terrainProvider.tilingScheme})):!i.tileCoordinates&&t(p)&&(e.imageryLayers.remove(p),p=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 m=function(e){i._canvas.removeEventListener("mousedown",m,!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",m,!1):i._canvas.removeEventListener("mousedown",m,!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&&u<l.length;++u){var c=l[u];if(t(c))for(var h=0;!r&&h<c.length;++h){var p=c[h];n.contains(p.rectangle,s)&&(r=p)}}i.tile=r,i._canvas.removeEventListener("mousedown",f,!1),i.pickTileActive=!1};this._pickTile=u(function(){i.pickTileActive=!i.pickTileActive,i.pickTileActive?i._canvas.addEventListener("mousedown",f,!1):i._canvas.removeEventListener("mousedown",f,!1)})};return r(d.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}},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 u(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return u(function(){e.tile=e.tile.children[0]})}},selectNE:{get:function(){var e=this;return u(function(){e.tile=e.tile.children[1]})}},selectSW:{get:function(){var e=this;return u(function(){e.tile=e.tile.children[2]})}},selectSE:{get:function(){var e=this;return u(function(){e.tile=e.tile.children[3]})}},primitive:{set:function(e){var r=this._primitive;e!==r&&(this.hasPickedPrimitive=!0,t(r)&&(r.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 r=this._tile;e!==r&&(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=c(e._scene.debugFrustumStatistics)),e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),d}),r("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r){if(!e(t))throw new i("container is required.");if(!e(r))throw new i("scene is required.");t=o(t);var s=document.createElement("div"),l=new a(r,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 w=document.createElement("div");w.className="cesium-cesiumInspector-sectionHeader",p=document.createElement("span"),p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),w.appendChild(p),w.appendChild(document.createTextNode("Primitives")),h.appendChild(w);var S=document.createElement("div");S.className="cesium-cesiumInspector-section",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),h.appendChild(S);var E=document.createElement("div");E.className="cesium-cesiumInspector-pickSection",S.appendChild(E);var b=document.createElement("input");b.type="button",b.value="Pick a primitive",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var x=document.createElement("div");x.className="cesium-cesiumInspector-center",x.appendChild(b),E.appendChild(x);var T=document.createElement("div");E.appendChild(T);var P=document.createElement("input");P.type="checkbox",P.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),T.appendChild(P),T.appendChild(document.createTextNode("Show bounding sphere"));var A=document.createElement("div");E.appendChild(A);var M=document.createElement("input");M.type="checkbox",M.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),A.appendChild(M),A.appendChild(document.createTextNode("Show reference frame"));var I=document.createElement("div");this._primitiveOnly=I,E.appendChild(I);var D=document.createElement("input");D.type="checkbox",D.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),I.appendChild(D),I.appendChild(document.createTextNode("Show only selected"));var O=document.createElement("div");O.className="cesium-cesiumInspector-sectionHeader",p=document.createElement("span"),p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),O.appendChild(p),O.appendChild(document.createTextNode("Terrain")),h.appendChild(O);var R=document.createElement("div");R.className="cesium-cesiumInspector-section",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),h.appendChild(R);var L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",R.appendChild(L);var N=document.createElement("input");N.type="button",N.value="Pick a tile",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),x=document.createElement("div"),x.appendChild(N),x.className="cesium-cesiumInspector-center",L.appendChild(x);var F=document.createElement("div");L.appendChild(F);var B=document.createElement("input");B.type="button",B.value="Parent",B.className="cesium-cesiumInspector-pickButton",B.setAttribute("data-bind","click: selectParent");var z=document.createElement("input");z.type="button",z.value="NW",z.className="cesium-cesiumInspector-pickButton",z.setAttribute("data-bind","click: selectNW");var V=document.createElement("input");V.type="button",V.value="NE",V.className="cesium-cesiumInspector-pickButton",V.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 U=document.createElement("input");U.type="button",U.value="SE",U.className="cesium-cesiumInspector-pickButton",U.setAttribute("data-bind","click: selectSE");var W=document.createElement("div");W.className="cesium-cesiumInspector-tileText",F.className="cesium-cesiumInspector-frustumStats",F.appendChild(W),F.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),W.setAttribute("data-bind","html: tileText");var G=document.createElement("div");G.className="cesium-cesiumInspector-relativeText",G.textContent="Select relative:",F.appendChild(G);var H=document.createElement("table"),q=document.createElement("tr"),j=document.createElement("tr"),Y=document.createElement("td");Y.appendChild(B);var X=document.createElement("td");X.appendChild(z);var Z=document.createElement("td");Z.appendChild(V),q.appendChild(Y),q.appendChild(X),q.appendChild(Z);var J=document.createElement("td"),Q=document.createElement("td");Q.appendChild(k);var K=document.createElement("td");K.appendChild(U),j.appendChild(J),j.appendChild(Q),j.appendChild(K),H.appendChild(q),H.appendChild(j),F.appendChild(H);var $=document.createElement("div");L.appendChild($);var et=document.createElement("input");et.type="checkbox",et.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),$.appendChild(et),$.appendChild(document.createTextNode("Show bounding sphere"));var tt=document.createElement("div");L.appendChild(tt);var rt=document.createElement("input");rt.type="checkbox",rt.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),tt.appendChild(rt),tt.appendChild(document.createTextNode("Show only selected"));var it=document.createElement("div");R.appendChild(it);var nt=document.createElement("input");nt.type="checkbox",nt.setAttribute("data-bind","checked: wireframe, click: showWireframe"),it.appendChild(nt),it.appendChild(document.createTextNode("Wireframe"));var ot=document.createElement("div");R.appendChild(ot);var at=document.createElement("input");at.type="checkbox",at.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),ot.appendChild(at),ot.appendChild(document.createTextNode("Suspend LOD update"));var st=document.createElement("div");R.appendChild(st);var lt=document.createElement("input");lt.type="checkbox",lt.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),st.appendChild(lt),st.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),r(this)},s}),r("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../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,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w){"use strict";function S(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function E(e){function t(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=i-r;s>a&&(e.resize(),e.render(),r=i-s%a),h(t)}else e.resize(),e.render(),h(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 r=0;h(t)}function b(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 T="data:image/png;base64, ",P=function(e,a){e=w(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)?w(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,b(this);try{var E=new v({canvas:l,contextOptions:a.contextOptions,creditContainer:c,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1)});this._scene=E,E.camera.constrainedAxis=t.UNIT_Z,x(this);var P=n(E.mapProjection.ellipsoid,u.WGS84),A=E.frameState.creditDisplay,M=new i("Cesium",T,"http://cesiumjs.org/");A.addDefaultCredit(M);var I=a.globe;o(I)||(I=new m(P)),I!==!1&&(E.globe=I);var D=a.skyBox;o(D)||(D=new y({sources:{positiveX:S("px"),negativeX:S("mx"),positiveY:S("py"),negativeY:S("my"),positiveZ:S("pz"),negativeZ:S("mz")}})),D!==!1&&(E.skyBox=D,E.sun=new C,E.moon=new f);var O=a.skyAtmosphere;o(O)||(O=new _(P)),O!==!1&&(E.skyAtmosphere=O);var R=a.globe===!1?!1:a.imageryProvider;o(R)||(R=new p({url:"//dev.virtualearth.net"})),R!==!1&&E.imageryLayers.addImageryProvider(R),o(a.terrainProvider)&&a.globe!==!1&&(E.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new d(l,!1),o(a.sceneMode)&&(a.sceneMode===g.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===g.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 L=this;E.renderError.addEventListener(function(e,t){if(L._useDefaultRenderLoop=!1,L._renderLoopRunning=!1,L._showRenderLoopErrors){var r="An error occurred while rendering.  Rendering has stopped.";L.showErrorPanel(r,void 0,t)}})}catch(N){var F="Error constructing CesiumWidget.",B='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:';throw this.showErrorPanel(F,B,N),N}};return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){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&&E(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}}}),P.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="<p>"+t+"</p>",l.appendChild(h)}var d="(no error details available)";o(r)&&(d=c(r));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(d)),l.appendChild(p);var m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(m);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)},m.appendChild(f),i.appendChild(n),console.error(e+"\n"+t+"\n"+d)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==r)&&(this._forceResize=!1,b(this),x(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),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 p=a.observable(r.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:p,set:function(e){p(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","../getElement"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){var r=this,i=o.observable(n.fullscreen),l=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 l()},set:function(e){l(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(s(t),document.body),this._callback=function(){i(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),r(this)},l}),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/Cartesian3","../../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,h){"use strict";function d(e){var r=e.searchText;if(!/^\s*$/.test(r)){var n=r.match(/[^\s,\n]+/g);if(2===n.length||3===n.length){var o=+n[0],u=+n[1],h=3===n.length?+n[2]:300;if(!isNaN(o)&&!isNaN(u)&&!isNaN(h))return e._scene.camera.flyTo({destination:t.fromDegrees(o,u,h),duration:e._flightDuration,endTransform:s.IDENTITY,convert:!1}),void 0}e._isSearchInProgress=!0;var d=a(e._url+"REST/v1/Locations",{parameters:{query:r,key:e._key},callbackParameterName:"jsonp"}),p=e._geocodeInProgress=c(d,function(t){if(!p.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return e.searchText=e._searchText+" (not found)",void 0;var r=t.resourceSets[0];if(0===r.resources.length)return e.searchText=e._searchText+" (not found)",void 0;var n=r.resources[0];e._searchText=n.name;var o=n.bbox,a=o[0],u=o[1],c=o[2],h=o[3],d=l.fromDegrees(u,a,h,c),m=e._scene.camera,f=m.getRectangleCameraCoordinates(d);i(f)&&e._scene.camera.flyTo({destination:f,duration:e._flightDuration,endTransform:s.IDENTITY,convert:!1})}},function(){p.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function p(e){e._isSearchInProgress=!1,i(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}var m=function(t){this._url=r(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=r(t.flightDuration,1.5),this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0;var i=this;this._searchCommand=h(function(){i.isSearchInProgress?p(i):d(i)}),u.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,u.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,u.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,u.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})};return n(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","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,r,i,n,o,a,s){"use strict";var l="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",u="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",c=function(e){var t=a(e.container),r=new s(e);r._startSearchPath=l,r._stopSearchPath=u;var i=document.createElement("form");i.setAttribute("data-bind","submit: search");var c=document.createElement("input");c.type="search",c.className="cesium-geocoder-input",c.setAttribute("placeholder","Enter an address or landmark..."),c.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : searchText.length > 0 }'),i.appendChild(c);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 }"),i.appendChild(h),t.appendChild(i),o.applyBindings(r,i),this._container=t,this._viewModel=r,this._form=i,this._onInputBegin=function(e){t.contains(e.target)||c.blur()},this._onInputEnd=function(e){t.contains(e.target)&&c.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))};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 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),r(this)},c}),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.flyTo({destination:a.MAX_VALUE,duration:i,endTransform:o.IDENTITY});else if(n===l.SCENE3D){var d=t.camera.getRectangleCameraCoordinates(s.DEFAULT_VIEW_RECTANGLE),p=e.magnitude(d);p+=p*s.DEFAULT_VIEW_FACTOR,e.normalize(d,d),e.multiplyByScalar(d,p,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,orientation:{direction:u,up:h},duration:i,endTransform:o.IDENTITY})}else if(n===l.COLUMBUS_VIEW){var m=t.globe.ellipsoid.maximumRadius,f=new e(0,-1,1);f=e.multiplyByScalar(e.normalize(f,f),5*m,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,orientation:{direction:u,up:h},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/deprecationWarning","../../Core/Event","../../Core/formatError","../../ThirdParty/knockout","../../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";var l,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._description="",this._descriptionSanitizedHtml="",this._cameraClicked=new n,this._closeClicked=new n,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',a.track(this,["showInfo","titleText","_description","_descriptionSanitizedHtml","maxHeight","enableCamera","isCameraTracking"]),this.description=void 0,a.defineProperty(this,"description",{get:function(){return this._description},set:function(r){if(this._description!==r){this._description=r;var i=e(this._sanitizer,l);if(t(i)){this._descriptionSanitizedHtml=this._loadingIndicatorHtml;var n=this;s(i(r),function(e){n._description===r&&(n._descriptionSanitizedHtml=e)}).otherwise(function(e){console.log("An error occurred while processing the description: "+o(e))})}else this._descriptionSanitizedHtml=r}}}),this.descriptionRawHtml=void 0,a.defineProperty(this,"descriptionRawHtml",{get:function(){return i("InfoBoxViewModel.descriptionRawHtml","InfoBoxViewModel.descriptionRawHtml has been deprecated.  Use InfoBoxViewModel.description instead."),this.description},set:function(e){i("InfoBoxViewModel.descriptionRawHtml","InfoBoxViewModel.descriptionRawHtml has been deprecated.  Use InfoBoxViewModel.description instead."),this.description=e}}),this.descriptionSanitizedHtml=void 0,a.defineProperty(this,"descriptionSanitizedHtml",{get:function(){return i("InfoBoxViewModel.descriptionSanitizedHtml","InfoBoxViewModel.descriptionSanitizedHtml has been deprecated.  Use InfoBoxViewModel.description instead."),this._descriptionSanitizedHtml}}),this.cameraIconPath=void 0,a.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?c:u}}),a.defineProperty(this,"_bodyless",{get:function(){return!t(this._descriptionSanitizedHtml)||0===this._descriptionSanitizedHtml.length}})};return h.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},r(h,{defaultSanitizer:{get:function(){return i("InfoBoxViewModel.defaultSanitizer","InfoBoxViewModel.defaultSanitizer has been deprecated. Set the InfoBox.frame.sandbox attribute instead."),l},set:function(e){i("InfoBoxViewModel.defaultSanitizer","InfoBoxViewModel.defaultSanitizer has been deprecated. Set the InfoBox.frame.sandbox attribute instead."),l=e}}}),r(h.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}},loadingIndicatorHtml:{get:function(){return i("InfoBoxViewModel.loadingIndicator","InfoBoxViewModel.loadingIndicator has been deprecated, loading is now sycnhronous."),this._loadingIndicatorHtml},set:function(e){i("InfoBoxViewModel.loadingIndicator","InfoBoxViewModel.loadingIndicator has been deprecated, loading is now sycnhronous."),this._loadingIndicatorHtml=e}},sanitizer:{get:function(){return i("InfoBoxViewModel.sanitizer","InfoBoxViewModel.sanitizer has been deprecated. Set the InfoBox.frame.sandbox instead."),e(this._sanitizer,l)},set:function(e){i("InfoBoxViewModel.sanitizer","InfoBoxViewModel.sanitizer has been deprecated. Set the InfoBox.frame.sandbox instead."),this._sanitizer=e;var t=this._description;this._description="",this.description=t}}}),h}),r("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(i){i=s(i);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),i.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="&times;",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=i,this._element=n,this._frame=d,this._viewModel=p,this._descriptionSubscription=void 0;var m=this;d.addEventListener("load",function(){var i=d.contentDocument,o=i.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=i.createElement("div");a.className="cesium-infoBox-description",i.head.appendChild(o),i.body.appendChild(a),m._descriptionSubscription=l(p,"_descriptionSanitizedHtml",function(e){d.style.height="5px",a.innerHTML=e;var i=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);r(u)&&0!==u.alpha&&(i=s["background-color"])}}n.style["background-color"]=i;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")};return i(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),r(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),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","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(r){var i=l(r.container),n=new u,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 c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",i.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.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.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 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=i,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 i(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}),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="&times;",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","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";var l="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",u="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",c="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",h=function(e,t,r){e=a(e);var i=new s(t,r);i._globePath=l,i._flatMapPath=u,i._columbusViewPath=c;var h=document.createElement("span");h.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(h);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 -->',h.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 }'),h.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 }'),h.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 }'),h.appendChild(f),o.applyBindings(i,h),this._viewModel=i,this._container=e,this._wrapper=h,this._closeDropDown=function(e){h.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(h.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),h.prototype.isDestroyed=function(){return!1},h.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),r(this)},h}),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='<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 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;l<i.timeBarWidth;++l){var h=r.addSeconds(i.startJulian,l/i.timeBarWidth*i.duration,new r);!t(u)&&r.greaterThanOrEquals(h,n)?u=l:!t(c)&&r.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height),t(u)&&(t(c)||(c=i.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,i.y,Math.max(c-u,1),this.height))}},i}),r("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return 10>e?"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 p(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 m(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='<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=u(this),this._onMouseUp=c(this),this._onMouseMove=h(this),this._onMouseWheel=d(this),this._onTouchStart=p(this),this._onTouchMove=f(this),this._onTouchEnd=m(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,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 _,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 x=f;f-=m;var T={startTime:S,startJulian:C,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:r};this._highlightRanges.forEach(function(e){h+=e.render(T)});var P=0,A=0,M=0,I=b/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var D,O=-1,R=-1,L=y.length;for(D=0;L>D;++D){var N=y[D];if(++O,P=N,N>I&&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=x,f>m&&1e-5>M&&Math.abs(f-P)>m&&(M=f,P+m>=f&&(A=0));var F,B=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);E>=o;o=t(o,M))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*r(o)).toString()+'px;"></span>';if(g*(A/this._timeBarSecondsSpan)>=3)for(o=e(A);E>=o;o=t(o,A))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*r(o)).toString()+'px;"></span>';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+='<span class="cesium-timeline-ticMain" style="left: '+U.toString()+'px;"></span>'+'<span class="cesium-timeline-ticLabel" style="left: '+G.toString()+'px;">'+W+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+U.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0px 0px;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),T.y=0,this._trackList.forEach(function(e){e.render(c._context,T),T.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/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/definedNotNull","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../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"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B,z){"use strict";function V(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function k(e,t){var n=e.scene.pick(t.position);if(i(n)){var o=r(n.id,n.primitive.id);if(o instanceof v)return o}return i(e.scene.globe)?W(e,t.position):void 0}function U(e,t,r){if(i(r)){var n=r.clock;i(n)&&(n.getValue(t),i(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function W(e,t){var r=e.scene,n=r.camera.getPickRay(t),o=r.imageryLayers.pickImageryLayerFeatures(n,r);if(i(o)){var a=new v({id:"Loading...",description:"Loading feature information..."});return w(o,function(t){if(e.selectedEntity===a){if(!i(t)||0===t.length)return e.selectedEntity=G(),void 0;var r=t[0],n=new v({id:r.name,description:r.description});if(i(r.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,J);n.position=new p(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=G())}),a}}function G(){return new v({id:"None",description:"No features found."})}function H(e,t,n,o){j(e);var a=w.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,w(t,function(t){if(e._zoomPromise===a)if(t.isLoading&&i(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else t=r(t.values,t),i(t.entities)&&(t=t.entities.values),e._zoomTarget=u(t)?t.slice(0):[t]}),a}function q(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function j(e){var t=e._zoomPromise;i(t)&&(q(e),t.resolve(!1))}function Y(t){var n=t._zoomTarget;if(i(n)){for(var o=t._zoomPromise,a=[],s=0,l=n.length;l>s;s++){var u=t._dataSourceDisplay.getBoundingSphere(n[s],!1,Z);if(u===d.PENDING)return;u!==d.FAILED&&a.push(e.clone(Z))}if(0===a.length)return j(t),void 0;t.trackedEntity=void 0;var h=t.scene,p=h.camera,m=e.fromBoundingSpheres(a),f=h.screenSpaceCameraController;if(f.minimumZoomDistance=Math.min(f.minimumZoomDistance,.5*m.radius),t._zoomIsFlight){var v=r(t._zoomOptions,{}),g={duration:v.duration,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)},offset:v.offset};q(t),p.flyToBoundingSphere(m,g)}else p.viewBoundingSphere(m,t._zoomOptions),p.lookAtTransform(c.IDENTITY),q(t),o.resolve(!0)}}function X(e){if(e._needTrackedEntityUpdate){var t=e.scene,r=e._trackedEntity,i=e._dataSourceDisplay.getBoundingSphere(r,!1,Z);if(i!==d.PENDING){var n=t.mode;(n===y.COLUMBUS_VIEW||n===y.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!1),(n===y.COLUMBUS_VIEW||n===y.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!1);var o=i!==d.FAILED?Z:void 0;e._entityView=new g(r,t,t.mapProjection.ellipsoid,o),e._entityView.update(e.clock.currentTime),e._needTrackedEntityUpdate=!1}}}var Z=new e,J=new t,Q=function(e,t){function o(e){var t=k(yt,e);i(t)&&(i(t.position)?yt.trackedEntity=t:yt.zoomTo(t))}function a(e){yt.selectedEntity=k(yt,e)}e=D(e),t=r(t,r.EMPTY_OBJECT);var u=!(i(t.globe)&&t.globe===!1||i(t.baseLayerPicker)&&t.baseLayerPicker===!1),c=document.createElement("div");c.className="cesium-viewer",e.appendChild(c);var d=document.createElement("div");d.className="cesium-viewer-cesiumWidgetContainer",c.appendChild(d);var p=document.createElement("div");p.className="cesium-viewer-bottom",c.appendChild(p);var v=r(t.scene3DOnly,!1),g=new P(d,{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:i(t.creditContainer)?t.creditContainer:p,scene3DOnly:v}),_=t.dataSources,y=!1;i(_)||(_=new m,y=!0);var w=new f({scene:g.scene,dataSourceCollection:_}),U=g.clock,W=new A(U),G=new l;G.add(U.onTick,Q.prototype._onTick,this);var H;if(!i(t.selectionIndicator)||t.selectionIndicator!==!1){var q=document.createElement("div");q.className="cesium-viewer-selectionIndicatorContainer",c.appendChild(q),H=new F(q,g.scene)}var j;if(!i(t.infoBox)||t.infoBox!==!1){var Y=document.createElement("div");Y.className="cesium-viewer-infoBoxContainer",c.appendChild(Y),j=new R(Y);var X=j.viewModel;G.add(X.cameraClicked,Q.prototype._onInfoBoxCameraClicked,this),G.add(X.closeClicked,Q.prototype._onInfoBoxClockClicked,this)}var Z=document.createElement("div");Z.className="cesium-viewer-toolbar",c.appendChild(Z);var J;if(!i(t.geocoder)||t.geocoder!==!1){var K=document.createElement("div");K.className="cesium-viewer-geocoderContainer",Z.appendChild(K),J=new I({container:K,scene:g.scene}),G.add(J.viewModel.search.beforeExecute,Q.prototype._clearObjects,this)}var $;if(i(t.homeButton)&&t.homeButton===!1||($=new O(Z,g.scene),i(J)&&G.add($.viewModel.command.afterExecute,function(){var e=J.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),G.add($.viewModel.command.beforeExecute,Q.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&v)throw new s("options.sceneModePicker is not available when options.scene3DOnly is set to true.");var et;v||i(t.sceneModePicker)&&t.sceneModePicker===!1||(et=new N(Z,g.scene));var tt,rt;if(u){var it=r(t.imageryProviderViewModels,x()),nt=r(t.terrainProviderViewModels,T());tt=new b(Z,{globe:g.scene.globe,imageryProviderViewModels:it,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:nt,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var ot=Z.getElementsByClassName("cesium-baseLayerPicker-dropDown");rt=ot[0]}var at;if(!i(t.navigationHelpButton)||t.navigationHelpButton!==!1){var st=!0;try{if(n(window.localStorage)){var lt=window.localStorage.getItem("cesium-hasSeenNavHelp");i(lt)&&Boolean(lt)?st=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(ut){}at=new L({container:Z,instructionsInitiallyVisible:r(t.navigationInstructionsInitiallyVisible,st)})}var ct;if(!i(t.animation)||t.animation!==!1){var ht=document.createElement("div");ht.className="cesium-viewer-animationContainer",c.appendChild(ht),ct=new S(ht,new E(W))}var dt;if(!i(t.timeline)||t.timeline!==!1){var pt=document.createElement("div");pt.className="cesium-viewer-timelineContainer",c.appendChild(pt),dt=new z(pt,U),dt.addEventListener("settime",V,!1),dt.zoomTo(U.startTime,U.stopTime)}var mt,ft;if(i(t.fullscreenButton)&&t.fullscreenButton===!1)i(dt)&&(dt.container.style.right=0);else{var vt=document.createElement("div");vt.className="cesium-viewer-fullscreenContainer",c.appendChild(vt),mt=new M(vt,t.fullscreenElement),ft=B(mt.viewModel,"isFullscreenEnabled",function(e){vt.style.display=e?"block":"none",i(dt)&&(dt.container.style.right=vt.clientWidth+"px",dt.resize())})}this._baseLayerPickerDropDown=rt,this._fullscreenSubscription=ft,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=r(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=p,this._element=c,this._cesiumWidget=g,this._selectionIndicator=H,this._infoBox=j,this._dataSourceCollection=_,this._destroyDataSourceCollection=y,this._dataSourceDisplay=w,this._clockViewModel=W,this._toolbar=Z,this._homeButton=$,this._sceneModePicker=et,this._baseLayerPicker=tt,this._animation=ct,this._timeline=dt,this._fullscreenButton=mt,this._geocoder=J,this._eventHelper=G,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=i(j)||i(H),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,C.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),G.add(_.dataSourceAdded,Q.prototype._onDataSourceAdded,this),G.add(_.dataSourceRemoved,Q.prototype._onDataSourceRemoved,this),G.add(g.scene.preRender,Q.prototype.resize,this),G.add(g.scene.postRender,Q.prototype._postRender,this);for(var gt=_.length,_t=0;gt>_t;_t++)this._dataSourceAdded(_,_.get(_t));this._dataSourceAdded(void 0,w.defaultDataSource),G.add(_.dataSourceAdded,Q.prototype._dataSourceAdded,this),G.add(_.dataSourceRemoved,Q.prototype._dataSourceRemoved,this);var yt=this;g.screenSpaceEventHandler.setInputAction(a,h.LEFT_CLICK),g.screenSpaceEventHandler.setInputAction(o,h.LEFT_DOUBLE_CLICK)};return o(Q.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}},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,j(this);var t=this.scene,r=t.mode;if(!i(e)||!i(e.position))return this._needTrackedEntityUpdate=!1,(r===y.COLUMBUS_VIEW||r===y.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(r===y.COLUMBUS_VIEW||r===y.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(c.IDENTITY),void 0;this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=i(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;i(e)?i(t)&&t.animateAppear():i(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,U(this._timeline,this.clock,e))}}}),Q.prototype.extend=function(e,t){e(this,t)},Q.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,r=t.clientWidth,n=t.clientHeight,o=i(this._animation),a=i(this._timeline);if(this._forceResize||r!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;i(l)&&(l.style.maxHeight=s+"px"),i(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,r>900?(h=169,900>=m&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):r>=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=c.container,g=v.style;p=v.clientHeight+3,g.left=h+"px",i(f)&&(g.right=f.container.clientWidth+"px"),c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=r,this._lastHeight=n}},Q.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Q.prototype.render=function(){this._cesiumWidget.render()},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.LEFT_DOUBLE_CLICK);var t=this.dataSources,r=t.length;for(e=0;r>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(),i(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),i(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),i(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),i(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),i(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),i(this._timeline)&&(this._timeline.removeEventListener("settime",V,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),i(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),i(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),i(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)},Q.prototype._dataSourceAdded=function(e,t){var r=t.entities;r.collectionChanged.addEventListener(Q.prototype._onEntityCollectionChanged,this)},Q.prototype._dataSourceRemoved=function(e,t){var r=t.entities;r.collectionChanged.removeEventListener(Q.prototype._onEntityCollectionChanged,this),i(this.trackedEntity)&&r.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),i(this.selectedEntity)&&r.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Q.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;i(a)&&a.update(n);var s,l=!1,u=this.selectedEntity,c=i(u)&&this._enableInfoOrSelection;if(c&&u.isShowing&&u.isAvailable(n)){var h=this._dataSourceDisplay.getBoundingSphere(u,!0,Z);h!==d.FAILED?s=Z.center:i(u.position)&&(s=u.position.getValue(n,s)),l=i(s)}var p=i(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;i(p)&&(p.position=t.clone(s,p.position),p.showSelection=c&&l,p.update());var m=i(this._infoBox)?this._infoBox.viewModel:void 0;i(m)&&(m.showInfo=c,m.enableCamera=l,m.isCameraTracking=this.trackedEntity===this.selectedEntity,c?(m.titleText=r(u.name,u.id),m.description=_.getValueOrDefault(u.description,n,"")):(m.titleText="",m.description=""))},Q.prototype._onEntityCollectionChanged=function(e,t,r){for(var i=r.length,n=0;i>n;n++){var o=r[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Q.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,r=t.position;i(r)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Q.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Q.prototype._onInfoBoxClockClicked=function(){this.selectedEntity=void 0},Q.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Q.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&U(this.timeline,this.clock,e)},Q.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var r=t.entities.id,i=this._eventHelper.add(t.changedEvent,Q.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[r]=i},Q.prototype._onDataSourceRemoved=function(e,t){var r=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,r){var n=e.length;this.clockTrackedDataSource=this._automaticallyTrackDataSourceClocks&&n>0?e.get(n-1):void 0}},Q.prototype.zoomTo=function(e,t){return H(this,e,t,!1)},Q.prototype.flyTo=function(e,t){return H(this,e,t,!0)},Q.prototype._postRender=function(){Y(this),X(this)},Q}),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","../../DataSources/KmlDataSource","../getElement"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",c,!1),i.removeEventListener("dragover",c,!1),i.removeEventListener("dragexit",c,!1))}function d(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",c,!1),e.addEventListener("dragover",c,!1),e.addEventListener("dragexit",c,!1)}function p(e,r,i){return function(n){var o=r.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 e.dropError.raiseEvent(e,o,"Unrecognized file: "+o),void 0;u=l.load(r,{sourceUri:o,proxy:i})}t(u)&&e.dataSources.add(u).otherwise(function(t){e.dropError.raiseEvent(e,o,t)})}catch(c){e.dropError.raiseEvent(e,o,c)}}}function m(e,t){return function(r){e.dropError.raiseEvent(e,t.name,r.target.error)}}var f=function(t,i){function a(e){c(e),f&&(t.entities.removeAll(),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=p(t,o,g),a.onerror=m(t,o),a.readAsText(o)}}i=e(i,e.EMPTY_OBJECT);var s=!0,l=new n,f=e(i.clearOnDrop,!0),v=e(i.dropTarget,t.container),g=i.proxy;v=u(v),r(t,{dropTarget:{get:function(){return v},set:function(e){h(v,a),v=e,d(v,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?d(v,a):h(v,a),s=e)}},dropError:{get:function(){return l}},clearOnDrop:{get:function(){return f},set:function(e){f=e}},proxy:{get:function(){return g},set:function(e){g=e}}}),d(v,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a};return f}),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/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/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/definedNotNull","./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/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/CustomDataSource","./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/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./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/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./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","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/dynamicGeometryGetBoundingSphere","./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/createUniform","./Renderer/createUniformArray","./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/HeadingPitchRange","./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/Autolinker","./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","./ThirdParty/zip","./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/viewerPerformanceWatchdogMixin","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,w,S,E,b,x,T,P,A,M,I,D,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z,J,Q,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,ft,vt,gt,_t,yt,Ct,wt,St,Et,bt,xt,Tt,Pt,At,Mt,It,Dt,Ot,Rt,Lt,Nt,Ft,Bt,zt,Vt,kt,Ut,Wt,Gt,Ht,qt,jt,Yt,Xt,Zt,Jt,Qt,Kt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,hr,dr,pr,mr,fr,vr,gr,_r,yr,Cr,wr,Sr,Er,br,xr,Tr,Pr,Ar,Mr,Ir,Dr,Or,Rr,Lr,Nr,Fr,Br,zr,Vr,kr,Ur,Wr,Gr,Hr,qr,jr,Yr,Xr,Zr,Jr,Qr,Kr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,hi,di,pi,mi,fi,vi,gi,_i,yi,Ci,wi,Si,Ei,bi,xi,Ti,Pi,Ai,Mi,Ii,Di,Oi,Ri,Li,Ni,Fi,Bi,zi,Vi,ki,Ui,Wi,Gi,Hi,qi,ji,Yi,Xi,Zi,Ji,Qi,Ki,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,pn,mn,fn,vn,gn,_n,yn,Cn,wn,Sn,En,bn,xn,Tn,Pn,An,Mn,In,Dn,On,Rn,Ln,Nn,Fn,Bn,zn,Vn,kn,Un,Wn,Gn,Hn,qn,jn,Yn,Xn,Zn,Jn,Qn,Kn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,po,mo,fo,vo,go,_o,yo,Co,wo,So,Eo,bo,xo,To,Po,Ao,Mo,Io,Do,Oo,Ro,Lo,No,Fo,Bo,zo,Vo,ko,Uo,Wo,Go,Ho,qo,jo,Yo,Xo,Zo,Jo,Qo,Ko,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,ha,da,pa,ma,fa,va,ga,_a,ya,Ca,wa,Sa,Ea,ba,xa,Ta,Pa,Aa,Ma,Ia,Da,Oa,Ra,La,Na,Fa,Ba,za,Va,ka,Ua,Wa,Ga,Ha,qa,ja,Ya,Xa,Za,Ja,Qa,Ka,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,hs,ds,ps,ms,fs,vs,gs,_s,ys,Cs,ws,Ss,Es,bs,xs,Ts,Ps,As,Ms,Is,Ds,Os,Rs,Ls,Ns,Fs,Bs,zs,Vs,ks,Us,Ws,Gs,Hs,qs,js,Ys,Xs,Zs,Js,Qs,Ks,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,hl,dl,pl,ml,fl,vl,gl,_l,yl,Cl,wl,Sl,El,bl,xl,Tl,Pl,Al,Ml,Il,Dl,Ol,Rl,Ll,Nl,Fl,Bl,zl,Vl,kl,Ul,Wl,Gl,Hl,ql,jl,Yl,Xl,Zl,Jl,Ql,Kl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,hu,du,pu,mu,fu,vu,gu,_u,yu,Cu,wu,Su,Eu,bu,xu,Tu,Pu,Au,Mu,Iu,Du,Ou,Ru,Lu,Nu,Fu,Bu,zu,Vu,ku,Uu,Wu,Gu,Hu,qu,ju,Yu,Xu,Zu,Ju,Qu,Ku,$u,ec,tc,rc,ic,nc,oc,ac,sc,lc,uc,cc,hc,dc,pc,mc,fc,vc,gc,_c,yc,Cc,wc,Sc,Ec,bc,xc,Tc,Pc,Ac,Mc,Ic,Dc,Oc,Rc,Lc,Nc,Fc,Bc,zc,Vc,kc,Uc,Wc,Gc,Hc,qc,jc,Yc,Xc,Zc,Jc,Qc,Kc,$c,eh,th,rh,ih,nh){"use strict";
var oh={VERSION:"1.9",_shaders:{}};return oh.ArcGisImageServerTerrainProvider=e,oh.AssociativeArray=t,oh.AttributeCompression=r,oh.AxisAlignedBoundingBox=i,oh.BingMapsApi=n,oh.BoundingRectangle=o,oh.BoundingSphere=a,oh.BoxGeometry=s,oh.BoxOutlineGeometry=l,oh.Cartesian2=u,oh.Cartesian3=c,oh.Cartesian4=h,oh.Cartographic=d,oh.CatmullRomSpline=p,oh.CesiumTerrainProvider=m,oh.CircleGeometry=f,oh.CircleOutlineGeometry=v,oh.Clock=g,oh.ClockRange=_,oh.ClockStep=y,oh.Color=C,oh.ColorGeometryInstanceAttribute=w,oh.ComponentDatatype=S,oh.CornerType=E,oh.CorridorGeometry=b,oh.CorridorGeometryLibrary=x,oh.CorridorOutlineGeometry=T,oh.Credit=P,oh.CubicRealPolynomial=A,oh.CylinderGeometry=M,oh.CylinderGeometryLibrary=I,oh.CylinderOutlineGeometry=D,oh.DefaultProxy=O,oh.DeveloperError=R,oh.EarthOrientationParameters=L,oh.EarthOrientationParametersSample=N,oh.EasingFunction=F,oh.EllipseGeometry=B,oh.EllipseGeometryLibrary=z,oh.EllipseOutlineGeometry=V,oh.Ellipsoid=k,oh.EllipsoidGeodesic=U,oh.EllipsoidGeometry=W,oh.EllipsoidOutlineGeometry=G,oh.EllipsoidTangentPlane=H,oh.EllipsoidTerrainProvider=q,oh.EllipsoidalOccluder=j,oh.EncodedCartesian3=Y,oh.Event=X,oh.EventHelper=Z,oh.ExtrapolationType=J,oh.FeatureDetection=Q,oh.Fullscreen=K,oh.GeographicProjection=$,oh.GeographicTilingScheme=et,oh.Geometry=tt,oh.GeometryAttribute=rt,oh.GeometryAttributes=it,oh.GeometryInstance=nt,oh.GeometryInstanceAttribute=ot,oh.GeometryPipeline=at,oh.GeometryType=st,oh.GregorianDate=lt,oh.HeightmapTerrainData=ut,oh.HeightmapTessellator=ct,oh.HermitePolynomialApproximation=ht,oh.HermiteSpline=dt,oh.Iau2000Orientation=pt,oh.Iau2006XysData=mt,oh.Iau2006XysSample=ft,oh.IauOrientationAxes=vt,oh.IauOrientationParameters=gt,oh.IndexDatatype=_t,oh.InterpolationAlgorithm=yt,oh.Intersect=Ct,oh.IntersectionTests=wt,oh.Intersections2D=St,oh.Interval=Et,oh.Iso8601=bt,oh.JulianDate=xt,oh.KeyboardEventModifier=Tt,oh.LagrangePolynomialApproximation=Pt,oh.LeapSecond=At,oh.LinearApproximation=Mt,oh.LinearSpline=It,oh.MapProjection=Dt,oh.Math=Ot,oh.Matrix2=Rt,oh.Matrix3=Lt,oh.Matrix4=Nt,oh.NearFarScalar=Ft,oh.ObjectOrientedBoundingBox=Bt,oh.Occluder=zt,oh.Packable=Vt,oh.PackableForInterpolation=kt,oh.PinBuilder=Ut,oh.PixelFormat=Wt,oh.Plane=Gt,oh.PolygonGeometry=Ht,oh.PolygonGeometryLibrary=qt,oh.PolygonHierarchy=jt,oh.PolygonOutlineGeometry=Yt,oh.PolygonPipeline=Xt,oh.PolylineGeometry=Zt,oh.PolylinePipeline=Jt,oh.PolylineVolumeGeometry=Qt,oh.PolylineVolumeGeometryLibrary=Kt,oh.PolylineVolumeOutlineGeometry=$t,oh.PrimitiveType=er,oh.QuadraticRealPolynomial=tr,oh.QuantizedMeshTerrainData=rr,oh.QuarticRealPolynomial=ir,oh.Quaternion=nr,oh.QuaternionSpline=or,oh.Queue=ar,oh.Ray=sr,oh.Rectangle=lr,oh.RectangleGeometry=ur,oh.RectangleGeometryLibrary=cr,oh.RectangleOutlineGeometry=hr,oh.ReferenceFrame=dr,oh.RequestErrorEvent=pr,oh.RuntimeError=mr,oh.ScreenSpaceEventHandler=fr,oh.ScreenSpaceEventType=vr,oh.ShowGeometryInstanceAttribute=gr,oh.Simon1994PlanetaryPositions=_r,oh.SimplePolylineGeometry=yr,oh.SphereGeometry=Cr,oh.SphereOutlineGeometry=wr,oh.Spherical=Sr,oh.Spline=Er,oh.TaskProcessor=br,oh.TerrainData=xr,oh.TerrainMesh=Tr,oh.TerrainProvider=Pr,oh.TileProviderError=Ar,oh.TilingScheme=Mr,oh.TimeConstants=Ir,oh.TimeInterval=Dr,oh.TimeIntervalCollection=Or,oh.TimeStandard=Rr,oh.Tipsify=Lr,oh.Transforms=Nr,oh.TridiagonalSystemSolver=Fr,oh.VRTheWorldTerrainProvider=Br,oh.VertexFormat=zr,oh.Visibility=Vr,oh.WallGeometry=kr,oh.WallGeometryLibrary=Ur,oh.WallOutlineGeometry=Wr,oh.WebMercatorProjection=Gr,oh.WebMercatorTilingScheme=Hr,oh.WindingOrder=qr,oh.appendForwardSlash=jr,oh.barycentricCoordinates=Yr,oh.binarySearch=Xr,oh.buildModuleUrl=Zr,oh.cancelAnimationFrame=Jr,oh.clone=Qr,oh.combine=Kr,oh.createGuid=$r,oh.defaultValue=ei,oh.defineProperties=ti,oh.defined=ri,oh.definedNotNull=ii,oh.deprecationWarning=ni,oh.destroyObject=oi,oh.formatError=ai,oh.freezeObject=si,oh.getFilenameFromUri=li,oh.getImagePixels=ui,oh.getTimestamp=ci,oh.isArray=hi,oh.isCrossOriginUrl=di,oh.isLeapYear=pi,oh.jsonp=mi,oh.loadArrayBuffer=fi,oh.loadBlob=vi,oh.loadImage=gi,oh.loadImageViaBlob=_i,oh.loadJson=yi,oh.loadText=Ci,oh.loadWithXhr=wi,oh.loadXML=Si,oh.mergeSort=Ei,oh.objectToQuery=bi,oh.parseResponseHeaders=xi,oh.pointInsideTriangle=Ti,oh.queryToObject=Pi,oh.requestAnimationFrame=Ai,oh.sampleTerrain=Mi,oh.subdivideArray=Ii,oh.throttleRequestByServer=Di,oh.wrapFunction=Oi,oh.writeTextToCanvas=Ri,oh.BillboardGraphics=Li,oh.BillboardVisualizer=Ni,oh.BoundingSphereState=Fi,oh.BoxGeometryUpdater=Bi,oh.BoxGraphics=zi,oh.CallbackProperty=Vi,oh.CheckerboardMaterialProperty=ki,oh.ColorMaterialProperty=Ui,oh.CompositeEntityCollection=Wi,oh.CompositeMaterialProperty=Gi,oh.CompositePositionProperty=Hi,oh.CompositeProperty=qi,oh.ConstantPositionProperty=ji,oh.ConstantProperty=Yi,oh.CorridorGeometryUpdater=Xi,oh.CorridorGraphics=Zi,oh.CustomDataSource=Ji,oh.CylinderGeometryUpdater=Qi,oh.CylinderGraphics=Ki,oh.CzmlDataSource=$i,oh.DataSource=en,oh.DataSourceClock=tn,oh.DataSourceCollection=rn,oh.DataSourceDisplay=nn,oh.DynamicGeometryUpdater=on,oh.EllipseGeometryUpdater=an,oh.EllipseGraphics=sn,oh.EllipsoidGeometryUpdater=ln,oh.EllipsoidGraphics=un,oh.Entity=cn,oh.EntityCollection=hn,oh.EntityView=dn,oh.GeoJsonDataSource=pn,oh.GeometryUpdater=mn,oh.GeometryVisualizer=fn,oh.GridMaterialProperty=vn,oh.ImageMaterialProperty=gn,oh.KmlDataSource=_n,oh.LabelGraphics=yn,oh.LabelVisualizer=Cn,oh.MaterialProperty=wn,oh.ModelGraphics=Sn,oh.ModelVisualizer=En,oh.PathGraphics=bn,oh.PathVisualizer=xn,oh.PointGraphics=Tn,oh.PointVisualizer=Pn,oh.PolygonGeometryUpdater=An,oh.PolygonGraphics=Mn,oh.PolylineArrowMaterialProperty=In,oh.PolylineGeometryUpdater=Dn,oh.PolylineGlowMaterialProperty=On,oh.PolylineGraphics=Rn,oh.PolylineOutlineMaterialProperty=Ln,oh.PolylineVolumeGeometryUpdater=Nn,oh.PolylineVolumeGraphics=Fn,oh.PositionProperty=Bn,oh.PositionPropertyArray=zn,oh.Property=Vn,oh.PropertyArray=kn,oh.RectangleGeometryUpdater=Un,oh.RectangleGraphics=Wn,oh.ReferenceProperty=Gn,oh.SampledPositionProperty=Hn,oh.SampledProperty=qn,oh.ScaledPositionProperty=jn,oh.StaticGeometryColorBatch=Yn,oh.StaticGeometryPerMaterialBatch=Xn,oh.StaticOutlineGeometryBatch=Zn,oh.StripeMaterialProperty=Jn,oh.StripeOrientation=Qn,oh.TimeIntervalCollectionPositionProperty=Kn,oh.TimeIntervalCollectionProperty=$n,oh.VelocityOrientationProperty=eo,oh.Visualizer=to,oh.WallGeometryUpdater=ro,oh.WallGraphics=io,oh.createMaterialPropertyDescriptor=no,oh.createPropertyDescriptor=oo,oh.createRawPropertyDescriptor=ao,oh.dynamicGeometryGetBoundingSphere=so,oh.AutomaticUniforms=lo,oh.Buffer=uo,oh.BufferUsage=co,oh.ClearCommand=ho,oh.Context=po,oh.CubeMap=mo,oh.CubeMapFace=fo,oh.DrawCommand=vo,oh.Framebuffer=go,oh.MipmapHint=_o,oh.PassState=yo,oh.PickFramebuffer=Co,oh.PixelDatatype=wo,oh.RenderState=So,oh.Renderbuffer=Eo,oh.RenderbufferFormat=bo,oh.ShaderCache=xo,oh.ShaderProgram=To,oh.ShaderSource=Po,oh.Texture=Ao,oh.TextureMagnificationFilter=Mo,oh.TextureMinificationFilter=Io,oh.TextureWrap=Do,oh.UniformState=Oo,oh.VertexArray=Ro,oh.VertexArrayFacade=Lo,oh.createUniform=No,oh.createUniformArray=Fo,oh.loadCubeMap=Bo,oh.Appearance=zo,oh.ArcGisMapServerImageryProvider=Vo,oh.Billboard=ko,oh.BillboardCollection=Uo,oh.BingMapsImageryProvider=Wo,oh.BingMapsStyle=Go,oh.BlendEquation=Ho,oh.BlendFunction=qo,oh.BlendingState=jo,oh.Camera=Yo,oh.CameraEventAggregator=Xo,oh.CameraEventType=Zo,oh.CameraFlightPath=Jo,oh.CreditDisplay=Qo,oh.CullFace=Ko,oh.CullingVolume=$o,oh.DebugAppearance=ea,oh.DebugModelMatrixPrimitive=ta,oh.DepthFunction=ra,oh.DiscardMissingTileImagePolicy=ia,oh.EllipsoidPrimitive=na,oh.EllipsoidSurfaceAppearance=oa,oh.FXAA=aa,oh.FrameRateMonitor=sa,oh.FrameState=la,oh.FrustumCommands=ua,oh.Globe=ca,oh.GlobeSurfaceShaderSet=ha,oh.GlobeSurfaceTile=da,oh.GlobeSurfaceTileProvider=pa,oh.GoogleEarthImageryProvider=ma,oh.GridImageryProvider=fa,oh.HeadingPitchRange=va,oh.HorizontalOrigin=ga,oh.Imagery=_a,oh.ImageryLayer=ya,oh.ImageryLayerCollection=Ca,oh.ImageryLayerFeatureInfo=wa,oh.ImageryProvider=Sa,oh.ImageryState=Ea,oh.Label=ba,oh.LabelCollection=xa,oh.LabelStyle=Ta,oh.Material=Pa,oh.MaterialAppearance=Aa,oh.Model=Ma,oh.ModelAnimation=Ia,oh.ModelAnimationCache=Da,oh.ModelAnimationCollection=Oa,oh.ModelAnimationLoop=Ra,oh.ModelAnimationState=La,oh.ModelMaterial=Na,oh.ModelMesh=Fa,oh.ModelNode=Ba,oh.Moon=za,oh.NeverTileDiscardPolicy=Va,oh.OIT=ka,oh.OpenStreetMapImageryProvider=Ua,oh.OrthographicFrustum=Wa,oh.Pass=Ga,oh.PerInstanceColorAppearance=Ha,oh.PerformanceDisplay=qa,oh.PerspectiveFrustum=ja,oh.PerspectiveOffCenterFrustum=Ya,oh.Polygon=Xa,oh.Polyline=Za,oh.PolylineCollection=Ja,oh.PolylineColorAppearance=Qa,oh.PolylineMaterialAppearance=Ka,oh.Primitive=$a,oh.PrimitiveCollection=es,oh.PrimitivePipeline=ts,oh.PrimitiveState=rs,oh.QuadtreeOccluders=is,oh.QuadtreePrimitive=ns,oh.QuadtreeTile=os,oh.QuadtreeTileLoadState=as,oh.QuadtreeTileProvider=ss,oh.RectanglePrimitive=ls,oh.Scene=us,oh.SceneMode=cs,oh.SceneTransforms=hs,oh.SceneTransitioner=ds,oh.ScreenSpaceCameraController=ps,oh.SingleTileImageryProvider=ms,oh.SkyAtmosphere=fs,oh.SkyBox=vs,oh.StencilFunction=gs,oh.StencilOperation=_s,oh.Sun=ys,oh.SunPostProcess=Cs,oh.TerrainState=ws,oh.TextureAtlas=Ss,oh.TileCoordinatesImageryProvider=Es,oh.TileDiscardPolicy=bs,oh.TileImagery=xs,oh.TileMapServiceImageryProvider=Ts,oh.TileReplacementQueue=Ps,oh.TileState=As,oh.TileTerrain=Ms,oh.TweenCollection=Is,oh.VerticalOrigin=Ds,oh.ViewportQuad=Os,oh.WebMapServiceImageryProvider=Rs,oh.WebMapTileServiceImageryProvider=Ls,oh.createTangentSpaceDebugPrimitive=Ns,oh.getModelAccessor=Fs,oh.terrainAttributeLocations=Bs,oh._shaders.AdjustTranslucentFS=zs,oh._shaders.AllMaterialAppearanceFS=Vs,oh._shaders.AllMaterialAppearanceVS=ks,oh._shaders.BasicMaterialAppearanceFS=Us,oh._shaders.BasicMaterialAppearanceVS=Ws,oh._shaders.EllipsoidSurfaceAppearanceFS=Gs,oh._shaders.EllipsoidSurfaceAppearanceVS=Hs,oh._shaders.PerInstanceColorAppearanceFS=qs,oh._shaders.PerInstanceColorAppearanceVS=js,oh._shaders.PerInstanceFlatColorAppearanceFS=Ys,oh._shaders.PerInstanceFlatColorAppearanceVS=Xs,oh._shaders.PolylineColorAppearanceVS=Zs,oh._shaders.PolylineMaterialAppearanceVS=Js,oh._shaders.TexturedMaterialAppearanceFS=Qs,oh._shaders.TexturedMaterialAppearanceVS=Ks,oh._shaders.BillboardCollectionFS=$s,oh._shaders.BillboardCollectionVS=el,oh._shaders.degreesPerRadian=tl,oh._shaders.depthRange=rl,oh._shaders.epsilon1=il,oh._shaders.epsilon2=nl,oh._shaders.epsilon3=ol,oh._shaders.epsilon4=al,oh._shaders.epsilon5=sl,oh._shaders.epsilon6=ll,oh._shaders.epsilon7=ul,oh._shaders.infinity=cl,oh._shaders.oneOverPi=hl,oh._shaders.oneOverTwoPi=dl,oh._shaders.pi=pl,oh._shaders.piOverFour=ml,oh._shaders.piOverSix=fl,oh._shaders.piOverThree=vl,oh._shaders.piOverTwo=gl,oh._shaders.radiansPerDegree=_l,oh._shaders.sceneMode2D=yl,oh._shaders.sceneMode3D=Cl,oh._shaders.sceneModeColumbusView=wl,oh._shaders.sceneModeMorphing=Sl,oh._shaders.solarRadius=El,oh._shaders.threePiOver2=bl,oh._shaders.twoPi=xl,oh._shaders.webMercatorMaxLatitude=Tl,oh._shaders.CzmBuiltins=Pl,oh._shaders.RGBToXYZ=Al,oh._shaders.XYZToRGB=Ml,oh._shaders.alphaWeight=Il,oh._shaders.antialias=Dl,oh._shaders.columbusViewMorph=Ol,oh._shaders.computePosition=Rl,oh._shaders.cosineAndSine=Ll,oh._shaders.decompressTextureCoordinates=Nl,oh._shaders.eastNorthUpToEyeCoordinates=Fl,oh._shaders.ellipsoidContainsPoint=Bl,oh._shaders.ellipsoidNew=zl,oh._shaders.ellipsoidWgs84TextureCoordinates=Vl,oh._shaders.equalsEpsilon=kl,oh._shaders.eyeOffset=Ul,oh._shaders.eyeToWindowCoordinates=Wl,oh._shaders.geodeticSurfaceNormal=Gl,oh._shaders.getDefaultMaterial=Hl,oh._shaders.getLambertDiffuse=ql,oh._shaders.getSpecular=jl,oh._shaders.getWaterNoise=Yl,oh._shaders.getWgs84EllipsoidEC=Xl,oh._shaders.hue=Zl,oh._shaders.isEmpty=Jl,oh._shaders.isFull=Ql,oh._shaders.latitudeToWebMercatorFraction=Kl,oh._shaders.luminance=$l,oh._shaders.modelToWindowCoordinates=eu,oh._shaders.multiplyWithColorBalance=tu,oh._shaders.octDecode=ru,oh._shaders.phong=iu,oh._shaders.pointAlongRay=nu,oh._shaders.rayEllipsoidIntersectionInterval=ou,oh._shaders.saturation=au,oh._shaders.signNotZero=su,oh._shaders.tangentToEyeSpaceMatrix=lu,oh._shaders.translateRelativeToEye=uu,oh._shaders.translucentPhong=cu,oh._shaders.transpose=hu,oh._shaders.windowToEyeCoordinates=du,oh._shaders.depthRangeStruct=pu,oh._shaders.ellipsoid=mu,oh._shaders.material=fu,oh._shaders.materialInput=vu,oh._shaders.ray=gu,oh._shaders.raySegment=_u,oh._shaders.CompositeOITFS=yu,oh._shaders.EllipsoidFS=Cu,oh._shaders.EllipsoidVS=wu,oh._shaders.GlobeFS=Su,oh._shaders.GlobeFSDepth=Eu,oh._shaders.GlobeFSPole=bu,oh._shaders.GlobeVS=xu,oh._shaders.GlobeVSDepth=Tu,oh._shaders.GlobeVSPole=Pu,oh._shaders.BumpMapMaterial=Au,oh._shaders.CheckerboardMaterial=Mu,oh._shaders.DotMaterial=Iu,oh._shaders.FadeMaterial=Du,oh._shaders.GridMaterial=Ou,oh._shaders.NormalMapMaterial=Ru,oh._shaders.PolylineArrowMaterial=Lu,oh._shaders.PolylineGlowMaterial=Nu,oh._shaders.PolylineOutlineMaterial=Fu,oh._shaders.RimLightingMaterial=Bu,oh._shaders.StripeMaterial=zu,oh._shaders.Water=Vu,oh._shaders.PolylineCommon=ku,oh._shaders.PolylineFS=Uu,oh._shaders.PolylineVS=Wu,oh._shaders.AdditiveBlend=Gu,oh._shaders.BrightPass=Hu,oh._shaders.FXAA=qu,oh._shaders.GaussianBlur1D=ju,oh._shaders.PassThrough=Yu,oh._shaders.ReprojectWebMercatorFS=Xu,oh._shaders.ReprojectWebMercatorVS=Zu,oh._shaders.SkyAtmosphereFS=Ju,oh._shaders.SkyAtmosphereVS=Qu,oh._shaders.SkyBoxFS=Ku,oh._shaders.SkyBoxVS=$u,oh._shaders.SunFS=ec,oh._shaders.SunTextureFS=tc,oh._shaders.SunVS=rc,oh._shaders.ViewportQuadFS=ic,oh._shaders.ViewportQuadVS=nc,oh.Autolinker=oc,oh.Tween=ac,oh.Uri=sc,oh.gltfDefaults=lc,oh["knockout-3.2.0"]=uc,oh["knockout-es5"]=cc,oh.knockout=hc,oh.measureText=dc,oh["mersenne-twister"]=pc,oh.sprintf=mc,oh.topojson=fc,oh.when=vc,oh.zip=gc,oh.Animation=_c,oh.AnimationViewModel=yc,oh.BaseLayerPicker=Cc,oh.BaseLayerPickerViewModel=wc,oh.ProviderViewModel=Sc,oh.createDefaultImageryProviderViewModels=Ec,oh.createDefaultTerrainProviderViewModels=bc,oh.CesiumInspector=xc,oh.CesiumInspectorViewModel=Tc,oh.CesiumWidget=Pc,oh.ClockViewModel=Ac,oh.Command=Mc,oh.FullscreenButton=Ic,oh.FullscreenButtonViewModel=Dc,oh.Geocoder=Oc,oh.GeocoderViewModel=Rc,oh.HomeButton=Lc,oh.HomeButtonViewModel=Nc,oh.InfoBox=Fc,oh.InfoBoxViewModel=Bc,oh.NavigationHelpButton=zc,oh.NavigationHelpButtonViewModel=Vc,oh.PerformanceWatchdog=kc,oh.PerformanceWatchdogViewModel=Uc,oh.SceneModePicker=Wc,oh.SceneModePickerViewModel=Gc,oh.SelectionIndicator=Hc,oh.SelectionIndicatorViewModel=qc,oh.SvgPathBindingHandler=jc,oh.Timeline=Yc,oh.TimelineHighlightRange=Xc,oh.TimelineTrack=Zc,oh.ToggleButtonViewModel=Jc,oh.Viewer=Qc,oh.viewerCesiumInspectorMixin=Kc,oh.viewerDragDropMixin=$c,oh.viewerPerformanceWatchdogMixin=eh,oh.createCommand=th,oh.getElement=rh,oh.subscribeAndEvaluate=ih,oh.createTaskProcessorWorker=nh,oh}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}();