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

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

/**
  @license
  when.js - https://github.com/cujojs/when

  MIT License (c) copyright B Cavalier & J Hann

 * A lightweight CommonJS Promises/A and when() implementation
 * when is part of the cujo.js family of libraries (http://cujojs.com/)
 *
 * Licensed under the MIT License at:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * @version 1.7.1
 */

/**
@license
sprintf.js from the php.js project - https://github.com/kvz/phpjs
Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js

php.js is copyright 2012 Kevin van Zonneveld.

Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas
Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev
Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa,
Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick
(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann,
Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R.
L. Rodrigues (http://www.jsfromhell.com), Ash Searle
(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek,
Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny
Mast (http://www.phpvrouwen.nl), T.Wild, d3x,
http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo
(http://webdevhobo.blogspot.com/), marrtins, GeekFG
(http://geekfg.blogspot.com), Andrea Giammarchi
(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net),
gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg
Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser
(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
Marc Palau, Martin
(http://www.erlenwiese.de/), Breaking Par Consulting Inc
(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
Chris, Mirek Slugen, saulius, Alfonso Jimenez
(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix,
Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio
Ariede (http://caioariede.com), Robin, Kankrelune
(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata
(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer,
Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ,
David, Aman Gupta, Michael White, Public Domain
(http://www.json.org/json2.js), Steven Levithan
(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada,
Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018),
Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon
(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/),
Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank
Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov
(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford
(http://javascript.crockford.com), madipta, Slawomir Kaniecki,
ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner
(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix,
Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick
(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan,
Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt
(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb,
josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren
Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon
(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX
(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH,
Stoyan Kyosev (http://www.svest.org/), nord_ua, omid
(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc
(http://yass.meetcweb.com), Peter-Paul Koch
(http://www.quirksmode.org/js/beat.html), Olivier Louvignes
(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami,
Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith,
vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair
Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger
(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner
B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna,
Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni,
Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke
(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski,
Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke
Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet,
sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen,
Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya
(http://www.premasolutions.com/), Philippe Jausions
(http://pear.php.net/user/jausions), Aidan Lister
(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp,
strcmp, Taras Bogach, jpfle, Alexander Ermolaev
(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando,
dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha
(http://www.pedrotainha.com), James, Arnout Kazemier
(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo,
FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan
Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook,
daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan
W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage
(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo,
Billy, stensi, Cord, Manish, T.J. Leahy, Riddler
(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt
Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo
Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi
(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem,
Russell Walker (http://www.nbill.co.uk/), Jamie Beck
(http://www.terabit.ca/), setcookie, Michael, YUI Library:
http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
http://hacks.bluesmoon.info/strftime/strftime.js, Ben
(http://benblume.co.uk/), DtTvB
(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William,
meo, incidence, Cagri Ekin, Amirouche, Amir Habibi
(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name),
Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani,
Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben
Bryan

Licensed under the MIT (MIT-LICENSE.txt) license.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/

// Copyright 2012 Google Inc., Apache 2.0 license.

/**
@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.17.1
 *
 * 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.
 */

/**
 * @licence
 *
 * crunch/crnlib v1.04 - Advanced DXTn texture compression library
 * Copyright (C) 2010-2016 Richard Geldreich, Jr. and Binomial LLC http://binomial.info
 */

/**
 * @license
 *
 * crunch_lib.cpp
 *
 * Copyright (c) 2013, Evan Parker, Brandon Jones. 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.
 *
 * 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 HOLDER 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.
 */

/*!
 * Knockout JavaScript library v3.4.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
 */

/**
 * @license
 * NoSleep.js v0.5.0 - git.io/vfn01
 * Rich Tibbett
 * MIT license
 **/

!function(){var requirejs,require,define;!function(e){function t(e,t){return v.call(e,t)}function i(e,t){var i,r,n,o,a,s,l,u,c,d,h,p,f=t&&t.split("/"),m=_.map,g=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,_.nodeIdCompat&&C.test(e[a])&&(e[a]=e[a].replace(C,"")),"."===e[0].charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),c=0;c<e.length;c++)if(h=e[c],"."===h)e.splice(c,1),c-=1;else if(".."===h){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((f||g)&&m){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),f)for(d=f.length;d>0;d-=1)if(n=m[f.slice(0,d).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&g&&g[r]&&(l=g[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function r(t,i){return function(){var r=y.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),d.apply(e,r.concat([t,i]))}}function n(e){return function(t){return i(t,e)}}function o(e){return function(t){f[e]=t}}function a(i){if(t(m,i)){var r=m[i];delete m[i],g[i]=!0,c.apply(e,r)}if(!t(f,i)&&!t(g,i))throw new Error("No "+i);return f[i]}function s(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function l(e){return e?s(e):[]}function u(e){return function(){return _&&_.config&&_.config[e]||{}}}var c,d,h,p,f={},m={},_={},g={},v=Object.prototype.hasOwnProperty,y=[].slice,C=/\.js$/;h=function(e,t){var r,o=s(e),l=o[0],u=t[1];return e=o[1],l&&(l=i(l,u),r=a(l)),l?e=r&&r.normalize?r.normalize(e,n(u)):i(e,u):(e=i(e,u),o=s(e),l=o[0],e=o[1],l&&(r=a(l))),{f:l?l+"!"+e:e,n:e,pr:l,p:r}},p={require:function(e){return r(e)},exports:function(e){var t=f[e];return"undefined"!=typeof t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:u(e)}}},c=function(i,n,s,u){var c,d,_,v,y,C,w,S=[],E=typeof s;if(u=u||i,C=l(u),"undefined"===E||"function"===E){for(n=!n.length&&s.length?["require","exports","module"]:n,y=0;y<n.length;y+=1)if(v=h(n[y],C),d=v.f,"require"===d)S[y]=p.require(i);else if("exports"===d)S[y]=p.exports(i),w=!0;else if("module"===d)c=S[y]=p.module(i);else if(t(f,d)||t(m,d)||t(g,d))S[y]=a(d);else{if(!v.p)throw new Error(i+" missing "+d);v.p.load(v.n,r(u,!0),o(d),{}),S[y]=f[d]}_=s?s.apply(f[i],S):void 0,i&&(c&&c.exports!==e&&c.exports!==f[i]?f[i]=c.exports:_===e&&w||(f[i]=_))}else i&&(f[i]=s)},requirejs=require=d=function(t,i,r,n,o){if("string"==typeof t)return p[t]?p[t](i):a(h(t,l(i)).f);if(!t.splice){if(_=t,_.deps&&d(_.deps,_.callback),!i)return;i.splice?(t=i,i=r,r=null):t=e}return i=i||function(){},"function"==typeof r&&(r=n,n=o),n?c(e,t,i,r):setTimeout(function(){c(e,t,i,r)},4),d},d.config=function(e){return d(e)},requirejs._defined=f,define=function(e,i,r){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");i.splice||(r=i,i=[]),t(f,e)||t(m,e)||(m[e]=[e,i,r])},define.amd={jQuery:!0}}(),define("Core/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^e>>>1^t[1&e];for(;i<this.N-1;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,i){return i=t(i,255),Math.round((.5*n.clamp(e,-1,1)+.5)*i)},n.fromSNorm=function(e,i){return i=t(i,255),n.clamp(e,0,i)/i*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)<n.EPSILON14&&Math.abs(e)>n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;r<=e;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return e<t?t:e>i?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,r,n){if(t(i)){n=e(n,!1);var a=i.length;if(a<2)return i;var s,l,u;for(s=1;s<a&&(l=i[s-1],u=i[s],!r(l,u,o));++s);if(s===a)return n&&r(i[0],i[i.length-1],o)?i.slice(1):i;for(var c=i.slice(0,s);s<a;++s)u=i[s],r(l,u,o)||(c.push(u),l=u);return n&&c.length>1&&r(c[0],c[c.length-1],o)&&c.shift(),c}}var o=r.EPSILON10;return n}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return t&&e(i)||(i=function(e){return e}),i}),define("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e){return e+" is required, actual value was undefined"}function r(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}var n={};return n.typeOf={},n.defined=function(r,n){if(!e(n))throw new t(i(r))},n.typeOf.func=function(e,i){if("function"!=typeof i)throw new t(r(typeof i,"function",e))},n.typeOf.string=function(e,i){if("string"!=typeof i)throw new t(r(typeof i,"string",e))},n.typeOf.number=function(e,i){if("number"!=typeof i)throw new t(r(typeof i,"number",e))},n.typeOf.number.lessThan=function(e,i,r){if(n.typeOf.number(e,i),i>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+i)},n.typeOf.number.lessThanOrEquals=function(e,i,r){if(n.typeOf.number(e,i),i>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+i)},n.typeOf.number.greaterThan=function(e,i,r){if(n.typeOf.number(e,i),i<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+i)},n.typeOf.number.greaterThanOrEquals=function(e,i,r){if(n.typeOf.number(e,i),i<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+i)},n.typeOf.object=function(e,i){if("object"!=typeof i)throw new t(r(typeof i,"object",e))},n.typeOf.bool=function(e,i){if("boolean"!=typeof i)throw new t(r(typeof i,"boolean",e))},n}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i){this.x=t(e,0),this.y=t(i,0)}a.fromElements=function(e,t,r){return i(r)?(r.x=e,r.y=t,r):new a(e,t)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r]=e.y,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=2*r:t=new Array(2*r);for(var n=0;n<r;++n)a.pack(e[n],t,2*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/2:t=new Array(r/2);for(var n=0;n<r;n+=2){var o=n/2;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,u),a.normalize(t,c),o.acosClamped(a.dot(u,c))};var d=new a;return a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,d);return a.abs(i,i),t=i.x<=i.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,n)},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0)}a.fromSpherical=function(e,r){i(r)||(r=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(o),r},a.fromElements=function(e,t,r,n){return i(n)?(n.x=e,n.y=t,n.z=r,n):new a(e,t,r)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r]=e.z,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=3*r:t=new Array(3*r);for(var n=0;n<r;++n)a.pack(e[n],t,3*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/3:t=new Array(r/3);for(var n=0;n<r;n+=3){var o=n/3;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,u),a.normalize(t,c);var i=a.dot(u,c),r=a.magnitude(a.cross(u,c,u));return Math.atan2(r,i)};var d=new a;a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,d);return a.abs(i,i),t=i.x<=i.y?i.x<=i.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):i.y<=i.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,n)&&o.equalsEpsilon(e.z,t.z,r,n)},a.cross=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,d=r*s-n*a;return i.x=u,i.y=c,i.z=d,i},a.fromDegrees=function(e,t,i,r,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,i,r,n)};var h=new a,p=new a,f=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(e,r,n,o,s){n=t(n,0);var l=i(o)?o.radiiSquared:f,u=Math.cos(r);h.x=u*Math.cos(e),h.y=u*Math.sin(e),h.z=Math.sin(r),h=a.normalize(h,h),a.multiplyComponents(l,h,p);var c=Math.sqrt(a.dot(h,p));return p=a.divideByScalar(p,c,p),h=a.multiplyByScalar(h,n,h),i(s)||(s=new a),a.add(p,h,s)},a.fromDegreesArray=function(e,t,r){var n=e.length;i(r)?r.length=n/2:r=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;r[u]=a.fromDegrees(s,l,0,t,r[u])}return r},a.fromRadiansArray=function(e,t,r){var n=e.length;i(r)?r.length=n/2:r=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;r[u]=a.fromRadians(s,l,0,t,r[u])}return r},a.fromDegreesArrayHeights=function(e,t,r){var n=e.length;i(r)?r.length=n/3:r=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;r[c]=a.fromDegrees(s,l,u,t,r[c])}return r},a.fromRadiansArrayHeights=function(e,t,r){var n=e.length;i(r)?r.length=n/3:r=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;r[c]=a.fromRadians(s,l,u,t,r[c])}return r},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncodeInRange=function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=i.x,o=i.y;i.x=(1-Math.abs(o))*n.signNotZero(r),i.y=(1-Math.abs(r))*n.signNotZero(o)}return i.x=n.toSNorm(i.x,t),i.y=n.toSNorm(i.y,t),i},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,i,r,o){if(o.x=n.fromSNorm(e,r),o.y=n.fromSNorm(i,r),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){var a=o.x;o.x=(1-Math.abs(o.y))*n.signNotZero(a),o.y=(1-Math.abs(a))*n.signNotZero(o.y)}return t.normalize(o,o)},o.octDecode=function(e,t,i){return o.octDecodeInRange(e,t,255,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,d=t.length,h=1;h<d;h++){var p=t[h],f=p.x,m=p.y,_=p.z;n=Math.min(f,n),l=Math.max(f,l),a=Math.min(m,a),u=Math.max(m,u),s=Math.min(_,s),c=Math.max(_,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var v=r.maximum;v.x=l,v.y=u,v.z=c;var y=e.add(g,v,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){if(i(t))return i(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new o(t.minimum,t.maximum)},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,i){a=e.subtract(t.maximum,t.minimum,a);var r=e.multiplyByScalar(a,.5,a),o=i.normal,s=r.x*Math.abs(o.x)+r.y*Math.abs(o.y)+r.z*Math.abs(o.z),l=e.dot(t.center,o)+i.distance;return l-s>0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var d,h,p,f,m,_,g,v;i(n.z)?(d=t.subtract(l,n,o),h=t.subtract(u,n,a),p=t.subtract(r,n,s),f=t.dot(d,d),m=t.dot(d,h),_=t.dot(d,p),g=t.dot(h,h),v=t.dot(h,p)):(d=e.subtract(l,n,o),h=e.subtract(u,n,a),p=e.subtract(r,n,s),f=e.dot(d,d),m=e.dot(d,h),_=e.dot(d,p),g=e.dot(h,h),v=e.dot(h,p));var y=1/(f*g-m*m);return c.y=(g*_-m*v)*y,c.z=(f*v-m*_)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;o<=a;)if(r=~~((o+a)/2),n=i(e[r],t),n<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),define("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){var a=e(r),s=e(i),l=e(t);l||s||(t=r),this._text=t,this._imageUrl=i,this._link=r,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,i,r]);e(o[c])?u=o[c]:(u=n++,o[c]=u),this._id=u}var n=0,o={};return t(r.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),r.prototype.hasImage=function(){return this._hasImage},r.prototype.hasLink=function(){return this._hasLink},r.equals=function(t,i){return t===i||e(t)&&e(i)&&t._id===i._id},r.prototype.equals=function(e){return r.equals(this,e)},r}),define("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultKey=void 0;var r,n=!1,o="This application is using Cesium's default Bing Maps key.  Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return i.getKey=function(e){return t(e)?e:t(i.defaultKey)?i.defaultKey:(n||(console.log(o),n=!0),"AudaMP3YocqmIOQrFAValZ9d_tFqS4JWwiSEnvt2jwP5lizGzV_mJxLaKaI0fWRT")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultKey))return t(r)||(r=new e(o)),r},i}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,i,r,n){return t(e).then(i,r,n)}function t(e){var t,i;return e instanceof r?t=e:s(e)?(i=a(),e.then(function(e){i.resolve(e)},function(e){i.reject(e)},function(e){i.progress(e)}),t=i.promise):t=n(e),t}function i(t){return e(t,o)}function r(e){this.then=e}function n(e){var i=new r(function(i){try{return t(i?i(e):e)}catch(e){return o(e)}});return i}function o(e){var i=new r(function(i,r){try{return r?t(r(e)):o(e)}catch(e){return o(e)}});return i}function a(){function e(e,t,i){return h(e,t,i)}function i(e){return f(e)}function n(e){return f(o(e))}function s(e){return p(e)}var l,u,c,d,h,p,f;return u=new r(e),l={then:e,resolve:i,reject:n,progress:s,promise:u,resolver:{resolve:i,reject:n,progress:s}},c=[],d=[],h=function(e,t,i){var r,n;return r=a(),n="function"==typeof i?function(e){try{r.progress(i(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},c.push(function(i){i.then(e,t).then(r.resolve,r.reject,n)}),d.push(n),r.promise},p=function(e){return m(d,e),e},f=function(e){return e=t(e),h=e.then,f=t,p=g,m(c,e),d=c=w,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,i,r,n,o){return _(2,arguments),e(t,function(t){function s(e){m(e)}function l(e){f(e)}var u,c,d,h,p,f,m,_,v,y;if(v=t.length>>>0,u=Math.max(0,Math.min(i,v)),d=[],c=v-u+1,h=[],p=a(),u)for(_=p.progress,m=function(e){h.push(e),--c||(f=m=g,p.reject(h))},f=function(e){d.push(e),--u||(f=m=g,p.resolve(d))},y=0;y<v;++y)y in t&&e(t[y],l,s,_);else p.resolve(d);return p.then(r,n,o)})}function u(e,t,i,r){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,i,r)}function c(e,t,i,r){return _(1,arguments),h(e,v).then(t,i,r)}function d(){return h(arguments,v)}function h(t,i){return e(t,function(t){var r,n,o,s,l,u;if(o=n=t.length>>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;l<n;l++)l in t?s(t[l],l):--o;else u.resolve(r);return u.promise})}function p(t,i){var r=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,r[0]=function(t,r,o){return e(t,function(t){return e(r,function(e){return i(t,e,o,n)})})},y.apply(t,r)})}function f(t,i,r){var n=arguments.length>2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function m(e,t){for(var i,r=0;i=e[r++];)i(t)}function _(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=i,e.join=d,e.all=c,e.map=h,e.reduce=p,e.any=u,e.some=l,e.chain=f,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(w,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;o<n;++o)o in t&&(r=e(r,t[o],o,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),d=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],d&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(d)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(i(n))for(var a=0,s=n.length;a<s;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return r}),define("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(t){var r={};if(""===t)return r;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;o<a;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=r[l];"string"==typeof c?r[l]=[c,u]:i(c)?c.push(u):r[l]=u}return r}return r}),define("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,i,r,n,o,a,s){"use strict";function l(o,u){u=r(u,r.EMPTY_OBJECT);var c;do c="loadJsonp"+Math.random().toString().substring(2,8);while(n(window[c]));var d=t.defer();window[c]=function(e){d.resolve(e);try{delete window[c]}catch(e){window[c]=void 0}};var h=new e(o),p=s(r(h.query,""));n(u.parameters)&&(p=i(u.parameters,p));var f=r(u.callbackParameterName,"callback");
p[f]=c,h.query=a(p),o=h.toString();var m=u.proxy;return n(m)&&(o=m.getURL(o)),l.loadAndExecuteScript(o,c,d),d.promise}return l.loadAndExecuteScript=function(e,t,i){var r=document.createElement("script");r.async=!0,r.src=e;var n=document.getElementsByTagName("head")[0];r.onload=function(){r.onload=void 0,n.removeChild(r)},r.onerror=function(e){i.reject(e)},n.appendChild(r)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,n,s,l,u){var c=i.x,d=i.y,h=i.z,p=n.x,f=n.y,m=n.z,_=c*c*p*p,g=d*d*f*f,v=h*h*m*m,y=_+g+v,C=Math.sqrt(1/y),w=e.multiplyByScalar(i,C,o);if(y<l)return isFinite(C)?e.clone(w,u):void 0;var S=s.x,E=s.y,b=s.z,T=a;T.x=w.x*S*2,T.y=w.y*E*2,T.z=w.z*b*2;var x,A,P,D,M,I,R,O,N,L,B,F=(1-C)*e.magnitude(i)/(.5*e.magnitude(T)),k=0;do{F-=k,P=1/(1+F*S),D=1/(1+F*E),M=1/(1+F*b),I=P*P,R=D*D,O=M*M,N=I*P,L=R*D,B=O*M,x=_*I+g*R+v*O-1,A=_*N*S+g*L*E+v*B*b;var V=-2*A;k=x/V}while(Math.abs(x)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=d*D,u.z=h*M,u):new e(c*P,d*D,h*M)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var f=i(r)?r.oneOverRadii:d,m=i(r)?r.oneOverRadiiSquared:h,_=i(r)?r._centerToleranceSquared:p,g=a(t,f,m,_,u);if(i(g)){var v=e.multiplyComponents(g,m,l);v=e.normalize(v,v);var y=e.subtract(t,g,c),C=Math.atan2(v.y,v.x),w=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=w,n.height=S,n):new s(C,w,S)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,u(this,e,t,i)}n(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var d=new e,h=new e;c.prototype.cartographicToCartesian=function(t,i){var n=d,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),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n<i;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var p=new e,f=new e,m=new e;return c.prototype.cartesianToCartographic=function(i,n){var o=this.scaleToGeodeticSurface(i,f);if(r(o)){var a=this.geodeticSurfaceNormal(o,p),l=e.subtract(i,o,m),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),d=s.sign(e.dot(l,i))*e.magnitude(l);return r(n)?(n.longitude=u,n.latitude=c,n.height=d,n):new t(u,c,d)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n<i;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,i){r(i)||(i=new e);var n=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(n*n*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,i)},c.prototype.transformPositionToScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._oneOverRadii,i)},c.prototype.transformPositionFromScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._radii,i)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,o){n=i(n,0);var a=this._sqauredXOverSquaredZ;if(r(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=this._radii.z-n))return o},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.west=i(e,0),this.south=i(t,0),this.east=i(r,0),this.north=i(n,0)}n(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},l.computeWidth=function(e){var t=e.east,i=e.west;return t<i&&(t+=s.TWO_PI),t-i},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,t,n,o,a){return e=s.toRadians(i(e,0)),t=s.toRadians(i(t,0)),n=s.toRadians(i(n,0)),o=s.toRadians(i(o,0)),r(a)?(a.west=e,a.south=t,a.east=n,a.north=o,a):new l(e,t,n,o)},l.fromRadians=function(e,t,n,o,a){return r(a)?(a.west=i(e,0),a.south=i(t,0),a.east=i(n,0),a.north=i(o,0),a):new l(e,t,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,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var p=e[d];i=Math.min(i,p.longitude),n=Math.max(n,p.longitude),u=Math.min(u,p.latitude),c=Math.max(c,p.latitude);var f=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}return n-i>a-o&&(i=o,n=a,n>s.PI&&(n-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(t)?(t.west=i,t.south=u,t.east=n,t.north=c,t):new l(i,u,n,c)},l.fromCartesianArray=function(e,t,i){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0,p=e.length;h<p;h++){var f=t.cartesianToCartographic(e[h]);n=Math.min(n,f.longitude),o=Math.max(o,f.longitude),c=Math.min(c,f.latitude),d=Math.max(d,f.latitude);var m=f.longitude>=0?f.longitude:f.longitude+s.TWO_PI;a=Math.min(a,m),u=Math.max(u,m)}return o-n>u-a&&(n=a,o=u,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(i)?(i.west=n,i.south=c,i.east=o,i.north=d,i):new l(n,c,o,d)},l.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||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(e){},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;n<o&&(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;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),d=s.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&d<=c)){var h=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(h>=p))return r(i)?(i.west=c,i.south=h,i.east=d,i.north=p,i):new l(c,h,d,p)}},l.simpleIntersection=function(e,t,i){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return r(i)?(i.west=n,i.south=o,i.east=a,i.north=s,i):new l(n,o,a,s)},l.union=function(e,t,i){r(i)||(i=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(o,u)),d=s.convertLongitudeRange(Math.max(n,a));return i.west=c,i.south=Math.min(e.south,t.south),i.east=d,i.north=Math.max(e.north,t.north),i},l.expand=function(e,t,i){return r(i)||(i=new l),i.west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},l.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return o<n&&(o+=s.TWO_PI,i<0&&(i+=s.TWO_PI)),(i>n||s.equalsEpsilon(i,n,s.EPSILON14))&&(i<o||s.equalsEpsilon(i,o,s.EPSILON14))&&r>=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,t,n,a){t=i(t,o.WGS84),n=i(n,0),r(a)||(a=[]);var c=0,d=e.north,h=e.south,p=e.east,f=e.west,m=u;m.height=n,m.longitude=f,m.latitude=d,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=h,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,d<0?m.latitude=d:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*s.PI_OVER_TWO,l.contains(e,m)&&(a[c]=t.cartographicToCartesian(m,a[c]),c++);return 0===m.latitude&&(m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,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}),define("Core/BingMapsGeocoderService",["./BingMapsApi","./defaultValue","./defined","./defineProperties","./DeveloperError","./loadJsonp","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.key;if(this._key=e.getKey(n),i(n)){var o=e.getErrorCredit(n);i(o)&&r.scene._frameState.creditDisplay.addDefaultCredit(o)}}var l="https://dev.virtualearth.net/REST/v1/Locations";return r(s.prototype,{url:{get:function(){return l}},key:{get:function(){return this._key}}}),s.prototype.geocode=function(e){var t=this.key,i=o(l,{parameters:{query:e,key:t},callbackParameterName:"jsonp"});return i.then(function(e){if(0===e.resourceSets.length)return[];var t=e.resourceSets[0].resources;return t.map(function(e){var t=e.bbox,i=t[0],r=t[1],n=t[2],o=t[3];return{displayName:e.name,destination:a.fromDegrees(r,i,o,n)}})})},s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},s.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i,n){this.x=r(e,0),this.y=r(t,0),this.width=r(i,0),this.height=r(n,0)}l.packedLength=4,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.width,t[i]=e.height,t},l.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new l),i.x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},l.fromPoints=function(e,t){if(n(t)||(t=new l),!n(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,r=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;u<i;u++){var c=e[u],d=c.x,h=c.y;r=Math.min(d,r),a=Math.max(d,a),o=Math.min(h,o),s=Math.max(h,s)}return t.x=r,t.y=o,t.width=a-r,t.height=s-o,t};var u=new o,c=new t,d=new t;return l.fromRectangle=function(t,i,o){if(n(o)||(o=new l),!n(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;i=r(i,u);var a=i.project(s.southwest(t,c)),h=i.project(s.northeast(t,d));return e.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height)},l.union=function(e,t,i){n(i)||(i=new l);var r=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return i.x=r,i.y=o,i.width=a-r,i.height=s-o,i},l.expand=function(e,t,i){i=l.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.width<n||r+e.height<o||r>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n,o,a,s,l,u){this[0]=i(e,0),this[1]=i(n,0),this[2]=i(s,0),this[3]=i(t,0),this[4]=i(o,0),this[5]=i(l,0),this[6]=i(r,0),this[7]=i(a,0),this[8]=i(u,0)}function u(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,i=0;i<3;++i){var r=e[l.getElementIndex(m[i],f[i])];t+=2*r*r}return Math.sqrt(t)}function d(e,t){for(var i=s.EPSILON15,r=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(m[o],f[o])]);a>r&&(n=o,r=a)}var u=1,c=0,d=f[n],h=m[n];if(Math.abs(e[l.getElementIndex(h,d)])>i){var p,_=e[l.getElementIndex(h,h)],g=e[l.getElementIndex(d,d)],v=e[l.getElementIndex(h,d)],y=(_-g)/2/v;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(d,d)]=t[l.getElementIndex(h,h)]=u,t[l.getElementIndex(h,d)]=c,t[l.getElementIndex(d,h)]=-c,t}l.packedLength=9,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},l.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.fromQuaternion=function(e,t){var i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,d=e.z*e.z,h=e.z*e.w,p=e.w*e.w,f=i-s-d+p,m=2*(n-h),_=2*(o+c),g=2*(n+h),v=-i+s-d+p,y=2*(u-a),C=2*(o-c),w=2*(u+a),S=-i-s+d+p;return r(t)?(t[0]=f,t[1]=g,t[2]=C,t[3]=m,t[4]=v,t[5]=w,t[6]=_,t[7]=y,t[8]=S,t):new l(f,m,_,g,v,y,C,w,S)},l.fromHeadingPitchRoll=function(e,t){var i=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=i*n,d=-o*s+u*a*n,h=u*s+o*a*n,p=i*s,f=o*n+u*a*s,m=-a*o+o*a*s,_=-a,g=u*i,v=o*i;return r(t)?(t[0]=c,t[1]=p,t[2]=_,t[3]=d,t[4]=f,t[5]=g,t[6]=h,t[7]=m,t[8]=v,t):new l(c,d,h,p,f,m,_,g,v)},l.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new l(e.x,0,0,0,e.y,0,0,0,e.z)},l.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new l(e,0,0,0,e,0,0,0,e)},l.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.fromRotationX=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new l(1,0,0,0,i,-n,0,n,i)},l.fromRotationY=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new l(i,0,n,0,1,0,-n,0,i)},l.fromRotationZ=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new l(i,-n,0,n,i,0,0,0,1)},l.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},l.setColumn=function(e,t,i,r){r=l.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},l.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},l.setRow=function(e,t,i,r){return r=l.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var h=new e;l.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),i};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=d,i},l.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},l.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},l.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},l.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},l.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},l.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var f=[1,0,0],m=[2,2,1],_=new l,g=new l;return l.computeEigenDecomposition=function(e,t){var i=s.EPSILON20,n=10,o=0,a=0;r(t)||(t={});for(var h=t.unitary=l.clone(l.IDENTITY,t.unitary),p=t.diagonal=l.clone(e,t.diagonal),f=i*u(p);a<n&&c(p)>f;)d(p,_),l.transpose(_,g),l.multiply(p,_,p),l.multiply(g,p,p),l.multiply(h,_,h),++o>2&&(++a,o=0);return t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},l.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},l.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],d=e[8],h=l.determinant(e);t[0]=a*d-c*s,t[1]=c*n-r*d,t[2]=r*s-a*n,t[3]=u*s-o*d,t[4]=i*d-u*n,t[5]=o*n-i*s,t[6]=o*c-u*a,t[7]=u*r-i*c,t[8]=i*a-o*r;var p=1/h;return l.multiplyByScalar(t,p,t)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},l.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},l.IDENTITY=a(new l(1,0,0,0,1,0,0,0,1)),l.ZERO=a(new l(0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN1ROW0=3,l.COLUMN1ROW1=4,l.COLUMN1ROW2=5,l.COLUMN2ROW0=6,l.COLUMN2ROW1=7,l.COLUMN2ROW2=8,n(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}a.fromElements=function(e,t,r,n,o){return i(o)?(o.x=e,o.y=t,o.z=r,o.w=n,o):new a(e,t,r,n)},a.fromColor=function(e,t){return i(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r++],n.w=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=4*r:t=new Array(4*r);for(var n=0;n<r;++n)a.pack(e[n],t,4*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/4:t=new Array(r/4);for(var n=0;n<r;n+=4){var o=n/4;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,u);return a.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):i.z<=i.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):i.y<=i.z?i.y<=i.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):i.z<=i.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,n)&&o.equalsEpsilon(e.z,t.z,r,n)&&o.equalsEpsilon(e.w,t.w,r,n)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,n,o,a,s,l,u,c,d,h,p,f,m,_){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(f,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(d,0),this[11]=r(m,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(h,0),this[15]=r(_,0)}c.packedLength=16,c.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},c.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},c.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,i,o){return i=r(i,e.ZERO),n(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=i.x,o[13]=i.y,o[14]=i.z,o[15]=1,o):new c(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,i,r){n(r)||(r=new c);var o=i.x,a=i.y,s=i.z,l=t.x*t.x,u=t.x*t.y,d=t.x*t.z,h=t.x*t.w,p=t.y*t.y,f=t.y*t.z,m=t.y*t.w,_=t.z*t.z,g=t.z*t.w,v=t.w*t.w,y=l-p-_+v,C=2*(u-g),w=2*(d+m),S=2*(u+g),E=-l+p-_+v,b=2*(f-h),T=2*(d-m),x=2*(f+h),A=-l-p+_+v;return r[0]=y*o,r[1]=S*o,r[2]=T*o,r[3]=0,r[4]=C*a,r[5]=E*a,r[6]=x*a,r[7]=0,r[8]=w*s,r[9]=b*s,r[10]=A*s,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(l.IDENTITY,e,t)},c.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1);
},c.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,p=new e;c.fromCamera=function(t,i){var r=t.position,o=t.direction,a=t.up;e.normalize(o,d),e.normalize(e.cross(d,a,h),h),e.normalize(e.cross(h,d,p),p);var s=h.x,l=h.y,u=h.z,f=d.x,m=d.y,_=d.z,g=p.x,v=p.y,y=p.z,C=r.x,w=r.y,S=r.z,E=s*-C+l*-w+u*-S,b=g*-C+v*-w+y*-S,T=f*C+m*w+_*S;return n(i)?(i[0]=s,i[1]=g,i[2]=-f,i[3]=0,i[4]=l,i[5]=v,i[6]=-m,i[7]=0,i[8]=u,i[9]=y,i[10]=-_,i[11]=0,i[12]=E,i[13]=b,i[14]=T,i[15]=1,i):new c(s,l,u,E,g,v,y,b,-f,-m,-_,T,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,i,r,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(r+i)/(i-r),u=2*r*i/(i-r);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},c.computeOrthographicOffCenter=function(e,t,i,r,n,o,a){var s=1/(t-e),l=1/(r-i),u=1/(o-n),c=-(t+e)*s,d=-(r+i)*l,h=-(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]=d,a[14]=h,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,i,r,n,o,a){var s=2*n/(t-e),l=2*n/(r-i),u=(t+e)/(t-e),c=(r+i)/(r-i),d=-(o+n)/(o-n),h=-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]=d,a[11]=h,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,o){var a=2*n/(t-e),s=2*n/(r-i),l=(t+e)/(t-e),u=(r+i)/(r-i),c=-1,d=-1,h=-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]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},c.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,d=.5*(i-t),h=u,p=c,f=d,m=o+u,_=a+c,g=t+d,v=1;return n[0]=h,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]=f,n[11]=0,n[12]=m,n[13]=_,n[14]=g,n[15]=v,n},c.computeView=function(t,i,r,n,o){return o[0]=n.x,o[1]=r.x,o[2]=-i.x,o[3]=0,o[4]=n.y,o[5]=r.y,o[6]=-i.y,o[7]=0,o[8]=n.z,o[9]=r.z,o[10]=-i.z,o[11]=0,o[12]=-e.dot(n,t),o[13]=-e.dot(r,t),o[14]=e.dot(i,t),o[15]=1,o},c.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,i){var r=4*t,n=e[r],o=e[r+1],a=e[r+2],s=e[r+3];return i.x=n,i.y=o,i.z=a,i.w=s,i},c.setColumn=function(e,t,i,r){r=c.clone(e,r);var n=4*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.w,r},c.setTranslation=function(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i},c.getRow=function(e,t,i){var r=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return i.x=r,i.y=n,i.z=o,i.w=a,i},c.setRow=function(e,t,i,r){return r=c.clone(e,r),r[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var f=new e;c.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),i};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.multiply=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=e[9],p=e[10],f=e[11],m=e[12],_=e[13],g=e[14],v=e[15],y=t[0],C=t[1],w=t[2],S=t[3],E=t[4],b=t[5],T=t[6],x=t[7],A=t[8],P=t[9],D=t[10],M=t[11],I=t[12],R=t[13],O=t[14],N=t[15],L=r*y+s*C+d*w+m*S,B=n*y+l*C+h*w+_*S,F=o*y+u*C+p*w+g*S,k=a*y+c*C+f*w+v*S,V=r*E+s*b+d*T+m*x,z=n*E+l*b+h*T+_*x,U=o*E+u*b+p*T+g*x,G=a*E+c*b+f*T+v*x,H=r*A+s*P+d*D+m*M,W=n*A+l*P+h*D+_*M,q=o*A+u*P+p*D+g*M,j=a*A+c*P+f*D+v*M,Y=r*I+s*R+d*O+m*N,X=n*I+l*R+h*O+_*N,Z=o*I+u*R+p*O+g*N,K=a*I+c*R+f*O+v*N;return i[0]=L,i[1]=B,i[2]=F,i[3]=k,i[4]=V,i[5]=z,i[6]=U,i[7]=G,i[8]=H,i[9]=W,i[10]=q,i[11]=j,i[12]=Y,i[13]=X,i[14]=Z,i[15]=K,i},c.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},c.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},c.multiplyTransformation=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=e[12],p=e[13],f=e[14],m=t[0],_=t[1],g=t[2],v=t[4],y=t[5],C=t[6],w=t[8],S=t[9],E=t[10],b=t[12],T=t[13],x=t[14],A=r*m+a*_+u*g,P=n*m+s*_+c*g,D=o*m+l*_+d*g,M=r*v+a*y+u*C,I=n*v+s*y+c*C,R=o*v+l*y+d*C,O=r*w+a*S+u*E,N=n*w+s*S+c*E,L=o*w+l*S+d*E,B=r*b+a*T+u*x+h,F=n*b+s*T+c*x+p,k=o*b+l*T+d*x+f;return i[0]=A,i[1]=P,i[2]=D,i[3]=0,i[4]=M,i[5]=I,i[6]=R,i[7]=0,i[8]=O,i[9]=N,i[10]=L,i[11]=0,i[12]=B,i[13]=F,i[14]=k,i[15]=1,i},c.multiplyByMatrix3=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=t[0],p=t[1],f=t[2],m=t[3],_=t[4],g=t[5],v=t[6],y=t[7],C=t[8],w=r*h+a*p+u*f,S=n*h+s*p+c*f,E=o*h+l*p+d*f,b=r*m+a*_+u*g,T=n*m+s*_+c*g,x=o*m+l*_+d*g,A=r*v+a*y+u*C,P=n*v+s*y+c*C,D=o*v+l*y+d*C;return i[0]=w,i[1]=S,i[2]=E,i[3]=0,i[4]=b,i[5]=T,i[6]=x,i[7]=0,i[8]=A,i[9]=P,i[10]=D,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.multiplyByTranslation=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=r*e[0]+n*e[4]+o*e[8]+e[12],s=r*e[1]+n*e[5]+o*e[9]+e[13],l=r*e[2]+n*e[6]+o*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=a,i[13]=s,i[14]=l,i[15]=e[15],i};var _=new e;c.multiplyByUniformScale=function(e,t,i){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,i)},c.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?c.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=o*e[8],i[9]=o*e[9],i[10]=o*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},c.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*r+e[4]*n+e[8]*o+e[12]*a,l=e[1]*r+e[5]*n+e[9]*o+e[13]*a,u=e[2]*r+e[6]*n+e[10]*o+e[14]*a,c=e[3]*r+e[7]*n+e[11]*o+e[15]*a;return i.x=s,i.y=l,i.z=u,i.w=c,i},c.multiplyByPointAsVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o,s=e[1]*r+e[5]*n+e[9]*o,l=e[2]*r+e[6]*n+e[10]*o;return i.x=a,i.y=s,i.z=l,i},c.multiplyByPoint=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o+e[12],s=e[1]*r+e[5]*n+e[9]*o+e[13],l=e[2]*r+e[6]*n+e[10]*o+e[14];return i.x=a,i.y=s,i.z=l,i},c.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var i=e[1],r=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,i){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var g=new l,v=new l,y=new t,C=new t(0,0,0,1);return c.inverse=function(e,i){if(l.equalsEpsilon(c.getRotation(e,g),v,s.EPSILON7)&&t.equals(c.getRow(e,3,y),C))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-e[12],i[13]=-e[13],i[14]=-e[14],i[15]=1,i;var r=e[0],n=e[4],o=e[8],a=e[12],d=e[1],h=e[5],p=e[9],f=e[13],m=e[2],_=e[6],w=e[10],S=e[14],E=e[3],b=e[7],T=e[11],x=e[15],A=w*x,P=S*T,D=_*x,M=S*b,I=_*T,R=w*b,O=m*x,N=S*E,L=m*T,B=w*E,F=m*b,k=_*E,V=A*h+M*p+I*f-(P*h+D*p+R*f),z=P*d+O*p+B*f-(A*d+N*p+L*f),U=D*d+N*h+F*f-(M*d+O*h+k*f),G=R*d+L*h+k*p-(I*d+B*h+F*p),H=P*n+D*o+R*a-(A*n+M*o+I*a),W=A*r+N*o+L*a-(P*r+O*o+B*a),q=M*r+O*n+k*a-(D*r+N*n+F*a),j=I*r+B*n+F*o-(R*r+L*n+k*o);A=o*f,P=a*p,D=n*f,M=a*h,I=n*p,R=o*h,O=r*f,N=a*d,L=r*p,B=o*d,F=r*h,k=n*d;var Y=A*b+M*T+I*x-(P*b+D*T+R*x),X=P*E+O*T+B*x-(A*E+N*T+L*x),Z=D*E+N*b+F*x-(M*E+O*b+k*x),K=R*E+L*b+k*T-(I*E+B*b+F*T),Q=D*w+R*S+P*_-(I*S+A*_+M*w),J=L*S+A*m+N*w-(O*w+B*S+P*m),$=O*_+k*S+M*m-(F*S+D*m+N*_),ee=F*w+I*m+B*_-(L*_+k*w+R*m),te=r*V+n*z+o*U+a*G;if(Math.abs(te)<s.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return te=1/te,i[0]=V*te,i[1]=z*te,i[2]=U*te,i[3]=G*te,i[4]=H*te,i[5]=W*te,i[6]=q*te,i[7]=j*te,i[8]=Y*te,i[9]=X*te,i[10]=Z*te,i[11]=K*te,i[12]=Q*te,i[13]=J*te,i[14]=$*te,i[15]=ee*te,i},c.inverseTransformation=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],d=e[12],h=e[13],p=e[14],f=-i*d-r*h-n*p,m=-o*d-a*h-s*p,_=-l*d-u*h-c*p;return t[0]=i,t[1]=o,t[2]=l,t[3]=0,t[4]=r,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=f,t[13]=m,t[14]=_,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=a(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t,i){this.center=e.clone(r(t,e.ZERO)),this.radius=r(i,0)}var p=new e,f=new e,m=new e,_=new e,g=new e,v=new e,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e;h.fromPoints=function(t,i){if(n(i)||(i=new h),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;for(var r=e.clone(t[0],y),o=e.clone(r,p),a=e.clone(r,f),s=e.clone(r,m),l=e.clone(r,_),u=e.clone(r,g),c=e.clone(r,v),d=t.length,T=1;T<d;T++){e.clone(t[T],r);var x=r.x,A=r.y,P=r.z;x<o.x&&e.clone(r,o),x>l.x&&e.clone(r,l),A<a.y&&e.clone(r,a),A>u.y&&e.clone(r,u),P<s.z&&e.clone(r,s),P>c.z&&e.clone(r,c)}var D=e.magnitudeSquared(e.subtract(l,o,C)),M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=o,O=l,N=D;M>N&&(N=M,R=a,O=u),I>N&&(N=I,R=s,O=c);var L=w;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var B=e.magnitudeSquared(e.subtract(O,L,C)),F=Math.sqrt(B),k=S;k.x=o.x,k.y=a.y,k.z=s.z;var V=E;V.x=l.x,V.y=u.y,V.z=c.z;var z=e.multiplyByScalar(e.add(k,V,C),.5,b),U=0;for(T=0;T<d;T++){e.clone(t[T],r);var G=e.magnitude(e.subtract(r,z,C));G>U&&(U=G);var H=e.magnitudeSquared(e.subtract(r,L,C));if(H>B){var W=Math.sqrt(H);F=.5*(F+W),B=F*F;var q=W-F;L.x=(F*L.x+q*r.x)/W,L.y=(F*L.y+q*r.y)/W,L.z=(F*L.z+q*r.z)/W}}return F<U?(e.clone(L,i.center),i.radius=F):(e.clone(z,i.center),i.radius=U),i};var T=new a,x=new e,A=new e,P=new t,D=new t;h.fromRectangle2D=function(e,t,i){return h.fromRectangleWithHeights2D(e,t,0,0,i)},h.fromRectangleWithHeights2D=function(t,i,o,a,s){if(n(s)||(s=new h),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;i=r(i,T),d.southwest(t,P),P.height=o,d.northeast(t,D),D.height=a;var l=i.project(P,x),u=i.project(D,A),c=u.x-l.x,p=u.y-l.y,f=u.z-l.z;s.radius=.5*Math.sqrt(c*c+p*p+f*f);var m=s.center;return m.x=l.x+.5*c,m.y=l.y+.5*p,m.z=l.z+.5*f,s};var M=[];h.fromRectangle3D=function(e,t,i,a){t=r(t,o.WGS84),i=r(i,0);var s;return n(e)&&(s=d.subsample(e,t,i,M)),h.fromPoints(s,a)},h.fromVertices=function(t,i,o,a){if(n(a)||(a=new h),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;i=r(i,e.ZERO),o=r(o,3);var s=y;s.x=t[0]+i.x,s.y=t[1]+i.y,s.z=t[2]+i.z;for(var l=e.clone(s,p),u=e.clone(s,f),c=e.clone(s,m),d=e.clone(s,_),T=e.clone(s,g),x=e.clone(s,v),A=t.length,P=0;P<A;P+=o){var D=t[P]+i.x,M=t[P+1]+i.y,I=t[P+2]+i.z;s.x=D,s.y=M,s.z=I,D<l.x&&e.clone(s,l),D>d.x&&e.clone(s,d),M<u.y&&e.clone(s,u),M>T.y&&e.clone(s,T),I<c.z&&e.clone(s,c),I>x.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(d,l,C)),O=e.magnitudeSquared(e.subtract(T,u,C)),N=e.magnitudeSquared(e.subtract(x,c,C)),L=l,B=d,F=R;O>F&&(F=O,L=u,B=T),N>F&&(F=N,L=c,B=x);var k=w;k.x=.5*(L.x+B.x),k.y=.5*(L.y+B.y),k.z=.5*(L.z+B.z);var V=e.magnitudeSquared(e.subtract(B,k,C)),z=Math.sqrt(V),U=S;U.x=l.x,U.y=u.y,U.z=c.z;var G=E;G.x=d.x,G.y=T.y,G.z=x.z;var H=e.multiplyByScalar(e.add(U,G,C),.5,b),W=0;for(P=0;P<A;P+=o){s.x=t[P]+i.x,s.y=t[P+1]+i.y,s.z=t[P+2]+i.z;var q=e.magnitude(e.subtract(s,H,C));q>W&&(W=q);var j=e.magnitudeSquared(e.subtract(s,k,C));if(j>V){var Y=Math.sqrt(j);z=.5*(z+Y),V=z*z;var X=Y-z;k.x=(z*k.x+X*s.x)/Y,k.y=(z*k.y+X*s.y)/Y,k.z=(z*k.z+X*s.z)/Y}}return z<W?(e.clone(k,a.center),a.radius=z):(e.clone(H,a.center),a.radius=W),a},h.fromEncodedCartesianVertices=function(t,i,r){if(n(r)||(r=new h),!n(t)||!n(i)||t.length!==i.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var o=y;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];for(var a=e.clone(o,p),s=e.clone(o,f),l=e.clone(o,m),u=e.clone(o,_),c=e.clone(o,g),d=e.clone(o,v),T=t.length,x=0;x<T;x+=3){var A=t[x]+i[x],P=t[x+1]+i[x+1],D=t[x+2]+i[x+2];o.x=A,o.y=P,o.z=D,A<a.x&&e.clone(o,a),A>u.x&&e.clone(o,u),P<s.y&&e.clone(o,s),P>c.y&&e.clone(o,c),D<l.z&&e.clone(o,l),D>d.z&&e.clone(o,d)}var M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=e.magnitudeSquared(e.subtract(d,l,C)),O=a,N=u,L=M;I>L&&(L=I,O=s,N=c),R>L&&(L=R,O=l,N=d);var B=w;B.x=.5*(O.x+N.x),B.y=.5*(O.y+N.y),B.z=.5*(O.z+N.z);var F=e.magnitudeSquared(e.subtract(N,B,C)),k=Math.sqrt(F),V=S;V.x=a.x,V.y=s.y,V.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=d.z;var U=e.multiplyByScalar(e.add(V,z,C),.5,b),G=0;for(x=0;x<T;x+=3){o.x=t[x]+i[x],o.y=t[x+1]+i[x+1],o.z=t[x+2]+i[x+2];var H=e.magnitude(e.subtract(o,U,C));H>G&&(G=H);var W=e.magnitudeSquared(e.subtract(o,B,C));if(W>F){var q=Math.sqrt(W);k=.5*(k+q),F=k*k;var j=q-k;B.x=(k*B.x+j*o.x)/q,B.y=(k*B.y+j*o.y)/q,B.z=(k*B.z+j*o.z)/q}}return k<G?(e.clone(B,r.center),r.radius=k):(e.clone(U,r.center),r.radius=G),r},h.fromCornerPoints=function(t,i,r){n(r)||(r=new h);var o=r.center;return e.add(t,i,o),e.multiplyByScalar(o,.5,o),r.radius=e.distance(o,i),r},h.fromEllipsoid=function(t,i){return n(i)||(i=new h),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var I=new e;h.fromBoundingSpheres=function(t,i){if(n(i)||(i=new h),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var r=t.length;if(1===r)return h.clone(t[0],i);if(2===r)return h.union(t[0],t[1],i);for(var o=[],a=0;a<r;a++)o.push(t[a].center);i=h.fromPoints(o,i);var s=i.center,l=i.radius;for(a=0;a<r;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,I)+u.radius)}return i.radius=l,i};var R=new e,O=new e,N=new e;h.fromOrientedBoundingBox=function(t,i){n(i)||(i=new h);var r=t.halfAxes,o=u.getColumn(r,0,R),a=u.getColumn(r,1,O),s=u.getColumn(r,2,N),l=e.magnitude(o),c=e.magnitude(a),d=e.magnitude(s);return i.center=e.clone(t.center,i.center),i.radius=Math.max(l,c,d),i},h.clone=function(t,i){if(n(t))return n(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,i){i=r(i,0);var n=e.center;return t[i++]=n.x,t[i++]=n.y,t[i++]=n.z,t[i]=e.radius,t},h.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new h);var o=i.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],i.radius=e[t],i};var L=new e,B=new e;h.union=function(t,i,r){n(r)||(r=new h);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,L),c=e.magnitude(u);if(a>=c+l)return t.clone(r),r;if(l>=c+a)return i.clone(r),r;var d=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+d)/c,B);return e.add(p,o,p),e.clone(p,r.center),r.radius=d,r};var F=new e;h.expand=function(t,i,r){r=h.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,F));return n>r.radius&&(r.radius=n),r},h.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a<n?s.INTERSECTING:s.INSIDE},h.transform=function(e,t,i){return n(i)||(i=new h),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=c.getMaximumScale(t)*e.radius,i};var k=new e;h.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,k);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,i){return n(i)||(i=new h),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var V=new e;h.computePlaneDistances=function(t,i,r,o){n(o)||(o=new l);var a=e.subtract(t.center,i,V),s=e.dot(r,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var z=new e,U=new e,G=new e,H=new e,W=new e,q=new t,j=new Array(8),Y=0;Y<8;++Y)j[Y]=new e;var X=new a;return h.projectTo2D=function(t,i,n){i=r(i,X);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,z),u=e.cross(e.UNIT_Z,l,U);e.normalize(u,u);var c=e.cross(l,u,G);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,W),p=e.negate(u,H),f=j,m=f[0];e.add(l,c,m),e.add(m,u,m),m=f[1],e.add(l,c,m),e.add(m,p,m),m=f[2],e.add(l,d,m),e.add(m,p,m),m=f[3],e.add(l,d,m),e.add(m,u,m),e.negate(l,l),m=f[4],e.add(l,c,m),e.add(m,u,m),m=f[5],e.add(l,c,m),e.add(m,p,m),m=f[6],e.add(l,d,m),e.add(m,p,m),m=f[7],e.add(l,d,m),e.add(m,u,m);for(var _=f.length,g=0;g<_;++g){var v=f[g];e.add(a,v,v);var y=o.cartesianToCartographic(v,q);i.project(y,v)}n=h.fromPoints(f,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.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,i){return t===i||n(t)&&n(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,i){return h.computePlaneDistances(this,e,t,i)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a<s;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(r.requestFullscreen=n,i=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(r.requestFullscreen=n,i=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",void 0!==document[n]?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",void 0!==document[n]&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",void 0!==document[n]?r.fullscreenElement=n:(n=l+"FullScreenElement",void 0!==document[n]&&(r.fullscreenElement=n)),n=l+"fullscreenchange",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return i},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[r.exitFullscreen]()},n}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,i){"use strict";function r(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function n(){if(!t(w)&&(w=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(w=!0,S=r(e[1]))}return w}function o(){return n()&&S}function a(){if(!t(E)&&(E=!1,!n()&&!h()&&/ Safari\/[\.0-9]+/.test(C.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(E=!0,b=r(e[1]))}return E}function s(){return a()&&b}function l(){if(!t(T)){T=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(C.userAgent);null!==e&&(T=!0,x=r(e[1]),x.isNightly=!!e[2])}return T}function u(){return l()&&x}function c(){if(!t(A)){A=!1;var e;"Microsoft Internet Explorer"===C.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(C.userAgent),null!==e&&(A=!0,P=r(e[1]))):"Netscape"===C.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(C.userAgent),null!==e&&(A=!0,P=r(e[1])))}return A}function d(){return c()&&P}function h(){if(!t(D)){D=!1;var e=/ Edge\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(D=!0,M=r(e[1]))}return D}function p(){return h()&&M}function f(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(I=!0,R=r(e[1]))}return I}function m(){return t(O)||(O=/Windows/i.test(C.appVersion)),O}function _(){return f()&&R}function g(){return t(N)||(N="undefined"!=typeof PointerEvent&&(!t(C.pointerEnabled)||C.pointerEnabled)),N}function v(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;B=t(i)&&""!==i,B&&(L=i)}return B}function y(){return v()?L:void 0}var C;C="undefined"!=typeof navigator?navigator:{};var w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:d,isEdge:h,edgeVersion:p,isFirefox:f,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(C.hardwareConcurrency,3),supportsPointerEvents:g,supportsImageRenderingPixelated:v,imageRenderingValue:y};return F.supportsFullscreen=function(){return i.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,
TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,i,r,n,o){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.INT||e===a.UNSIGNED_INT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,i,r,n){switch(r=e(r,0),n=e(n,(i.byteLength-r)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(i,r,n);case a.UNSIGNED_BYTE:return new Uint8Array(i,r,n);case a.SHORT:return new Int16Array(i,r,n);case a.UNSIGNED_SHORT:return new Uint16Array(i,r,n);case a.INT:return new Int32Array(i,r,n);case a.UNSIGNED_INT:return new Uint32Array(i,r,n);case a.FLOAT:return new Float32Array(i,r,n);case a.DOUBLE:return new Float64Array(i,r,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return e(i)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var i=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var n=e.attributes[r],o=n.values.length/n.componentsPerAttribute;i=o}return i},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.tangent?1:0,i[r++]=t.bitangent?1:0,i[r++]=t.color?1:0,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.tangent=1===i[r++],o.bitangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.tangent=e.tangent,i.bitangent=e.bitangent,i.color=e.color,i},n}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var h=new t;d.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new d({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*t.packedLength+c.packedLength,d.pack=function(e,i,n){return n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength),i};var p=new t,f=new t,m=new c,_={minimum:p,maximum:f,vertexFormat:m};return d.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,f),l=c.unpack(e,i+2*t.packedLength,m);return n(o)?(o._minimum=t.clone(a,o._minimum),o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new d(_)},d.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var d,p,f=new l;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var m=new Float32Array(72);m[0]=0,m[1]=0,m[2]=1,m[3]=0,m[4]=0,m[5]=1,m[6]=0,m[7]=0,m[8]=1,m[9]=0,m[10]=0,m[11]=1,m[12]=0,m[13]=0,m[14]=-1,m[15]=0,m[16]=0,m[17]=-1,m[18]=0,m[19]=0,m[20]=-1,m[21]=0,m[22]=0,m[23]=-1,m[24]=1,m[25]=0,m[26]=0,m[27]=1,m[28]=0,m[29]=0,m[30]=1,m[31]=0,m[32]=0,m[33]=1,m[34]=0,m[35]=0,m[36]=-1,m[37]=0,m[38]=0,m[39]=-1,m[40]=0,m[41]=0,m[42]=-1,m[43]=0,m[44]=0,m[45]=-1,m[46]=0,m[47]=0,m[48]=0,m[49]=1,m[50]=0,m[51]=0,m[52]=1,m[53]=0,m[54]=0,m[55]=1,m[56]=0,m[57]=0,m[58]=1,m[59]=0,m[60]=0,m[61]=-1,m[62]=0,m[63]=0,m[64]=-1,m[65]=0,m[66]=0,m[67]=-1,m[68]=0,m[69]=0,m[70]=-1,m[71]=0,f.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:m})}if(c.st){var _=new Float32Array(48);_[0]=0,_[1]=0,_[2]=1,_[3]=0,_[4]=1,_[5]=1,_[6]=0,_[7]=1,_[8]=1,_[9]=0,_[10]=0,_[11]=0,_[12]=0,_[13]=1,_[14]=1,_[15]=1,_[16]=0,_[17]=0,_[18]=1,_[19]=0,_[20]=1,_[21]=1,_[22]=0,_[23]=1,_[24]=1,_[25]=0,_[26]=0,_[27]=0,_[28]=0,_[29]=1,_[30]=1,_[31]=1,_[32]=1,_[33]=0,_[34]=0,_[35]=0,_[36]=0,_[37]=1,_[38]=1,_[39]=1,_[40]=0,_[41]=0,_[42]=1,_[43]=0,_[44]=1,_[45]=1,_[46]=0,_[47]=1,f.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:_})}if(c.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,f.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.bitangent){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,f.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}d=new Uint16Array(36),d[0]=0,d[1]=1,d[2]=2,d[3]=0,d[4]=2,d[5]=3,d[6]=6,d[7]=5,d[8]=4,d[9]=7,d[10]=6,d[11]=4,d[12]=8,d[13]=9,d[14]=10,d[15]=8,d[16]=10,d[17]=11,d[18]=14,d[19]=13,d[20]=12,d[21]=15,d[22]=14,d[23]=12,d[24]=18,d[25]=17,d[26]=16,d[27]=19,d[28]=18,d[29]=16,d[30]=20,d[31]=21,d[32]=22,d[33]=20,d[34]=22,d[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d=new Uint16Array(36),d[0]=4,d[1]=5,d[2]=6,d[3]=4,d[4]=6,d[5]=7,d[6]=1,d[7]=0,d[8]=3,d[9]=1,d[10]=3,d[11]=2,d[12]=1,d[13]=6,d[14]=5,d[15]=1,d[16]=2,d[17]=6,d[18]=2,d[19]=3,d[20]=7,d[21]=2,d[22]=7,d[23]=6,d[24]=3,d[25]=0,d[26]=4,d[27]=3,d[28]=4,d[29]=7,d[30]=0,d[31]=1,d[32]=5,d[33]=0,d[34]=5,d[35]=4;var y=t.subtract(o,n,h),C=.5*t.magnitude(y);return new a({attributes:f,indices:d,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})}},d}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var d=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){return n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength),i};var h=new t,p=new t,f={minimum:h,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,h),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(f)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,h=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h[0]=4,h[1]=5,h[2]=5,h[3]=6,h[4]=6,h[5]=7,h[6]=7,h[7]=4,h[8]=0,h[9]=1,h[10]=1,h[11]=2,h[12]=2,h[13]=3,h[14]=3,h[15]=0,h[16]=0,h[17]=4,h[18]=1,h[19]=5,h[20]=2,h[21]=6,h[22]=3,h[23]=7;var f=t.subtract(o,n,d),m=.5*t.magnitude(f);return new a({attributes:c,indices:h,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,m)})}},c}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=t(r,document.location.href);var n=new e(r),o=new e(i);return o.resolve(n).toString()}return n}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,o){o=t(o,!0),r instanceof e||(r=new e(r)),n instanceof e||(n=new e(n)),i(n.authority)&&!i(n.scheme)&&("undefined"!=typeof document&&i(document.location)&&i(document.location.href)?n.scheme=new e(document.location.href).scheme:n.scheme=r.scheme);var a=r;n.isAbsolute()&&(a=n);var s="";i(a.scheme)&&(s+=a.scheme+":"),i(a.authority)&&(s+="//"+a.authority,""!==a.path&&"/"!==a.path&&(s=s.replace(/\/?$/,"/"),a.path=a.path.replace(/^\/?/g,""))),s+=a===r?o?r.path.replace(/\/?$/,"/")+n.path.replace(/^\/?/g,""):r.path+n.path:n.path;var l=i(r.query),u=i(n.query);l&&u?s+="?"+r.query+"&"+n.query:l&&!u?s+="?"+r.query:!l&&u&&(s+="?"+n.query);var c=i(n.fragment);return i(r.fragment)&&!c?s+="#"+r.fragment:c&&(s+="#"+n.fragment),s}return n}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,i,r,n,o){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t<i;++t){var r=e[t].getAttribute("src"),n=f.exec(r);if(null!==n)return n[1]}}function s(){if(t(d))return d;var i;return i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),d=new e(r(i))}function l(e){return o.toUrl("../"+e)}function u(e){return n(s(),e)}function c(e){t(h)||(h=t(o.toUrl)?l:u),t(p)||(p=document.createElement("a"));var i=h(e);return p.href=i,p.href=p.href,p.href}var d,h,p,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=f,c.setBaseUrl=function(t){d=new e(t).resolve(new e(document.location.href))},c}),define("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;r<n&&!e(i);)i=window[t[r]+"CancelAnimationFrame"],e(i)||(i=window[t[r]+"CancelRequestAnimationFrame"]),++r;e(i)||(i=clearTimeout)}(),t}}),define("Core/CartographicGeocoderService",["./Cartesian3","./defaultValue","./defineProperties","./defined","./DeveloperError","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(){}return a.prototype.geocode=function(t){var i=t.match(/[^\s,\n]+/g);if(2===i.length||3===i.length){var r=+i[0],n=+i[1],a=3===i.length?+i[2]:300;if(!isNaN(r)&&!isNaN(n)&&!isNaN(a)){var s={displayName:t,destination:e.fromDegrees(r,n,a)};return o.resolve([s])}}return o.resolve([])},a}),define("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.times=void 0,this.points=void 0,i.throwInstantiationError()}return r.prototype.evaluate=i.throwInstantiationError,r.prototype.findTimeInterval=function(t,i){var r=this.times,n=r.length;if(i=e(i,0),t>=r[i]){if(i+1<n&&t<r[i+1])return i;if(i+2<n&&t<r[i+2])return i+1}else if(i-1>=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;o<n-1&&!(t>=r[o]&&t<r[o+1]);++o);else for(o=i-1;o>=0&&!(t>=r[o]&&t<r[o+1]);--o);return o===n-1&&(o=n-2),o},r}),define("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.points,r=e.times;this._times=r,this._points=i,this._lastTimeIndex=0}return r(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,r){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return i(r)||(r=new e),e.lerp(n[a],n[a+1],s,r)},a}),define("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.solve=function(t,i,r,n){var o,a=new Array(r.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=r[0]/i[0],s[0]=e.multiplyByScalar(n[0],1/i[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(i[o]-a[o-1]*t[o-1]),a[o]=r[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(i[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),define("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=m,s=f,l=_;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var d=l[0];for(r(d)||(d=l[0]=new e),e.clone(i,d),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,d=l[c],r(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d);return o[c]=0,a[c]=1,s[c]=4,d=l[c],r(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d),s[c+1]=1,d=l[c+1],r(d)||(d=l[c+1]=new e),e.clone(n,d),u.solve(o,s,a,l)}function d(t){var i=p,n=m,o=f,a=_;i.length=n.length=t.length-1,o.length=a.length=t.length;var s;i[0]=n[0]=1,o[0]=2;var l=a[0];for(r(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<i.length;++s)i[s]=n[s]=1,o[s]=4,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(i,o,n,a)}function h(e){e=i(e,i.EMPTY_OBJECT);var t=e.points,r=e.times,n=e.inTangents,o=e.outTangents;this._times=r,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var p=[],f=[],m=[],_=[];n(h.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}}}),h.createC1=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.tangents,o=n.slice(0,n.length-1),a=n.slice(1,n.length);return new h({times:t,points:r,inTangents:a,outTangents:o})},h.createNaturalCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points;if(r.length<3)return new a({points:r,times:t});var n=d(r),o=n.slice(0,n.length-1),s=n.slice(1,n.length);return new h({times:t,points:r,inTangents:s,outTangents:o})},h.createClampedCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.firstTangent,o=e.lastTangent;if(r.length<3)return new a({points:r,times:t});var s=c(r,n,o),l=s.slice(0,s.length-1),u=s.slice(1,s.length);return new h({times:t,points:r,inTangents:u,outTangents:l})},h.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),h.prototype.findTimeInterval=l.prototype.findTimeInterval;var g=new t,v=new e;return h.prototype.evaluate=function(t,i){r(i)||(i=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),d=g;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;var p=s.multiplyByVector(h.hermiteCoefficientMatrix,d,d);return i=e.multiplyByScalar(n[u],p.x,i),e.multiplyByScalar(n[u+1],p.y,v),e.add(i,v,i),e.multiplyByScalar(l[u],p.z,v),e.add(i,v,i),e.multiplyByScalar(a[u],p.w,v),e.add(i,v,i)},h}),define("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./HermiteSpline","./Matrix4","./Spline"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){var i=t.points,n=t.times;if(i.length<3){var o=n[0],l=1/(n[1]-o),u=i[0],f=i[1];return function(t,i){r(i)||(i=new e);var n=(t-o)*l;return e.lerp(u,f,n,i)}}return function(o,l){r(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),f=(o-n[u])/(n[u+1]-n[u]),m=d;m.z=f,m.y=f*f,m.x=m.y*f,m.w=1;var _,g,v,y,C;return 0===u?(_=i[0],g=i[1],v=t.firstTangent,y=e.subtract(i[2],_,h),e.multiplyByScalar(y,.5,y),C=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):u===i.length-2?(_=i[u],g=i[u+1],y=t.lastTangent,v=e.subtract(g,i[u-1],h),e.multiplyByScalar(v,.5,v),C=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):(_=i[u-1],g=i[u],v=i[u+1],y=i[u+2],C=s.multiplyByVector(c.catmullRomCoefficientMatrix,m,m)),l=e.multiplyByScalar(_,C.x,l),e.multiplyByScalar(g,C.y,p),e.add(l,p,l),e.multiplyByScalar(v,C.z,p),e.add(l,p,l),e.multiplyByScalar(y,C.w,p),e.add(l,p,l)}}function c(t){t=i(t,i.EMPTY_OBJECT);var n=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(n.length>2&&(r(a)||(a=f,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=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}var d=new t,h=new e,p=new e,f=new e,m=new e;return n(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),define("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o<i.length;o++)if(i[o]===e&&r[o]===t){n=o;break}return n!==-1&&(this._insideRaiseEvent?(this._toRemove.push(n),i[n]=void 0,r[n]=void 0):(i.splice(n,1),r.splice(n,1)),!0)},r.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var t,i=this._listeners,r=this._scopes,n=i.length;for(t=0;t<n;t++){var o=i[t];e(o)&&i[t].apply(r[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;t<n;t++){var s=a[t];i.splice(s,1),r.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),define("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var r=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return i(t)?(t.west=r,t.south=n,t.east=o,t.north=a,t):new l(r,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.tileXYToRectangle(e,t,i,r);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,r,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),u=o.width/a,c=e*u+o.west,d=(e+1)*u+o.west,h=o.height/s,p=o.north-t*h,f=o.north-(t+1)*h;return i(n)||(n=new l(c,f,d,p)),n.west=c,n.south=f,n.east=d,n.north=p,n},u.prototype.positionToTileXY=function(t,r,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(r),u=this.getNumberOfYTilesAtLevel(r),c=o.width/a,d=o.height/u,h=t.longitude;o.east<o.west&&(h+=s.TWO_PI);var p=(h-o.west)/c|0;p>=a&&(p=a-1);
var f=(o.north-t.latitude)/d|0;return f>=u&&(f=u-1),i(n)?(n.x=p,n.y=f,n):new e(p,f)}},u}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(e,i){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(i)&&(this.cameraPosition=i)}function l(e,i,r){var n=e.transformPositionToScaledSpace(i,f),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,m);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,r),u=t.magnitude(t.cross(s,r,s)),c=1/a,d=Math.sqrt(o-1)*c;return 1/(l*c-u*d)}function u(e,i,r){if(!(i<=0||i===1/0||i!==i))return t.multiplyByScalar(e,i,r)}function c(e,i){return t.equals(i,t.ZERO)?i:(e.transformPositionToScaledSpace(i,_),t.normalize(_,_))}n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var i=this._ellipsoid,r=i.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=n}}});var d=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,i=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(i)},s.prototype.isScaledSpacePointVisible=function(e){var i=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,i,d),o=-t.dot(n,i),a=r<0?o>0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,d=0,h=i.length;d<h;++d){var p=i[d],f=l(o,p,a);s=Math.max(s,f)}return u(a,s,n)};var h=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,s){r(s)||(s=new t),a=i(a,t.ZERO);for(var d=this._ellipsoid,p=c(d,e),f=0,m=0,_=n.length;m<_;m+=o){h.x=n[m]+a.x,h.y=n[m+1]+a.y,h.z=n[m+2]+a.z;var g=l(d,h,p);f=Math.max(f,g)}return u(p,f,s)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(i,r,n){var o=a.subsample(i,r,0,p),s=e.fromPoints(o);if(!(t.magnitude(s.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(s.center,o,n)};var f=new t,m=new t,_=new t;return s}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function i(e,i,r){var n=e+i;return t.sign(e)!==t.sign(i)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(i)))<r?0:n}var r={};return r.computeDiscriminant=function(e,t,i){var r=t*t-4*e*i;return r},r.computeRealRoots=function(e,r,n){var o;if(0===e)return 0===r?[]:[-n/r];if(0===r){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(a<s&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(o=-n/e,o<0)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-r/e,o<0?[o,0]:[0,o];var u=r*r,c=4*e*n,d=i(u,-c,t.EPSILON14);if(d<0)return[];var h=-.5*i(r,t.sign(r)*Math.sqrt(d),t.EPSILON14);return r>0?[h/e,n/h]:[n/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,d=s*u,h=s*s,p=l*l,f=a*l-h,m=a*u-s*l,_=s*u-p,g=4*f*_-m*m;if(g<0){var v,y,C;h*d>=c*p?(v=a,y=f,C=-2*s*f+a*m):(v=u,y=_,C=-u*m+2*l*_);var w=C<0?-1:1,S=-w*Math.abs(v)*Math.sqrt(-g);o=-C+S;var E=o/2,b=E<0?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=y<=0?b+T:-C/(b*b+T*T+y),h*d>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=f,A=-2*s*f+a*m,P=_,D=-u*m+2*l*_,M=Math.sqrt(g),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-x);var O=Math.cos(R);o=n*O;var N=n*(-O/2-I*Math.sin(R)),L=o+N>2*s?o-s:N-s,B=a,F=L/B;R=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-I*Math.sin(R));var k=-u,V=o+N<2*l?o+l:N+l,z=k/V,U=B*V,G=-L*V-B*k,H=L*k,W=(l*G-s*H)/(-s*G+l*U);return F<=W?F<=z?W<=z?[F,W,z]:[F,z,W]:[z,F,W]:F<=z?[W,F,z]:W<=z?[W,z,F]:[z,W,F]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,s<0?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,d=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(d.length>0){var h=-t/4,p=d[d.length-1];if(Math.abs(p)<i.EPSILON14){var f=r.computeRealRoots(1,l,c);if(2===f.length){var m,_=f[0],g=f[1];if(_>=0&&g>=0){var v=Math.sqrt(_),y=Math.sqrt(g);return[h-y,h-v,h+v,h+y]}if(_>=0&&g<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&g>=0)return m=Math.sqrt(g),[h-m,h+m]}return[]}if(p>0){var C=Math.sqrt(p),w=(l+p-u/C)/2,S=(l+p+u/C)/2,E=r.computeRealRoots(1,C,w),b=r.computeRealRoots(1,-C,S);return 0!==E.length?(E[0]+=h,E[1]+=h,0!==b.length?(b[0]+=h,b[1]+=h,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]+=h,b[1]+=h,b):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,d=o*t+l-4*a,h=u*a-o*n*t+s,p=e.computeRealRoots(1,c,d,h);if(p.length>0){var f,m,_=p[0],g=n-_,v=g*g,y=t/2,C=g/2,w=v-4*a,S=v+4*Math.abs(a),E=u-4*_,b=u+4*Math.abs(_);if(_<0||w*b<E*S){var T=Math.sqrt(E);f=T/2,m=0===T?0:(t*C-o)/T}else{var x=Math.sqrt(w);f=0===x?0:(t*C-o)/x,m=x/2}var A,P;0===y&&0===f?(A=0,P=0):i.sign(y)===i.sign(f)?(A=y+f,P=_/A):(P=y-f,A=_/P);var D,M;0===C&&0===m?(D=0,M=0):i.sign(C)===i.sign(m)?(D=C+m,M=a/D):(M=C-m,D=a/M);var I=r.computeRealRoots(1,A,D),R=r.computeRealRoots(1,P,M);if(0!==I.length)return 0!==R.length?I[1]<=R[0]?[I[0],I[1],R[0],R[1]]:R[1]<=I[0]?[R[0],R[1],I[0],I[1]]:I[0]>=R[0]&&I[1]<=R[1]?[R[0],I[0],I[1],R[1]]:R[0]>=I[0]&&R[1]<=I[1]?[I[0],R[0],R[1],I[1]]:I[0]>R[0]&&I[0]<R[1]?[R[0],I[0],R[1],I[1]]:[I[0],R[0],I[1],R[1]]:I;if(0!==R.length)return R}return[]}var a={};return a.computeDiscriminant=function(e,t,i,r,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=i*i,c=u*i,d=r*r,h=d*r,p=n*n,f=p*n,m=s*u*d-4*l*h-4*e*c*d+18*e*t*i*h-27*o*d*d+256*a*f+n*(18*l*i*r-4*s*c+16*e*u*u-80*e*t*u*r-6*e*s*d+144*o*i*d)+p*(144*e*s*i-27*s*s-128*o*u-192*o*t*r);return m},a.computeRealRoots=function(t,r,a,s,l){if(Math.abs(t)<i.EPSILON15)return e.computeRealRoots(r,a,s,l);var u=r/t,c=a/t,d=s/t,h=l/t,p=u<0?1:0;switch(p+=c<0?p+1:p,p+=d<0?p+1:p,p+=h<0?p+1:p){case 0:return n(u,c,d,h);case 1:return o(u,c,d,h);case 2:return o(u,c,d,h);case 3:return n(u,c,d,h);case 4:return n(u,c,d,h);case 5:return o(u,c,d,h);case 6:return n(u,c,d,h);case 7:return n(u,c,d,h);case 8:return o(u,c,d,h);case 9:return n(u,c,d,h);case 10:return n(u,c,d,h);case 11:return o(u,c,d,h);case 12:return n(u,c,d,h);case 13:return n(u,c,d,h);case 14:return n(u,c,d,h);case 15:return n(u,c,d,h);default:return}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(i,e.ZERO)),this.direction=r}return n.getPoint=function(t,r,n){return i(n)||(n=new e),n=e.multiplyByScalar(t.direction,r,n),e.add(t.origin,n,n)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t,i,r){var n=t*t-4*e*i;if(!(n<0)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s<l?(r.root0=s,r.root1=l):(r.root0=l,r.root1=s),r}var u=-t/(2*e);if(0!==u)return r.root0=r.root1=u,r}}function h(t,i,n){r(n)||(n=new o);var a=t.origin,s=t.direction,l=i.center,u=i.radius*i.radius,c=e.subtract(a,l,v),h=e.dot(s,s),p=2*e.dot(s,c),f=e.magnitudeSquared(c)-u,m=d(h,p,f,S);if(r(m))return n.start=m.root0,n.stop=m.root1,n}function p(e,t,i){var r=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}function f(t,i,r,n,o){var c,d=n*n,h=o*o,f=(t[s.COLUMN1ROW1]-t[s.COLUMN2ROW2])*h,m=o*(n*p(t[s.COLUMN1ROW0],t[s.COLUMN0ROW1],a.EPSILON15)+i.y),_=t[s.COLUMN0ROW0]*d+t[s.COLUMN2ROW2]*h+n*i.x+r,g=h*p(t[s.COLUMN2ROW1],t[s.COLUMN1ROW2],a.EPSILON15),v=o*(n*p(t[s.COLUMN2ROW0],t[s.COLUMN0ROW2])+i.z),y=[];if(0===v&&0===g){if(c=l.computeRealRoots(f,m,_),0===c.length)return y;var C=c[0],w=Math.sqrt(Math.max(1-C*C,0));if(y.push(new e(n,o*C,o*-w)),y.push(new e(n,o*C,o*w)),2===c.length){var S=c[1],E=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,o*S,o*-E)),y.push(new e(n,o*S,o*E))}return y}var b=v*v,T=g*g,x=f*f,A=v*g,P=x+T,D=2*(m*f+A),M=2*_*f+m*m-T+b,I=2*(_*m-A),R=_*_-b;if(0===P&&0===D&&0===M&&0===I)return y;c=u.computeRealRoots(P,D,M,I,R);var O=c.length;if(0===O)return y;for(var N=0;N<O;++N){var L,B=c[N],F=B*B,k=Math.max(1-F,0),V=Math.sqrt(k);L=a.sign(f)===a.sign(_)?p(f*F+_,m*B,a.EPSILON12):a.sign(_)===a.sign(m*B)?p(f*F,m*B+_,a.EPSILON12):p(f*F+m*B,_,a.EPSILON12);var z=p(g*B,v,a.EPSILON15),U=L*z;U<0?y.push(new e(n,o*B,o*V)):U>0?y.push(new e(n,o*B,o*-V)):0!==V?(y.push(new e(n,o*B,o*-V)),y.push(new e(n,o*B,o*V)),++N):y.push(new e(n,o*B,o*V))}return y}var m={};m.rayPlane=function(t,i,n){r(n)||(n=new e);var o=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON15)){var c=(-i.distance-e.dot(l,o))/u;if(!(c<0))return n=e.multiplyByScalar(s,c,n),e.add(o,n,n)}};var _=new e,g=new e,v=new e,y=new e,C=new e;m.rayTriangleParametric=function(t,r,n,o,s){s=i(s,!1);var l,u,c,d,h,p=t.origin,f=t.direction,m=e.subtract(n,r,_),w=e.subtract(o,r,g),S=e.cross(f,w,v),E=e.dot(m,S);if(s){if(E<a.EPSILON6)return;if(l=e.subtract(p,r,y),c=e.dot(l,S),c<0||c>E)return;if(u=e.cross(l,m,C),d=e.dot(f,u),d<0||c+d>E)return;h=e.dot(w,u)/E}else{if(Math.abs(E)<a.EPSILON6)return;var b=1/E;if(l=e.subtract(p,r,y),c=e.dot(l,S)*b,c<0||c>1)return;if(u=e.cross(l,m,C),d=e.dot(f,u)*b,d<0||c+d>1)return;h=e.dot(w,u)*b}return h},m.rayTriangle=function(t,i,n,o,a,s){var l=m.rayTriangleParametric(t,i,n,o,a);if(r(l)&&!(l<0))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var w=new c;m.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=w;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!r(c)||c<0||c>e.distance(t,i)))return r(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var S={root0:0,root1:0};m.raySphere=function(e,t,i){if(i=h(e,t,i),r(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var E=new c;m.lineSegmentSphere=function(t,i,n,o){var a=E;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var b=new e,T=new e;m.rayEllipsoid=function(t,i){var r,n,a,s,l,u=i.oneOverRadii,c=e.multiplyComponents(u,t.origin,b),d=e.multiplyComponents(u,t.direction,T),h=e.magnitudeSquared(c),p=e.dot(c,d);if(h>1){if(p>=0)return;var f=p*p;if(r=h-1,n=e.magnitudeSquared(d),a=n*r,f<a)return;if(f>a){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,_=r/l;return m<_?new o(m,_):{start:_,stop:m}}var g=Math.sqrt(r/n);return new o(g,g)}return h<1?(r=h-1,n=e.magnitudeSquared(d),a=n*r,s=p*p-a,l=-p+Math.sqrt(s),new o(0,l/n)):p<0?(n=e.magnitudeSquared(d),new o(0,-p/n)):void 0};var x=new e,A=new e,P=new e,D=new e,M=new e,I=new s,R=new s,O=new s,N=new s,L=new s,B=new s,F=new s,k=new e,V=new e,z=new t;m.grazingAltitudeLocation=function(t,i){var n=t.origin,o=t.direction;if(!e.equals(n,e.ZERO)){var l=i.geodeticSurfaceNormal(n,x);if(e.dot(o,l)>=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(o,x),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,D),p=e.normalize(e.cross(h,d,A),A),m=e.normalize(e.cross(d,p,P),P),_=I;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=p.x,_[4]=p.y,_[5]=p.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var g=s.transpose(_,R),v=s.fromScale(i.radii,O),y=s.fromScale(i.oneOverRadii,N),C=L;C[0]=0,C[1]=-o.z,C[2]=o.y,C[3]=o.z,C[4]=0,C[5]=-o.x,C[6]=-o.y,C[7]=o.x,C[8]=0;var w,S,E=s.multiply(s.multiply(g,y,B),C,B),b=s.multiply(s.multiply(E,v,F),_,F),T=s.multiplyByVector(E,n,M),U=f(b,e.negate(T,x),0,0,1),G=U.length;if(G>0){for(var H=e.clone(e.ZERO,V),W=Number.NEGATIVE_INFINITY,q=0;q<G;++q){w=s.multiplyByVector(v,s.multiplyByVector(_,U[q],k),k);var j=e.normalize(e.subtract(w,n,D),D),Y=e.dot(j,o);Y>W&&(W=Y,H=e.clone(w,H))}var X=i.cartesianToCartographic(H,z);return W=a.clamp(W,0,1),S=e.magnitude(e.subtract(H,n,D))*Math.sqrt(1-W*W),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var U=new e;return m.lineSegmentPlane=function(t,i,n,o){r(o)||(o=new e);var s=e.subtract(i,t,U),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON6)){var c=e.dot(l,t),d=-(n.distance+c)/u;if(!(d<0||d>1))return e.multiplyByScalar(s,d,o),e.add(t,o,o),o}},m.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var d,h;if(1!==c&&2!==c||(d=new e,h=new e),1===c){if(s)return m.lineSegmentPlane(t,i,n,d),m.lineSegmentPlane(t,r,n,h),{positions:[t,i,r,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(i,r,n,d),m.lineSegmentPlane(i,t,n,h),{positions:[t,i,r,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(r,t,n,d),m.lineSegmentPlane(r,i,n,h),{positions:[t,i,r,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(i,t,n,d),m.lineSegmentPlane(r,t,n,h),{positions:[t,i,r,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(r,i,n,d),m.lineSegmentPlane(t,i,n,h),{positions:[t,i,r,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,r,n,d),m.lineSegmentPlane(i,r,n,h),{positions:[t,i,r,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){t(n[i])||(n[i]=!0,console.warn(e(r,i)))}var n={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,i){"use strict";function r(e,t){i(e,t)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,d,h){var p,f,m,_,g;if("%%"==e)return"%";for(var v=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&b<E;b++)switch(l.charAt(b)){case" ":y=" ";break;case"+":y="+";break;case"-":v=!0;break;case"'":S=l.charAt(b+1);break;case"0":C=!0;break;case"#":w=!0}if(u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,u<0&&(u=-u,v=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[i++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],h){case"s":return s(String(g),v,u,d,C,S);case"c":return s(String.fromCharCode(+g),v,u,d,C);case"b":return a(g,2,w,v,u,d,C);case"o":return a(g,8,w,v,u,d,C);case"x":return a(g,16,w,v,u,d,C);case"X":return a(g,16,w,v,u,d,C).toUpperCase();case"u":return a(g,10,w,v,u,d,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),f=p<0?"-":y,g=f+n(String(Math.abs(p)),d,"0",!1),o(g,f,v,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,f=p<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],g=f+Math.abs(p)[m](d),o(g,f,v,u,C)[_]();default:return e}};return r.replace(e,l)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){y.julianDate=e;var i=m.leapSeconds,r=t(i,y,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=m.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}m.addSeconds(e,n,e)}function h(e,i){y.julianDate=e;var r=m.leapSeconds,n=t(r,y,c);if(n<0&&(n=~n),0===n)return m.addSeconds(e,-r[0].offset,i);if(n>=r.length)return m.addSeconds(e,-r[n-1].offset,i);var o=m.secondsDifference(r[n].julianDate,e);return 0===o?m.addSeconds(e,-r[n].offset,i):o<=1?void 0:m.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,t<0&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function f(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,r<0&&(r+=24);var d=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return d>=43200&&(c-=1),[c,d]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&d(this)}var _=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,y=new s,C=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,E=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,b=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;m.fromDate=function(e,t){var i=f(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),d(t),t):new m(i[0],i[1],u.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var i,n,o,s=e.split("T"),l=1,c=1,h=0,_=0,y=0,T=0,D=s[0],M=s[1];if(s=D.match(b),null!==s)i=+s[1],l=+s[2],c=+s[3];else if(s=D.match(w),null!==s)i=+s[1],l=+s[2];else if(s=D.match(C),null!==s)i=+s[1];else{var I;if(s=D.match(S),null!==s)i=+s[1],I=+s[2],o=a(i);else if(s=D.match(E),null!==s){i=+s[1];var R=+s[2],O=+s[3]||0,N=new Date(Date.UTC(i,0,4));I=7*R+O-N.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(i);var L;if(r(M)){s=M.match(P),null!==s?(h=+s[1],_=+s[2],y=+s[3],T=1e3*+(s[4]||0),L=5):(s=M.match(A),null!==s?(h=+s[1],_=+s[2],y=60*+(s[3]||0),L=4):(s=M.match(x),null!==s&&(h=+s[1],_=60*+(s[2]||0),L=3)));var B=s[L],F=+s[L+1],k=+(s[L+2]||0);switch(B){case"+":h-=F,_-=k;break;case"-":h+=F,_+=k;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,h,_)).getTimezoneOffset()}}else _+=new Date(i,l-1,c).getTimezoneOffset();var V=60===y;for(V&&y--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===l?v:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?v:g[l-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,c--;for(;c<1;)l--,l<1&&(l+=12,i--),n=o&&2===l?v:g[l-1],c+=n;var z=f(i,l,c,h,_,y,T);return r(t)?(p(z[0],z[1],t),d(t)):t=new m(z[0],z[1],u.UTC),V&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var D=new m(0,0,u.TAI);return m.toGregorianDate=function(e,t){var i=!1,n=h(e,D);r(n)||(m.addSeconds(e,-1,D),n=h(D,D),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var d=4e3*(u+1)/1461001|0;u=u-(1461*d/4|0)+31|0;var p=80*u/2447|0,f=u-(2447*p/80|0)|0;u=p/11|0;var _=p+2-12*u|0,g=100*(c-49)+d+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var w=0|y,S=(y-w)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(w+=1),r(t)?(t.year=g,t.month=_,t.day=f,t.hour=v,t.minute=C,t.second=w,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,f,v,C,w,S,i)},m.toDate=function(e){var t=m.toGregorianDate(e,_),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},m.toIso8601=function(t,i){var n,o=m.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,u.TAI)},m.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=i},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var i=m.leapSeconds,r=t(i,y,c);return r<0&&(r=~r,--r,r<0&&(r=0)),i[r].offset},m.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},m.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},m.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},m.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},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),new s(new m(2457204,43236,u.TAI),36),new s(new m(2457754,43237,u.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r<i.length;++r){var n=i[r],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i){var r=new e(i);r.normalize();var n=r.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=r.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])||(o[r]=!0)},n.remove=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])&&delete o[r]},n.contains=function(e){var i=r(e);return!(!t(i)||!t(o[i]))},n.clear=function(){o={}},n}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,a=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var i=e.defer();return s.load(t,r,n,o,a,i,l),i.promise})}function l(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function u(e,t){for(var i=l(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=i.charCodeAt(o);return r}function c(e,i){i=t(i,"");var r=e[1],n=!!e[2],o=e[3];switch(i){case"":case"text":return l(n,o);case"arraybuffer":return u(n,o);case"blob":var a=u(n,o);return new Blob([a],{type:r});case"document":var s=new DOMParser;return s.parseFromString(l(n,o),r);case"json":return JSON.parse(l(n,o))}}var d=/^data:(.*?)(;base64)?,(.*)$/;return s.load=function(e,t,r,s,l,u,h){var p=d.exec(e);if(null!==p)return void u.resolve(c(p,t));var f=new XMLHttpRequest;if(a.contains(e)&&(f.withCredentials=!0),i(h)&&i(f.overrideMimeType)&&f.overrideMimeType(h),f.open(r,e,!0),i(l))for(var m in l)l.hasOwnProperty(m)&&f.setRequestHeader(m,l[m]);i(t)&&(f.responseType=t),f.onload=function(){if(f.status<200||f.status>=300)return void u.reject(new n(f.status,f.response,f.getAllResponseHeaders()));var e=f.response,r=f.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&i(f.responseXML)&&f.responseXML.hasChildNodes()?u.resolve(f.responseXML):""!==r&&"text"!==r||!i(f.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(f.responseText);else u.resolve(e)},f.onerror=function(e){u.reject(new n)},f.send(s)},s.defaultLoad=s.load,s}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,headers:i})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))f(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){f(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else f(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function f(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),h=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||h<0||f<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=m,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,C=0,w=_.length;C<w;C+=e._columnCount){
var S=_[C+n],E=_[C+m],b=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new a(b,E,d.TAI);if(g.push(T),y){if(E!==v&&r(v)){var x=a.leapSeconds,A=t(x,T,p);if(A<0){var P=new s(T,E);x.splice(~A,0,P)}}v=E}}}function m(e,t,i,r,n){var o=i*r;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function _(e,t,i){return t+e*(i-t)}function g(e,t,i,r,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return m(e,i,n,l,s),s;if(r.equals(c))return m(e,i,o,l,s),s;var d=a.secondsDifference(r,u)/a.secondsDifference(c,u),h=n*l,p=o*l,f=i[h+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],v=g-f;if(v>.5||v<-.5){var y=i[h+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?f=g:g-=C-y)}return s.xPoleWander=_(d,i[h+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=_(d,i[h+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_(d,i[h+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_(d,i[h+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_(d,f,g),s}return h.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var d=o[s],h=o[s+1],p=a.lessThanOrEquals(d,e),f=!r(h),m=f||a.greaterThanOrEquals(h,e);if(p&&m)return l=s,!f&&h.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var _=t(o,e,a.compare,this._dateColumn);return _>=0?(_<o.length-1&&o[_+1].equals(e)&&++_,l=_,c=_):(c=~_,l=c-1,l<0&&(l=0)),this._lastIndex=l,g(this,o,this._samples,e,l,c,i),i}if(r(this._dataError))throw new u(this._dataError)},h}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,i){this.x=e,this.y=t,this.s=i}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=i(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=i(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=i(e.stepSizeDays,1),this._samplesPerXysFile=i(e.samplesPerXysFile,1e3),this._totalSamples=i(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;l<=t;++l){r[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;u<=t;++u)u!==l&&(r[l]*=l-u);r[l]=1/r[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,i){var r=d;return r.dayNumber=t,r.secondsOfDay=i,o.daysDifference(r,e._sampleZeroDateTT)}function c(i,n){if(i._chunkDownloadsInProgress[n])return i._chunkDownloadsInProgress[n];var o=e.defer();i._chunkDownloadsInProgress[n]=o;var s,l=i._xysFileUrlTemplate;return s=r(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){i._chunkDownloadsInProgress[n]=!1;for(var t=i._samples,r=e.samples,a=n*i._samplesPerXysFile*3,s=0,l=r.length;s<l;++s)t[a+s]=r[s];o.resolve()}),o.promise}var d=new o(0,0,s.TAI);return l.prototype.preload=function(t,i,r,n){var o=u(this,t,i),a=u(this,r,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var d=s/this._samplesPerXysFile|0,h=l/this._samplesPerXysFile|0,p=[],f=d;f<=h;++f)p.push(c(this,f));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var d=l+s;d>=this._totalSamples&&(d=this._totalSamples-1,l=d-s,l<0&&(l=0));var h=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),h=!0),r(p[3*d])||(c(this,d/this._samplesPerXysFile|0),h=!0),!h){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var f,m,_=o-l*this._stepSizeDays,g=this._work,v=this._denominators,y=this._coef,C=this._xTable;for(f=0;f<=s;++f)g[f]=_-C[f];for(f=0;f<=s;++f){for(y[f]=1,m=0;m<=s;++m)m!==f&&(y[f]*=g[m]);y[f]*=v[f];var w=3*(l+f);i.x+=y[f]*p[w++],i.y+=y[f]*p[w++],i.s+=y[f]*p[w]}return i}}}},l}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.roll=e(r,0)}return n.fromQuaternion=function(e,i){t(i)||(i=new n);var r=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),l=2*(e.w*e.z+e.x*e.y);return i.heading=-Math.atan2(l,s),i.roll=Math.atan2(a,o),i.pitch=-Math.asin(r),i},n.fromDegrees=function(e,i,o,a){return t(a)||(a=new n),a.heading=e*r.RADIANS_PER_DEGREE,a.pitch=i*r.RADIANS_PER_DEGREE,a.roll=o*r.RADIANS_PER_DEGREE,a},n.clone=function(e,i){if(t(e))return t(i)?(i.heading=e.heading,i.pitch=e.pitch,i.roll=e.roll,i):new n(e.heading,e.pitch,e.roll)},n.equals=function(e,i){return e===i||t(e)&&t(i)&&e.heading===i.heading&&e.pitch===i.pitch&&e.roll===i.roll},n.equalsEpsilon=function(e,i,n,o){return e===i||t(e)&&t(i)&&r.equalsEpsilon(e.heading,i.heading,n,o)&&r.equalsEpsilon(e.pitch,i.pitch,n,o)&&r.equalsEpsilon(e.roll,i.roll,n,o)},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t,i){return n.equalsEpsilon(this,e,t,i)},n.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},n}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.z=i(r,0),this.w=i(n,0)}var d=new e;c.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);d=e.normalize(t,d);var s=d.x*a,l=d.y*a,u=d.z*a,h=Math.cos(o);return r(n)?(n.x=s,n.y=l,n.z=u,n.w=h,n):new c(s,l,u,h)};var h=[1,2,0],p=new Array(3);c.fromRotationMatrix=function(e,t){var i,n,o,a,s,l=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],f=e[u.COLUMN2ROW2],m=l+d+f;if(m>0)i=Math.sqrt(m+1),s=.5*i,i=.5/i,n=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*i,o=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*i,a=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*i;else{var _=h,g=0;d>l&&(g=1),f>l&&f>d&&(g=2);var v=_[g],y=_[v];i=Math.sqrt(e[u.getElementIndex(g,g)]-e[u.getElementIndex(v,v)]-e[u.getElementIndex(y,y)]+1);var C=p;C[g]=.5*i,i=.5/i,s=(e[u.getElementIndex(y,v)]-e[u.getElementIndex(v,y)])*i,C[v]=(e[u.getElementIndex(v,g)]+e[u.getElementIndex(g,v)])*i,C[y]=(e[u.getElementIndex(y,g)]+e[u.getElementIndex(g,y)])*i,n=-C[0],o=-C[1],a=-C[2]}return r(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new c(n,o,a,s)};var f=new c,m=new c,_=new c,g=new c;c.fromHeadingPitchRoll=function(t,i,r,o){var a;return t instanceof s?(a=t,o=i):(n("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),a=new s(t,i,r)),g=c.fromAxisAngle(e.UNIT_X,a.roll,f),_=c.fromAxisAngle(e.UNIT_Y,-a.pitch,o),o=c.multiply(_,g,_),m=c.fromAxisAngle(e.UNIT_Z,-a.heading,f),c.multiply(m,o,o)};var v=new e,y=new e,C=new c,w=new c,S=new c;c.packedLength=4,c.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new c),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,i,r){c.unpack(e,4*i,S),c.conjugate(S,S);for(var n=0,o=i-t+1;n<o;n++){var a=3*n;c.unpack(e,4*(t+n),C),c.multiply(C,S,C),C.w<0&&c.negate(C,C),c.computeAxis(C,v);var s=c.computeAngle(C);r[a]=v.x*s,r[a+1]=v.y*s,r[a+2]=v.z*s}},c.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new c),e.fromArray(t,0,y);var s=e.magnitude(y);return c.unpack(i,4*o,w),0===s?c.clone(c.IDENTITY,C):c.fromAxisAngle(y,s,C),c.multiply(C,w,a)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var i=1/c.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},c.inverse=function(e,t){var i=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/i,t)},c.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},c.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,d=a*s+r*c+n*u-o*l,h=a*l-r*u+n*c+o*s,p=a*u+r*l-n*s+o*c,f=a*c-r*s-n*l-o*u;return i.x=d,i.y=h,i.z=p,i.w=f,i},c.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},c.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},c.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)<l.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-i*i);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<l.EPSILON6?0:2*Math.acos(e.w)};var E=new c;c.lerp=function(e,t,i,r){return E=c.multiplyByScalar(t,i,E),r=c.multiplyByScalar(e,1-i,r),c.add(E,r,r)};var b=new c,T=new c,x=new c;c.slerp=function(e,t,i,r){var n=c.dot(e,t),o=t;if(n<0&&(n=-n,o=b=c.negate(t,b)),1-n<l.EPSILON6)return c.lerp(e,o,i,r);var a=Math.acos(n);return T=c.multiplyByScalar(e,Math.sin((1-i)*a),T),x=c.multiplyByScalar(o,Math.sin(i*a),x),r=c.add(T,x,r),c.multiplyByScalar(r,1/Math.sin(a),r)},c.log=function(t,i){var r=l.acosClamped(t.w),n=0;return 0!==r&&(n=r/Math.sin(r)),e.multiplyByScalar(t,n,i)},c.exp=function(t,i){var r=e.magnitude(t),n=0;return 0!==r&&(n=Math.sin(r)/r),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(r),i};var A=new e,P=new e,D=new c,M=new c;c.computeInnerQuadrangle=function(t,i,r,n){var o=c.conjugate(i,D);c.multiply(o,r,M);var a=c.log(M,A);c.multiply(o,t,M);var s=c.log(M,P);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),c.exp(a,D),c.multiply(i,D,n)},c.squad=function(e,t,i,r,n,o){var a=c.slerp(e,t,n,D),s=c.slerp(i,r,n,M);return c.slerp(a,s,2*n*(1-n),o)};for(var I=new c,R=1.9011074535173003,O=o.supportsTypedArrays()?new Float32Array(8):[],N=o.supportsTypedArrays()?new Float32Array(8):[],L=o.supportsTypedArrays()?new Float32Array(8):[],B=o.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var k=F+1,V=2*k+1;O[F]=1/(k*V),N[F]=k/V}return O[7]=R/136,N[7]=8*R/17,c.fastSlerp=function(e,t,i,r){var n,o=c.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,l=i*i,u=s*s,d=7;d>=0;--d)L[d]=(O[d]*l-N[d])*a,B[d]=(O[d]*u-N[d])*a;var h=n*i*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),p=s*(1+B[0]*(1+B[1]*(1+B[2]*(1+B[3]*(1+B[4]*(1+B[5]*(1+B[6]*(1+B[7])))))))),f=c.multiplyByScalar(e,p,I);return c.multiplyByScalar(t,h,r),c.add(f,r,r)},c.fastSquad=function(e,t,i,r,n,o){var a=c.fastSlerp(e,t,n,D),s=c.fastSlerp(i,r,n,M);return c.fastSlerp(a,s,2*n*(1-n),o)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,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},c.ZERO=a(new c(0,0,0,0)),c.IDENTITY=a(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";var w={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},E={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},b={},T={east:new i,north:new i,up:new i,west:new i,south:new i,down:new i},x=new i,A=new i,P=new i;w.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new u("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,n=S[e][t],o=e+t;return s(b[o])?r=b[o]:(r=function(r,o,l){if(s(l)||(l=new v),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var u=_.sign(r.z);i.unpack(E[e],0,x),"east"!==e&&"west"!==e&&i.multiplyByScalar(x,u,x),i.unpack(E[t],0,A),"east"!==t&&"west"!==t&&i.multiplyByScalar(A,u,A),i.unpack(E[n],0,P),"east"!==n&&"west"!==n&&i.multiplyByScalar(P,u,P)}else{o=a(o,h.WGS84),o.geodeticSurfaceNormal(r,T.up);var c=T.up,d=T.east;d.x=-r.y,d.y=r.x,d.z=0,i.normalize(d,T.east),i.cross(c,d,T.north),i.multiplyByScalar(T.up,-1,T.down),i.multiplyByScalar(T.east,-1,T.west),i.multiplyByScalar(T.north,-1,T.south),x=T[e],A=T[t],P=T[n]}return l[0]=x.x,l[1]=x.y,l[2]=x.z,l[3]=0,l[4]=A.x,l[5]=A.y,l[6]=A.z,l[7]=0,l[8]=P.x,l[9]=P.y,l[10]=P.z,l[11]=0,l[12]=r.x,l[13]=r.y,l[14]=r.z,l[15]=1,l},b[o]=r),r},w.eastNorthUpToFixedFrame=w.localFrameToFixedFrameGenerator("east","north"),w.northEastDownToFixedFrame=w.localFrameToFixedFrameGenerator("north","east"),w.northUpEastToFixedFrame=w.localFrameToFixedFrameGenerator("north","up"),w.northWestUpToFixedFrame=w.localFrameToFixedFrameGenerator("north","west");var D=new y,M=new i(1,1,1),I=new v;w.headingPitchRollToFixedFrame=function(e,t,r,n,o){n instanceof v&&(o=n,n=void 0,l("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),n=a(n,w.eastNorthUpToFixedFrame);var s=y.fromHeadingPitchRoll(t,D),u=v.fromTranslationQuaternionRotationScale(i.ZERO,s,M,I);return o=n(e,r,o),v.multiply(o,u,o)};var R=new v,O=new g;w.headingPitchRollQuaternion=function(e,t,i,r,n){r instanceof y&&(n=r,r=void 0,l("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var o=w.headingPitchRollToFixedFrame(e,t,i,r,R),a=v.getRotation(o,O);return y.fromRotationMatrix(a,n)};var N=24110.54841,L=8640184.812866,B=.093104,F=-62e-7,k=1.1772758384668e-19,V=72921158553e-15,z=_.TWO_PI/86400,U=new m;w.computeTemeToPseudoFixedMatrix=function(e,t){U=m.addSeconds(e,-m.computeTaiMinusUtc(e),U);var i,r=U.dayNumber,n=U.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/C.DAYS_PER_JULIAN_CENTURY:(o-.5)/C.DAYS_PER_JULIAN_CENTURY;var a=N+i*(L+i*(B+i*F)),l=a*z%_.TWO_PI,u=V+k*(r-2451545.5),c=(n+.5*C.SECONDS_PER_DAY)%C.SECONDS_PER_DAY,d=l+u*c,h=Math.cos(d),p=Math.sin(d);return s(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(h,p,0,-p,h,0,0,0,1)},w.iau2006XysData=new p,w.earthOrientationParameters=c.NONE;var G=32.184,H=2451545;w.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+G,n=t.stop.dayNumber,o=t.stop.secondsOfDay+G,a=w.iau2006XysData.preload(i,r,n,o),s=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},w.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new g);var i=w.computeFixedToIcrfMatrix(e,t);if(s(i))return g.transpose(i,t)};var W=new f(0,0,0),q=new d(0,0,0,0,0,0),j=new g,Y=new g;w.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new g);var i=w.earthOrientationParameters.compute(e,q);if(s(i)){var r=e.dayNumber,n=e.secondsOfDay+G,o=w.iau2006XysData.computeXysRadians(r,n,W);if(s(o)){var a=o.x+i.xPoleOffset,l=o.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-a*a-l*l)),c=j;c[0]=1-u*a*a,c[3]=-u*a*l,c[6]=a,c[1]=-u*a*l,c[4]=1-u*l*l,c[7]=l,c[2]=-a,c[5]=-l,c[8]=1-u*(a*a+l*l);var d=g.fromRotationZ(-o.s,Y),h=g.multiply(c,d,j),p=e.dayNumber,f=e.secondsOfDay-m.computeTaiMinusUtc(e)+i.ut1MinusUtc,v=p-2451545,y=f/C.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(v+y);S=S%1*_.TWO_PI;var E=g.fromRotationZ(S,Y),b=g.multiply(h,E,j),T=Math.cos(i.xPoleWander),x=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),D=r-H+n/C.SECONDS_PER_DAY;D/=36525;var M=-47e-6*D*_.RADIANS_PER_DEGREE/3600,I=Math.cos(M),R=Math.sin(M),O=Y;return O[0]=T*I,O[1]=T*R,O[2]=A,O[3]=-x*R+P*A*I,O[4]=x*I+P*A*R,O[5]=-P*T,O[6]=-P*R-x*A*I,O[7]=P*I-x*A*R,O[8]=x*T,g.multiply(b,O,t)}}};var X=new r;w.pointToWindowCoordinates=function(e,t,i,r){return r=w.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},w.pointToGLWindowCoordinates=function(e,i,n,o){s(o)||(o=new t);var a=X;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,a),a),r.multiplyByScalar(a,1/a.w,a),v.multiplyByVector(i,a,a),t.fromCartesian4(a,o)};var Z=new i,K=new i,Q=new i;w.rotationMatrixFromPositionVelocity=function(e,t,r,n){var o=a(r,h.WGS84).geodeticSurfaceNormal(e,Z),l=i.cross(t,o,K);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,Q);return i.cross(t,u,l),i.negate(l,l),s(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var J=new n,$=new i,ee=new i,te=new r,ie=new r,re=new r,ne=new r,oe=new r,ae=new v,se=new v;w.basisTo2D=function(e,t,n){var o=e.ellipsoid,a=v.getColumn(t,3,te),s=o.cartesianToCartographic(a,J),l=w.eastNorthUpToFixedFrame(a,o,ae),u=v.inverseTransformation(l,se),c=e.project(s,$),d=ie;d.x=c.z,d.y=c.x,d.z=c.y,d.w=1;var h=v.getColumn(t,0,ee),p=i.magnitude(h),f=v.multiplyByVector(u,h,re);r.fromElements(f.z,f.x,f.y,0,f);var m=v.getColumn(t,1,ee),_=i.magnitude(m),g=v.multiplyByVector(u,m,ne);r.fromElements(g.z,g.x,g.y,0,g);var y=v.getColumn(t,2,ee),C=i.magnitude(y),S=oe;return i.cross(f,g,S),i.normalize(S,S),i.cross(g,S,f),i.normalize(f,f),i.cross(S,f,g),i.normalize(g,g),i.multiplyByScalar(f,p,f),i.multiplyByScalar(g,_,g),i.multiplyByScalar(S,C,S),v.setColumn(n,0,f,n),v.setColumn(n,1,g,n),v.setColumn(n,2,S,n),v.setColumn(n,3,d,n),n};var le=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return w.wgs84To2DModelMatrix=function(e,t,i){var r=e.ellipsoid,n=w.eastNorthUpToFixedFrame(t,r,ae),o=v.inverseTransformation(n,se),a=r.cartesianToCartographic(t,J),s=e.project(a,$),l=ie;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=v.fromTranslation(l,ae);return v.multiply(le,o,i),v.multiply(u,i,i),i},w}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(c.getColumn(r,0,m)),this._yAxis=i.fromCartesian4(c.getColumn(r,1,m));var o=i.fromCartesian4(c.getColumn(r,2,m));this._plane=d.fromPointNormal(e,o)}var m=new r;a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;f.fromPoints=function(t,i){var r=e.fromPoints(t,_);return new f(r.center,i)};var g=new h,v=new i;f.prototype.projectPointOntoPlane=function(e,r){var n=g;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;n<r;n++){var a=this.projectPointOntoPlane(e[n],t[i]);o(a)&&(t[i]=a,i++)}return t.length=i,t},f.prototype.projectPointToNearestOnPlane=function(e,r){o(r)||(r=new t);var n=g;n.origin=e,i.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,v);o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v));var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return r.x=l,r.y=c,r},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;r<i;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new i;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;o(t)?t.length=r:t=new Array(r);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;c<r;++c){var d=e[c];i.multiplyByScalar(s,d.x,u),o(t[c])||(t[c]=new i);var h=i.add(a,u,t[c]);i.multiplyByScalar(l,d.y,u),i.add(h,u,h),n.scaleToGeocentricSurface(h,h)}return t},f}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t){this.center=i.clone(n(e,i.ZERO)),this.halfAxes=h.clone(n(t,h.ZERO))}function _(e,t,r,n,a,s,l,u){o(u)||(u=new m);var c=u.halfAxes;h.setColumn(c,0,e.xAxis,c),h.setColumn(c,1,e.yAxis,c),h.setColumn(c,2,e.zAxis,c);var d=T;d.x=(t+r)/2,d.y=(n+a)/2,d.z=(s+l)/2;var p=x;p.x=(r-t)/2,p.y=(a-n)/2,p.z=(l-s)/2;var f=u.center;return d=h.multiplyByVector(c,d,d),i.add(e.origin,d,f),h.multiplyByScale(c,p,c),u}var g=new i,v=new i,y=new i,C=new i,w=new i,S=new i,E=new h,b={unitary:new h,diagonal:new h};m.fromPoints=function(e,t){if(o(t)||(t=new m),!o(e)||0===e.length)return t.halfAxes=h.ZERO,t.center=i.ZERO,t;var r,n=e.length,a=i.clone(e[0],g);for(r=1;r<n;r++)i.add(a,e[r],a);var s=1/n;i.multiplyByScalar(a,s,a);var l,u=0,c=0,d=0,p=0,f=0,_=0;for(r=0;r<n;r++)l=i.subtract(e[r],a,v),u+=l.x*l.x,c+=l.x*l.y,d+=l.x*l.z,p+=l.y*l.y,f+=l.y*l.z,_+=l.z*l.z;u*=s,c*=s,d*=s,p*=s,f*=s,_*=s;var T=E;T[0]=u,T[1]=c,T[2]=d,T[3]=c,T[4]=p,T[5]=f,T[6]=d,T[7]=f,T[8]=_;var x=h.computeEigenDecomposition(T,b),A=h.clone(x.unitary,t.halfAxes),P=h.getColumn(A,0,C),D=h.getColumn(A,1,w),M=h.getColumn(A,2,S),I=-Number.MAX_VALUE,R=-Number.MAX_VALUE,O=-Number.MAX_VALUE,N=Number.MAX_VALUE,L=Number.MAX_VALUE,B=Number.MAX_VALUE;for(r=0;r<n;r++)l=e[r],I=Math.max(i.dot(P,l),I),R=Math.max(i.dot(D,l),R),O=Math.max(i.dot(M,l),O),N=Math.min(i.dot(P,l),N),L=Math.min(i.dot(D,l),L),B=Math.min(i.dot(M,l),B);P=i.multiplyByScalar(P,.5*(N+I),P),D=i.multiplyByScalar(D,.5*(L+R),D),M=i.multiplyByScalar(M,.5*(B+O),M);var F=i.add(P,D,t.center);F=i.add(F,M,F);var k=y;return k.x=I-N,k.y=R-L,k.z=O-B,i.multiplyByScalar(k,.5,k),h.multiplyByScale(t.halfAxes,k,t.halfAxes),t};var T=new i,x=new i,A=new r,P=new i,D=[new r,new r,new r,new r,new r,new r,new r,new r],M=[new i,new i,new i,new i,new i,new i,new i,new i],I=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,i,r,o){t=n(t,0),i=n(i,0),r=n(r,s.WGS84);var a=f.center(e,A),u=r.cartographicToCartesian(a,P),c=new l(u,r),d=c.plane,h=D[0],m=D[1],g=D[2],v=D[3],y=D[4],C=D[5],w=D[6],S=D[7],E=a.longitude,b=e.south<0&&e.north>0?0:a.latitude;w.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=b,h.latitude=m.latitude=g.latitude=e.north,w.longitude=S.longitude=h.longitude=e.west,C.longitude=m.longitude=E,y.longitude=v.longitude=g.longitude=e.east,g.height=m.height=h.height=S.height=w.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(D,M),c.projectPointsToNearestOnPlane(M,I);var T=Math.min(I[6].x,I[7].x,I[0].x),x=Math.max(I[2].x,I[3].x,I[4].x),R=Math.min(I[4].y,I[5].y,I[6].y),O=Math.max(I[0].y,I[1].y,I[2].y);g.height=h.height=y.height=w.height=t,r.cartographicArrayToCartesianArray(D,M);var N=Math.min(p.getPointDistance(d,M[0]),p.getPointDistance(d,M[2]),p.getPointDistance(d,M[4]),p.getPointDistance(d,M[6])),L=i;return _(c,T,x,R,O,N,L,o)},m.clone=function(e,t){if(o(e))return o(t)?(i.clone(e.center,t.center),h.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[h.COLUMN0ROW0]+s*o[h.COLUMN0ROW1]+l*o[h.COLUMN0ROW2])+Math.abs(a*o[h.COLUMN1ROW0]+s*o[h.COLUMN1ROW1]+l*o[h.COLUMN1ROW2])+Math.abs(a*o[h.COLUMN2ROW0]+s*o[h.COLUMN2ROW1]+l*o[h.COLUMN2ROW2]),d=i.dot(n,r)+t.distance;return d<=-c?u.OUTSIDE:d>=c?u.INSIDE:u.INTERSECTING};var R=new i,O=new i,N=new i,L=new i;m.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=h.getColumn(n,0,R),a=h.getColumn(n,1,O),s=h.getColumn(n,2,N),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var d=L;d.x=i.dot(r,o),d.y=i.dot(r,a),d.z=i.dot(r,s);var p,f=0;return d.x<-l?(p=d.x+l,f+=p*p):d.x>l&&(p=d.x-l,f+=p*p),d.y<-u?(p=d.y+u,f+=p*p):d.y>u&&(p=d.y-u,f+=p*p),d.z<-c?(p=d.z+c,f+=p*p):d.z>c&&(p=d.z-c,f+=p*p),f};var B=new i,F=new i;m.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,d=h.getColumn(u,0,R),p=h.getColumn(u,1,O),f=h.getColumn(u,2,N),m=i.add(d,p,B);i.add(m,f,m),i.add(m,l,m);var _=i.subtract(m,t,F),g=i.dot(r,_);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,d,m),i.add(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,d,m),i.subtract(m,p,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,d,m),i.subtract(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.add(m,p,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.add(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.subtract(m,p,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.subtract(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var k=new e;return m.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,k);return!i.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,i){return m.computePlaneDistances(this,e,t,i)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&h.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,a,u,h){var _,g,v,y;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,w=e.maximum,S=i.subtract(w,C,d),E=r-t,b=Math.max(i.maximumComponent(S),E);_=b<m-1?l.BITS12:l.NONE,g=e.center,v=s.inverseTransformation(a,new s);var T=i.negate(C,c);s.multiply(s.fromTranslation(T,p),v,v);var x=c;x.x=1/S.x,x.y=1/S.y,x.z=1/S.z,s.multiply(s.fromScale(x,p),v,v),y=s.clone(a),s.setTranslation(y,i.ZERO,y),a=s.clone(a,new s);var A=s.fromTranslation(C,p),P=s.fromScale(S,f),D=s.multiply(A,P,p);s.multiply(a,D,a),s.multiply(y,D,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=g,this.toScaledENU=v,this.fromScaledENU=a,this.matrix=y,this.hasVertexNormals=u,this.hasWebMercatorT=n(h,!1)}var c=new i,d=new i,h=new t,p=new s,f=new s,m=Math.pow(2,12);u.prototype.encode=function(r,n,o,u,d,p,f){var m=u.x,_=u.y;if(this.quantization===l.BITS12){o=s.multiplyByPoint(this.toScaledENU,o,c),o.x=a.clamp(o.x,0,1),o.y=a.clamp(o.y,0,1),o.z=a.clamp(o.z,0,1);var g=this.maximumHeight-this.minimumHeight,v=a.clamp((d-this.minimumHeight)/g,0,1);t.fromElements(o.x,o.y,h);var y=e.compressTextureCoordinates(h);t.fromElements(o.z,v,h);var C=e.compressTextureCoordinates(h);t.fromElements(m,_,h);var w=e.compressTextureCoordinates(h);if(r[n++]=y,r[n++]=C,r[n++]=w,this.hasWebMercatorT){t.fromElements(f,0,h);var S=e.compressTextureCoordinates(h);r[n++]=S}}else i.subtract(o,this.center,c),r[n++]=c.x,r[n++]=c.y,r[n++]=c.z,r[n++]=d,r[n++]=m,r[n++]=_,this.hasWebMercatorT&&(r[n++]=f);return this.hasVertexNormals&&(r[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,r,n){if(o(n)||(n=new i),r*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[r],h);n.x=a.x,n.y=a.y;var u=e.decompressTextureCoordinates(t[r+1],h);return n.z=u.x,s.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[r],n.y=t[r+1],n.z=t[r+2],i.add(n,this.center,n)},u.prototype.decodeTextureCoordinates=function(i,r,n){return o(n)||(n=new t),r*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(i[r+2],n):t.fromElements(i[r+4],i[r+5],n)},u.prototype.decodeHeight=function(t,i){if(i*=this.getStride(),this.quantization===l.BITS12){var r=e.decompressTextureCoordinates(t[i+1],h);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[i+3]},u.prototype.getOctEncodedNormal=function(e,i,r){var n=this.getStride();i=(i+1)*n-1;var o=e[i]/256,a=Math.floor(o),s=256*(o-a);return t.fromElements(a,s,r)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},g={compressed0:0,compressed1:1};return u.prototype.getAttributes=function(e){var t,i=r.FLOAT,n=r.getSizeInBytes(i);if(this.quantization===l.NONE){var o=4,a=2;return this.hasWebMercatorT&&++a,this.hasVertexNormals&&++a,t=(o+a)*n,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:o,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,
componentsPerAttribute:a,offsetInBytes:o*n,strideInBytes:t}]}var s=3,u=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++s,this.hasWebMercatorT&&this.hasVertexNormals?(++u,t=(s+u)*n,[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s,offsetInBytes:0,strideInBytes:t},{index:g.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:u,offsetInBytes:s*n,strideInBytes:t}]):[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?_:g},u.clone=function(e,t){return o(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=i.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},u}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";var g={};g.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new r,y=new d,C=new r,w=new r;return g.computeVertices=function(a){var u,S,E,b,T=Math.cos,x=Math.sin,A=Math.sqrt,P=Math.atan,D=Math.exp,M=c.PI_OVER_TWO,I=c.toRadians,R=a.heightmap,O=a.width,N=a.height,L=a.skirtHeight,B=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),k=1/F.maximumRadius,V=a.nativeRectangle,z=a.rectangle;o(z)?(u=z.west,S=z.south,E=z.east,b=z.north):B?(u=I(V.west),S=I(V.south),E=I(V.east),b=I(V.north)):(u=V.west*k,S=M-2*P(D(-V.south*k)),E=V.east*k,b=M-2*P(D(-V.north*k)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var H,W,q=n(a.exaggeration,1),j=n(a.includeWebMercatorT,!1),Y=n(a.structure,g.DEFAULT_STRUCTURE),X=n(Y.heightScale,g.DEFAULT_STRUCTURE.heightScale),Z=n(Y.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),K=n(Y.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(Y.stride,g.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(V),te=p.computeHeight(V),ie=ee/(O-1),re=te/(N-1),ne=F.radiiSquared,oe=ne.x,ae=ne.y,se=ne.z,le=65536,ue=-65536,ce=m.eastNorthUpToFixedFrame(U,F),de=d.inverseTransformation(ce,y);j&&(H=_.geodeticLatitudeToMercatorAngle(S),W=1/(_.geodeticLatitudeToMercatorAngle(b)-H));var he=C;he.x=Number.POSITIVE_INFINITY,he.y=Number.POSITIVE_INFINITY,he.z=Number.POSITIVE_INFINITY;var pe=w;pe.x=Number.NEGATIVE_INFINITY,pe.y=Number.NEGATIVE_INFINITY,pe.z=Number.NEGATIVE_INFINITY;var fe=Number.POSITIVE_INFINITY,me=O+(L>0?2:0),_e=N+(L>0?2:0),ge=me*_e,ve=new Array(ge),ye=new Array(ge),Ce=new Array(ge),we=j?new Array(ge):[],Se=0,Ee=N,be=0,Te=O;L>0&&(--Se,++Ee,--be,++Te);for(var xe=0,Ae=Se;Ae<Ee;++Ae){var Pe=Ae;Pe<0&&(Pe=0),Pe>=N&&(Pe=N-1);var De=V.north-re*Pe;De=B?I(De):M-2*P(D(-De*k));var Me=T(De),Ie=x(De),Re=se*Ie,Oe=(De-S)/(b-S);Oe=c.clamp(Oe,0,1);var Ne;j&&(Ne=(_.geodeticLatitudeToMercatorAngle(De)-H)*W);for(var Le=be;Le<Te;++Le){var Be=Le;Be<0&&(Be=0),Be>=O&&(Be=O-1);var Fe=V.west+ie*Be;B?Fe=I(Fe):Fe*=k;var ke,Ve=Pe*(O*Q)+Be*Q;if(1===K)ke=R[Ve];else{ke=0;var ze;if($)for(ze=0;ze<K;++ze)ke=ke*J+R[Ve+ze];else for(ze=K-1;ze>=0;--ze)ke=ke*J+R[Ve+ze]}ke=(ke*X+Z)*q;var Ue=(Fe-u)/(E-u);if(Ue=c.clamp(Ue,0,1),Ce[xe]=new i(Ue,Oe),ue=Math.max(ue,ke),le=Math.min(le,ke),Le!==Be||Ae!==Pe){var Ge=1e-5;Le<0?Fe-=Ge*ee:Fe+=Ge*ee,Ae<0?De+=Ge*te:De-=Ge*te,Me=T(De),Ie=x(De),Re=se*Ie,ke-=L}var He=Me*T(Fe),We=Me*x(Fe),qe=oe*He,je=ae*We,Ye=A(qe*He+je*We+Re*Ie),Xe=1/Ye,Ze=qe*Xe,Ke=je*Xe,Qe=Re*Xe,Je=new r;Je.x=Ze+He*ke,Je.y=Ke+We*ke,Je.z=Qe+Ie*ke,ve[xe]=Je,ye[xe]=ke,j&&(we[xe]=Ne),xe++,d.multiplyByPoint(de,Je,v),r.minimumByComponent(v,he,he),r.maximumByComponent(v,pe,pe),fe=Math.min(fe,ke)}}var $e,et=t.fromPoints(ve);o(z)&&z.width<c.PI_OVER_TWO+c.EPSILON5&&($e=h.fromRectangle(z,le,ue,F));var tt;if(G){var it=new l(F);tt=it.computeHorizonCullingPoint(U,ve)}for(var rt=new e(he,pe,U),nt=new f(rt,fe,ue,ce,!1,j),ot=new Float32Array(ge*nt.getStride()),at=0,st=0;st<ge;++st)at=nt.encode(ot,at,ve[st],Ce[st],ye[st],void 0,we[st]);return{vertices:ot,maximumHeight:ue,minimumHeight:le,encoding:nt,boundingSphere3D:et,orientedBoundingBox:$e,occludeePointInScaledSpace:tt}},g}),define("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function i(){return!0}function r(t,r){function n(){}r=e(r,"This object was destroyed, i.e., destroy() was called.");for(var o in t)"function"==typeof t[o]&&(t[o]=n);t.isDestroyed=i}return r}),define("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(i)||(i=document.createElement("a")),i.href=window.location.href;var r=i.host,n=i.protocol;return i.href=t,i.href=i.href,n!==i.protocol||r!==i.host}var i;return t}),define("Core/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){if(!r(m._canTransferArrayBuffer)){var t=new Worker(h("Workers/transferTypedArrayTest.js"));t.postMessage=i(t.webkitPostMessage,t.postMessage);var n=99,o=new Int8Array([n]);try{t.postMessage({array:o},[o.buffer])}catch(e){return m._canTransferArrayBuffer=!1,m._canTransferArrayBuffer}var a=e.defer();t.onmessage=function(e){var i=e.data.array,o=r(i)&&i[0]===n;a.resolve(o),t.terminate(),m._canTransferArrayBuffer=o},m._canTransferArrayBuffer=a.promise}return m._canTransferArrayBuffer}function d(e,t){--e._activeTasks;var i=t.id;if(r(i)){var n=e._deferreds,a=n[i];if(r(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new l(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),a.reject(s)}else a.resolve(t.result);delete n[i]}}function h(e){var i=t(e);if(s(i)){var r,n='importScripts("'+i+'");';try{r=new Blob([n],{type:"application/javascript"})}catch(e){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(n),r=a.getBlob("application/javascript")}var l=window.URL||window.webkitURL;i=l.createObjectURL(r)}return i}function p(){return r(_)||(_=h("Workers/cesiumWorkerBootstrapper.js")),_}function f(e){var n=new Worker(p());n.postMessage=i(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:m._workerModulePrefix+e._workerName};return r(m._loaderConfig)?o.loaderConfig=m._loaderConfig:r(u.toUrl)?o.loaderConfig.baseUrl=a("..",t("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:t("Workers")},n.postMessage(o),n.onmessage=function(t){d(e,t.data)},n}function m(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var _,g=[];return m.prototype.scheduleTask=function(t,i){if(r(this._worker)||(this._worker=f(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){r(i)?o||(i.length=0):i=g;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},m._defaultWorkerModulePrefix="Workers/",m._workerModulePrefix=m._defaultWorkerModulePrefix,m._loaderConfig=void 0,m._canTransferArrayBuffer=void 0,m}),define("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c,d){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=d}return t}),define("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError},availability:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;l<i-1;++l){for(var u=0;u<t-1;++u){var c=a,d=c+t,h=d+1,p=c+1;n[s++]=c,n[s++]=d,n[s++]=p,n[s++]=p,n[s++]=d,n[s++]=h,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*i)},n.prototype.requestTileGeometry=i.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=i.throwInstantiationError,n.prototype.getTileDataAvailable=i.throwInstantiationError,n}),define("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var r=a.DEFAULT_STRUCTURE,n=e.structure;i(n)?n!==r&&(n.heightScale=t(n.heightScale,r.heightScale),n.heightOffset=t(n.heightOffset,r.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,r.elementsPerHeight),n.stride=t(n.stride,r.stride),n.elementMultiplier=t(n.elementMultiplier,r.elementMultiplier),n.isBigEndian=t(n.isBigEndian,r.isBigEndian)):n=r,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function f(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south),h=0|c,p=h+1;p>=a&&(p=a-1,h=a-2);var f=0|d,m=f+1;m>=s&&(m=s-1,f=s-2);var v=c-h,y=d-f;f=s-1-f,m=s-1-m;var C=g(e,t,i,r,n,f*a+h),w=g(e,t,i,r,n,f*a+p),S=g(e,t,i,r,n,m*a+h),E=g(e,t,i,r,n,m*a+p);return _(v,y,C,w,S,E)}function m(e,t,i,r,n,o,a,s,l,u,c){var d=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(d+=1,h+=1,a+=2,s+=2);var p=n>0?a-1:a,f=0|d,m=f+1;m>=p&&(m=a-1,f=a-2);var g=n>0?s-1:s,v=0|h,y=v+1;y>=g&&(y=s-1,v=s-2);var C=d-f,w=h-v;v=s-1-v,y=s-1-y;var S=(t.decodeHeight(e,v*a+f)/c-i)/r,E=(t.decodeHeight(e,v*a+m)/c-i)/r,b=(t.decodeHeight(e,y*a+f)/c-i)/r,T=(t.decodeHeight(e,y*a+m)/c-i)/r;return _(C,w,S,E,b,T)}function _(e,t,i,r,n,o){return t<e?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function g(e,t,i,r,n,o){o*=r;var a,s=0;if(n)for(a=0;a<t;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function v(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;l<t-1;++l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;else for(l=t-1;l>0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,f=r.tileXYToNativeRectangle(n,a,s),m=r.tileXYToRectangle(n,a,s);u=t(u,1);var _=p.cartographicToCartesian(l.center(m)),g=this._structure,v=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=v/(1<<s);this._skirtHeight=Math.min(4*C,1e3);var w=y.scheduleTask({heightmap:this._buffer,structure:g,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:f,rectangle:m,relativeToCenter:_,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:r instanceof o,exaggeration:u});if(i(w)){var S=this;return e(w,function(e){return S._mesh=new d(_,new Float32Array(e.vertices),h.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,c.clone(e.encoding),u),S._buffer=void 0,S._mesh})}},p.prototype.interpolateHeight=function(e,t,r){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,d=s.isBigEndian,h=s.heightOffset,p=s.heightScale;if(i(this._mesh)){var _=this._mesh.vertices,g=this._mesh.encoding,v=this._skirtHeight,y=this._mesh.exaggeration;n=m(_,g,h,p,v,e,o,a,t,r,y)}else n=f(this._buffer,u,c,l,d,e,o,a,t,r),n=n*p+h;return n},p.prototype.upsample=function(e,t,r,n,o,a,l){var u=this._width,c=this._height,d=this._structure,h=this._skirtHeight,f=d.stride,_=new this._bufferType(u*c*f),g=this._mesh;if(i(g)){for(var y=g.vertices,C=g.encoding,w=e.tileXYToRectangle(t,r,n),S=e.tileXYToRectangle(o,a,l),E=d.heightOffset,b=d.heightScale,T=g.exaggeration,x=d.elementsPerHeight,A=d.elementMultiplier,P=d.isBigEndian,D=Math.pow(A,x-1),M=0;M<c;++M)for(var I=s.lerp(S.north,S.south,M/(c-1)),R=0;R<u;++R){var O=s.lerp(S.west,S.east,R/(u-1)),N=m(y,C,E,b,h,w,u,c,O,I,T);N=N<d.lowestEncodedHeight?d.lowestEncodedHeight:N,N=N>d.highestEncodedHeight?d.highestEncodedHeight:N,v(_,x,A,D,f,P,M*u+R,N)}return new p({buffer:_,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,n){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,n):new Uint16Array(t,i,n)},i(o)}),define("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"arraybuffer",headers:i})}return t}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=r<e,l=n<e,u=o<e):(s=r>e,l=n>e,u=o>e);var c,d,h,p,f,m,_=s+l+u;return 1===_?s?(c=(e-r)/(n-r),d=(e-r)/(o-r),a.push(1),a.push(2),1!==d&&(a.push(-1),a.push(0),a.push(2),a.push(d)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(h=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==h&&(a.push(-1),a.push(1),a.push(2),a.push(h))):u&&(f=(e-o)/(r-o),m=(e-o)/(n-o),a.push(0),a.push(1),1!==m&&(a.push(-1),a.push(2),a.push(1),a.push(m)),1!==f&&(a.push(-1),a.push(2),a.push(0),a.push(f))):2===_?s||r===e?l||n===e?u||o===e||(d=(e-r)/(o-r),h=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(d),a.push(-1),a.push(1),a.push(2),a.push(h)):(m=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(m),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),f=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(f)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var d=n-l,h=l-a,p=s-u,f=o-u,m=1/(p*d+h*f),_=r-u,g=i-l,v=(p*g+h*_)*m,y=(-f*g+d*_)*m,C=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=C,c):new e(v,y,C)},r}),define("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=_(e.westIndices,t,r),this._southIndices=_(e.southIndices,i,r),this._eastIndices=_(e.eastIndices,t,r),this._northIndices=_(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function _(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;n<o;++n)y[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,b),f=o.decodeTextureCoordinates(n,d,T),m=o.decodeTextureCoordinates(n,h,x),_=u.computeBarycentricCoordinates(t,i,p.x,p.y,f.x,f.y,m.x,m.y,E);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var g=o.decodeHeight(n,c),v=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return _.x*g+_.y*v+_.z*y}}}function v(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var d=a[s],h=a[s+1],p=a[s+2],f=r[d],m=r[h],_=r[p],g=n[d],v=n[h],y=n[p],C=u.computeBarycentricCoordinates(t,i,f,g,m,v,_,y,E);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var w=C.x*o[d]+C.y*o[h]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,w/S)}}}a(m.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var d=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(d)){var h=this;return e(d,function(e){var t=h._quantizedVertices.length/3;t+=h._westIndices.length+h._southIndices.length+h._eastIndices.length+h._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,h._boundingSphere),d=n(e.orientedBoundingBox,h._orientedBoundingBox),m=h._horizonOcclusionPoint,_=e.vertexStride,g=p.clone(e.encoding);return h._skirtIndex=e.skirtIndex,h._vertexCountWithoutSkirts=h._quantizedVertices.length/3,h._mesh=new f(o,r,i,a,u,c,m,_,d,g,s),h._quantizedVertices=void 0,h._encodedNormals=void 0,h._indices=void 0,h._uValues=void 0,h._vValues=void 0,h._heightValues=void 0,h._westIndices=void 0,h._southIndices=void 0,h._eastIndices=void 0,h._northIndices=void 0,h._mesh})}};var w=new h("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(i,n,a,s,u,c,h){var p=this._mesh;if(o(this._mesh)){var f=2*n!==u,_=2*a===c,g=i.ellipsoid,v=i.tileXYToRectangle(u,c,h),y=w.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:_,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=f?.5*C:this._westSkirtHeight,E=_?.5*C:this._southSkirtHeight,b=f?this._eastSkirtHeight:.5*C,T=_?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new m({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:d.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:E,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,E=new r;m.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):v(this,r,n)};var b=new i,T=new i,x=new i;return m.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},m.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},m}),define("Core/throttleRequestByServer",["../ThirdParty/Uri","../ThirdParty/when","./defaultValue"],function(e,t,i){"use strict";function r(t){var i=new e(t).resolve(a);i.normalize();var r=i.authority;return/:/.test(r)||(r=r+":"+("https"===i.scheme?"443":"80")),r}function n(e,a){var s=r(e),l=i(o[s],0);if(!(l>=n.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),define("Core/TileAvailability",["./binarySearch","./Cartographic","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o){"use strict";function a(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[];for(var i=0;i<e.getNumberOfYTilesAtLevel();++i)for(var r=0;r<e.getNumberOfXTilesAtLevel();++r)this._rootNodes.push(new s(e,void 0,0,r,i))}function s(e,t,i,r,n){this.tilingScheme=e,this.parent=t,this.level=i,this.x=r,this.y=n,this.extent=e.tileXYToRectangle(r,n,i),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function l(e,t,i,r,n){this.level=e,this.west=t,this.south=i,this.east=r,this.north=n}function u(e,t){var i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),n=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return r<o&&i<n}function c(t,i,r){for(;i.level<t;)if(h(i.nw.extent,r))i=i.nw;else if(h(i.ne.extent,r))i=i.ne;else if(h(i.sw.extent,r))i=i.sw;else{if(!h(i.se.extent,r))break;i=i.se}if(0===i.rectangles.length||i.rectangles[i.rectangles.length-1].level<=r.level)i.rectangles.push(r);else{var n=e(i.rectangles,r.level,d);n<=0&&(n=~n),i.rectangles.splice(n,0,r)}}function d(e,t){return e.level-t}function h(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function p(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,i){for(var r=0;;){var n=t._nw&&p(t._nw.extent,i),o=t._ne&&p(t._ne.extent,i),a=t._sw&&p(t._sw.extent,i),s=t._se&&p(t._se.extent,i);if(n+o+a+s>1){n&&(r=Math.max(r,f(t,t._nw,i))),o&&(r=Math.max(r,f(t,t._ne,i))),a&&(r=Math.max(r,f(t,t._sw,i))),s&&(r=Math.max(r,f(t,t._se,i)));break}if(n)t=t._nw;else if(o)t=t._ne;else if(a)t=t._sw;else{if(!s)break;t=t._se}}for(;t!==e;){for(var l=t.rectangles,u=l.length-1;u>=0&&l[u].level>r;--u){var c=l[u];p(c,i)&&(r=c.level)}t=t.parent}return r}function m(e,t,i){if(t){var r,n=!1;for(r=0;r<i.length;++r)n=n||u(t.extent,i[r]);if(n){var o=t.rectangles;for(r=0;r<o.length;++r){var a=o[r];e[a.level]||(e[a.level]=i),e[a.level]=_(e[a.level],a)}m(e,t._nw,i),m(e,t._ne,i),m(e,t._sw,i),m(e,t._se,i)}}}function _(e,t){for(var i=[],r=0;r<e.length;++r){var n=e[r];u(n,t)?(n.west<t.west&&i.push(new o(n.west,n.south,t.west,n.north)),n.east>t.east&&i.push(new o(t.east,n.south,n.east,n.north)),n.south<t.south&&i.push(new o(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&i.push(new o(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}var g=new o;a.prototype.addAvailableTileRange=function(e,t,i,r,n){var o=this._tilingScheme;o.tileXYToRectangle(t,i,e,g);var a=g.west,s=g.north;o.tileXYToRectangle(r,n,e,g);for(var d=g.east,h=g.south,p=new l(e,a,h,d,s),f=0;f<this._rootNodes.length;++f){var m=this._rootNodes[f];u(m.extent,p)&&c(this._maximumLevel,m,p)}},a.prototype.computeMaximumLevelAtPosition=function(e){for(var t,i=0;i<this._rootNodes.length;++i){var r=this._rootNodes[i];if(p(r.extent,e)){t=r;break}}return f(void 0,t,e)};var v=[],y=[],C=new o,w=new o;a.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=v;t.length=0,e.east<e.west?(t.push(o.fromRadians(-Math.PI,e.south,e.east,e.north,C)),t.push(o.fromRadians(e.west,e.south,Math.PI,e.north,w))):t.push(e);var r=y;r.length=0;var n;for(n=0;n<this._rootNodes.length;++n)m(r,this._rootNodes[n],t);for(n=r.length-1;n>=0;--n)if(i(r[n])&&0===r[n].length)return n;return 0};var S=new t;return a.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(t,i,e,g);return o.center(r,S),this.computeMaximumLevelAtPosition(S)>=e},a.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(r,2*t,2*i+1)?1:0,n|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,n|=this.isTileAvailable(r,2*t,2*i)?4:0,n|=this.isTileAvailable(r,2*t+1,2*i)?8:0},r(s.prototype,{nw:{get:function(){return this._nw||(this._nw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),a}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var i,r=t.name,n=t.message;i=e(r)&&e(n)?r+": "+n:t.toString();var o=t.stack;return e(o)&&(i+="\n"+o),i}return t}),define("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,i){"use strict";function r(t,i,r,n,o,a,s){this.provider=t,this.message=i,this.x=r,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return r.handleError=function(e,n,o,a,s,l,u,c,d){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.error=d,++h.timesRetried):h=new r(n,a,s,l,u,0,d),o.numberOfListeners>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),h.retry&&t(c)&&c(),h},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),define("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./TerrainProvider","./throttleRequestByServer","./TileAvailability","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(f=S.handleError(f,_,_._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(f=S.handleError(f,_,_._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)_._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},_._hasWaterMask=!0,_._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(f=S.handleError(f,_,_._errorEvent,i,void 0,void 0,void 0,l));_._tileUrlTemplates=t.tiles;for(var r=0;r<_._tileUrlTemplates.length;++r){var o=new e(_._tileUrlTemplates[r]),s=new e(_._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),_._tileUrlTemplates[r]=p(s,o).toString().replace("{version}",t.version)}var u=t.available;if(a(u)){_._availability=new w(_._tilingScheme,u.length);for(var c=0;c<u.length;++c)for(var d=u[c],h=_._tilingScheme.getNumberOfYTilesAtLevel(c),m=0;m<d.length;++m){var g=d[m];_._availability.addAvailableTileRange(c,g.startX,h-g.endY-1,g.endX,h-g.startY-1)}}!a(_._credit)&&a(t.attribution)&&null!==t.attribution&&(_._credit=new n(t.attribution)),a(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?_._hasVertexNormals=!0:a(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(_._hasVertexNormals=!0,_._littleEndianExtensionSize=!1),a(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(_._hasWaterMask=!0),_._ready=!0,_._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+h+".";f=S.handleError(f,_,_._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=m(h);t(e,r,s)}this._url=i.url,this._proxy=i.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=y.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,
this._requestWaterMask=o(i.requestWaterMask,!1),this._errorEvent=new u,this._availability=void 0;var d=i.credit;"string"==typeof d&&(d=new n(d)),this._credit=d,this._ready=!1,this._readyPromise=t.defer();var h=p(this._url,"layer.json");a(this._proxy)&&(h=this._proxy.getURL(h));var f,_=this;l()}function b(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function T(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new d({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function x(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,d=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,f=Float64Array.BYTES_PER_ELEMENT*d,m=3,y=Uint16Array.BYTES_PER_ELEMENT*m,C=3,w=Uint16Array.BYTES_PER_ELEMENT,S=w*C,E=new DataView(t),b=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var T=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var x=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var P=new i(new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+p,!0));u+=f;var D=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var M=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var I=new Uint16Array(t,u,3*M);u+=M*y,M>65536&&(w=Uint32Array.BYTES_PER_ELEMENT,S=w*C);var R,O=I.subarray(0,M),N=I.subarray(M,2*M),L=I.subarray(2*M,3*M),B=0,F=0,k=0;for(R=0;R<M;++R)B+=l(O[R]),F+=l(N[R]),k+=l(L[R]),O[R]=B,N[R]=F,L[R]=k;u%w!==0&&(u+=w-u%w);var V=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var z=h.createTypedArrayFromArrayBuffer(M,t,u,V*C);u+=V*S;var U=0;for(R=0;R<z.length;++R){var G=z[R];z[R]=U-G,0===G&&++U}var H=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var W=h.createTypedArrayFromArrayBuffer(M,t,u,H);u+=H*w;var q=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var j=h.createTypedArrayFromArrayBuffer(M,t,u,q);u+=q*w;var Y=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var X=h.createTypedArrayFromArrayBuffer(M,t,u,Y);u+=Y*w;var Z=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var K=h.createTypedArrayFromArrayBuffer(M,t,u,Z);u+=Z*w;for(var Q,J;u<E.byteLength;){var $=E.getUint8(u,!0);u+=Uint8Array.BYTES_PER_ELEMENT;var ee=E.getUint32(u,e._littleEndianExtensionSize);u+=Uint32Array.BYTES_PER_ELEMENT,$===A.OCT_VERTEX_NORMALS&&e._requestVertexNormals?Q=new Uint8Array(t,u,2*M):$===A.WATER_MASK&&e._requestWaterMask&&(J=new Uint8Array(t,u,ee)),u+=ee}var te,ie=5*e.getLevelMaximumGeometricError(n),re=e._tilingScheme.tileXYToRectangle(o,a,n);return re.width<_.PI_OVER_TWO+_.EPSILON5&&(te=g.fromRectangle(re,T,x,e._tilingScheme.ellipsoid)),new v({center:b,minimumHeight:T,maximumHeight:x,boundingSphere:P,orientedBoundingBox:te,horizonOcclusionPoint:D,quantizedVertices:I,encodedNormals:Q,indices:z,westIndices:W,southIndices:j,eastIndices:X,northIndices:K,westSkirtHeight:ie,southSkirtHeight:ie,eastSkirtHeight:ie,northSkirtHeight:ie,childTileMask:e.availability.computeChildMaskForTile(n,o,a),waterMask:J})}var A={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return E.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return f(e,b(m))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,d=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),h=this._proxy;a(h)&&(d=h.getURL(d));var p,m=[];if(this._requestVertexNormals&&this._hasVertexNormals&&m.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&m.push("watermask"),n=o(n,!0)){if(p=C(d,s),!a(p))return}else p=s(d);var _=this;return t(p,function(t){return a(_._heightmapStructure)?T(_,t,r,e,i,c):x(_,t,r,e,i,c)})}},s(E.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},availability:{get:function(){return this._availability}}}),E.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},E.prototype.getTileDataAvailable=function(e,t,i){if(a(this.availability))return this.availability.isTileAvailable(i,e,t)},E}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,d,h,p,f,m,_){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var v=Math.cos(t);v*=v;var y=Math.sin(t);y*=y;var C=h/Math.sqrt(p*v+d*y),w=C/f;return r.fromAxisAngle(a,w,l),i.fromQuaternion(l,u),i.multiplyByVector(u,m,_),e.normalize(_,_),e.multiplyByScalar(_,f,_),_}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,d=new e,h=new e,p=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,f=r?u:0,m=0;m<u;m+=3){var _=m+1,g=m+2,v=e.fromArray(t,m,c);n.scaleToGeodeticSurface(v,v);var y=e.clone(v,d),C=n.geodeticSurfaceNormal(v,p),w=e.multiplyByScalar(C,o,h);e.add(v,w,v),r&&(e.multiplyByScalar(C,a,w),e.add(y,w,y),l[m+f]=y.x,l[_+f]=y.y,l[g+f]=y.z),l[m]=v.x,l[_]=v.y,l[g]=v.z}return l};var f=new e,m=new e,_=new e;return o.computeEllipsePositions=function(i,r,o){var a=i.semiMinorAxis,s=i.semiMajorAxis,l=i.rotation,u=i.center,p=8*i.granularity,g=a*a,v=s*s,y=s*a,C=e.magnitude(u),w=e.normalize(u,f),S=e.cross(e.UNIT_Z,u,m);S=e.normalize(S,S);var E=e.cross(w,S,_),b=1+Math.ceil(t.PI_OVER_TWO/p),T=t.PI_OVER_TWO/(b-1),x=t.PI_OVER_TWO-b*T;x<0&&(b-=Math.ceil(Math.abs(x)/T));var A,P,D,M,I,R=2*(b*(b+2)),O=r?new Array(3*R):void 0,N=0,L=c,B=d,F=4*b*3,k=F-1,V=0,z=o?new Array(F):void 0;for(x=t.PI_OVER_TWO,L=n(x,l,E,S,g,y,v,C,w,L),r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z),o&&(z[k--]=L.z,z[k--]=L.y,z[k--]=L.x),x=t.PI_OVER_TWO-T,A=1;A<b+1;++A){if(L=n(x,l,E,S,g,y,v,C,w,L),B=n(Math.PI-x,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*A+2,P=1;P<D-1;++P)M=P/(D-1),I=e.lerp(L,B,M,h),O[N++]=I.x,O[N++]=I.y,O[N++]=I.z;O[N++]=B.x,O[N++]=B.y,O[N++]=B.z}o&&(z[k--]=L.z,z[k--]=L.y,z[k--]=L.x,z[V++]=B.x,z[V++]=B.y,z[V++]=B.z),x=t.PI_OVER_TWO-(A+1)*T}for(A=b;A>1;--A){if(x=t.PI_OVER_TWO-(A-1)*T,L=n(-x,l,E,S,g,y,v,C,w,L),B=n(x+Math.PI,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*(A-1)+2,P=1;P<D-1;++P)M=P/(D-1),I=e.lerp(L,B,M,h),O[N++]=I.x,O[N++]=I.y,O[N++]=I.z;O[N++]=B.x,O[N++]=B.y,O[N++]=B.z}o&&(z[k--]=L.z,z[k--]=L.y,z[k--]=L.x,z[V++]=B.x,z[V++]=B.y,z[V++]=B.z)}x=t.PI_OVER_TWO,L=n(-x,l,E,S,g,y,v,C,w,L);var U={};return r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,U.positions=O,U.numPts=b),o&&(z[k--]=L.z,z[k--]=L.y,z[k--]=L.x,U.outerPositions=z),U},o}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,i){t(i)||(i={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];s<a;)l>n&&(n=l),++s,l=r[s]}for(var u=[],c=0;c<n+1;c++)u[c]=0;for(var d=o+1,h=0;h<a;++h)d-u[r[h]]>o&&(u[r[h]]=d,++d);return(d-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o<r;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,d=0;d<i.length;){var h=i[d];n[h].numLiveTriangles&&(l=0,o-n[h].timeStamp+2*n[h].numLiveTriangles<=t&&(l=o-n[h].timeStamp),(l>c||c===-1)&&(c=l,u=h)),++d}return u===-1?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,d=0,h=a[d],p=u;if(t(s))c=s+1;else{for(;d<p;)h>c&&(c=h),++d,h=a[d];if(c===-1)return 0;++c}for(var f=[],m=0;m<c;m++)f[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;for(var _=0;d<p;)f[a[d]].vertexTriangles.push(_),++f[a[d]].numLiveTriangles,f[a[d+1]].vertexTriangles.push(_),++f[a[d+1]].numLiveTriangles,f[a[d+2]].vertexTriangles.push(_),++f[a[d+2]].numLiveTriangles,++_,d+=3;var g=0,v=l+1;o=1;var y,C,w=[],S=[],E=0,b=[],T=u/3,x=[];for(m=0;m<T;m++)x[m]=!1;for(var A,P;g!==-1;){w=[],C=f[g],P=C.vertexTriangles.length;for(var D=0;D<P;++D)if(_=C.vertexTriangles[D],!x[_]){x[_]=!0,d=_+_+_;for(var M=0;M<3;++M)A=a[d],w.push(A),S.push(A),b[E]=A,++E,y=f[A],--y.numLiveTriangles,v-y.timeStamp>l&&(y.timeStamp=v,++v),++d}g=n(a,l,w,f,v,S,c)}return b},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function x(e){for(var t=e.length,i=t/3*6,r=_.createTypedArray(t,i),n=0,o=0;o<t;o+=3,n+=6)T(r,n,e[o],e[o+1],e[o+2]);return r}function A(e){var t=e.length;if(t>=3){var i=6*(t-2),r=_.createTypedArray(t,i);T(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)T(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function P(e){if(e.length>0){for(var t=e.length-1,i=6*(t-1),r=_.createTypedArray(t,i),n=e[0],o=0,a=1;a<t;++a,o+=6)T(r,o,n,e[a],e[a+1]);return r}return new Uint16Array}function D(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&u(e[i])&&u(e[i].values)){var r=e[i];t[i]=new f({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values))for(var n=t[r],o=0;o<n.componentsPerAttribute;++o)e[r].values.push(n.values[i*n.componentsPerAttribute+o])}function I(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,oe),w.multiplyByPoint(e,oe,oe),n.pack(oe,i,o)}function R(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,oe),C.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,i,o)}function O(e,t){var i,r=e.length,n={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&u(o[i])&&u(o[i].values)){for(var a=o[i],l=a.values.length,c=!0,d=1;d<r;++d){var h=e[d][t].attributes[i];if(!u(h)||a.componentDatatype!==h.componentDatatype||a.componentsPerAttribute!==h.componentsPerAttribute||a.normalize!==h.normalize){c=!1;break}l+=h.values.length}c&&(n[i]=new f({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function N(e,t){var r,o,a,s,l,c,d,h=e.length,f=(e[0].modelMatrix,u(e[0][t].indices)),m=e[0][t].primitiveType,g=O(e,t);for(r in g)if(g.hasOwnProperty(r))for(l=g[r].values,s=0,o=0;o<h;++o)for(c=e[o][t].attributes[r].values,d=c.length,a=0;a<d;++a)l[s++]=c[a];var v;if(f){var y=0;for(o=0;o<h;++o)y+=e[o][t].indices.length;var C=p.computeNumberOfVertices(new p({attributes:g,primitiveType:E.POINTS})),w=_.createTypedArray(C,y),S=0,b=0;for(o=0;o<h;++o){var T=e[o][t].indices,x=T.length;for(s=0;s<x;++s)w[S++]=b+T[s];b+=p.computeNumberOfVertices(e[o][t])}v=w}var A,P=new n,D=0;for(o=0;o<h;++o){if(A=e[o][t].boundingSphere,!u(A)){P=void 0;break}n.add(A.center,P,P)}if(u(P))for(n.divideByScalar(P,h,P),o=0;o<h;++o){A=e[o][t].boundingSphere;var M=n.magnitude(n.subtract(A.center,P,le))+A.radius;M>D&&(D=M)}return new p({attributes:g,indices:v,primitiveType:m,boundingSphere:u(P)?new i(P,D):void 0})}function L(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function B(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;n<t;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=E.TRIANGLES,e}function F(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;n<t-1;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,n+2<t&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=E.TRIANGLES,e}function k(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function V(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=E.LINES,e}function z(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=E.LINES,e}function U(e){switch(e.primitiveType){case E.TRIANGLE_FAN:return B(e);case E.TRIANGLE_STRIP:return F(e);case E.TRIANGLES:return L(e);case E.LINE_STRIP:return V(e);case E.LINE_LOOP:return z(e);case E.LINES:return k(e)}return e}function G(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function H(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y)return G(e,e.y<0),G(t,t.y<0),void G(i,i.y<0);var r,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(i.y);r=n>o?n>a?y.sign(e.y):y.sign(i.y):o>a?y.sign(t.y):y.sign(i.y);var s=r<0;G(e,s),G(t,s),G(i,s)}function W(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,we),e.y/(e.y-t.y),we),i),n.clone(i,r),G(i,!0),G(r,!1)}function q(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){H(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(W(e,t,Se,be),W(e,i,Ee,Te),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,i,Se,be),W(t,e,Ee,Te),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(i,e,Se,be),W(i,t,Ee,Te),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(W(i,e,Se,be),W(i,t,Ee,Te),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,i,Se,be),W(t,e,Ee,Te),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,Se,be),W(e,i,Ee,Te),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=Se,l[4]=Ee,l[5]=be,l[6]=Te,l.length=7),xe}}function j(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=_.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function Y(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new f({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:i,indices:[],primitiveType:e.primitiveType})}function X(e,t,i){var r=u(e.geometry.boundingSphere);t=j(t,r),i=j(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Z(e,i,o,a,s,l,c,d,h,p,f,m){if(u(l)||u(c)||u(d)||u(h)||u(p)){var _=n.fromArray(s,3*e,Ae),g=n.fromArray(s,3*i,Pe),v=n.fromArray(s,3*o,De),y=t(a,_,g,v,Me);if(u(l)){var C=n.fromArray(l,3*e,Ae),w=n.fromArray(l,3*i,Pe),S=n.fromArray(l,3*o,De);n.multiplyByScalar(C,y.x,C),n.multiplyByScalar(w,y.y,w),n.multiplyByScalar(S,y.z,S);var E=n.add(C,w,C);n.add(E,S,E),n.normalize(E,E),n.pack(E,f.normal.values,3*m)}if(u(p)){var b=n.fromArray(p,3*e,Ae),T=n.fromArray(p,3*i,Pe),x=n.fromArray(p,3*o,De);n.multiplyByScalar(b,y.x,b),n.multiplyByScalar(T,y.y,T),n.multiplyByScalar(x,y.z,x);var A;n.equals(b,n.ZERO)&&n.equals(T,n.ZERO)&&n.equals(x,n.ZERO)?(A=Ae,A.x=0,A.y=0,A.z=0):(A=n.add(b,T,b),n.add(A,x,A),n.normalize(A,A)),n.pack(A,f.extrudeDirection.values,3*m)}if(u(c)){var P=n.fromArray(c,3*e,Ae),D=n.fromArray(c,3*i,Pe),M=n.fromArray(c,3*o,De);n.multiplyByScalar(P,y.x,P),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(M,y.z,M);var I=n.add(P,D,P);n.add(I,M,I),n.normalize(I,I),n.pack(I,f.tangent.values,3*m)}if(u(d)){var R=n.fromArray(d,3*e,Ae),O=n.fromArray(d,3*i,Pe),N=n.fromArray(d,3*o,De);n.multiplyByScalar(R,y.x,R),n.multiplyByScalar(O,y.y,O),n.multiplyByScalar(N,y.z,N);var L=n.add(R,O,R);n.add(L,N,L),n.normalize(L,L),n.pack(L,f.bitangent.values,3*m)}if(u(h)){var B=r.fromArray(h,2*e,Ie),F=r.fromArray(h,2*i,Re),k=r.fromArray(h,2*o,Oe);r.multiplyByScalar(B,y.x,B),r.multiplyByScalar(F,y.y,F),r.multiplyByScalar(k,y.z,k);var V=r.add(B,F,B);r.add(V,k,V),r.pack(V,f.st.values,2*m)}}}function K(e,t,i,r,n,o){var a=e.position.values.length/3;if(n!==-1){var s=r[n],l=i[s];return l===-1?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function Q(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,d=u(l.normal)?l.normal.values:void 0,h=u(l.bitangent)?l.bitangent.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,f=u(l.st)?l.st.values:void 0,m=u(l.extrudeDirection)?l.extrudeDirection.values:void 0,_=s.indices,g=Y(s),v=Y(s),y=[];y.length=c.length/3;var C=[];for(C.length=c.length/3,a=0;a<y.length;++a)y[a]=-1,C[a]=-1;var w=_.length;for(a=0;a<w;a+=3){var S=_[a],E=_[a+1],b=_[a+2],T=n.fromArray(c,3*S),x=n.fromArray(c,3*E),A=n.fromArray(c,3*b),P=q(T,x,A);if(u(P)&&P.positions.length>3)for(var D=P.positions,M=P.indices,I=M.length,R=0;R<I;++R){var O=M[R],N=D[O];N.y<0?(t=v.attributes,i=v.indices,r=y):(t=g.attributes,i=g.indices,r=C),o=K(t,i,r,_,O<3?a+O:-1,N),Z(S,E,b,N,c,d,p,h,f,m,t,o)}else u(P)&&(T=P.positions[0],x=P.positions[1],A=P.positions[2]),T.y<0?(t=v.attributes,i=v.indices,r=y):(t=g.attributes,i=g.indices,r=C),o=K(t,i,r,_,a,T),Z(S,E,b,T,c,d,p,h,f,m,t,o),o=K(t,i,r,_,a+1,x),Z(S,E,b,x,c,d,p,h,f,m,t,o),o=K(t,i,r,_,a+2,A),Z(S,E,b,A,c,d,p,h,f,m,t,o)}X(e,v,g)}function J(e){var t,i=e.geometry,r=i.attributes,o=r.position.values,a=i.indices,s=Y(i),l=Y(i),c=a.length,d=[];d.length=o.length/3;var h=[];for(h.length=o.length/3,t=0;t<d.length;++t)d[t]=-1,h[t]=-1;for(t=0;t<c;t+=2){var p=a[t],f=a[t+1],m=n.fromArray(o,3*p,Ae),_=n.fromArray(o,3*f,Pe);Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6),Math.abs(_.y)<y.EPSILON6&&(_.y<0?_.y=-y.EPSILON6:_.y=y.EPSILON6);var g=s.attributes,C=s.indices,w=h,S=l.attributes,E=l.indices,b=d,T=v.lineSegmentPlane(m,_,Ne,De);if(u(T)){var x=n.multiplyByScalar(n.UNIT_Y,5*y.EPSILON9,Le);m.y<0&&(n.negate(x,x),g=l.attributes,C=l.indices,w=d,S=s.attributes,E=s.indices,b=h);var A=n.add(T,x,Be);K(g,C,w,a,t,m),K(g,C,w,a,-1,A),n.negate(x,x),n.add(T,x,A),K(S,E,b,a,-1,A),K(S,E,b,a,t+1,_)}else{var P,D,M;m.y<0?(P=l.attributes,D=l.indices,M=d):(P=s.attributes,D=s.indices,M=h),K(P,D,M,a,t,m),K(P,D,M,a,t+1,_)}}X(e,l,s)}function $(e){for(var t=e.attributes,i=t.position.values,r=t.prevPosition.values,o=t.nextPosition.values,a=i.length,s=0;s<a;s+=3){var l=n.unpack(i,s,Ve);if(!(l.x>0)){var u=n.unpack(r,s,ze);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(r[s]=i[s-3],r[s+1]=i[s-2],r[s+2]=i[s-1]):n.pack(l,r,s));var c=n.unpack(o,s,Ue);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3<a?(o[s]=i[s+3],o[s+1]=i[s+4],o[s+2]=i[s+5]):n.pack(l,o,s))}}}function ee(e){var t,i,a,s=e.geometry,l=s.attributes,c=l.position.values,d=l.prevPosition.values,h=l.nextPosition.values,p=l.expandAndWidth.values,f=u(l.st)?l.st.values:void 0,m=u(l.color)?l.color.values:void 0,_=Y(s),g=Y(s),C=!1,w=c.length/3;for(t=0;t<w;t+=4){var S=t,E=t+2,b=n.fromArray(c,3*S,Ve),T=n.fromArray(c,3*E,ze);if(Math.abs(b.y)<Ye)for(b.y=Ye*(T.y<0?-1:1),c[3*t+1]=b.y,c[3*(t+1)+1]=b.y,i=3*S;i<3*S+12;i+=3)d[i]=c[3*t],d[i+1]=c[3*t+1],d[i+2]=c[3*t+2];if(Math.abs(T.y)<Ye)for(T.y=Ye*(b.y<0?-1:1),c[3*(t+2)+1]=T.y,c[3*(t+3)+1]=T.y,i=3*S;i<3*S+12;i+=3)h[i]=c[3*(t+2)],h[i+1]=c[3*(t+2)+1],h[i+2]=c[3*(t+2)+2];var x=_.attributes,A=_.indices,P=g.attributes,D=g.indices,M=v.lineSegmentPlane(b,T,Ne,Ge);if(u(M)){C=!0;var I=n.multiplyByScalar(n.UNIT_Y,je,He);b.y<0&&(n.negate(I,I),x=g.attributes,A=g.indices,P=_.attributes,D=_.indices);var R=n.add(M,I,We);x.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),x.position.values.push(R.x,R.y,R.z),x.position.values.push(R.x,R.y,R.z),x.prevPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),x.prevPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]),x.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),n.negate(I,I),n.add(M,I,R),P.position.values.push(R.x,R.y,R.z),P.position.values.push(R.x,R.y,R.z),P.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),P.nextPosition.values.push(h[3*E],h[3*E+1],h[3*E+2]),P.nextPosition.values.push(h[3*E+3],h[3*E+4],h[3*E+5]);var O=r.fromArray(p,2*S,Fe),N=Math.abs(O.y);x.expandAndWidth.values.push(-1,N,1,N),x.expandAndWidth.values.push(-1,-N,1,-N),P.expandAndWidth.values.push(-1,N,1,N),P.expandAndWidth.values.push(-1,-N,1,-N);var L=n.magnitudeSquared(n.subtract(M,b,Ue));if(L/=n.magnitudeSquared(n.subtract(T,b,Ue)),u(m)){var B=o.fromArray(m,4*S,qe),F=o.fromArray(m,4*E,qe),k=y.lerp(B.x,F.x,L),V=y.lerp(B.y,F.y,L),z=y.lerp(B.z,F.z,L),U=y.lerp(B.w,F.w,L);for(i=4*S;i<4*S+8;++i)x.color.values.push(m[i]);for(x.color.values.push(k,V,z,U),x.color.values.push(k,V,z,U),P.color.values.push(k,V,z,U),P.color.values.push(k,V,z,U),i=4*E;i<4*E+8;++i)P.color.values.push(m[i])}if(u(f)){var G=r.fromArray(f,2*S,Fe),H=r.fromArray(f,2*(t+3),ke),W=y.lerp(G.x,H.x,L);for(i=2*S;i<2*S+4;++i)x.st.values.push(f[i]);for(x.st.values.push(W,G.y),x.st.values.push(W,H.y),P.st.values.push(W,G.y),P.st.values.push(W,H.y),i=2*E;i<2*E+4;++i)P.st.values.push(f[i])}a=x.position.values.length/3-4,A.push(a,a+2,a+1),A.push(a+1,a+2,a+3),a=P.position.values.length/3-4,D.push(a,a+2,a+1),D.push(a+1,a+2,a+3)}else{var q,j;for(b.y<0?(q=g.attributes,j=g.indices):(q=_.attributes,j=_.indices),q.position.values.push(b.x,b.y,b.z),q.position.values.push(b.x,b.y,b.z),q.position.values.push(T.x,T.y,T.z),q.position.values.push(T.x,T.y,T.z),i=3*t;i<3*t+12;++i)q.prevPosition.values.push(d[i]),q.nextPosition.values.push(h[i]);for(i=2*t;i<2*t+8;++i)q.expandAndWidth.values.push(p[i]),u(f)&&q.st.values.push(f[i]);if(u(m))for(i=4*t;i<4*t+16;++i)q.color.values.push(m[i]);a=q.position.values.length/3-4,j.push(a,a+2,a+1),j.push(a+1,a+2,a+3)}}C&&($(g),$(_)),X(e,g,_)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case E.TRIANGLES:e.indices=x(t);break;case E.TRIANGLE_STRIP:e.indices=A(t);break;case E.TRIANGLE_FAN:e.indices=P(t)}e.primitiveType=E.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=l(t,"normal"),r=l(r,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),d=0,h=0;h<a;h+=3)c[d++]=n[h],c[d++]=n[h+1],c[d++]=n[h+2],c[d++]=n[h]+o[h]*r,c[d++]=n[h+1]+o[h+1]*r,c[d++]=n[h+2]+o[h+2]*r;var m,_=e.boundingSphere;return u(_)&&(m=new i(_.center,_.radius+r)),new p({attributes:{position:new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:E.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;t<a;++t){var s=i[t];u(r[s])&&(n[s]=o++)}for(var l in r)r.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),i=e.indices;if(u(i)){for(var r=new Int32Array(t),n=0;n<t;n++)r[n]=-1;for(var o,a=i,l=a.length,c=_.createTypedArray(t,l),d=0,h=0,f=0;d<l;)o=r[a[d]],o!==-1?c[h]=o:(o=a[d],r[o]=f,c[h]=f,++f),++d,++h;e.indices=c;var m=e.attributes;for(var g in m)if(m.hasOwnProperty(g)&&u(m[g])&&u(m[g].values)){for(var v=m[g],y=v.values,C=0,w=v.componentsPerAttribute,S=s.createTypedArray(v.componentDatatype,f*w);C<t;){var E=r[C];if(E!==-1)for(n=0;n<w;n++)S[w*E+n]=y[w*C+n];++C}v.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===E.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;o<r;o++)i[o]>n&&(n=i[o]);e.indices=b.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.computeNumberOfVertices(e);if(u(e.indices)&&i>=y.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=D(e.attributes),l=e.indices,c=l.length;e.primitiveType===E.TRIANGLES?r=3:e.primitiveType===E.LINES?r=2:e.primitiveType===E.POINTS&&(r=1);for(var d=0;d<c;d+=r){for(var h=0;h<r;++h){var f=l[d+h],m=n[f];u(m)||(m=a++,n[f]=m,M(s,e.attributes,f)),o.push(m)}a+r>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new h;for(var l=o.ellipsoid,c=a.values,d=new Float64Array(c.length),p=0,m=0;m<c.length;m+=3){var _=n.fromArray(c,m,ie),g=l.cartesianToCartographic(_,re),v=o.project(g,ie);d[p++]=v.x,d[p++]=v.y,d[p++]=v.z}return e.attributes[i]=a,e.attributes[r]=new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var ne={high:0,low:0};te.encodeAttribute=function(e,t,i,r){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;c<a;++c)d.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var h=n.componentsPerAttribute;return e.attributes[i]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:l}),e.attributes[r]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var oe=new n,ae=new w,se=new C;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(w.equals(t,w.IDENTITY))return e;var r=e.geometry.attributes;I(t,r.position),I(t,r.prevPosition),I(t,r.nextPosition),(u(r.normal)||u(r.tangent)||u(r.bitangent))&&(w.inverse(t,ae),w.transpose(ae,ae),w.getRotation(ae,se),R(se,r.normal),R(se,r.tangent),R(se,r.bitangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=w.clone(w.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;n<r;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&i.push(o)}var a=[];return t.length>0&&a.push(N(t,"geometry")),i.length>0&&(a.push(N(i,"westHemisphereGeometry")),a.push(N(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,de=new n,he=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),d=0;d<o;d++)l[d]={indexOffset:0,count:0,currentCount:0};var h=0;for(d=0;d<a;d+=3){var p=t[d],m=t[d+1],_=t[d+2],g=3*p,v=3*m,C=3*_;ce.x=r[g],ce.y=r[g+1],ce.z=r[g+2],de.x=r[v],de.y=r[v+1],de.z=r[v+2],he.x=r[C],he.y=r[C+1],he.z=r[C+2],l[p].count++,l[m].count++,l[_].count++,n.subtract(de,ce,de),n.subtract(he,ce,he),u[h]=n.cross(de,he,new n),h++}var w=0;for(d=0;d<o;d++)l[d].indexOffset+=w,w+=l[d].count;h=0;var S;for(d=0;d<a;d+=3){S=l[t[d]];var E=S.indexOffset+S.currentCount;c[E]=h,S.currentCount++,S=l[t[d+1]],E=S.indexOffset+S.currentCount,c[E]=h,S.currentCount++,S=l[t[d+2]],E=S.indexOffset+S.currentCount,c[E]=h,S.currentCount++,h++}var b=new Float32Array(3*o);for(d=0;d<o;d++){var T=3*d;if(S=l[d],n.clone(n.ZERO,ue),S.count>0){for(h=0;h<S.count;h++)n.add(ue,u[c[S.indexOffset+h]],ue);n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&n.clone(u[c[S.indexOffset]],ue)}n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&(ue.z=1),n.normalize(ue,ue),b[T]=ue.x,b[T+1]=ue.y,b[T+2]=ue.z}return e.attributes.normal=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:b}),e};var pe=new n,fe=new n,me=new n;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,l=t.length,u=new Array(3*a),c=0;c<u.length;c++)u[c]=0;var d,h,p;for(c=0;c<l;c+=3){var m=t[c],_=t[c+1],g=t[c+2];d=3*m,h=3*_,p=3*g;var v=2*m,y=2*_,C=2*g,w=i[d],S=i[d+1],E=i[d+2],b=o[v],T=o[v+1],x=o[y+1]-T,A=o[C+1]-T,P=1/((o[y]-b)*A-(o[C]-b)*x),D=(A*(i[h]-w)-x*(i[p]-w))*P,M=(A*(i[h+1]-S)-x*(i[p+1]-S))*P,I=(A*(i[h+2]-E)-x*(i[p+2]-E))*P;u[d]+=D,u[d+1]+=M,u[d+2]+=I,u[h]+=D,u[h+1]+=M,u[h+2]+=I,u[p]+=D,u[p+1]+=M,u[p+2]+=I}var R=new Float32Array(3*a),O=new Float32Array(3*a);for(c=0;c<a;c++){d=3*c,h=d+1,p=d+2;var N=n.fromArray(r,d,pe),L=n.fromArray(u,d,me),B=n.dot(N,L);n.multiplyByScalar(N,B,fe),n.normalize(n.subtract(L,fe,L),L),R[d]=L.x,R[h]=L.y,R[p]=L.z,n.normalize(n.cross(N,L,L),L),O[d]=L.x,O[h]=L.y,O[p]=L.z}return e.attributes.tangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.bitangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e};var _e=new r,ge=new n,ve=new n,ye=new n,Ce=new r;te.compressVertices=function(t){var i,o,a=t.attributes.extrudeDirection;if(u(a)){var l=a.values;o=l.length/3;var c=new Float32Array(2*o),d=0;for(i=0;i<o;++i)n.fromArray(l,3*i,ge),n.equals(ge,n.ZERO)?d+=2:(Ce=e.octEncodeInRange(ge,65535,Ce),c[d++]=Ce.x,c[d++]=Ce.y);return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:c}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,p=t.attributes.st,m=u(h),_=u(p);if(!m&&!_)return t;var g,v,y,C,w=t.attributes.tangent,S=t.attributes.bitangent,E=u(w),b=u(S);m&&(g=h.values),_&&(v=p.values),E&&(y=w.values),b&&(C=S.values);var T=m?g.length:v.length,x=m?3:2;o=T/x;var A=o,P=_&&m?2:1;P+=E||b?1:0,A*=P;var D=new Float32Array(A),M=0;for(i=0;i<o;++i){_&&(r.fromArray(v,2*i,_e),D[M++]=e.compressTextureCoordinates(_e));var I=3*i;m&&u(y)&&u(C)?(n.fromArray(g,I,ge),n.fromArray(y,I,ve),n.fromArray(C,I,ye),e.octPack(ge,ve,ye,_e),D[M++]=_e.x,D[M++]=_e.y):(m&&(n.fromArray(g,I,ge),D[M++]=e.octEncodeFloat(ge)),E&&(n.fromArray(y,I,ge),D[M++]=e.octEncodeFloat(ge)),
b&&(n.fromArray(C,I,ge),D[M++]=e.octEncodeFloat(ge)))}return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:P,values:D}),m&&delete t.attributes.normal,_&&delete t.attributes.st,b&&delete t.attributes.bitangent,E&&delete t.attributes.tangent,t};var we=new n,Se=new n,Ee=new n,be=new n,Te=new n,xe={positions:new Array(7),indices:new Array(9)},Ae=new n,Pe=new n,De=new n,Me=new n,Ie=new r,Re=new r,Oe=new r,Ne=S.fromPointNormal(n.ZERO,n.UNIT_Y),Le=new n,Be=new n,Fe=new r,ke=new r,Ve=new n,ze=new n,Ue=new n,Ge=new n,He=new n,We=new n,qe=new o,je=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(u(r)){var n=r.center.x-r.radius;if(n>0||i.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==g.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:Q(e);break;case m.LINES:J(e)}else U(t),t.primitiveType===E.TRIANGLES?Q(e):t.primitiveType===E.LINES&&J(e);return e},te}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,r,o){var a=r.vertexFormat,s=r.center,l=r.semiMajorAxis,c=r.semiMinorAxis,h=r.ellipsoid,m=r.stRotation,_=o?e.length/3*2:e.length/3,g=r.shadowVolume,v=a.st?new Float32Array(2*_):void 0,C=a.normal?new Float32Array(3*_):void 0,w=a.tangent?new Float32Array(3*_):void 0,E=a.bitangent?new Float32Array(3*_):void 0,b=g?new Float32Array(3*_):void 0,T=0,x=U,A=G,P=H,D=new d(h),M=D.project(h.cartesianToCartographic(s,W),q),I=h.scaleToGeodeticSurface(s,N);h.geodeticSurfaceNormal(I,I);for(var R=S.fromAxisAngle(I,m,z),O=y.fromQuaternion(R,V),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Z=e.length,K=o?Z:0,Q=K/3*2,J=0;J<Z;J+=3){var $=J+1,ee=J+2,te=i.fromArray(e,J,N);if(a.st){var ie=y.multiplyByVector(O,te,L),re=D.project(h.cartesianToCartographic(ie,W),B);i.subtract(re,M,re),k.x=(re.x+l)/(2*l),k.y=(re.y+c)/(2*c),F.x=Math.min(k.x,F.x),F.y=Math.min(k.y,F.y),X.x=Math.max(k.x,X.x),X.y=Math.max(k.y,X.y),o&&(v[T+Q]=k.x,v[T+1+Q]=k.y),v[T++]=k.x,v[T++]=k.y}(a.normal||a.tangent||a.bitangent||g)&&(x=h.geodeticSurfaceNormal(te,x),g&&(b[J+K]=-x.x,b[$+K]=-x.y,b[ee+K]=-x.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(A=i.normalize(i.cross(i.UNIT_Z,x,A),A),y.multiplyByVector(O,A,A)),a.normal&&(C[J]=x.x,C[$]=x.y,C[ee]=x.z,o&&(C[J+K]=-x.x,C[$+K]=-x.y,C[ee+K]=-x.z)),a.tangent&&(w[J]=A.x,w[$]=A.y,w[ee]=A.z,o&&(w[J+K]=-A.x,w[$+K]=-A.y,w[ee+K]=-A.z)),a.bitangent&&(P=i.normalize(i.cross(x,A,P),P),E[J]=P.x,E[$]=P.y,E[ee]=P.z,o&&(E[J+K]=P.x,E[$+K]=P.y,E[ee+K]=P.z))))}if(a.st){Z=v.length;for(var ne=0;ne<Z;ne+=2)v[ne]=(v[ne]-F.x)/(X.x-F.x),v[ne+1]=(v[ne+1]-F.y)/(X.y-F.y)}var oe=new f;if(a.position){var ae=u.raisePositionsToHeight(e,r,o);oe.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ae})}return a.st&&(oe.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),a.normal&&(oe.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a.tangent&&(oe.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(oe.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),g&&(oe.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),oe}function A(e){var t,i,r,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,r=1,n=0;n<3;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;n<e+1;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,a[s++]=r++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=r++,a[s++]=t,a[s++]=r}for(i=2*e,++r,++t,n=0;n<i-1;++n)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;for(a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=t++,a[s++]=t++,a[s++]=r++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}function P(t){var r=t.center;X=i.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,X),t.height,X),X=i.add(r,X,X);var n=new e(X,t.semiMajorAxis),o=u.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,l=x(a,t,!1),c=A(s);return c=g.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:l,indices:c}}function D(e,r){var o=r.vertexFormat,a=r.center,s=r.semiMajorAxis,l=r.semiMinorAxis,u=r.ellipsoid,c=r.height,h=r.extrudedHeight,m=r.stRotation,_=e.length/3*2,g=new Float64Array(3*_),v=o.st?new Float32Array(2*_):void 0,C=o.normal?new Float32Array(3*_):void 0,w=o.tangent?new Float32Array(3*_):void 0,E=o.bitangent?new Float32Array(3*_):void 0,b=r.shadowVolume,T=b?new Float32Array(3*_):void 0,x=0,A=U,P=G,D=H,M=new d(u),I=M.project(u.cartesianToCartographic(a,W),q),R=u.scaleToGeodeticSurface(a,N);u.geodeticSurfaceNormal(R,R);for(var O=S.fromAxisAngle(R,m,z),X=y.fromQuaternion(O,V),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Q=e.length,J=Q/3*2,$=0;$<Q;$+=3){var ee,te=$+1,ie=$+2,re=i.fromArray(e,$,N);if(o.st){var ne=y.multiplyByVector(X,re,L),oe=M.project(u.cartesianToCartographic(ne,W),B);i.subtract(oe,I,oe),k.x=(oe.x+s)/(2*s),k.y=(oe.y+l)/(2*l),Z.x=Math.min(k.x,Z.x),Z.y=Math.min(k.y,Z.y),K.x=Math.max(k.x,K.x),K.y=Math.max(k.y,K.y),v[x+J]=k.x,v[x+1+J]=k.y,v[x++]=k.x,v[x++]=k.y}re=u.scaleToGeodeticSurface(re,re),ee=i.clone(re,L),A=u.geodeticSurfaceNormal(re,A),b&&(T[$+Q]=-A.x,T[te+Q]=-A.y,T[ie+Q]=-A.z);var ae=i.multiplyByScalar(A,c,F);if(re=i.add(re,ae,re),ae=i.multiplyByScalar(A,h,ae),ee=i.add(ee,ae,ee),o.position&&(g[$+Q]=ee.x,g[te+Q]=ee.y,g[ie+Q]=ee.z,g[$]=re.x,g[te]=re.y,g[ie]=re.z),o.normal||o.tangent||o.bitangent){D=i.clone(A,D);var se=i.fromArray(e,($+3)%Q,F);i.subtract(se,re,se);var le=i.subtract(ee,re,B);A=i.normalize(i.cross(le,se,A),A),o.normal&&(C[$]=A.x,C[te]=A.y,C[ie]=A.z,C[$+Q]=A.x,C[te+Q]=A.y,C[ie+Q]=A.z),o.tangent&&(P=i.normalize(i.cross(D,A,P),P),w[$]=P.x,w[te]=P.y,w[ie]=P.z,w[$+Q]=P.x,w[$+1+Q]=P.y,w[$+2+Q]=P.z),o.bitangent&&(E[$]=D.x,E[te]=D.y,E[ie]=D.z,E[$+Q]=D.x,E[te+Q]=D.y,E[ie+Q]=D.z)}}if(o.st){Q=v.length;for(var ue=0;ue<Q;ue+=2)v[ue]=(v[ue]-Z.x)/(K.x-Z.x),v[ue+1]=(v[ue+1]-Z.y)/(K.y-Z.y)}var ce=new f;return o.position&&(ce.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(ce.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),o.normal&&(ce.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),o.tangent&&(ce.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),o.bitangent&&(ce.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),b&&(ce.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),ce}function M(e){for(var t=e.length/3,i=g.createTypedArray(t,6*t),r=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;i[r++]=o,i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=a,i[r++]=l}return i}function I(t){var r=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,N),t.height,N);Z.center=i.add(r,a,Z.center),Z.radius=o,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,a),t.extrudedHeight,a),K.center=i.add(r,a,K.center),K.radius=o;var s=u.computeEllipsePositions(t,!0,!0),l=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(Z,K),f=x(l,t,!0),v=A(c),y=v.length;v.length=2*y;for(var C=l.length/3,S=0;S<y;S+=3)v[S+y]=v[S+2]+C,v[S+1+y]=v[S+1]+C,v[S+2+y]=v[S]+C;var E=g.createTypedArray(2*C/3,v),b=new h({attributes:f,indices:E,primitiveType:w.TRIANGLES}),T=D(d,t);v=M(d);var P=g.createTypedArray(2*d.length/3,v),I=new h({attributes:T,indices:P,primitiveType:w.TRIANGLES}),R=_.combineInstances([new m({geometry:b}),new m({geometry:I})]);return{boundingSphere:p,attributes:R[0].attributes,indices:R[0].indices}}function R(e,t,r,n,o){b.eastNorthUpToFixedFrame(e,t,Q),C.inverseTransformation(Q,J);for(var a=0;a<4;++a)i.clone(i.ZERO,ee[a]);for(ee[0].x+=r,ee[1].x-=r,ee[2].y+=n,ee[3].y-=n,y.fromRotationZ(o,$),a=0;a<4;++a)y.multiplyByVector($,ee[a],ee[a]),C.multiplyByPoint(Q,ee[a],ee[a]),t.cartesianToCartographic(ee[a],te[a]);return E.fromCartographicArray(te)}function O(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,r=o(e.ellipsoid,c.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,v.RADIANS_PER_DEGREE),u=o(e.height,0),d=e.extrudedHeight,h=a(d)&&Math.abs(u-d)>1,p=o(e.vertexFormat,T.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(d,u),this._extrude=h,this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=R(this._center,this._ellipsoid,n,s,this._rotation)}var N=new i,L=new i,B=new i,F=new i,k=new t,V=new y,z=new S,U=new i,G=new i,H=new i,W=new r,q=new i,j=new t,Y=new t,X=new i,Z=new e,K=new e,Q=new C,J=new C,$=new y,ee=[new i,new i,new i,new i],te=[new r,new r,new r,new r];O.packedLength=i.packedLength+c.packedLength+T.packedLength+E.packedLength+9,O.pack=function(e,t,r){return r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,E.pack(e._rectangle,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r]=e._shadowVolume?1:0,t};var ie=new i,re=new c,ne=new T,oe=new E,ae={center:ie,ellipsoid:re,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return O.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,ie);t+=i.packedLength;var s=c.unpack(e,t,re);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=E.unpack(e,t,oe);t+=E.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],_=e[t++],g=e[t++],v=1===e[t++],y=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=c.clone(s,r._ellipsoid),r._vertexFormat=T.clone(l,r._vertexFormat),r._semiMajorAxis=d,r._semiMinorAxis=h,r._rotation=p,r._stRotation=f,r._height=m,r._granularity=_,r._extrudedHeight=g,r._extrude=v,r._shadowVolume=y,r._rectangle=E.clone(u),r):(ae.height=m,ae.extrudedHeight=g,ae.granularity=_,ae.stRotation=f,ae.rotation=p,ae.semiMajorAxis=d,ae.semiMinorAxis=h,ae.shadowVolume=y,new O(ae))},O.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),i.shadowVolume=e._shadowVolume,t=I(i)):t=P(i),new h({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},s(O.prototype,{rectangle:{get:function(){return this._rectangle}}}),O}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT);var t=e.radius,r={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new o(r),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,i){return o.pack(e._ellipseGeometry,t,i)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return l.unpack=function(t,i,n){var d=o.unpack(t,i,u);return c.center=e.clone(d._center,c.center),c.ellipsoid=a.clone(d._ellipsoid,c.ellipsoid),c.height=d._height,c.extrudedHeight=d._extrudedHeight,c.granularity=d._granularity,c.vertexFormat=s.clone(d._vertexFormat,c.vertexFormat),c.stRotation=d._stRotation,c.shadowVolume=d._shadowVolume,r(n)?(c.semiMajorAxis=d._semiMajorAxis,c.semiMinorAxis=d._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=d._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY,shadowVolume:!0})},n(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(r){var n=r.center;v=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,v),r.height,v),v=t.add(n,v,v);for(var o=new e(v,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),h=s.length/3,p=d.createTypedArray(h,2*h),f=0,m=0;m<h;++m)p[f++]=m,p[f++]=(m+1)%h;return{boundingSphere:o,attributes:l,indices:p}}function m(n){var o=n.center,s=n.ellipsoid,l=n.semiMajorAxis,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,g),n.height,g);y.center=t.add(o,p,y.center),y.radius=l,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,p),n.extrudedHeight,p),C.center=t.add(o,p,C.center),C.radius=l;var f=a.computeEllipsePositions(n,!1,!0).outerPositions,m=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(f,n,!0)})});f=m.position.values;var _=e.union(y,C),v=f.length/3,w=r(n.numberOfVerticalLines,16);w=h.clamp(w,0,v/2);var S=d.createTypedArray(v,2*v+2*w);v/=2;var E,b=0;for(E=0;E<v;++E)S[b++]=E,S[b++]=(E+1)%v,S[b++]=E+v,S[b++]=(E+1)%v+v;var T;if(w>0){var x=Math.min(w,v);T=Math.round(v/x);var A=Math.min(T*w,v);for(E=0;E<A;E+=T)S[b++]=E,S[b++]=E+v}return{boundingSphere:_,attributes:m,indices:S}}function _(e){e=r(e,r.EMPTY_OBJECT);var i=e.center,o=r(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=r(e.granularity,h.RADIANS_PER_DEGREE),c=r(e.height,0),d=e.extrudedHeight,p=n(d)&&Math.abs(c-d)>1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=d,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,v=new t,y=new e,C=new e;_.packedLength=t.packedLength+s.packedLength+9,_.pack=function(e,i,o){return o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines,i};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return _.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,w);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],d=e[i++],h=e[i++],p=e[i++],f=e[i++],m=e[i++],g=1===e[i++],v=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=d,o._height=h,o._granularity=p,o._extrudedHeight=f?m:void 0,o._extrude=g,o._numberOfVerticalLines=v,o):(E.height=h,E.extrudedHeight=f?m:void 0,E.granularity=p,E.rotation=d,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=v,new _(E))},_.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=m(i)):t=f(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},_}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=i(e,i.EMPTY_OBJECT);var t=e.radius,r={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,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}),define("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),define("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),define("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()}}),define("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=r(o)?l.clone(o):r(u)?l.clone(u):r(c)?l.addDays(c,-1,new l):l.now(),u=r(u)?l.clone(u):l.clone(o),c=r(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=i(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var i=s(),r=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)r=l.now(r);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)r=l.addSeconds(r,o,r);else{var a=i-this._lastSystemTime;r=l.addSeconds(r,o*(a/1e3),r)}var u=this.clockRange,c=this.startTime,d=this.stopTime;if(u===e.CLAMPED)l.lessThan(r,c)?r=l.clone(c,r):l.greaterThan(r,d)&&(r=l.clone(d,r));else if(u===e.LOOP_STOP)for(l.lessThan(r,c)&&(r=l.clone(c,r));l.greaterThan(r,d);)r=l.addSeconds(c,l.secondsDifference(r,d),r)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(i,r,n,o,l){i=e(i,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var u=n,c=n,d=n;if(0!==r){var h;h=n<.5?n*(1+r):n+r-n*r;var p=2*n-h;u=a(p,h,i+1/3),c=a(p,h,i),d=a(p,h,i-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=d,l.alpha=o,l):new s(u,c,d,o)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),d=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(d-c)}var h=i.blue;if(!t(h)){var p=e(i.minimumBlue,0),f=e(i.maximumBlue,1);h=p+o.nextRandomNumber()*(f-p)}var m=i.alpha;if(!t(m)){var _=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);m=_+o.nextRandomNumber()*(g-_)}return t(r)?(r.red=n,r.green=u,r.blue=h,r.alpha=m,r):new s(n,u,h,m)};var d=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([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,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i,r){t(r)||(r=new s);var n=s[i.toUpperCase()];if(t(n))return s.clone(n,r),r;var o=d.exec(i);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=1,r):(o=h.exec(i),null!==o?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=1,r):(o=p.exec(i),null!==o?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(e(o[4],"1.0")),r):(o=f.exec(i),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),r):r=void 0)))},s.packedLength=4,s.pack=function(t,i,r){return r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha,i},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){if(t(e))return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},s.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},s.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},s.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},s.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},s.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},s.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUCHSIA=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}),define("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,t){"use strict";function i(e,t,i,r){this._format=e,this._width=t,this._height=i,this._buffer=r}return t(i.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),i.clone=function(t){if(e(t))return new i(t._format,t._width,t._height,t._buffer)},i.prototype.clone=function(){return i.clone(this)},i}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),d=l*a,h=d*d,p=1-h,f=Math.sqrt(p),m=t/4,_=m*m,g=_*m,v=_*_,y=1+m-3*_/4+5*g/4-175*v/64,C=1-m+15*_/8-35*g/8,w=1-3*m+35*_/4,S=1-5*m,E=y*c-C*Math.sin(2*c)*m/2-w*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,b=e._constants;b.a=i,b.b=r,b.f=n,b.cosineHeading=o,b.sineHeading=a,b.tanU=s,b.cosineU=l,b.sineU=u,b.sigma=c,b.sineAlpha=d,b.sineSquaredAlpha=h,b.cosineSquaredAlpha=p,b.cosineAlpha=f,b.u2Over4=m,b.u4Over16=_,b.u6Over64=g,b.u8Over256=v,b.a0=y,b.a1=C,b.a2=w,b.a3=S,b.distanceRatio=E}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function d(e,t,i,r,n,o,a){var l,u,d,h,p,f=(t-i)/t,m=o-r,_=Math.atan((1-f)*Math.tan(n)),g=Math.atan((1-f)*Math.tan(a)),v=Math.cos(_),y=Math.sin(_),C=Math.cos(g),w=Math.sin(g),S=v*C,E=v*w,b=y*w,T=y*C,x=m,A=s.TWO_PI,P=Math.cos(x),D=Math.sin(x);do{P=Math.cos(x),D=Math.sin(x);var M=E-T*P;d=Math.sqrt(C*C*D*D+M*M),u=b+S*P,l=Math.atan2(d,u);var I;0===d?(I=0,h=1):(I=S*D/d,h=1-I*I),A=x,p=u-2*b/h,isNaN(p)&&(p=0),x=m+c(f,I,h,l,d,u,p)}while(Math.abs(x-A)>s.EPSILON12);var R=h*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,B=N*d*(p+N*(u*(2*L-1)-N*p*(4*d*d-3)*(4*L-3)/6)/4),F=i*O*(l-B),k=Math.atan2(C*D,E-T*P),V=Math.atan2(v*D,E*P-T);e._distance=F,e._startHeading=k,e._endHeading=V,e._uSquared=R}function h(i,r,n,o){e.normalize(o.cartographicToCartesian(r,m),f),e.normalize(o.cartographicToCartesian(n,m),m);d(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&h(this,e,n,s)}var f=new e,m=new e;return n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),d=Math.sin(4*o),h=Math.sin(6*o),p=Math.sin(8*o),f=o*o,m=o*f,_=n.u8Over256,g=n.u2Over4,v=n.u6Over64,y=n.u4Over16,C=2*m*_*a/3+o*(1-g+7*y/4-15*v/4+579*_/64-(y-15*v/4+187*_/16)*a-(5*v/4-115*_/16)*s-29*_*l/16)+(g/2-y+71*v/32-85*_/16)*u+(5*y/16-5*v/4+383*_/96)*d-f*((v-11*_/2)*u+5*_*d/2)+(29*v/96-29*_/16)*h+539*_*p/1536,w=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(w));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),x=n.cosineU*T,A=n.sineU*b,P=Math.atan2(b*n.sineHeading,x-A*n.cosineHeading),D=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(i)?(i.longitude=this._start.longitude+D,i.latitude=S,i.height=0,i):new t(this._start.longitude+D,S,0)},p}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e,t,i){var r=b;r.length=e;var n;if(t===i){for(n=0;n<e;n++)r[n]=t;return r}var o=i-t,a=o/e;for(n=0;n<e;n++){var s=t+n*a;r[n]=s}return r}function p(t,i,r,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(i,D),d=f.numberOfPoints(t,i,r),p=n.cartesianToCartographic(u,T),m=n.cartesianToCartographic(c,x),_=h(d,o,a);M.setEndPoints(p,m);var g=M.surfaceDistance/d,v=l;p.height=o;var y=n.cartographicToCartesian(p,A);e.pack(y,s,v),v+=3;for(var C=1;C<d;C++){var w=M.interpolateUsingSurfaceDistance(C*g,x);w.height=_[C],y=n.cartographicToCartesian(w,A),e.pack(y,s,v),v+=3}return v}var f={};f.numberOfPoints=function(t,i,r){var n=e.distance(t,i);return Math.ceil(n/r)};var m=new t;f.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n<i;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,m).height}return r};var _=new c,g=new e,v=new e,y=new d(e.ZERO,0),C=new e,w=new d(e.ZERO,0),S=new e,E=new e,b=[],T=new t,x=new t,A=new e,P=new e,D=new e,M=new a;return f.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,_),u=c.multiplyByPoint(l,e.ZERO,g),h=c.multiplyByPointAsVector(l,e.UNIT_Y,v),p=d.fromPointNormal(u,h,y),f=c.multiplyByPointAsVector(l,e.UNIT_X,C),m=d.fromPointNormal(u,f,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,A=1;A<x;++A){var P=t[A];if(d.getPointDistance(m,T)<0||d.getPointDistance(m,P)<0){var D=s.lineSegmentPlane(T,P,p,S);if(r(D)){var M=e.multiplyByScalar(h,5e-9,E);d.getPointDistance(p,T)<0&&e.negate(M,M),o.push(e.add(D,M,new e)),a.push(b+1),e.negate(M,M),o.push(e.add(D,M,new e)),b=1}}o.push(e.clone(t[A])),b++,T=P}a.push(b)}return{positions:o,lengths:a}},f.generateArc=function(t){r(t)||(t={});var n=t.positions,a=n.length,s=i(t.ellipsoid,o.WGS84),c=i(t.height,0),d=l(c);if(a<1)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],P);if(c=d?c[0]:c,0!==c){var m=s.geodeticSurfaceNormal(h,A);e.multiplyByScalar(m,c,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var g=i(t.granularity,u.RADIANS_PER_DEGREE);_=u.chordLength(g,s.maximumRadius)}var v,y=0;for(v=0;v<a-1;v++)y+=f.numberOfPoints(n[v],n[v+1],_);var C=3*(y+1),w=new Array(C),S=0;for(v=0;v<a-1;v++){var E=n[v],x=n[v+1],D=d?c[v]:c,M=d?c[v+1]:c;S=p(E,x,_,s,D,M,w,S)}b.length=0;var I=n[a-1],R=s.cartesianToCartographic(I,T);R.height=d?c[a-1]:c;var O=s.cartographicToCartesian(R,A);return e.pack(O,w,C-3),w},f.generateCartesianArc=function(t){for(var i=f.generateArc(t),r=i.length/3,n=new Array(r),o=0;o<r;o++)n[o]=e.unpack(i,3*o);return n},f}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];O=t.cartesianToCartographic(n,O),i[r]=O.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function p(e,i,r,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(i===r){for(o=0;o<u;o++)c[o]=i;return c.push(r),c}var d=r-i,h=d/u;for(o=1;o<u;o++){var p=i+o*h;c[o]=p}return c[0]=i,c.push(r),c}function f(i,r,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,i,j),j),u=s.projectPointOntoPlane(t.add(n,r,Y),Y),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function m(e,i,r,n,o,a,u,c){var h=V,p=z;L=d.eastNorthUpToFixedFrame(e,o,L),h=l.multiplyByPointAsVector(L,N,h),h=t.normalize(h,h);var m=f(h,i,e,o);F=s.fromRotationZ(m,F),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(F,U,B),L);var _=k;_[0]=u;for(var g=0;g<c;g++)for(var v=0;v<r.length;v+=3)p=t.fromArray(r,v,p),p=s.multiplyByVector(_,p,p),p=l.multiplyByPoint(L,p,p),n.push(p.x,p.y,p.z);return n}function _(e,i,r,n,o,a,s){for(var l=0;l<e.length;l+=3){var u=t.fromArray(e,l,G);n=m(u,i,r,n,o,a[l/3],s,1)}return n}function g(e,t){var i=e.length,r=new Array(6*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a;for(var l=1;l<i;l++){s=e[l];var u=s.x-o,c=s.y-a;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a,r}function v(e,t){for(var i=e.length,r=new Array(3*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<i;s++)r[n++]=e[s].x-o,r[n++]=0,r[n++]=e[s].y-a;return r}function y(e,i,r,o,l,u,d,h,p,f){var _,g=t.angleBetween(t.subtract(i,e,M),t.subtract(r,e,I)),v=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));_=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,M),g/(v+1),H),q):s.fromQuaternion(c.fromAxisAngle(e,g/(v+1),H),q);var y,C;if(i=t.clone(i,W),v>0)for(var w=f?2:1,S=0;S<v;S++)i=s.multiplyByVector(_,i,i),y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,I),d=m(C,y,h,d,u,p,1,w);else y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,I),d=m(C,y,h,d,u,p,1,1),r=t.clone(r,W),y=t.subtract(r,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,I),d=m(C,y,h,d,u,p,1,1);return d}var C=[new t,new t],w=new t,S=new t,E=new t,b=new t,T=new t,x=new t,A=new t,P=new t,D=new t,M=new t,I=new t,R={},O=new r,N=new t(-1,0,0),L=new l,B=new l,F=new s,k=s.IDENTITY.clone(),V=new t,z=new i,U=new t,G=new t,H=new c,W=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var i=t.length,r=[],n=i-1,o=0;o<i;n=o++){var a=t[n],s=t[o];e.equals(a,s)||r.push(s)}return r};var j=new t,Y=new t;R.angleIsGreaterThanPi=function(e,i,r,n){var a=new o(r,n),s=a.projectPointOntoPlane(t.add(r,e,j),j),l=a.projectPointOntoPlane(t.add(r,i,Y),Y);return l.x*s.y-l.y*s.x>=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=h(e,l),d=o._granularity,f=o._cornerType,I=s?g(i,r):v(i,r),O=s?v(i,r):void 0,N=r.height/2,L=r.width/2,B=e.length,F=[],k=s?[]:void 0,V=w,z=S,U=E,G=b,H=T,W=x,q=A,j=P,Y=D,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),V=t.subtract(Q,K,V),V=t.normalize(V,V),j=t.cross(G,V,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(k=m(K,j,O,k,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(V,z);for(var ee,te,ie=1;ie<B-1;ie++){var re=s?2:1;Q=e[ie+1],V=t.subtract(Q,K,V),V=t.normalize(V,V),U=t.add(V,z,U),U=t.normalize(U,U),G=l.geodeticSurfaceNormal(K,G);var ne=t.multiplyByScalar(G,t.dot(V,G),X);t.subtract(V,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(z,G),Z);t.subtract(z,oe,oe),t.normalize(oe,oe);var ae=!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7);if(ae){U=t.cross(U,G,U),U=t.cross(G,U,U),U=t.normalize(U,U);var se=1/Math.max(.25,t.magnitude(t.cross(U,z,M))),le=R.angleIsGreaterThanPi(V,z,K,l);le?(H=t.add(K,t.multiplyByScalar(U,se*L,U),H),W=t.add(H,t.multiplyByScalar(j,L,W),W),C[0]=t.clone(Y,C[0]),C[1]=t.clone(W,C[1]),ee=p(C,J+N,$+N,d),te=u.generateArc({positions:C,granularity:d,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),j=t.cross(G,V,j),j=t.normalize(j,j),q=t.add(H,t.multiplyByScalar(j,L,q),q),f===n.ROUNDED||f===n.BEVELED?y(H,W,q,f,le,l,F,I,$+N,s):(U=t.negate(U,U),F=m(K,U,I,F,l,$+N,se,re)),Y=t.clone(q,Y)):(H=t.add(K,t.multiplyByScalar(U,se*L,U),H),W=t.add(H,t.multiplyByScalar(j,-L,W),W),C[0]=t.clone(Y,C[0]),C[1]=t.clone(W,C[1]),ee=p(C,J+N,$+N,d),te=u.generateArc({positions:C,granularity:d,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),j=t.cross(G,V,j),j=t.normalize(j,j),q=t.add(H,t.multiplyByScalar(j,-L,q),q),f===n.ROUNDED||f===n.BEVELED?y(H,W,q,f,le,l,F,I,$+N,s):F=m(K,U,I,F,l,$+N,se,re),Y=t.clone(q,Y)),z=t.negate(V,z)}else F=m(Y,j,I,F,l,J+N,1,1),Y=K;J=$,$=c[ie+1],K=Q}C[0]=t.clone(Y,C[0]),C[1]=t.clone(K,C[1]),ee=p(C,J+N,$+N,d),te=u.generateArc({positions:C,granularity:d,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),s&&(k=m(K,j,O,k,l,$+N,1,1)),B=F.length;var ue=s?B+k.length:B,ce=new Float64Array(ue);return ce.set(F),s&&ce.set(k,B),ce},R}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,o,a,l,u){var c=e.angleBetween(e.subtract(o,i,f),e.subtract(a,i,m)),d=l===t.BEVELED?1:Math.ceil(c/r.toRadians(5))+1,h=3*d,p=new Array(h);p[h-3]=a.x,p[h-2]=a.y,p[h-1]=a.z;var _;_=u?n.fromQuaternion(s.fromAxisAngle(e.negate(i,f),c/d,D),M):n.fromQuaternion(s.fromAxisAngle(i,c/d,D),M);var g=0;o=e.clone(o,f);for(var v=0;v<d;v++)o=n.multiplyByVector(_,o,o),p[g++]=o.x,p[g++]=o.y,p[g++]=o.z;return p}function u(i){var r=y,n=C,o=w,a=i[1];n=e.fromArray(i[1],a.length-3,n),o=e.fromArray(i[0],0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var s=l(r,n,o,t.ROUNDED,!1),u=i.length-1,c=i[u-1];a=i[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var d=l(r,n,o,t.ROUNDED,!1);return[s,d]}function c(t,i,r,n){var o=f;return n?o=e.add(t,i,o):(i=e.negate(i,i),o=e.add(t,i,o)),[o.x,o.y,o.z,r.x,r.y,r.z]}function d(t,i,r,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(i,r,f),l=e.negate(s,m),u=0,c=t.length-1,d=0;d<t.length;d+=3){var h=e.fromArray(t,d,_),p=e.add(h,l,g);o[u++]=p.x,o[u++]=p.y,o[u++]=p.z;var v=e.add(h,s,g);a[c--]=v.z,a[c--]=v.y,a[c--]=v.x}return n.push(o,a),n}function h(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}var p={},f=new e,m=new e,_=new e,g=new e,v=[new e,new e],y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new e,x=new e,A=new e,P=new e,D=new s,M=new n;p.addAttribute=function(e,t,r,n){var o=t.x,a=t.y,s=t.z;i(r)&&(e[r]=o,e[r+1]=a,e[r+2]=s),i(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var I=new e,R=new e;return p.computePositions=function(i){var n=i.granularity,s=i.positions,p=i.ellipsoid;s=h(s,p);var m=i.width/2,_=i.cornerType,g=i.saveAttributes,D=y,M=C,O=w,N=S,L=E,B=b,F=T,k=x,V=A,z=P,U=[],G=g?[]:void 0,H=g?[]:void 0,W=s[0],q=s[1];M=e.normalize(e.subtract(q,W,M),M),D=p.geodeticSurfaceNormal(W,D),N=e.normalize(e.cross(D,M,N),N),g&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z)),F=e.clone(W,F),W=q,O=e.negate(M,O);var j,Y,X=[],Z=s.length;for(Y=1;Y<Z-1;Y++){D=p.geodeticSurfaceNormal(W,D),q=s[Y+1],M=e.normalize(e.subtract(q,W,M),M),L=e.normalize(e.add(M,O,L),L);var K=e.multiplyByScalar(D,e.dot(M,D),I);e.subtract(M,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(D,e.dot(O,D),R);e.subtract(O,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,D,L),L=e.cross(D,L,L),L=e.normalize(L,L);var $=m/Math.max(.25,e.magnitude(e.cross(L,O,f))),ee=a.angleIsGreaterThanPi(M,O,W,p);L=e.multiplyByScalar(L,$,L),ee?(k=e.add(W,L,k),z=e.add(k,e.multiplyByScalar(N,m,z),z),V=e.add(k,e.multiplyByScalar(N,2*m,V),V),v[0]=e.clone(F,v[0]),v[1]=e.clone(z,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z)),B=e.clone(V,B),N=e.normalize(e.cross(D,M,N),N),V=e.add(k,e.multiplyByScalar(N,2*m,V),V),F=e.add(k,e.multiplyByScalar(N,m,F),F),_===t.ROUNDED||_===t.BEVELED?X.push({leftPositions:l(k,B,V,_,ee)}):X.push({leftPositions:c(W,e.negate(L,L),V,ee)})):(V=e.add(W,L,V),z=e.add(V,e.negate(e.multiplyByScalar(N,m,z),z),z),k=e.add(V,e.negate(e.multiplyByScalar(N,2*m,k),k),k),v[0]=e.clone(F,v[0]),v[1]=e.clone(z,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z)),B=e.clone(k,B),N=e.normalize(e.cross(D,M,N),N),k=e.add(V,e.negate(e.multiplyByScalar(N,2*m,k),k),k),F=e.add(V,e.negate(e.multiplyByScalar(N,m,F),F),F),_===t.ROUNDED||_===t.BEVELED?X.push({rightPositions:l(V,B,k,_,ee)}):X.push({rightPositions:c(W,L,k,ee)})),O=e.negate(M,O)}W=q}D=p.geodeticSurfaceNormal(W,D),v[0]=e.clone(F,v[0]),v[1]=e.clone(W,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z));var te;return _===t.ROUNDED&&(te=u(U)),{positions:U,corners:X,lefts:G,normals:H,endPositions:te}},p}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,i,n){n=n||2;var o=i&&i.length,a=o?i[0]*n:e.length,s=t(e,0,a,n,!0),u=[];if(!s)return u;var c,d,h,p,f,m,_;if(o&&(s=l(e,i,s,n)),e.length>80*n){c=h=e[0],d=p=e[1];for(var g=n;g<a;g+=n)f=e[g],m=e[g+1],f<c&&(c=f),m<d&&(d=m),f>h&&(h=f),m>p&&(p=m);_=Math.max(h-c,p-d)}return r(s,u,n,c,d,_),u}function t(e,t,i,r,n){var o,a;if(n===P(e,t,i,r)>0)for(o=t;o<i;o+=r)a=T(o,e[o],e[o+1],a);else for(o=i-r;o>=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function i(e,t){if(!e)return e;t||(t=e);var i,r=e;do if(i=!1,r.steiner||!y(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;i=!0}while(i||r!==t);return t}function r(e,t,l,u,c,d,p){if(e){!p&&d&&h(e,u,c,d);for(var f,m,_=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?o(e,u,c,d):n(e))t.push(f.i/l),t.push(e.i/l),t.push(m.i/l),x(e),e=m.next,_=m.next;else if(e=m,e===_){p?1===p?(e=a(e,t,l),r(e,t,l,u,c,d,2)):2===p&&s(e,t,l,u,c,d):r(i(e),t,l,u,c,d,1);break}}}function n(e){var t=e.prev,i=e,r=e.next;if(v(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(_(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,i,r){var n=e.prev,o=e,a=e.next;if(v(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,d=f(s,l,t,i,r),h=f(u,c,t,i,r),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!y(n,o)&&C(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),x(r),x(r.next),r=e=o),r=r.next}while(r!==e);return r}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,o,a,s),void r(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,r,n,o){var a,s,l,d,h,p=[];for(a=0,s=r.length;a<s;a++)l=r[a]*o,d=a<s-1?r[a+1]*o:e.length,h=t(e,l,d,o,!1),h===h.next&&(h.steiner=!0),p.push(m(h));for(p.sort(u),a=0;a<p.length;a++)c(p[a],n),n=i(n,n.next);return n}function u(e,t){return e.x-t.x}function c(e,t){if(t=d(e,t)){var r=b(t,e);i(r,r.next)}}function d(e,t){var i,r=t,n=e.x,o=e.y,a=-(1/0);do{if(o<=r.y&&o>=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===a)return i.prev;var l,u=i,c=i.x,d=i.y,h=1/0;for(r=i.next;r!==u;)n>=r.x&&r.x>=c&&_(o<d?n:a,o,c,d,o<d?a:n,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(n-r.x),(l<h||l===h&&r.x>i.x)&&S(r,e)&&(i=r,h=l)),r=r.next;return i}function h(e,t,i,r){var n=e;do null===n.z&&(n.z=f(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(l=u;s>0||l>0&&r;)0===s?(n=r,r=r.nextZ,l--):0!==l&&r?i.z<=r.z?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--):(n=i,i=i.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function f(e,t,i,r,n){return e=32767*(e-i)/n,t=32767*(t-r)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,i=e;do t.x<i.x&&(i=t),t=t.next;while(t!==e);return i}function _(e,t,i,r,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!w(e,t)&&S(e,t)&&S(t,e)&&E(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,i,r){return!!(y(e,t)&&y(i,r)||y(e,r)&&y(i,t))||v(e,t,i)>0!=v(e,t,r)>0&&v(i,r,e)>0!=v(i,r,t)>0}function w(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&C(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function S(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function E(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==e);return r}function b(e,t){var i=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function T(e,t,i,r){var n=new A(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(e,t,i,r){for(var n=0,o=t,a=i-r;o<i;o+=r)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}return e.deviation=function(e,t,i,r){var n=t&&t.length,o=n?t[0]*i:e.length,a=Math.abs(P(e,0,o,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;a-=Math.abs(P(e,u,c,i))}var d=0;for(s=0;s<r.length;s+=3){var h=r[s]*i,p=r[s+1]*i,f=r[s+2]*i;d+=Math.abs((e[h]-e[f])*(e[p+1]-e[h+1])-(e[h]-e[p])*(e[f+1]-e[h+1]))}return 0===a&&0===d?0:Math.abs((d-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)i.vertices.push(e[n][o][a]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return e(i)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";var p=new i,f=new i,m={};m.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i,S=new i;return m.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var h,p=a.slice(0),f=t.length,m=new Array(3*f),E=0;for(h=0;h<f;h++){var b=t[h];m[E++]=b.x,m[E++]=b.y,m[E++]=b.z}for(var T=[],x={},A=e.maximumRadius,P=c.chordLength(s,A),D=P*P;p.length>0;){var M,I,R=p.pop(),O=p.pop(),N=p.pop(),L=i.fromArray(m,3*N,_),B=i.fromArray(m,3*O,g),F=i.fromArray(m,3*R,v),k=i.multiplyByScalar(i.normalize(L,y),A,y),V=i.multiplyByScalar(i.normalize(B,C),A,C),z=i.multiplyByScalar(i.normalize(F,w),A,w),U=i.magnitudeSquared(i.subtract(k,V,S)),G=i.magnitudeSquared(i.subtract(V,z,S)),H=i.magnitudeSquared(i.subtract(z,k,S)),W=Math.max(U,G,H);W>D?U===W?(M=Math.min(N,O)+" "+Math.max(N,O),h=x[M],o(h)||(I=i.add(L,B,S),i.multiplyByScalar(I,.5,I),m.push(I.x,I.y,I.z),h=m.length/3-1,x[M]=h),p.push(N,h,R),p.push(h,O,R)):G===W?(M=Math.min(O,R)+" "+Math.max(O,R),h=x[M],o(h)||(I=i.add(B,F,S),i.multiplyByScalar(I,.5,I),m.push(I.x,I.y,I.z),h=m.length/3-1,x[M]=h),p.push(O,h,N),p.push(h,R,N)):H===W&&(M=Math.min(R,N)+" "+Math.max(R,N),h=x[M],o(h)||(I=i.add(F,L,S),i.multiplyByScalar(I,.5,I),m.push(I.x,I.y,I.z),h=m.length/3-1,x[M]=h),p.push(R,h,O),p.push(h,N,O)):(T.push(N),T.push(O),T.push(R))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:T,primitiveType:d.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,a){r=n(r,s.WGS84);var l=p,u=f;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,d=0;d<c;d+=3)i.fromArray(e,d,u),a&&(u=r.scaleToGeodeticSurface(u,u)),0!==t&&(l=r.geodeticSurfaceNormal(u,l),i.multiplyByScalar(l,t,l),i.add(u,l,u)),e[d]=u.x,e[d+1]=u.y,e[d+2]=u.z;return e},m}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function w(e,t,r,n,o,s){var l=e.normals,u=e.tangents,c=e.bitangents,d=i.normalize(i.cross(r,t,L),L);s.normal&&a.addAttribute(l,t,n,o),s.tangent&&a.addAttribute(u,d,n,o),s.bitangent&&a.addAttribute(c,r,n,o)}function S(e,t,r){var o,s,u,c=e.positions,d=e.corners,h=e.endPositions,g=e.lefts,v=e.normals,y=new f,C=0,S=0,E=0;for(s=0;s<c.length;s+=2)u=c[s].length-3,C+=u,E+=2*u,S+=c[s+1].length-3;for(C+=3,S+=3,s=0;s<d.length;s++){o=d[s];var b=d[s].leftPositions;l(b)?(u=b.length,C+=u,E+=u):(u=d[s].rightPositions.length,S+=u,E+=u)}var T,x=l(h);x&&(T=h[0].length-3,C+=T,S+=T,T/=3,E+=6*T);var A,P,O,F,k,V,z=C+S,U=new Float64Array(z),G=t.normal?new Float32Array(z):void 0,H=t.tangent?new Float32Array(z):void 0,W=t.bitangent?new Float32Array(z):void 0,q={normals:G,tangents:H,bitangents:W},j=0,Y=z-1,X=D,Z=M,K=T/2,Q=m.createTypedArray(z/3,E),J=0;if(x){V=I,k=R;var $=h[0];for(X=i.fromArray(v,0,X),Z=i.fromArray(g,0,Z),s=0;s<K;s++)V=i.fromArray($,3*(K-1-s),V),k=i.fromArray($,3*(K+s),k),a.addAttribute(U,k,j),a.addAttribute(U,V,void 0,Y),w(q,X,Z,j,Y,t),P=j/3,F=P+1,A=(Y-2)/3,O=A-1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3}var ee=0,te=0,ie=c[ee++],re=c[ee++];U.set(ie,j),U.set(re,Y-re.length+1),Z=i.fromArray(g,te,Z);var ne,oe;for(u=re.length-3,s=0;s<u;s+=3)ne=r.geodeticSurfaceNormal(i.fromArray(ie,s,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u-s,B),B),X=i.normalize(i.add(ne,oe,X),X),w(q,X,Z,j,Y,t),P=j/3,F=P+1,A=(Y-2)/3,O=A-1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3;for(ne=r.geodeticSurfaceNormal(i.fromArray(ie,u,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u,B),B),X=i.normalize(i.add(ne,oe,X),X),te+=3,s=0;s<d.length;s++){var ae;o=d[s];var se,le,ue=o.leftPositions,ce=o.rightPositions,de=N,he=I,pe=R;if(X=i.fromArray(v,te,X),l(ue)){for(w(q,X,Z,void 0,Y,t),Y-=3,se=F,le=O,ae=0;ae<ue.length/3;ae++)de=i.fromArray(ue,3*ae,de),Q[J++]=se,Q[J++]=le-ae-1,Q[J++]=le-ae,a.addAttribute(U,de,void 0,Y),he=i.fromArray(U,3*(le-ae-1),he),pe=i.fromArray(U,3*se,pe),Z=i.normalize(i.subtract(he,pe,Z),Z),w(q,X,Z,void 0,Y,t),Y-=3;de=i.fromArray(U,3*se,de),he=i.subtract(i.fromArray(U,3*le,he),de,he),pe=i.subtract(i.fromArray(U,3*(le-ae),pe),de,pe),Z=i.normalize(i.add(he,pe,Z),Z),w(q,X,Z,j,void 0,t),j+=3}else{for(w(q,X,Z,j,void 0,t),j+=3,se=O,le=F,ae=0;ae<ce.length/3;ae++)de=i.fromArray(ce,3*ae,de),Q[J++]=se,Q[J++]=le+ae,Q[J++]=le+ae+1,a.addAttribute(U,de,j),he=i.fromArray(U,3*se,he),pe=i.fromArray(U,3*(le+ae),pe),Z=i.normalize(i.subtract(he,pe,Z),Z),w(q,X,Z,j,void 0,t),j+=3;de=i.fromArray(U,3*se,de),he=i.subtract(i.fromArray(U,3*(le+ae),he),de,he),pe=i.subtract(i.fromArray(U,3*le,pe),de,pe),Z=i.normalize(i.negate(i.add(pe,he,Z),Z),Z),w(q,X,Z,void 0,Y,t),Y-=3}for(ie=c[ee++],re=c[ee++],ie.splice(0,3),re.splice(re.length-3,3),U.set(ie,j),U.set(re,Y-re.length+1),u=re.length-3,te+=3,Z=i.fromArray(g,te,Z),ae=0;ae<re.length;ae+=3)ne=r.geodeticSurfaceNormal(i.fromArray(ie,ae,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u-ae,B),B),X=i.normalize(i.add(ne,oe,X),X),w(q,X,Z,j,Y,t),F=j/3,P=F-1,O=(Y-2)/3,A=O+1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3;j-=3,Y+=3}if(X=i.fromArray(v,v.length-3,X),w(q,X,Z,j,Y,t),x){j+=3,Y-=3,V=I,k=R;var fe=h[1];for(s=0;s<K;s++)V=i.fromArray(fe,3*(T-s-1),V),k=i.fromArray(fe,3*s,k),a.addAttribute(U,V,void 0,Y),a.addAttribute(U,k,j),w(q,X,Z,j,Y,t),F=j/3,P=F-1,O=(Y-2)/3,A=O+1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3}if(y.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:U}),t.st){var me,_e,ge=new Float32Array(z/3*2),ve=0;if(x){C/=3,S/=3;var ye=Math.PI/(T+1);_e=1/(C-T+1),
me=1/(S-T+1);var Ce,we=T/2;for(s=we+1;s<T+1;s++)Ce=_.PI_OVER_TWO+ye*s,ge[ve++]=me*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=1;s<S-T+1;s++)ge[ve++]=s*me,ge[ve++]=0;for(s=T;s>we;s--)Ce=_.PI_OVER_TWO-s*ye,ge[ve++]=1-me*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=we;s>0;s--)Ce=_.PI_OVER_TWO-ye*s,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=C-T;s>0;s--)ge[ve++]=s*_e,ge[ve++]=1;for(s=1;s<we+1;s++)Ce=_.PI_OVER_TWO+ye*s,ge[ve++]=_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce))}else{for(C/=3,S/=3,_e=1/(C-1),me=1/(S-1),s=0;s<S;s++)ge[ve++]=s*me,ge[ve++]=0;for(s=C;s>0;s--)ge[ve++]=(s-1)*_e,ge[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.bitangents})),{attributes:y,indices:Q}}function E(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var r,n,o=e.position.values;(t.normal||t.bitangent)&&(r=e.normal.values,n=e.bitangent.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,d=2*u;if(t.normal||t.bitangent||t.tangent){var h=t.normal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=t.bitangent?new Float32Array(6*u):void 0,m=D,_=M,g=I,v=R,y=O,C=N,w=d;for(s=0;s<u;s+=3){var S=w+d;m=i.fromArray(o,s,m),_=i.fromArray(o,s+u,_),g=i.fromArray(o,(s+3)%u,g),_=i.subtract(_,m,_),g=i.subtract(g,m,g),v=i.normalize(i.cross(_,g,v),v),t.normal&&(a.addAttribute(h,v,S),a.addAttribute(h,v,S+3),a.addAttribute(h,v,w),a.addAttribute(h,v,w+3)),(t.tangent||t.bitangent)&&(C=i.fromArray(r,s,C),t.bitangent&&(a.addAttribute(f,C,S),a.addAttribute(f,C,S+3),a.addAttribute(f,C,w),a.addAttribute(f,C,w+3)),t.tangent&&(y=i.normalize(i.cross(C,v,y),y),a.addAttribute(p,y,S),a.addAttribute(p,y,S+3),a.addAttribute(p,y,w),a.addAttribute(p,y,w+3))),w+=6}if(t.normal){for(h.set(r),s=0;s<u;s+=3)h[s+u]=-r[s],h[s+u+1]=-r[s+1],h[s+u+2]=-r[s+2];e.normal.values=h}else e.normal=void 0;if(t.bitangent?(f.set(n),f.set(n,u),e.bitangent.values=f):e.bitangent=void 0,t.tangent){var E=e.tangent.values;p.set(E),p.set(E,u),e.tangent.values=p}}if(t.st){var b=e.st.values,T=new Float32Array(6*c);T.set(b),T.set(b,c);for(var x=2*c,A=0;A<2;A++){for(T[x++]=b[0],T[x++]=b[1],s=2;s<c;s+=2){var P=b[s],L=b[s+1];T[x++]=P,T[x++]=L,T[x++]=P,T[x++]=L}T[x++]=b[0],T[x++]=b[1]}e.st.values=T}return e}function b(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],o=e[r+1],a=e[r+2];i[t++]=n,i[t++]=o,i[t++]=a,i[t++]=n,i[t++]=o,i[t++]=a}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function T(e,t){var i=new C({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,o=a.computePositions(e),s=S(o,i,r),l=e.height,u=e.extrudedHeight,c=s.attributes,d=s.indices,h=c.position.values,f=h.length,_=new Float64Array(6*f),v=new Float64Array(f);v.set(h);var y=new Float64Array(4*f);h=g.scaleToGeodeticHeight(h,l,r),y=b(h,0,y),v=g.scaleToGeodeticHeight(v,u,r),y=b(v,2*f,y),_.set(h),_.set(v,f),_.set(y,2*f),c.position.values=_,c=E(c,t);var w=f/3;if(e.shadowVolume){var T=c.normal.values;f=T.length;var x=new Float32Array(6*f);for(A=0;A<f;A++)T[A]=-T[A];x.set(T,f),x=b(T,4*f,x),c.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:x}),t.normal||(c.normal=void 0)}var A,P=d.length,D=w+w,M=m.createTypedArray(_.length/3,2*P+3*D);M.set(d);var I=P;for(A=0;A<P;A+=3){var R=d[A],O=d[A+1],N=d[A+2];M[I++]=N+w,M[I++]=O+w,M[I++]=R+w}var L,B,F,k;for(A=0;A<D;A+=2)L=A+D,B=L+D,F=L+1,k=B+1,M[I++]=L,M[I++]=B,M[I++]=F,M[I++]=F,M[I++]=B,M[I++]=k;return{attributes:c,indices:M}}function x(e,t,r,n,o,a){var s=i.subtract(t,e,F);i.normalize(s,s);var l=r.geodeticSurfaceNormal(e,k),u=i.cross(s,l,F);i.multiplyByScalar(u,n,u);var c=o.latitude,d=o.longitude,h=a.latitude,p=a.longitude;i.add(e,u,k),r.cartesianToCartographic(k,V);var f=V.latitude,m=V.longitude;c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),i.subtract(e,u,k),r.cartesianToCartographic(k,V),f=V.latitude,m=V.longitude,c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),o.latitude=c,o.longitude=d,a.latitude=h,a.longitude=p}function A(t,r,n,a){var s=e(t,i.equalsEpsilon),l=s.length;if(l<2||n<=0)return new y;var u=.5*n;G.latitude=Number.POSITIVE_INFINITY,G.longitude=Number.POSITIVE_INFINITY,H.latitude=Number.NEGATIVE_INFINITY,H.longitude=Number.NEGATIVE_INFINITY;var c,d;if(a===o.ROUNDED){var h=s[0];i.subtract(h,s[1],z),i.normalize(z,z),i.multiplyByScalar(z,u,z),i.add(h,z,U),r.cartesianToCartographic(U,V),c=V.latitude,d=V.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,d),H.latitude=Math.max(H.latitude,c),H.longitude=Math.max(H.longitude,d)}for(var p=0;p<l-1;++p)x(s[p],s[p+1],r,u,G,H);var f=s[l-1];i.subtract(f,s[l-2],z),i.normalize(z,z),i.multiplyByScalar(z,u,z),i.add(f,z,U),x(f,U,r,u,G,H),a===o.ROUNDED&&(r.cartesianToCartographic(U,V),c=V.latitude,d=V.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,d),H.latitude=Math.max(H.latitude,c),H.longitude=Math.max(H.longitude,d));var m=new y;return m.north=H.latitude,m.south=G.latitude,m.east=H.longitude,m.west=G.longitude,m}function P(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=d.clone(s(e.ellipsoid,d.WGS84)),this._vertexFormat=C.clone(s(e.vertexFormat,C.DEFAULT)),this._width=r,this._height=s(e.height,0),this._extrudedHeight=s(e.extrudedHeight,this._height),this._cornerType=s(e.cornerType,o.ROUNDED),this._granularity=s(e.granularity,_.RADIANS_PER_DEGREE),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=A(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*i.packedLength+d.packedLength+C.packedLength+y.packedLength+6}var D=new i,M=new i,I=new i,R=new i,O=new i,N=new i,L=new i,B=new i,F=new i,k=new i,V=new r,z=new i,U=new i,G=new r,H=new r;P.pack=function(e,t,r){r=s(r,0);var n=e._positions,o=n.length;t[r++]=o;for(var a=0;a<o;++a,r+=i.packedLength)i.pack(n[a],t,r);return d.pack(e._ellipsoid,t,r),r+=d.packedLength,C.pack(e._vertexFormat,t,r),r+=C.packedLength,y.pack(e._rectangle,t,r),r+=y.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=e._shadowVolume?1:0,t};var W=d.clone(d.UNIT_SPHERE),q=new C,j=new y,Y={positions:void 0,ellipsoid:W,vertexFormat:q,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return P.unpack=function(e,t,r){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=i.packedLength)o[a]=i.unpack(e,t);var u=d.unpack(e,t,W);t+=d.packedLength;var c=C.unpack(e,t,q);t+=C.packedLength;var h=y.unpack(e,t,j);t+=y.packedLength;var p=e[t++],f=e[t++],m=e[t++],_=e[t++],g=e[t++],v=1===e[t];return l(r)?(r._positions=o,r._ellipsoid=d.clone(u,r._ellipsoid),r._vertexFormat=C.clone(c,r._vertexFormat),r._width=p,r._height=f,r._extrudedHeight=m,r._cornerType=_,r._granularity=g,r._rectangle=y.clone(h),r._shadowVolume=v,r):(Y.positions=o,Y.width=p,Y.height=f,Y.extrudedHeight=m,Y.cornerType=_,Y.granularity=g,Y.shadowVolume=v,new P(Y))},P.createGeometry=function(r){var n=r._positions,o=r._height,s=r._width,l=r._extrudedHeight,u=o!==l,c=e(n,i.equalsEpsilon);if(!(c.length<2||s<=0)){var d,p=r._ellipsoid,f=r._vertexFormat,m={ellipsoid:p,positions:c,width:s,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(u){var _=Math.max(o,l);l=Math.min(o,l),o=_,m.height=o,m.extrudedHeight=l,m.shadowVolume=r._shadowVolume,d=T(m,f)}else{var y=a.computePositions(m);d=S(y,f,p),d.attributes.position.values=g.scaleToGeodeticHeight(d.attributes.position.values,o,p)}var C=d.attributes,w=t.fromVertices(C.position.values,void 0,3);return f.position||(d.attributes.position.values=void 0),new h({attributes:C,indices:d.indices,primitiveType:v.TRIANGLES,boundingSphere:w})}},P.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:C.POSITION_ONLY,shadowVolume:!0})},u(P.prototype,{rectangle:{get:function(){return this._rectangle}}}),P}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e,t){var a,l,u,c=[],f=e.positions,m=e.corners,_=e.endPositions,g=new h,v=0,y=0,E=0;for(l=0;l<f.length;l+=2)u=f[l].length-3,v+=u,E+=u/3*4,y+=f[l+1].length-3;for(v+=3,y+=3,l=0;l<m.length;l++){a=m[l];var b=m[l].leftPositions;s(b)?(u=b.length,v+=u,E+=u/3*2):(u=m[l].rightPositions.length,y+=u,E+=u/3*2)}var T,x=s(_);x&&(T=_[0].length-3,v+=T,y+=T,T/=3,E+=4*T);var A,P,D,M,I,R,O=v+y,N=new Float64Array(O),L=0,B=O-1,F=T/2,k=p.createTypedArray(O/3,E+4),V=0;if(k[V++]=L/3,k[V++]=(B-2)/3,x){c.push(L/3),R=C,I=w;var z=_[0];for(l=0;l<F;l++)R=i.fromArray(z,3*(F-1-l),R),I=i.fromArray(z,3*(F+l),I),o.addAttribute(N,I,L),o.addAttribute(N,R,void 0,B),P=L/3,M=P+1,A=(B-2)/3,D=A-1,k[V++]=A,k[V++]=D,k[V++]=P,k[V++]=M,L+=3,B-=3}var U=0,G=f[U++],H=f[U++];for(N.set(G,L),N.set(H,B-H.length+1),u=H.length-3,c.push(L/3,(B-2)/3),l=0;l<u;l+=3)P=L/3,M=P+1,A=(B-2)/3,D=A-1,k[V++]=A,k[V++]=D,k[V++]=P,k[V++]=M,L+=3,B-=3;for(l=0;l<m.length;l++){var W;a=m[l];var q,j=a.leftPositions,Y=a.rightPositions,X=S;if(s(j)){for(B-=3,q=D,c.push(M),W=0;W<j.length/3;W++)X=i.fromArray(j,3*W,X),k[V++]=q-W-1,k[V++]=q-W,o.addAttribute(N,X,void 0,B),B-=3;c.push(q-Math.floor(j.length/6)),t===n.BEVELED&&c.push((B-2)/3+1),L+=3}else{for(L+=3,q=M,c.push(D),W=0;W<Y.length/3;W++)X=i.fromArray(Y,3*W,X),k[V++]=q+W,k[V++]=q+W+1,o.addAttribute(N,X,L),L+=3;c.push(q+Math.floor(Y.length/6)),t===n.BEVELED&&c.push(L/3-1),B-=3}for(G=f[U++],H=f[U++],G.splice(0,3),H.splice(H.length-3,3),N.set(G,L),N.set(H,B-H.length+1),u=H.length-3,W=0;W<H.length;W+=3)M=L/3,P=M-1,D=(B-2)/3,A=D+1,k[V++]=A,k[V++]=D,k[V++]=P,k[V++]=M,L+=3,B-=3;L-=3,B+=3,c.push(L/3,(B-2)/3)}if(x){L+=3,B-=3,R=C,I=w;var Z=_[1];for(l=0;l<F;l++)R=i.fromArray(Z,3*(T-l-1),R),I=i.fromArray(Z,3*l,I),o.addAttribute(N,R,void 0,B),o.addAttribute(N,I,L),M=L/3,P=M-1,D=(B-2)/3,A=D+1,k[V++]=A,k[V++]=D,k[V++]=P,k[V++]=M,L+=3,B-=3;c.push(L/3)}else c.push(L/3,(B-2)/3);return k[V++]=L/3,k[V++]=(B-2)/3,g.position=new d({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:g,indices:k,wallIndices:c}}function v(e){var t=e.ellipsoid,i=o.computePositions(e),r=g(i,e.cornerType),n=r.wallIndices,a=e.height,s=e.extrudedHeight,l=r.attributes,u=r.indices,c=l.position.values,d=c.length,h=new Float64Array(d);h.set(c);var f=new Float64Array(2*d);c=m.scaleToGeodeticHeight(c,a,t),h=m.scaleToGeodeticHeight(h,s,t),f.set(c),f.set(h,d),l.position.values=f,d/=3;var _,v=u.length,y=p.createTypedArray(f.length/3,2*(v+n.length));y.set(u);var C=v;for(_=0;_<v;_+=2){var w=u[_],S=u[_+1];y[C++]=w+d,y[C++]=S+d}var E,b;for(_=0;_<n.length;_++)E=n[_],b=E+d,y[C++]=E,y[C++]=b;return{attributes:l,indices:y}}function y(e){e=a(e,a.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._width=r,this._height=a(e.height,0),this._extrudedHeight=a(e.extrudedHeight,this._height),this._cornerType=a(e.cornerType,n.ROUNDED),this._granularity=a(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*i.packedLength+u.packedLength+5}var C=new i,w=new i,S=new i;y.pack=function(e,t,r){r=a(r,0);var n=e._positions,o=n.length;t[r++]=o;for(var s=0;s<o;++s,r+=i.packedLength)i.pack(n[s],t,r);return u.pack(e._ellipsoid,t,r),r+=u.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var E=u.clone(u.UNIT_SPHERE),b={positions:void 0,ellipsoid:E,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return y.unpack=function(e,t,r){t=a(t,0);for(var n=e[t++],o=new Array(n),l=0;l<n;++l,t+=i.packedLength)o[l]=i.unpack(e,t);var c=u.unpack(e,t,E);t+=u.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t];return s(r)?(r._positions=o,r._ellipsoid=u.clone(c,r._ellipsoid),r._width=d,r._height=h,r._extrudedHeight=p,r._cornerType=f,r._granularity=m,r):(b.positions=o,b.width=d,b.height=h,b.extrudedHeight=p,b.cornerType=f,b.granularity=m,new y(b))},y.createGeometry=function(r){var n=r._positions,a=r._height,s=r._width,l=r._extrudedHeight,u=a!==l,d=e(n,i.equalsEpsilon);if(!(d.length<2||s<=0)){var h,p=r._ellipsoid,f={ellipsoid:p,positions:d,width:s,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(u){var y=Math.max(a,l);l=Math.min(a,l),a=y,f.height=a,f.extrudedHeight=l,h=v(f)}else{var C=o.computePositions(f);h=g(C,f.cornerType),h.attributes.position.values=m.scaleToGeodeticHeight(h.attributes.position.values,a,p)}var w=h.attributes,S=t.fromVertices(w.position.values,void 0,3);return new c({attributes:w,indices:h.indices,primitiveType:_.LINES,boundingSphere:S})}},y}),define("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}return e}),define("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,i,r,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,d=new Float64Array(3*c),h=0,p=0,f=o?3*u:0,m=o?3*(u+n):3*n;for(a=0;a<n;a++){var _=a/n*e.TWO_PI,g=Math.cos(_),v=Math.sin(_),y=g*r,C=v*r,w=g*i,S=v*i;d[p+f]=y,d[p+f+1]=C,d[p+f+2]=l,d[p+m]=w,d[p+m+1]=S,d[p+m+2]=s,p+=3,o&&(d[h++]=y,d[h++]=C,d[h++]=l,d[h++]=w,d[h++]=S,d[h++]=s)}return d},t}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.vertexFormat,f.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=f.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var _=new t,g=new i,v=new i,y=new i,C=new i;m.packedLength=f.packedLength+4,m.pack=function(e,t,i){return i=o(i,0),f.pack(e._vertexFormat,t,i),i+=f.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i]=e._slices,t};var w=new f,S={vertexFormat:w,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return m.unpack=function(e,t,i){t=o(t,0);var r=f.unpack(e,t,w);t+=f.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._vertexFormat=f.clone(r,i._vertexFormat),i._length=n,i._topRadius=s,i._bottomRadius=l,i._slices=u,i):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new m(S))},m.createGeometry=function(o){var a=o._length,s=o._topRadius,f=o._bottomRadius,m=o._vertexFormat,w=o._slices;if(!(a<=0||s<0||f<0||0===s&&0===f)){var S,E=w+w,b=w+E,T=E+E,x=n.computePositions(a,s,f,w,!0),A=m.st?new Float32Array(2*T):void 0,P=m.normal?new Float32Array(3*T):void 0,D=m.tangent?new Float32Array(3*T):void 0,M=m.bitangent?new Float32Array(3*T):void 0,I=m.normal||m.tangent||m.bitangent;if(I){var R=m.tangent||m.bitangent,O=0,N=0,L=0,B=g;B.z=0;var F=y,k=v;for(S=0;S<w;S++){var V=S/w*h.TWO_PI,z=Math.cos(V),U=Math.sin(V);I&&(B.x=z,B.y=U,R&&(F=i.normalize(i.cross(i.UNIT_Z,B,F),F)),m.normal&&(P[O++]=z,P[O++]=U,P[O++]=0,P[O++]=z,P[O++]=U,P[O++]=0),m.tangent&&(D[N++]=F.x,D[N++]=F.y,D[N++]=F.z,D[N++]=F.x,D[N++]=F.y,D[N++]=F.z),m.bitangent&&(k=i.normalize(i.cross(B,F,k),k),M[L++]=k.x,M[L++]=k.y,M[L++]=k.z,M[L++]=k.x,M[L++]=k.y,M[L++]=k.z))}for(S=0;S<w;S++)m.normal&&(P[O++]=0,P[O++]=0,P[O++]=-1),m.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),m.bitangent&&(M[L++]=0,M[L++]=-1,M[L++]=0);for(S=0;S<w;S++)m.normal&&(P[O++]=0,P[O++]=0,P[O++]=1),m.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),m.bitangent&&(M[L++]=0,M[L++]=1,M[L++]=0)}var G=12*w-12,H=d.createTypedArray(T,G),W=0,q=0;for(S=0;S<w-1;S++)H[W++]=q,H[W++]=q+2,H[W++]=q+3,H[W++]=q,H[W++]=q+3,H[W++]=q+1,q+=2;for(H[W++]=E-2,H[W++]=0,H[W++]=1,H[W++]=E-2,H[W++]=1,H[W++]=E-1,S=1;S<w-1;S++)H[W++]=E+S+1,H[W++]=E+S,H[W++]=E;for(S=1;S<w-1;S++)H[W++]=b,H[W++]=b+S,H[W++]=b+S+1;var j=0;if(m.st){var Y=Math.max(s,f);for(S=0;S<T;S++){var X=i.fromArray(x,3*S,C);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new c;m.position&&(Z.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})),m.normal&&(Z.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),m.tangent&&(Z.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),m.bitangent&&(Z.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),m.st&&(Z.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:A})),_.x=.5*a,_.y=Math.max(f,s);var K=new e(i.ZERO,t.magnitude(_));return new l({attributes:Z,indices:H,primitiveType:p.TRIANGLES,boundingSphere:K})}},m}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"}var f=new t;p.packedLength=5,p.pack=function(e,t,i){return i=o(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=e._numberOfVerticalLines,t};var m={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,i){t=o(t,0);var r=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._length=r,i._topRadius=n,i._bottomRadius=s,i._slices=l,i._numberOfVerticalLines=u,i):(m.length=r,m.topRadius=n,m.bottomRadius=s,m.slices=l,m.numberOfVerticalLines=u,new p(m))},p.createGeometry=function(o){var a=o._length,s=o._topRadius,p=o._bottomRadius,m=o._slices,_=o._numberOfVerticalLines;if(!(a<=0||s<0||p<0||0===s&&0===p)){var g,v=2*m,y=n.computePositions(a,s,p,m,!1),C=2*m;if(_>0){var w=Math.min(_,m);g=Math.round(m/w),C+=w}for(var S=d.createTypedArray(v,2*C),E=0,b=0;b<m-1;b++)S[E++]=b,S[E++]=b+1,S[E++]=b+m,S[E++]=b+1+m;if(S[E++]=m-1,S[E++]=0,S[E++]=m+m-1,S[E++]=m,_>0)for(b=0;b<m;b+=g)S[E++]=b,S[E++]=b+m;var T=new c;T.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y}),f.x=.5*a,f.y=Math.max(p,s);var x=new e(i.ZERO,t.magnitude(f));return new l({attributes:T,indices:S,primitiveType:h.LINES,boundingSphere:x})}},p}),define("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),define("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties"],function(e,t,i){"use strict";function r(t,i){t=e(t,0),this._near=t,i=e(i,Number.MAX_VALUE),this._far=i}return i(r.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.far===i.far},r.clone=function(e,i){if(t(e))return t(i)||(i=new r),i.near=e.near,i.far=e.far,i},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),define("Core/DistanceDisplayConditionGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,i){e=t(e,0),i=t(i,Number.MAX_VALUE),this.value=new Float32Array([e,i])}return r(o.prototype,{componentDatatype:{get:function(){return e.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),o.fromDistanceDisplayCondition=function(e){return new o(e.near,e.far)},o.toValue=function(e,t){return i(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},o}),define("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);i!==-1&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();return e.Tween=function(t){var i=t,r={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,d=0,h=null,p=e.Easing.Linear.None,f=e.Interpolation.Linear,m=[],_=null,g=!1,v=null,y=null,C=null;for(var w in t)r[w]=parseFloat(t[w],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,g=!1,h=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),h+=d;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[i[a]].concat(n[a])}r[a]=i[a],r[a]instanceof Array==!1&&(r[a]*=1),o[a]=r[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==C&&C.call(i),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;e<t;e++)m[e].stop()},this.delay=function(e){return d=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 f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return _=e,this},this.onUpdate=function(e){return v=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return C=e,this},this.update=function(e){var t;if(e<h)return!0;g===!1&&(null!==_&&_.call(i),g=!0);var u=(e-h)/a;u=u>1?1:u;var C=p(u);for(t in n){var w=r[t]||0,S=n[t];S instanceof Array?i[t]=f(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(i[t]=w+(S-w)*C))}if(null!==v&&v.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E}r[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(i);for(var b=0,T=m.length;b<T;b++)m[b].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return i<0?a(t[0],t[1],n):i>1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;r<=o;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(i<0&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):i<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[r<o+1?r:o+1],t[r<o+2?r:o+2],n-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(t,i){var r=e.Interpolation.Utils.Factorial;return r(t)/r(i)/r(t-i)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),define("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,w),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,f.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=f.clone(a),this._workerName="createEllipsoidGeometry"}var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i(1,1,1),S=Math.cos,E=Math.sin;m.packedLength=i.packedLength+f.packedLength+2,m.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,f.pack(e._vertexFormat,t,r),r+=f.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions,t};var b=new i,T=new f,x={radii:b,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return m.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,b);t+=i.packedLength;var s=f.unpack(e,t,T);t+=f.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=f.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(x.stackPartitions=l,x.slicePartitions=u,new m(x))},m.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,f,m=s.fromCartesian3(o),w=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,A=new Float64Array(3*x),P=6*(b-1)*(T-2),D=d.createTypedArray(x,P),M=w.normal?new Float32Array(3*x):void 0,I=w.tangent?new Float32Array(3*x):void 0,R=w.bitangent?new Float32Array(3*x):void 0,O=w.st?new Float32Array(2*x):void 0,N=new Array(b),L=new Array(b),B=0;for(a=0;a<b;a++){var F=h.TWO_PI*a/(b-1);N[a]=S(F),L[a]=E(F),A[B++]=0,A[B++]=0,A[B++]=o.z}for(a=1;a<T-1;a++){var k=Math.PI*a/(T-1),V=E(k),z=o.x*V,U=o.y*V,G=o.z*S(k);for(f=0;f<b;f++)A[B++]=N[f]*z,A[B++]=L[f]*U,A[B++]=G}for(a=0;a<b;a++)A[B++]=0,A[B++]=0,A[B++]=-o.z;var H=new c;w.position&&(H.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A}));var W=0,q=0,j=0,Y=0;if(w.st||w.normal||w.tangent||w.bitangent){for(a=0;a<x;a++){var X=i.fromArray(A,3*a,_),Z=m.geodeticSurfaceNormal(X,g);if(w.st){var K=t.negate(Z,C);t.magnitude(K)<h.EPSILON6&&(B=3*(a+b*Math.floor(.5*T)),B>A.length&&(B=3*(a-b*Math.floor(.5*T))),i.fromArray(A,B,K),m.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[W++]=Math.atan2(K.y,K.x)/h.TWO_PI+.5,O[W++]=Math.asin(Z.z)/Math.PI+.5}if(w.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),w.tangent||w.bitangent){var Q=v;if(a<b||a>x-b-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),w.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),w.bitangent){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}w.st&&(H.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),w.normal&&(H.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),w.tangent&&(H.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),w.bitangent&&(H.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(B=0,f=0;f<b-1;f++)D[B++]=b+f,D[B++]=b+f+1,D[B++]=f+1;var $,ee;for(a=1;a<T-2;a++)for($=a*b,ee=(a+1)*b,f=0;f<b-1;f++)D[B++]=ee+f,D[B++]=ee+f+1,D[B++]=$+f+1,D[B++]=ee+f,D[B++]=$+f+1,D[B++]=$+f;for(a=T-2,$=a*b,ee=(a+1)*b,f=0;f<b-1;f++)D[B++]=ee+f,D[B++]=$+f+1,D[B++]=$+f;return new l({attributes:H,indices:D,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(m)})}},m}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=r(e,r.EMPTY_OBJECT);var i=r(e.radii,f),n=r(e.stackPartitions,10),o=r(e.slicePartitions,8),a=r(e.subdivisions,128);this._radii=t.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var f=new t(1,1,1),m=Math.cos,_=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,i,n){return n=r(n,0),t.pack(e._radii,i,n),
n+=t.packedLength,i[n++]=e._stackPartitions,i[n++]=e._slicePartitions,i[n]=e._subdivisions,i};var g=new t,v={radii:g,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,g);i+=t.packedLength;var s=e[i++],l=e[i++],u=e[i++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(v.stackPartitions=s,v.slicePartitions=l,v.subdivisions=u,new p(v))},p.createGeometry=function(t){var r=t._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var n,o,p,f,g,v,y=a.fromCartesian3(r),C=t._stackPartitions,w=t._slicePartitions,S=t._subdivisions,E=S*(C+w-1),b=E-w+2,T=new Float64Array(3*b),x=c.createTypedArray(b,2*E),A=0,P=new Array(S),D=new Array(S);for(n=0;n<S;n++)p=d.TWO_PI*n/S,P[n]=m(p),D[n]=_(p);for(n=1;n<C;n++)for(f=Math.PI*n/C,g=m(f),v=_(f),o=0;o<S;o++)T[A++]=r.x*P[o]*v,T[A++]=r.y*D[o]*v,T[A++]=r.z*g;for(P.length=w,D.length=w,n=0;n<w;n++)p=d.TWO_PI*n/w,P[n]=m(p),D[n]=_(p);for(T[A++]=0,T[A++]=0,T[A++]=r.z,n=1;n<S;n++)for(f=Math.PI*n/S,g=m(f),v=_(f),o=0;o<w;o++)T[A++]=r.x*P[o]*v,T[A++]=r.y*D[o]*v,T[A++]=r.z*g;for(T[A++]=0,T[A++]=0,T[A++]=-r.z,A=0,n=0;n<C-1;++n){var M=n*S;for(o=0;o<S-1;++o)x[A++]=M+o,x[A++]=M+o+1;x[A++]=M+S-1,x[A++]=M}var I=S*(C-1);for(o=1;o<w+1;++o)x[A++]=I,x[A++]=I+o;for(n=0;n<S-2;++n){var R=n*w+1+I,O=(n+1)*w+1+I;for(o=0;o<w-1;++o)x[A++]=O+o,x[A++]=R+o;x[A++]=O+w-1,x[A++]=R+w-1}var N=T.length/3-1;for(o=N-1;o>N-w-1;--o)x[A++]=N,x[A++]=o;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:L,indices:x,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),define("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,i){},u}),define("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function i(){this._removalFunctions=[]}return i.prototype.add=function(e,t,i){var r=e.addEventListener(t,i);this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},i.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;t<i;++t)e[t]();e.length=0},i}),define("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),define("Core/GeocoderService",["./DeveloperError"],function(e){"use strict";function t(){}return t.prototype.geocode=e.throwInstantiationError,t}),define("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return r}),define("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return o!==-1&&(n=i.substring(0,o+1)),r?(i=new e(i),t(i.query)&&(n+="?"+i.query),t(i.fragment)&&(n+="#"+i.fragment),n):n}return r}),define("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return n!==-1&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=n===-1?"":r.substr(n+1)}return r}),define("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return n!==-1&&(r=r.substr(n+1)),r}return r}),define("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),define("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,n){return i=e(i,0),n=e(n,t.byteLength-i),t=t.subarray(i,i+n),r.decode(t)}return r.decodeWithTextDecoder=function(e){var t=new TextDecoder("utf-8");return t.decode(e)},r.decodeWithFromCharCode=function(e){for(var t="",i=e.length,r=0;r<i;++r)t+=String.fromCharCode(e[r]);return t},"undefined"!=typeof TextDecoder?r.decode=r.decodeWithTextDecoder:r.decode=r.decodeWithFromCharCode,r}),define("Core/getMagic",["./defaultValue","./getStringFromTypedArray"],function(e,t){"use strict";function i(i,r){return r=e(r,0),t(i,r,Math.min(4,i.length))}return i}),define("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function i(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.range=e(r,0)}return i.clone=function(e,r){if(t(e))return t(r)||(r=new i),r.heading=e.heading,r.pitch=e.pitch,r.range=e.range,r},i}),define("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(e,t,i,r,o,a){var s,l,u,c=0;if(r>0){for(l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,i,r-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-i[t[l]])}return c}function o(e,t,i,n,o,a){for(var s,l,u=-1,c=t.length,d=c*(c+1)/2,h=0;h<o;h++){var p=Math.floor(h*d);for(s=0;s<c;s++)l=t[s]*o*(a+1)+h,e[p+s]=n[l];for(var f=1;f<c;f++){var m=0,_=Math.floor(f*(1-f)/2)+c*f,g=!1;for(s=0;s<c-f;s++){var v,y,C=i[t[s]],w=i[t[s+f]];if(w-C<=0)l=t[s]*o*(a+1)+o*f+h,v=n[l],y=v/r.factorial(f),e[p+_+m]=y,m++;else{var S=Math.floor((f-1)*(2-f)/2)+c*(f-1);v=e[p+S+s+1]-e[p+S+s],y=v/(w-C),e[p+_+m]=y,m++}g=g||0!==v}g&&(u=Math.max(u,f))}}return u}var a=r.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,i){return i=e(i,0),Math.max(Math.floor((t+1)/(i+1)),2)},s.interpolateOrderZero=function(e,i,r,o,s){t(s)||(s=new Array(o));var l,u,c,d,h,p,f=i.length,m=new Array(o);for(l=0;l<o;l++){s[l]=0;var _=new Array(f);for(m[l]=_,u=0;u<f;u++)_[u]=[]}var g=f,v=new Array(g);for(l=0;l<g;l++)v[l]=l;var y=f-1;for(d=0;d<o;d++){for(u=0;u<g;u++)p=v[u]*o+d,m[d][0].push(r[p]);for(l=1;l<g;l++){var C=!1;for(u=0;u<g-l;u++){var w,S=i[v[u]],E=i[v[u+l]];E-S<=0?(p=v[u]*o+o*l+d,w=r[p],m[d][l].push(w/a(l))):(w=m[d][l-1][u+1]-m[d][l-1][u],m[d][l].push(w/(E-S))),C=C||0!==w}C||(y=l-1)}}for(c=0,h=0;c<=h;c++)for(l=c;l<=y;l++){var b=n(e,v,i,c,l,[]);for(d=0;d<o;d++){var T=m[d][l][0];s[d+c*o]+=T*b}}return s};var l=[];return s.interpolate=function(e,i,r,a,s,u,c){var d=a*(u+1);t(c)||(c=new Array(d));for(var h=0;h<d;h++)c[h]=0;for(var p=i.length,f=new Array(p*(s+1)),m=0;m<p;m++)for(var _=0;_<s+1;_++)f[m*(s+1)+_]=m;for(var g=f.length,v=l,y=o(v,f,i,r,a,s),C=[],w=g*(g+1)/2,S=Math.min(y,u),E=0;E<=S;E++)for(m=E;m<=y;m++){C.length=0;for(var b=n(e,f,i,E,m,C),T=Math.floor(m*(1-m)/2)+g*m,x=0;x<a;x++){var A=Math.floor(x*w),P=v[A+T];c[x+E*a]+=P*b}}return c},s}),define("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}return e}),define("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,i,r,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,d=13.3407154,h=.9856003,p=26.4057084,f=13.064993,m=.3287146,_=1.7484877,g=-.1589763,v=.0036096,y=.1643573,C=12.9590088,w=new i;return o.ComputeMoon=function(o,S){e(o)||(o=i.now()),w=i.addSeconds(o,a,w);var E=i.totalDays(w)-s,b=E/n.DAYS_PER_JULIAN_CENTURY,T=(125.045+l*E)*r.RADIANS_PER_DEGREE,x=(250.089+u*E)*r.RADIANS_PER_DEGREE,A=(260.008+c*E)*r.RADIANS_PER_DEGREE,P=(176.625+d*E)*r.RADIANS_PER_DEGREE,D=(357.529+h*E)*r.RADIANS_PER_DEGREE,M=(311.589+p*E)*r.RADIANS_PER_DEGREE,I=(134.963+f*E)*r.RADIANS_PER_DEGREE,R=(276.617+m*E)*r.RADIANS_PER_DEGREE,O=(34.226+_*E)*r.RADIANS_PER_DEGREE,N=(15.134+g*E)*r.RADIANS_PER_DEGREE,L=(119.743+v*E)*r.RADIANS_PER_DEGREE,B=(239.961+y*E)*r.RADIANS_PER_DEGREE,F=(25.053+C*E)*r.RADIANS_PER_DEGREE,k=Math.sin(T),V=Math.sin(x),z=Math.sin(A),U=Math.sin(P),G=Math.sin(D),H=Math.sin(M),W=Math.sin(I),q=Math.sin(R),j=Math.sin(O),Y=Math.sin(N),X=Math.sin(L),Z=Math.sin(B),K=Math.sin(F),Q=Math.cos(T),J=Math.cos(x),$=Math.cos(A),ee=Math.cos(P),te=Math.cos(D),ie=Math.cos(M),re=Math.cos(I),ne=Math.cos(R),oe=Math.cos(O),ae=Math.cos(N),se=Math.cos(L),le=Math.cos(B),ue=Math.cos(F),ce=(269.9949+.0031*b-3.8787*k-.1204*V+.07*z-.0172*U+.0072*H-.0052*Y+.0043*K)*r.RADIANS_PER_DEGREE,de=(66.5392+.013*b+1.5419*Q+.0239*J-.0278*$+.0068*ee-.0029*ie+9e-4*re+8e-4*ae-9e-4*ue)*r.RADIANS_PER_DEGREE,he=(38.3213+13.17635815*E-1.4e-12*E*E+3.561*k+.1208*V-.0642*z+.0158*U+.0252*G-.0066*H-.0047*W-.0046*q+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*K)*r.RADIANS_PER_DEGREE,pe=(13.17635815-1.4e-12*(2*E)+3.561*Q*l+.1208*J*u-.0642*$*c+.0158*ee*d+.0252*te*h-.0066*ie*p-.0047*re*f-.0046*ne*m+.0028*oe*_+.0052*ae*g+.004*se*v+.0019*le*y-.0044*ue*C)/86400*r.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ce,S.declination=de,S.rotation=he,S.rotationRate=pe,S},o}),define("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,i,r,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=i.ComputeMoon),this._computeFunction=e}function l(i,r,a){var s=u;s.x=Math.cos(i+n.PI_OVER_TWO),s.y=Math.sin(i+n.PI_OVER_TWO),s.z=0;var l=Math.cos(r),h=d;h.x=l*Math.cos(i),h.y=l*Math.sin(i),h.z=Math.sin(r);var p=e.cross(h,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=h.x,a[3]=s.y,a[4]=p.y,a[5]=h.y,a[6]=s.z,a[7]=p.z,a[8]=h.z,a}var u=new e,c=new e,d=new e,h=new o,p=new a;return s.prototype.evaluate=function(i,s){t(i)||(i=r.now());var u=this._computeFunction(i),c=l(u.rightAscension,u.declination,s),d=n.zeroToTwoPi(u.rotation),f=a.fromAxisAngle(e.UNIT_Z,d,p),m=o.fromQuaternion(a.conjugate(f,f),h),_=o.multiply(m,c,c);return _},s}),define("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}),define("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(i){i=e(i,e.EMPTY_OBJECT),this.start=t(i.start)?o.clone(i.start):new o,this.stop=t(i.stop)?o.clone(i.stop):new o,this.data=i.data,this.isStartIncluded=e(i.isStartIncluded,!0),this.isStopIncluded=e(i.isStopIncluded,!0)}i(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(i,r){var n=i.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(i.isStartIncluded,!0),d=e(i.isStopIncluded,!0),h=i.data;return t(r)?(r.start=l,r.stop=u,r.isStartIncluded=c,r.isStopIncluded=d,r.data=h,r):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=d,s.data=h,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,i){if(t(e))return t(i)?(i.start=e.start,i.stop=e.stop,i.isStartIncluded=e.isStartIncluded,i.isStopIncluded=e.isStopIncluded,i.data=e.data,i):new a(e)},a.equals=function(e,i,r){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equals(e.start,i.start)&&o.equals(e.stop,i.stop)&&(e.data===i.data||t(r)&&r(e.data,i.data)))},a.equalsEpsilon=function(e,i,r,n){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equalsEpsilon(e.start,i.start,r)&&o.equalsEpsilon(e.stop,i.stop,r)&&(e.data===i.data||t(n)&&n(e.data,i.data)))},a.intersect=function(e,i,r,n){if(!t(i))return a.clone(a.EMPTY,r);var s=e.start,l=e.stop,u=i.start,c=i.stop,d=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),h=!d&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!d&&!h)return a.clone(a.EMPTY,r);var p=e.isStartIncluded,f=e.isStopIncluded,m=i.isStartIncluded,_=i.isStopIncluded,g=o.lessThan(l,c);return r.start=d?u:s,r.isStartIncluded=p&&m||!o.equals(u,s)&&(d&&m||h&&p),r.stop=g?l:c,r.isStopIncluded=g?f:f&&_||!o.equals(c,l)&&_,r.data=t(n)?n(e.data,i.data):e.data,r},a.contains=function(e,t){if(e.isEmpty)return!1;var i=o.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=o.compare(t,e.stop);return 0===r?e.isStopIncluded:i<0&&r<0},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),define("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,i){"use strict";var r=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new i({start:r,stop:n})),a={MINIMUM_VALUE:r,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),define("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),define("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l=i.length;for(a=0;a<n;a++)o[a]=0;for(a=0;a<l;a++){var u=1;for(s=0;s<l;s++)if(s!==a){var c=i[a]-i[s];u*=(t-i[s])/c}for(s=0;s<n;s++)o[s]+=u*r[a*n+s]}return o},t}),define("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var i={type:"Linear"};return i.getRequiredDataPoints=function(e){return 2},i.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l,u=i[0],c=i[1];for(a=0;a<n;a++)s=r[a],l=r[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},i}),define("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"blob",headers:i})}return t}),define("Core/loadCRN",["./CompressedTextureBuffer","./defined","./DeveloperError","./loadArrayBuffer","./TaskProcessor","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(t,i){var n;return n=t instanceof ArrayBuffer||ArrayBuffer.isView(t)?o.resolve(t):r(t,i),n.then(function(e){var t=[];return e instanceof ArrayBuffer?t.push(e):0===e.byteOffset&&e.byteLength===e.buffer.byteLength?t.push(e.buffer):(e=e.slice(0,e.length),t.push(e.buffer)),s.scheduleTask(e,t)}).then(function(t){return e.clone(t)})}var s=new n("transcodeCRNToDXT",Number.POSITIVE_INFINITY);return a}),define("Core/loadImage",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","./TrustedServers"],function(e,t,i,r,n,o){"use strict";function a(i,r){return r=t(r,!0),e(i,function(t){var i;i=!(s.test(t)||!r)&&n(t);var o=e.defer();return a.createImage(t,i,o),o.promise})}var s=/^data:/;return a.createImage=function(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(o.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},a.defaultCreateImage=a.createImage,a}),define("Core/loadImageFromTypedArray",["../ThirdParty/when","./defined","./DeveloperError","./loadImage"],function(e,t,i,r){"use strict";function n(t,i){var n=new Blob([t],{type:i}),o=window.URL.createObjectURL(n);return r(o,!1).then(function(e){return window.URL.revokeObjectURL(o),e},function(t){return window.URL.revokeObjectURL(o),e.reject(t)})}return n}),define("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,i){"use strict";function r(r){return n.test(r)?i(r):t(r).then(function(t){var r=window.URL.createObjectURL(t);return i(r,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(r),e},function(t){return window.URL.revokeObjectURL(r),e.reject(t)})})}var n=/^data:/,o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();return o?r:i}),define("Core/PixelFormat",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={DEPTH_COMPONENT:t.DEPTH_COMPONENT,DEPTH_STENCIL:t.DEPTH_STENCIL,ALPHA:t.ALPHA,RGB:t.RGB,RGBA:t.RGBA,LUMINANCE:t.LUMINANCE,LUMINANCE_ALPHA:t.LUMINANCE_ALPHA,RGB_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:t.COMPRESSED_RGB_ETC1_WEBGL,validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA||e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL},isCompressedFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isDXTFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5},isPVRTCFormat:function(e){return e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===i.RGB_ETC1},compressedTextureSize:function(e,t,r){switch(e){case i.RGB_DXT1:case i.RGBA_DXT1:case i.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*8;case i.RGBA_DXT3:case i.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case i.RGB_PVRTC_4BPPV1:case i.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case i.RGB_PVRTC_2BPPV1:case i.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);default:return 0}}};return e(i)}),define("Core/loadKTX",["../ThirdParty/when","./CompressedTextureBuffer","./defined","./DeveloperError","./loadArrayBuffer","./PixelFormat","./RuntimeError"],function(e,t,i,r,n,o,a){"use strict";function s(t,i){var r;return r=t instanceof ArrayBuffer||ArrayBuffer.isView(t)?e.resolve(t):n(t,i),r.then(function(e){return l(e)})}function l(e){for(var r=new Uint8Array(e),n=!0,s=0;s<u.length;++s)if(u[s]!==r[s]){n=!1;break}if(!n)throw new a("Invalid KTX file.");var l,h;i(e.buffer)?(l=new DataView(e.buffer),h=e.byteOffset):(l=new DataView(e),h=0),h+=12;var p=l.getUint32(h,!0);if(h+=d,p!==c)throw new a("File is the wrong endianness.");var f=l.getUint32(h,!0);h+=d;var m=l.getUint32(h,!0);h+=d;var _=l.getUint32(h,!0);h+=d;var g=l.getUint32(h,!0);h+=d;var v=l.getUint32(h,!0);h+=d;var y=l.getUint32(h,!0);h+=d;var C=l.getUint32(h,!0);h+=d;var w=l.getUint32(h,!0);h+=d;var S=l.getUint32(h,!0);h+=d;var E=l.getUint32(h,!0);h+=d;var b=l.getUint32(h,!0);h+=d;var T=l.getUint32(h,!0);h+=d,h+=T;var x=l.getUint32(h,!0);h+=d;var A;if(A=i(e.buffer)?new Uint8Array(e.buffer,h,x):new Uint8Array(e,h,x),32849===g?g=o.RGB:32856===g&&(g=o.RGBA),!o.validate(g))throw new a("glInternalFormat is not a valid format.");if(o.isCompressedFormat(g)){if(0!==f)throw new a("glType must be zero when the texture is compressed.");if(1!==m)throw new a("The type size for compressed textures must be 1.");if(0!==_)throw new a("glFormat must be zero when the texture is compressed.");if(0===b)throw new a("Generating mipmaps for a compressed texture is unsupported.")}else if(v!==_)throw new a("The base internal format must be the same as the format for uncompressed textures.");if(0!==w)throw new a("3D textures are unsupported.");if(0!==S)throw new a("Texture arrays are unsupported.");if(1!==E)throw new a("Cubemaps are unsupported.");if(o.isCompressedFormat(g)&&b>1){var P=o.compressedTextureSize(g,y,C);A=A.slice(0,P)}return new t(g,y,C,A)}var u=[171,75,84,88,32,49,49,187,13,10,26,10],c=67305985,d=4;return s}),define("Core/loadXML",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"document",headers:i,overrideMimeType:"text/xml"})}return t}),define("Core/MapboxApi",["./defined","./Credit"],function(e,t){"use strict";var i={};i.defaultAccessToken=void 0;var r,n=!1,o="This application is using Cesium's default Mapbox access token.  Please create a new access token for the application as soon as possible and prior to deployment by visiting https://www.mapbox.com/account/apps/, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API.";return i.getAccessToken=function(t){return e(t)?t:e(i.defaultAccessToken)?i.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},i.getErrorCredit=function(n){if(!e(n)&&!e(i.defaultAccessToken))return e(r)||(r=new t(o)),r},i}),define("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError}}),i.prototype.project=t.throwInstantiationError,i.prototype.unproject=t.throwInstantiationError,i}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,i,r,n,o){"use strict";function a(e,t,r,n){this[0]=i(e,0),this[1]=i(r,0),this[2]=i(t,0),this[3]=i(n,0)}a.packedLength=4,a.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},a.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new a),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},a.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3])},a.fromArray=function(e,t,n){return t=i(t,0),r(n)||(n=new a),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new a(e,0,0,e)},a.fromRotation=function(e,t){var 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 a(i,-n,n,i)},a.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},a.getElementIndex=function(e,t){return 2*e+t},a.getColumn=function(e,t,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},a.setColumn=function(e,t,i,r){r=a.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},a.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},a.setRow=function(e,t,i,r){return r=a.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var s=new e;a.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],s)),i.y=e.magnitude(e.fromElements(t[2],t[3],s)),i};var l=new e;return a.getMaximumScale=function(t){return a.getScale(t,l),e.maximumComponent(l)},a.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},a.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},a.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},a.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},a.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},a.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},a.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t},a.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},a.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},a.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},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,n(a.prototype,{length:{get:function(){return a.packedLength}}}),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),define("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n,s){var l,u,c=n-r+1,d=s-n,h=o,p=a;for(l=0;l<c;++l)h[l]=e[r+l];for(u=0;u<d;++u)p[u]=e[n+u+1];l=0,u=0;for(var f=r;f<=s;++f){var m=h[l],_=p[u];l<c&&(u>=d||t(m,_,i)<=0)?(e[f]=m,++l):u<d&&(e[f]=_,++u)}}function r(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),define("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){if(t(e))return t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue)},r.packedLength=4,r.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue,i},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),define("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),define("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var d=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,d),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,d);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,d),d)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var h=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,h),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,h),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r<this._occluderRadius)return o>0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n));if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var f=new t;c.prototype.computeVisibility=function(e){var i=t.clone(e.center),r=e.radius;if(r>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,f),o=this._occluderRadius-r,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+r*r<s?u.NONE:(o=this._occluderRadius+r,o=a-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+r*r?u.FULL:u.PARTIAL):(n=t.subtract(i,this._horizonPlanePosition,n),t.dot(n,this._horizonPlaneNormal)>-r?u.PARTIAL:u.FULL))}}return u.NONE};var m=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),o=t.clone(e.center),a=e.radius,s=r.length,l=t.normalize(t.subtract(n,o,m),m),u=-t.dot(l,o),d=c._anyRotationVector(o,l,u),h=c._horizonToPlaneNormalDotProduct(e,l,u,d,r[0]);if(h){for(var p,f=1;f<s;++f){if(p=c._horizonToPlaneNormalDotProduct(e,l,u,d,r[f]),!p)return;p<h&&(h=p)}if(!(h<.0017453283658983088)){var _=a/h;return t.add(o,t.multiplyByScalar(l,_,m),m)}}};var _=[];c.computeOccludeePointFromRectangle=function(r,n){n=i(n,a.WGS84);var o=l.subsample(r,n,0,_),s=e.fromPoints(o),u=t.ZERO;if(!t.equals(u,s.center))return c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var g=new t;c._anyRotationVector=function(e,i,r){var n=t.abs(i,g),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var v=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t);
}return o};var y=new t,C=new t,w=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,w),c=t.magnitudeSquared(u),d=l*l;if(c<d)return!1;var h=c-d,p=Math.sqrt(h),f=Math.sqrt(c),m=1/f,_=p*m,g=_*p;u=t.normalize(u,u);var v=t.add(a,t.multiplyByScalar(u,g,S),S),E=Math.sqrt(h-g*g),b=this._rotationVector(s,i,r,a,n),T=t.fromElements(b.x*b.x*u.x+(b.x*b.y-b.z)*u.y+(b.x*b.z+b.y)*u.z,(b.x*b.y+b.z)*u.x+b.y*b.y*u.y+(b.y*b.z-b.x)*u.z,(b.x*b.z-b.y)*u.x+(b.y*b.z+b.x)*u.y+b.z*b.z*u.z,y);T=t.normalize(T,T);var x=t.multiplyByScalar(T,E,y);b=t.normalize(t.subtract(t.add(v,x,w),s,w),w);var A=t.dot(i,b);b=t.normalize(t.subtract(t.subtract(v,x,b),s,b),b);var P=t.dot(i,b);return A<P?A:P},c}),define("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),define("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),define("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,i,r,n){var o=t.measureText(i),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=e(t.canvas,"font-style"),u=e(t.canvas,"font-weight"),c=!/\S/.test(i);o.fontsize=s;var d=document.createElement("div");d.style.position="absolute",d.style.opacity=0,d.style.font=l+" "+u+" "+s+"px "+a,d.innerHTML=i+"<br/>"+i,document.body.appendChild(d),o.leading=1.2*s;var h=e(d,"height");if(h=h.replace("px",""),h>=2*s&&(o.leading=h/2|0),document.body.removeChild(d),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),f=100;p.width=o.width+f,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var m=p.getContext("2d");m.font=l+" "+u+" "+s+"px "+a;var _=p.width,g=p.height,v=g/2;m.fillStyle="white",m.fillRect(-1,-1,_+2,g+2),r&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(i,f/2,v)),n&&(m.fillStyle="black",m.fillText(i,f/2,v));for(var y=m.getImageData(0,0,_,g).data,C=0,w=4*_,S=y.length;++C<S&&255===y[C];);var E=C/w|0;for(C=S-1;--C>0&&255===y[C];);var b=C/w|0;for(C=0;C<S&&255===y[C];)C+=w,C>=S&&(C=C-S+4);var T=C%w/4|0,x=1;for(C=S-3;C>=0&&255===y[C];)C-=w,C<0&&(C=S-3-4*x++);var A=C%w/4+1|0;o.ascent=v-E,o.descent=b-v,o.bounds={minx:T-f/2,maxx:A-f/2,miny:0,maxy:b-E},o.height=1+(b-E)}return o};return t}),define("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),d=i(o.backgroundColor,t.TRANSPARENT),h=i(o.padding,0),p=2*h,f=document.createElement("canvas");f.width=1,f.height=1,f.style.font=s;var m=f.getContext("2d");r(a)||(r(m.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(m.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(m.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(m.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,m.textBaseline=i(o.textBaseline,"bottom"),f.style.visibility="hidden",document.body.appendChild(f);var _=e(m,n,l,u);f.dimensions=_,document.body.removeChild(f),f.style.visibility="";var g=-_.bounds.minx,v=Math.ceil(_.width)+g+p,y=_.height+p,C=y-_.ascent+p,w=y-C+p;if(f.width=v,f.height=y,m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,d!==t.TRANSPARENT&&(m.fillStyle=d.toCssColorString(),m.fillRect(0,0,f.width,f.height)),l){var S=i(o.strokeColor,t.BLACK);m.strokeStyle=S.toCssColorString(),m.strokeText(n,g+h,w)}if(u){var E=i(o.fillColor,t.WHITE);m.fillStyle=E.toCssColorString(),m.fillText(n,g+h,w)}return f}}var a;return o}),define("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width<i.height&&(o=n*(i.width/i.height));var s=Math.round((r-o)/2),l=Math.round(7/24*r-a/2);e.globalCompositeOperation="destination-out",e.drawImage(i,s-1,l,o,a),e.drawImage(i,s,l-1,o,a),e.drawImage(i,s+1,l,o,a),e.drawImage(i,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(i,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s-1,l-2,o+2,a+2)}function u(e,t,r,a,u){d[0]=e,d[1]=t,d[2]=r,d[3]=a;var c=JSON.stringify(d),h=u[c];if(i(h))return h;var p=document.createElement("canvas");p.width=a,p.height=a;var f=p.getContext("2d");if(s(f,r,a),i(e)){var m=n(e).then(function(e){return l(f,e,a),u[c]=p,p});return u[c]=m,m}if(i(t)){var _=o(t,{font:"bold "+a+"px sans-serif"});l(f,_,a)}return u[c]=p,p}a.prototype.fromColor=function(e,t){return u(void 0,void 0,e,t,this._cache)},a.prototype.fromUrl=function(e,t,i){return u(e,void 0,t,i,this._cache)},a.prototype.fromMakiIconId=function(t,i,r){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,i,r,this._cache)},a.prototype.fromText=function(e,t,i){return u(void 0,e,t,i,this._cache)};var c=new t,d=new Array(4);return a}),define("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){t=i(t,i.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return u.createGeometry=function(i){var n=i._positionsTypedArray,u=n.byteLength/n.length,c=4===u?t.FLOAT:t.DOUBLE,d=new s;d.position=new a({componentDatatype:c,componentsPerAttribute:3,values:n}),d.color=new a({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:i._colorsTypedArray,normalize:!0});var h=i._boundingSphere;return r(h)||(h=e.fromVertices(n)),new o({attributes:d,primitiveType:l.POINTS,boundingSphere:h})},u}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function i(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return i}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e,i,r,n){return t.subtract(i,e,v),t.multiplyByScalar(v,r/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var g={};g.computeHierarchyPackedLength=function(e){for(var i=0,r=[e];r.length>0;){var o=r.pop();if(n(o)){i+=2;var a=o.positions,s=o.holes;if(n(a)&&(i+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u<l;++u)r.push(s[u])}}return i},g.packPolygonHierarchy=function(e,i,r){for(var o=[e];o.length>0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(i[r++]=n(s)?s.length:0,i[r++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c<u;++c,r+=3)t.pack(s[c],i,r);if(n(l))for(var d=l.length,h=0;h<d;++h)o.push(l[h])}}return r},g.unpackPolygonHierarchy=function(e,i){for(var r=e[i++],n=e[i++],o=new Array(r),a=n>0?new Array(n):void 0,s=0;s<r;++s,i+=t.packedLength)o[s]=t.unpack(e,i);for(var l=0;l<n;++l)a[l]=g.unpackPolygonHierarchy(e,i),i=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:i}};var v=new t;g.subdivideLineCount=function(e,i,r){var n=t.distance(e,i),o=n/r,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},g.subdivideLine=function(e,i,r,o){var a=g.subdivideLineCount(e,i,r),s=t.distance(e,i),l=s/a;n(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,d=0;d<a;d++){var h=_(e,i,d*l,s);u[c++]=h[0],u[c++]=h[1],u[c++]=h[2]}return u};var y=new t,C=new t,w=new t,S=new t;g.scaleToGeodeticHeightExtruded=function(e,i,a,s,l){s=r(s,o.WGS84);var u=y,c=C,d=w,h=S;if(n(e)&&n(e.attributes)&&n(e.attributes.position))for(var p=e.attributes.position.values,f=p.length/2,m=0;m<f;m+=3)t.fromArray(p,m,d),s.geodeticSurfaceNormal(d,u),h=s.scaleToGeodeticSurface(d,h),c=t.multiplyByScalar(u,a,c),c=t.add(h,c,c),p[m+f]=c.x,p[m+1+f]=c.y,p[m+2+f]=c.z,l&&(h=t.clone(d,h)),c=t.multiplyByScalar(u,i,c),c=t.add(h,c,c),p[m]=c.x,p[m+1]=c.y,p[m+2]=c.z;return e},g.polygonsFromHierarchy=function(i,r,o,a){var s=[],l=[],u=new f;for(u.enqueue(i);0!==u.length;){var c=u.dequeue(),d=c.positions,p=c.holes;if(d=e(d,t.equalsEpsilon,!0),!(d.length<3)){var _=o.projectPointsOntoPlane(d),g=[],v=h.computeWindingOrder2D(_);v===m.CLOCKWISE&&(_.reverse(),d=d.slice().reverse());var y,C,w=d.slice(),S=n(p)?p.length:0,E=[];for(y=0;y<S;y++){var b=p[y],T=e(b.positions,t.equalsEpsilon,!0);if(!(T.length<3)){var x=o.projectPointsOntoPlane(T);v=h.computeWindingOrder2D(x),v===m.CLOCKWISE&&(x.reverse(),T=T.slice().reverse()),E.push(T),g.push(w.length),w=w.concat(T),_=_.concat(x);var A=0;for(n(b.holes)&&(A=b.holes.length),C=0;C<A;C++)u.enqueue(b.holes[C])}}if(!r){for(y=0;y<d.length;y++)a.scaleToGeodeticSurface(d[y],d[y]);for(y=0;y<E.length;y++){var P=E[y];for(C=0;C<P.length;++C)a.scaleToGeodeticSurface(P[C],P[C])}}s.push({outerRing:d,holes:E}),l.push({positions:w,positions2D:_,holes:g})}}return{hierarchy:s,polygons:l}},g.createGeometryFromPositions=function(e,t,r,n,o){var l=h.triangulate(t.positions2D,t.holes);l.length<3&&(l=[0,1,2]);var c=t.positions;if(n){for(var d=c.length,f=new Array(3*d),m=0,_=0;_<d;_++){var g=c[_];f[m++]=g.x,f[m++]=g.y,f[m++]=g.z}var v=new a({attributes:{position:new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:p.TRIANGLES});return o.normal?u.computeNormal(v):v}return h.computeSubdivision(e,c,l,r)};var E=[],b=new t,T=new t;return g.computeWallGeometry=function(e,r,n,o){var u,h,f,m,_,v=e.length,y=0;if(o)for(h=3*v*2,u=new Array(2*h),f=0;f<v;f++)m=e[f],_=e[(f+1)%v],u[y]=u[y+h]=m.x,++y,u[y]=u[y+h]=m.y,++y,u[y]=u[y+h]=m.z,++y,u[y]=u[y+h]=_.x,++y,u[y]=u[y+h]=_.y,++y,u[y]=u[y+h]=_.z,++y;else{var C=d.chordLength(n,r.maximumRadius),w=0;for(f=0;f<v;f++)w+=g.subdivideLineCount(e[f],e[(f+1)%v],C);for(h=3*(w+v),u=new Array(2*h),f=0;f<v;f++){m=e[f],_=e[(f+1)%v];for(var S=g.subdivideLine(m,_,C,E),x=S.length,A=0;A<x;++A,++y)u[y]=S[A],u[y+h]=S[A];u[y]=_.x,u[y+h]=_.x,++y,u[y]=_.y,u[y+h]=_.y,++y,u[y]=_.z,u[y+h]=_.z,++y}}v=u.length;var P=c.createTypedArray(v/3,v-6*e.length),D=0;for(v/=6,f=0;f<v;f++){var M=f,I=M+1,R=M+v,O=R+1;m=t.fromArray(u,3*M,b),_=t.fromArray(u,3*I,T),t.equalsEpsilon(m,_,d.EPSILON14)||(P[D++]=M,P[D++]=R,P[D++]=I,P[D++]=I,P[D++]=R,P[D++]=O)}return new a({attributes:new l({position:new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:u})}),indices:P,primitiveType:p.TRIANGLES})},g}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,t,i,n){for(var o=S.fromAxisAngle(e._plane.normal,i,O),a=y.fromQuaternion(o,N),s=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=t.length,p=0;p<h;++p){var f=r.clone(t[p],R);y.multiplyByVector(a,f,f);var m=e.projectPointOntoPlane(f,I);l(m)&&(s=Math.min(s,m.x),u=Math.max(u,m.x),c=Math.min(c,m.y),d=Math.max(d,m.y))}return n.x=s,n.y=c,n.width=u-s,n.height=d-c,n}function A(e,t,i,r){var n=r.cartesianToCartographic(e,L),o=n.height,a=r.cartesianToCartographic(t,B);a.height=o,r.cartographicToCartesian(a,t);var s=r.cartesianToCartographic(i,B);s.height=o-100,r.cartographicToCartesian(s,i)}function P(e){var t=e.vertexFormat,n=e.geometry,o=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||o){var s=e.boundingRectangle,l=e.tangentPlane,u=e.ellipsoid,c=e.stRotation,d=e.wall,h=e.top||d,p=e.bottom||d,m=e.perPositionHeight,_=Y;_.x=s.x,_.y=s.y;var g,C=n.attributes.position.values,w=C.length,E=t.st?new Float32Array(2*(w/3)):void 0;t.normal&&(g=m&&h&&!d?n.attributes.normal.values:new Float32Array(w));var b=t.tangent?new Float32Array(w):void 0,T=t.bitangent?new Float32Array(w):void 0,x=o?new Float32Array(w):void 0,P=0,D=0,M=V,I=z,R=U,O=!0,N=S.fromAxisAngle(l._plane.normal,c,K),L=y.fromQuaternion(N,Q),B=0,F=0;h&&p&&(B=w/2,F=w/3,w/=2);for(var J=0;J<w;J+=3){var $=r.fromArray(C,J,Z);if(t.st){var ee=y.multiplyByVector(L,$,k);ee=u.scaleToGeodeticSurface(ee,ee);var te=l.projectPointOntoPlane(ee,X);i.subtract(te,_,te);var ie=v.clamp(te.x/s.width,0,1),re=v.clamp(te.y/s.height,0,1);p&&(E[P+F]=ie,E[P+1+F]=re),h&&(E[P]=ie,E[P+1]=re),P+=2}if(t.normal||t.tangent||t.bitangent||o){var ne=D+1,oe=D+2;if(d){if(J+3<w){var ae=r.fromArray(C,J+3,G);if(O){var se=r.fromArray(C,J+w,H);m&&A($,ae,se,u),r.subtract(ae,$,ae),r.subtract(se,$,se),M=r.normalize(r.cross(se,ae,M),M),O=!1}r.equalsEpsilon(ae,$,v.EPSILON10)&&(O=!0)}(t.tangent||t.bitangent)&&(R=u.geodeticSurfaceNormal($,R),t.tangent&&(I=r.normalize(r.cross(R,M,I),I)))}else M=u.geodeticSurfaceNormal($,M),(t.tangent||t.bitangent)&&(m&&(W=r.fromArray(g,D,W),q=r.cross(r.UNIT_Z,W,q),q=r.normalize(y.multiplyByVector(L,q,q),q),t.bitangent&&(j=r.normalize(r.cross(W,q,j),j))),I=r.cross(r.UNIT_Z,M,I),I=r.normalize(y.multiplyByVector(L,I,I),I),t.bitangent&&(R=r.normalize(r.cross(M,I,R),R)));t.normal&&(e.wall?(g[D+B]=M.x,g[ne+B]=M.y,g[oe+B]=M.z):p&&(g[D+B]=-M.x,g[ne+B]=-M.y,g[oe+B]=-M.z),(h&&!m||d)&&(g[D]=M.x,g[ne]=M.y,g[oe]=M.z)),o&&(d&&(M=u.geodeticSurfaceNormal($,M)),x[D+B]=-M.x,x[ne+B]=-M.y,x[oe+B]=-M.z),t.tangent&&(e.wall?(b[D+B]=I.x,b[ne+B]=I.y,b[oe+B]=I.z):p&&(b[D+B]=-I.x,b[ne+B]=-I.y,b[oe+B]=-I.z),h&&(m?(b[D]=q.x,b[ne]=q.y,b[oe]=q.z):(b[D]=I.x,b[ne]=I.y,b[oe]=I.z))),t.bitangent&&(p&&(T[D+B]=R.x,T[ne+B]=R.y,T[oe+B]=R.z),h&&(m?(T[D]=j.x,T[ne]=j.y,T[oe]=j.z):(T[D]=R.x,T[ne]=R.y,T[oe]=R.z))),D+=3}}t.st&&(n.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:E})),t.normal&&(n.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(n.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(n.attributes.bitangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),o&&(n.attributes.extrudeDirection=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:x}))}return n}function D(e,t,i,r,n,o,a,s){var l,u={walls:[]};if(o||a){var c,d,p=C.createGeometryFromPositions(e,t,i,n,s),f=p.attributes.position.values,_=p.indices;if(o&&a){var v=f.concat(f);c=v.length/3,d=g.createTypedArray(c,2*_.length),d.set(_);var y=_.length,S=c/2;for(l=0;l<y;l+=3){var E=d[l]+S,b=d[l+1]+S,x=d[l+2]+S;d[l+y]=x,d[l+1+y]=b,d[l+2+y]=E}if(p.attributes.position.values=v,n){var A=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(v.length),p.attributes.normal.values.set(A)}p.indices=d}else if(a){for(c=f.length/3,d=g.createTypedArray(c,_.length),l=0;l<_.length;l+=3)d[l]=_[l+2],d[l+1]=_[l+1],d[l+2]=_[l];p.indices=d}u.topAndBottom=new m({geometry:p})}var P=r.outerRing,D=h.fromPoints(P,e),M=D.projectPointsOntoPlane(P,J),I=w.computeWindingOrder2D(M);I===T.CLOCKWISE&&(P=P.slice().reverse());var R=C.computeWallGeometry(P,e,i,n);u.walls.push(new m({geometry:R}));var O=r.holes;for(l=0;l<O.length;l++){var N=O[l];D=h.fromPoints(N,e),M=D.projectPointsOntoPlane(N,J),I=w.computeWindingOrder2D(M),I===T.COUNTER_CLOCKWISE&&(N=N.slice().reverse()),R=C.computeWallGeometry(N,e,i),u.walls.push(new m({geometry:R}))}return u}function M(e){var t=e.polygonHierarchy,i=s(e.vertexFormat,b.DEFAULT),r=s(e.ellipsoid,d.WGS84),n=s(e.granularity,v.RADIANS_PER_DEGREE),o=s(e.stRotation,0),a=s(e.height,0),u=s(e.perPositionHeight,!1),c=e.extrudedHeight,h=l(c);if(!u&&h)if(v.equalsEpsilon(a,c,v.EPSILON10))c=void 0,h=!1;else{var p=c;c=Math.min(p,a),a=Math.max(p,a)}this._vertexFormat=b.clone(i),this._ellipsoid=d.clone(r),this._granularity=n,this._stRotation=o,this._height=a,this._extrudedHeight=s(c,0),this._extrude=h,this._closeTop=s(e.closeTop,!0),this._closeBottom=s(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=u,this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var f=t.positions;!l(f)||f.length<3?this._rectangle=new E:this._rectangle=E.fromCartesianArray(f,r),this.packedLength=C.computeHierarchyPackedLength(t)+d.packedLength+b.packedLength+E.packedLength+10}var I=new i,R=new r,O=new S,N=new y,L=new n,B=new n,F=new e,k=new r,V=new r,z=new r,U=new r,G=new r,H=new r,W=new r,q=new r,j=new r,Y=new i,X=new i,Z=new r,K=new S,Q=new y,J=[];M.fromPositions=function(e){e=s(e,s.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom};return new M(t)},M.pack=function(e,t,i){return i=s(i,0),i=C.packPolygonHierarchy(e._polygonHierarchy,t,i),d.pack(e._ellipsoid,t,i),i+=d.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,E.pack(e._rectangle,t,i),i+=E.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i++]=e._shadowVolume?1:0,t[i]=e.packedLength,t};var $=d.clone(d.UNIT_SPHERE),ee=new b,te=new E,ie={polygonHierarchy:{}};return M.unpack=function(e,t,i){t=s(t,0);var r=C.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=d.unpack(e,t,$);t+=d.packedLength;var o=b.unpack(e,t,ee);t+=b.packedLength;var a=E.unpack(e,t,te);t+=E.packedLength;var u=e[t++],c=e[t++],h=e[t++],p=e[t++],f=1===e[t++],m=1===e[t++],_=1===e[t++],g=1===e[t++],v=1===e[t++],y=e[t];return l(i)||(i=new M(ie)),i._polygonHierarchy=r,i._ellipsoid=d.clone(n,i._ellipsoid),i._vertexFormat=b.clone(o,i._vertexFormat),i._height=u,i._extrudedHeight=c,i._granularity=h,i._stRotation=p,i._extrude=f,i._perPositionHeight=m,i._closeTop=_,i._closeBottom=g,i._rectangle=E.clone(a),i._shadowVolume=v,i.packedLength=y,i},M.createGeometry=function(e){var i=e._vertexFormat,r=e._ellipsoid,n=e._granularity,o=e._stRotation,a=e._height,s=e._extrudedHeight,l=e._extrude,u=e._polygonHierarchy,c=e._perPositionHeight,d=e._closeTop,f=e._closeBottom,v=u.positions;if(!(v.length<3)){var y=h.fromPoints(v,r),S=C.polygonsFromHierarchy(u,c,y,r),E=S.hierarchy,b=S.polygons;if(0!==E.length){v=E[0].outerRing;var T,A,M=x(y,v,o,F),I=[],R={perPositionHeight:c,vertexFormat:i,geometry:void 0,tangentPlane:y,boundingRectangle:M,ellipsoid:r,stRotation:o,bottom:!1,top:!0,wall:!1};if(l)for(R.top=d,R.bottom=f,R.shadowVolume=e._shadowVolume,A=0;A<b.length;A++){T=D(r,b[A],n,E[A],c,d,f,i);var O;d&&f?(O=T.topAndBottom,R.geometry=C.scaleToGeodeticHeightExtruded(O.geometry,a,s,r,c)):d?(O=T.topAndBottom,O.geometry.attributes.position.values=w.scaleToGeodeticHeight(O.geometry.attributes.position.values,a,r,!c),R.geometry=O.geometry):f&&(O=T.topAndBottom,O.geometry.attributes.position.values=w.scaleToGeodeticHeight(O.geometry.attributes.position.values,s,r,!0),R.geometry=O.geometry),(d||f)&&(R.wall=!1,O.geometry=P(R),I.push(O));var N=T.walls;R.wall=!0;for(var L=0;L<N.length;L++){var B=N[L];R.geometry=C.scaleToGeodeticHeightExtruded(B.geometry,a,s,r,c),B.geometry=P(R),I.push(B)}}else for(A=0;A<b.length;A++)T=new m({geometry:C.createGeometryFromPositions(r,b[A],n,c,i)}),T.geometry.attributes.position.values=w.scaleToGeodeticHeight(T.geometry.attributes.position.values,a,r,!c),R.geometry=T.geometry,T.geometry=P(R),I.push(T);T=_.combineInstances(I)[0],T.attributes.position.values=new Float64Array(T.attributes.position.values),T.indices=g.createTypedArray(T.attributes.position.values.length/3,T.indices);var k=T.attributes,V=t.fromVertices(k.position.values);return i.position||delete k.position,new p({attributes:k,indices:T.indices,primitiveType:T.primitiveType,boundingSphere:V})}}},M.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new M({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:b.POSITION_ONLY,shadowVolume:!0})},u(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M});define("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,i){this.positions=e(t)?t:[],this.holes=e(i)?i:[]}return t});define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w){"use strict";function S(e,t,i,r){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,T),s=v.computeWindingOrder2D(a);s===w.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l,f,_=t.length,C=0;if(r)for(l=new Float64Array(2*_*3),f=0;f<_;f++){var S=t[f],E=t[(f+1)%_];l[C++]=S.x,l[C++]=S.y,l[C++]=S.z,l[C++]=E.x,l[C++]=E.y,l[C++]=E.z}else{var b=0;for(f=0;f<_;f++)b+=g.subdivideLineCount(t[f],t[(f+1)%_],i);for(l=new Float64Array(3*b),f=0;f<_;f++)for(var A=g.subdivideLine(t[f],t[(f+1)%_],i,x),P=A.length,D=0;D<P;++D)l[C++]=A[D]}_=l.length/3;var M=2*_,I=m.createTypedArray(_,M);for(C=0,f=0;f<_-1;f++)I[C++]=f,I[C++]=f+1;return I[C++]=_-1,I[C++]=0,new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l})}),indices:I,primitiveType:y.LINES})})}function E(e,t,i,r){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,T),s=v.computeWindingOrder2D(a);s===w.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l,f,_=t.length,C=new Array(_),S=0;if(r)for(l=new Float64Array(2*_*3*2),f=0;f<_;++f){C[f]=S/3;var E=t[f],b=t[(f+1)%_];l[S++]=E.x,l[S++]=E.y,l[S++]=E.z,l[S++]=b.x,l[S++]=b.y,l[S++]=b.z}else{var A=0;for(f=0;f<_;f++)A+=g.subdivideLineCount(t[f],t[(f+1)%_],i);for(l=new Float64Array(3*A*2),f=0;f<_;++f){C[f]=S/3;for(var P=g.subdivideLine(t[f],t[(f+1)%_],i,x),D=P.length,M=0;M<D;++M)l[S++]=P[M]}}_=l.length/6;var I=C.length,R=2*(2*_+I),O=m.createTypedArray(_,R);for(S=0,f=0;f<_;++f)O[S++]=f,O[S++]=(f+1)%_,O[S++]=f+_,O[S++]=(f+1)%_+_;for(f=0;f<I;f++){var N=C[f];O[S++]=N,O[S++]=N+_}return new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l})}),indices:O,primitiveType:y.LINES})})}function b(e){var t=e.polygonHierarchy,i=o(e.ellipsoid,l.WGS84),r=o(e.granularity,_.RADIANS_PER_DEGREE),n=o(e.height,0),s=o(e.perPositionHeight,!1),u=e.extrudedHeight,c=a(u);if(c&&!s){var d=u;u=Math.min(d,n),n=Math.max(d,n)}this._ellipsoid=l.clone(i),this._granularity=r,this._height=n,this._extrudedHeight=o(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=g.computeHierarchyPackedLength(t)+l.packedLength+6}var T=[],x=[];b.pack=function(e,t,i){return i=o(i,0),i=g.packPolygonHierarchy(e._polygonHierarchy,t,i),l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e.packedLength,t};var A=l.clone(l.UNIT_SPHERE),P={polygonHierarchy:{}};return b.unpack=function(e,t,i){t=o(t,0);var r=g.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=l.unpack(e,t,A);t+=l.packedLength;var s=e[t++],u=e[t++],c=e[t++],d=1===e[t++],h=1===e[t++],p=e[t++];return a(i)||(i=new b(P)),i._polygonHierarchy=r,i._ellipsoid=l.clone(n,i._ellipsoid),i._height=s,i._extrudedHeight=u,i._granularity=c,i._extrude=d,i._perPositionHeight=h,i.packedLength=p,i},b.fromPositions=function(e){e=o(e,o.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new b(t)},b.createGeometry=function(r){var n=r._ellipsoid,o=r._granularity,s=r._height,l=r._extrudedHeight,u=r._extrude,d=r._polygonHierarchy,h=r._perPositionHeight,p=[],m=new C;m.enqueue(d);for(var y;0!==m.length;){var w=m.dequeue(),b=w.positions;if(b=e(b,i.equalsEpsilon,!0),!(b.length<3)){var T=w.holes?w.holes.length:0;for(y=0;y<T;y++){var x=w.holes[y];if(x.positions=e(x.positions,i.equalsEpsilon,!0),!(x.positions.length<3)){p.push(x.positions);var A=0;a(x.holes)&&(A=x.holes.length);for(var P=0;P<A;P++)m.enqueue(x.holes[P])}}p.push(b)}}if(0!==p.length){var D,M=[],I=_.chordLength(o,n.maximumRadius);if(u)for(y=0;y<p.length;y++)D=E(n,p[y],I,h),D.geometry=g.scaleToGeodeticHeightExtruded(D.geometry,s,l,n,h),M.push(D);else for(y=0;y<p.length;y++)D=S(n,p[y],I,h),D.geometry.attributes.position.values=v.scaleToGeodeticHeight(D.geometry.attributes.position.values,s,n,!h),M.push(D);D=f.combineInstances(M)[0];var R=t.fromVertices(D.attributes.position.values);return new c({attributes:D.attributes,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:R})}},b}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(e,t,i,n,o){var a=C;a.length=o;var s,l=i.red,u=i.green,c=i.blue,d=i.alpha,h=n.red,p=n.green,f=n.blue,m=n.alpha;if(r.equals(i,n)){for(s=0;s<o;s++)a[s]=r.clone(i);return a}var _=(h-l)/o,g=(p-u)/o,v=(f-c)/o,y=(m-d)/o;for(s=0;s<o;s++)a[s]=new r(l+s*_,u+s*g,c+s*v,d+s*y);return a}function y(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,n=e.colors,s=o(e.width,1),u=o(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=s,this._colorsPerVertex=u,this._vertexFormat=g.clone(o(e.vertexFormat,g.DEFAULT)),this._followSurface=o(e.followSurface,!0),this._granularity=o(e.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._workerName="createPolylineGeometry";var c=1+t.length*i.packedLength;c+=a(n)?1+n.length*r.packedLength:1,this.packedLength=c+l.packedLength+g.packedLength+4}var C=[];y.pack=function(e,t,n){n=o(n,0);var s,u=e._positions,c=u.length;for(t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(u[s],t,n);var d=e._colors;for(c=a(d)?d.length:0,t[n++]=c,s=0;s<c;++s,n+=r.packedLength)r.pack(d[s],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,g.pack(e._vertexFormat,t,n),n+=g.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._followSurface?1:0,t[n]=e._granularity,t};var w=l.clone(l.UNIT_SPHERE),S=new g,E={positions:void 0,colors:void 0,ellipsoid:w,vertexFormat:S,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};y.unpack=function(e,t,n){t=o(t,0);var s,u=e[t++],c=new Array(u);for(s=0;s<u;++s,t+=i.packedLength)c[s]=i.unpack(e,t);u=e[t++];var d=u>0?new Array(u):void 0;for(s=0;s<u;++s,t+=r.packedLength)d[s]=r.unpack(e,t);var h=l.unpack(e,t,w);t+=l.packedLength;var p=g.unpack(e,t,S);t+=g.packedLength;var f=e[t++],m=1===e[t++],_=1===e[t++],v=e[t];return a(n)?(n._positions=c,n._colors=d,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=g.clone(p,n._vertexFormat),n._width=f,n._colorsPerVertex=m,n._followSurface=_,n._granularity=v,n):(E.positions=c,E.colors=d,E.width=f,E.colorsPerVertex=m,E.followSurface=_,E.granularity=v,new y(E))};var b=new i,T=new i,x=new i,A=new i;return y.createGeometry=function(o){var s,l,g,y=o._width,w=o._vertexFormat,S=o._colors,E=o._colorsPerVertex,P=o._followSurface,D=o._granularity,M=o._ellipsoid,I=e(o._positions,i.equalsEpsilon),R=I.length;if(!(R<2||y<=0)){if(P){var O=m.extractHeights(I,M),N=f.chordLength(D,M.maximumRadius);if(a(S)){var L=1;for(s=0;s<R-1;++s)L+=m.numberOfPoints(I[s],I[s+1],N);var B=new Array(L),F=0;for(s=0;s<R-1;++s){var k=I[s],V=I[s+1],z=S[s],U=m.numberOfPoints(k,V,N);if(E&&s<L){var G=S[s+1],H=v(k,V,z,G,U),W=H.length;for(l=0;l<W;++l)B[F++]=H[l]}else for(l=0;l<U;++l)B[F++]=r.clone(z)}B[F]=r.clone(S[S.length-1]),S=B,C.length=0}I=m.generateCartesianArc({positions:I,minDistance:N,ellipsoid:M,height:O})}R=I.length;var q,j=4*R-4,Y=new Float64Array(3*j),X=new Float64Array(3*j),Z=new Float64Array(3*j),K=new Float32Array(2*j),Q=w.st?new Float32Array(2*j):void 0,J=a(S)?new Uint8Array(4*j):void 0,$=0,ee=0,te=0,ie=0;for(l=0;l<R;++l){0===l?(q=b,i.subtract(I[0],I[1],q),i.add(I[0],q,q)):q=I[l-1],i.clone(q,x),i.clone(I[l],T),l===R-1?(q=b,i.subtract(I[R-1],I[R-2],q),i.add(I[R-1],q,q)):q=I[l+1],i.clone(q,A);var re,ne;a(J)&&(re=0===l||E?S[l]:S[l-1],l!==R-1&&(ne=S[l]));var oe=0===l?2:0,ae=l===R-1?2:4;for(g=oe;g<ae;++g){i.pack(T,Y,$),i.pack(x,X,$),i.pack(A,Z,$),$+=3;var se=g-2<0?-1:1;if(K[ee++]=2*(g%2)-1,K[ee++]=se*y,w.st&&(Q[te++]=l/(R-1),Q[te++]=Math.max(K[ee-2],0)),a(J)){var le=g<2?re:ne;J[ie++]=r.floatToByte(le.red),J[ie++]=r.floatToByte(le.green),J[ie++]=r.floatToByte(le.blue),J[ie++]=r.floatToByte(le.alpha)}}}var ue=new d;ue.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Y}),ue.prevPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:X}),ue.nextPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Z}),ue.expandAndWidth=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:K}),w.st&&(ue.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Q})),a(J)&&(ue.color=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ce=p.createTypedArray(j,6*R-6),de=0,he=0,pe=R-1;
for(l=0;l<pe;++l)ce[he++]=de,ce[he++]=de+2,ce[he++]=de+1,ce[he++]=de+1,ce[he++]=de+2,ce[he++]=de+3,de+=4;return new u({attributes:ue,indices:ce,primitiveType:_.TRIANGLES,boundingSphere:t.fromPoints(I),geometryType:h.POLYLINES})}},y}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(e,t,r,n){var a=new p;n.position&&(a.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,c,_,y,w=t.length,S=e.length/3,E=(S-2*w)/(2*w),b=v.triangulate(t),T=(E-1)*w*6+2*b.length,x=m.createTypedArray(S,T),A=2*w,P=0;for(s=0;s<E-1;s++){for(l=0;l<w-1;l++)u=2*l+s*w*2,y=u+A,c=u+1,_=c+A,x[P++]=c,x[P++]=u,x[P++]=_,x[P++]=_,x[P++]=u,x[P++]=y;u=2*w-2+s*w*2,c=u+1,_=c+A,y=u+A,x[P++]=c,x[P++]=u,x[P++]=_,x[P++]=_,x[P++]=u,x[P++]=y}if(n.st||n.tangent||n.bitangent){var D,M,I=new Float32Array(2*S),R=1/(E-1),O=1/r.height,N=r.height/2,L=0;for(s=0;s<E;s++){for(D=s*R,M=O*(t[0].y+N),I[L++]=D,I[L++]=M,l=1;l<w;l++)M=O*(t[l].y+N),I[L++]=D,I[L++]=M,I[L++]=D,I[L++]=M;M=O*(t[0].y+N),I[L++]=D,I[L++]=M}for(l=0;l<w;l++)D=0,M=O*(t[l].y+N),I[L++]=D,I[L++]=M;for(l=0;l<w;l++)D=(E-1)*R,M=O*(t[l].y+N),I[L++]=D,I[L++]=M;a.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(I)})}var B=S-2*w;for(s=0;s<b.length;s+=3){var F=b[s]+B,k=b[s+1]+B,V=b[s+2]+B;x[P++]=F,x[P++]=k,x[P++]=V,x[P++]=V+w,x[P++]=k+w,x[P++]=F+w}var z=new d({attributes:a,indices:x,boundingSphere:i.fromVertices(e),primitiveType:C.TRIANGLES});if(n.normal&&(z=f.computeNormal(z)),n.tangent||n.bitangent){try{z=f.computeTangentAndBitangent(z)}catch(e){g("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(z.attributes.tangent=void 0),n.bitangent||(z.attributes.bitangent=void 0),n.st||(z.attributes.st=void 0)}return z}function b(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._vertexFormat=w.clone(s(e.vertexFormat,w.DEFAULT)),this._granularity=s(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var o=1+t.length*n.packedLength;o+=1+i.length*r.packedLength,this.packedLength=o+c.packedLength+w.packedLength+2}b.pack=function(e,t,i){i=s(i,0);var o,a=e._positions,l=a.length;for(t[i++]=l,o=0;o<l;++o,i+=n.packedLength)n.pack(a[o],t,i);var u=e._shape;for(l=u.length,t[i++]=l,o=0;o<l;++o,i+=r.packedLength)r.pack(u[o],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var T=c.clone(c.UNIT_SPHERE),x=new w,A={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};b.unpack=function(e,t,i){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var d=new Array(a);for(o=0;o<a;++o,t+=r.packedLength)d[o]=r.unpack(e,t);var h=c.unpack(e,t,T);t+=c.packedLength;var p=w.unpack(e,t,x);t+=w.packedLength;var f=e[t++],m=e[t];return l(i)?(i._positions=u,i._shape=d,i._ellipsoid=c.clone(h,i._ellipsoid),i._vertexFormat=w.clone(p,i._vertexFormat),i._cornerType=f,i._granularity=m,i):(A.polylinePositions=u,A.shapePositions=d,A.cornerType=f,A.granularity=m,new b(A))};var P=new t;return b.createGeometry=function(i){var r=i._positions,o=e(r,n.equalsEpsilon),a=i._shape;if(a=y.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){v.computeWindingOrder2D(a)===S.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,P),l=y.computePositions(o,a,s,i,!0);return E(l,a,s,i._vertexFormat)}},b}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y){"use strict";function C(e,t){var r=new p;r.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e});var n,a,s=t.length,l=r.position.values.length/3,u=e.length/3,c=u/s,m=f.createTypedArray(l,2*s*(c+1)),_=0;n=0;var g=n*s;for(a=0;a<s-1;a++)m[_++]=a+g,m[_++]=a+g+1;for(m[_++]=s-1+g,m[_++]=g,n=c-1,g=n*s,a=0;a<s-1;a++)m[_++]=a+g,m[_++]=a+g+1;for(m[_++]=s-1+g,m[_++]=g,n=0;n<c-1;n++){var y=s*n,C=y+s;for(a=0;a<s;a++)m[_++]=a+y,m[_++]=a+C}var w=new d({attributes:r,indices:f.createTypedArray(l,m),boundingSphere:i.fromVertices(e),primitiveType:v.LINES});return w}function w(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._granularity=s(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var o=1+t.length*n.packedLength;o+=1+i.length*r.packedLength,this.packedLength=o+c.packedLength+2}w.pack=function(e,t,i){i=s(i,0);var o,a=e._positions,l=a.length;for(t[i++]=l,o=0;o<l;++o,i+=n.packedLength)n.pack(a[o],t,i);var u=e._shape;for(l=u.length,t[i++]=l,o=0;o<l;++o,i+=r.packedLength)r.pack(u[o],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),E={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,i){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var d=new Array(a);for(o=0;o<a;++o,t+=r.packedLength)d[o]=r.unpack(e,t);var h=c.unpack(e,t,S);t+=c.packedLength;var p=e[t++],f=e[t];return l(i)?(i._positions=u,i._shape=d,i._ellipsoid=c.clone(h,i._ellipsoid),i._cornerType=p,i._granularity=f,i):(E.polylinePositions=u,E.shapePositions=d,E.cornerType=p,E.granularity=f,new w(E))};var b=new t;return w.createGeometry=function(i){var r=i._positions,o=e(r,n.equalsEpsilon),a=i._shape;if(a=g.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){_.computeWindingOrder2D(a)===y.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,b),l=g.computePositions(o,a,s,i,!1);return C(l,a)}},w}),define("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){var o=e.length,a=new Array(o);a[0]=t(i)?i:e[0],a[o-1]=t(r)?r:e[o-1];for(var s=1;s<o-1;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var i=e.points,r=e.innerQuadrangles,o=e.times;if(i.length<3){var a=o[0],s=1/(o[1]-a),l=i[0],u=i[1];return function(e,i){t(i)||(i=new n);var r=(e-a)*s;return n.fastSlerp(l,u,r,i)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=i[l],d=i[l+1],h=r[l],p=r[l+1];return n.fastSquad(c,d,h,p,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var i=t.points,r=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(i,n,o);this._times=r,this._points=i,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return i(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r,n,o,s,l){var u=Math.cos(i),c=n*u,d=r*u,h=Math.sin(i),m=n*h,v=r*h;f=g.project(t,f),f=e.subtract(f,_,f);var y=a.fromRotation(i,p);f=a.multiplyByVector(y,f,f),f=e.add(f,_,f),t=g.unproject(f,t),s-=1,l-=1;var C=t.latitude,w=C+s*v,S=C-c*l,E=C-c*l+s*v,b=Math.max(C,w,S,E),T=Math.min(C,w,S,E),x=t.longitude,A=x+s*d,P=x+l*m,D=x+l*m+s*d,M=Math.max(x,A,P,D),I=Math.min(x,A,P,D);return{north:b,south:T,east:M,west:I,granYCos:c,granYSin:m,granXCos:d,granXSin:v,nwCorner:t}}var u=Math.cos,c=Math.sin,d=Math.sqrt,h={};h.computePosition=function(e,t,r,n,o){var a=e.ellipsoid.radiiSquared,s=e.nwCorner,l=e.rectangle,h=s.latitude-e.granYCos*t+r*e.granXSin,p=u(h),f=c(h),m=a.z*f,_=s.longitude+t*e.granYSin+r*e.granXCos,g=p*u(_),v=p*c(_),y=a.x*g,C=a.y*v,w=d(y*g+C*v+m*f);if(n.x=y/w,n.y=C/w,n.z=m/w,i(e.vertexFormat)&&e.vertexFormat.st){var S=e.stNwCorner;i(S)?(h=S.latitude-e.stGranYCos*t+r*e.stGranXSin,_=S.longitude+t*e.stGranYSin+r*e.stGranXCos,o.x=(_-e.stWest)*e.lonScalar,o.y=(h-e.stSouth)*e.latScalar):(o.x=(_-l.west)*e.lonScalar,o.y=(h-l.south)*e.latScalar)}};var p=new a,f=new e,m=new t,_=new e,g=new n;return h.computeOptions=function(e,t,i,r){var n,a,u,c,d,h=e._granularity,p=e._ellipsoid,f=e._surfaceHeight,v=e._rotation,y=e._stRotation,C=e._extrudedHeight,w=t.east,S=t.west,E=t.north,b=t.south,T=E-b;S>w?(d=o.TWO_PI-S+w,n=Math.ceil(d/h)+1,a=Math.ceil(T/h)+1,u=d/(n-1),c=T/(a-1)):(d=w-S,n=Math.ceil(d/h)+1,a=Math.ceil(T/h)+1,u=d/(n-1),c=T/(a-1)),i=s.northwest(t,i);var x=s.center(t,m);0===v&&0===y||(x.longitude<i.longitude&&(x.longitude+=o.TWO_PI),_=g.project(x,_));var A=c,P=u,D=0,M=0,I={granYCos:A,granYSin:D,granXCos:P,granXSin:M,ellipsoid:p,surfaceHeight:f,extrudedHeight:C,nwCorner:i,rectangle:t,width:n,height:a};if(0!==v){var R=l(i,v,u,c,x,n,a);E=R.north,b=R.south,w=R.east,S=R.west,I.granYCos=R.granYCos,I.granYSin=R.granYSin,I.granXCos=R.granXCos,I.granXSin=R.granXSin,t.north=E,t.south=b,t.east=w,t.west=S}if(0!==y){v-=y,r=s.northwest(t,r);var O=l(r,v,u,c,x,n,a);I.stGranYCos=O.granYCos,I.stGranXCos=O.granXCos,I.stGranYSin=O.granYSin,I.stGranXSin=O.granXSin,I.stNwCorner=r,I.stWest=O.west,I.stSouth=O.south}return I},h}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t){var i=new d({attributes:new p,primitiveType:C.TRIANGLES});return i.attributes.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}function x(e,t,r,n){var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.bitangent?new Float32Array(o):void 0,u=0,c=F,d=B,h=L;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<o;p+=3){var f=i.fromArray(e,p,N),m=u+1,_=u+2;h=r.geodeticSurfaceNormal(f,h),(t.tangent||t.bitangent)&&(i.cross(i.UNIT_Z,h,d),v.multiplyByVector(n,d,d),i.normalize(d,d),t.bitangent&&i.normalize(i.cross(h,d,c),c)),t.normal&&(a[u]=h.x,a[m]=h.y,a[_]=h.z),t.tangent&&(s[u]=d.x,s[m]=d.y,s[_]=d.z),t.bitangent&&(l[u]=c.x,l[m]=c.y,l[_]=c.z),u+=3}return T(t,{positions:e,normals:a,tangents:s,bitangents:l})}function A(e,t,r){var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=0,c=0,d=!0,h=F,p=B,f=L;if(t.normal||t.tangent||t.bitangent)for(var m=0;m<n;m+=6){var _=i.fromArray(e,m,N),v=i.fromArray(e,(m+6)%n,G);if(d){var y=i.fromArray(e,(m+3)%n,H);i.subtract(v,_,v),i.subtract(y,_,y),f=i.normalize(i.cross(y,v,f),f),d=!1}i.equalsEpsilon(v,_,g.EPSILON10)&&(d=!0),(t.tangent||t.bitangent)&&(h=r.geodeticSurfaceNormal(_,h),t.tangent&&(p=i.normalize(i.cross(h,f,p),p))),t.normal&&(o[l++]=f.x,o[l++]=f.y,o[l++]=f.z,o[l++]=f.x,o[l++]=f.y,o[l++]=f.z),t.tangent&&(a[u++]=p.x,a[u++]=p.y,a[u++]=p.z,a[u++]=p.x,a[u++]=p.y,a[u++]=p.z),t.bitangent&&(s[c++]=h.x,s[c++]=h.y,s[c++]=h.z,s[c++]=h.x,s[c++]=h.y,s[c++]=h.z)}return T(t,{positions:e,normals:o,tangents:a,bitangents:s})}function P(e){for(var t=e.vertexFormat,i=e.ellipsoid,r=e.size,n=e.height,a=e.width,s=t.position?new Float64Array(3*r):void 0,l=t.st?new Float32Array(2*r):void 0,u=0,c=0,d=N,p=V,f=Number.MAX_VALUE,m=Number.MAX_VALUE,g=-Number.MAX_VALUE,v=-Number.MAX_VALUE,y=0;y<n;++y)for(var C=0;C<a;++C)E.computePosition(e,y,C,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[c++]=p.x,l[c++]=p.y,f=Math.min(f,p.x),m=Math.min(m,p.y),g=Math.max(g,p.x),v=Math.max(v,p.y));if(t.st&&(f<0||m<0||g>1||v>1))for(var w=0;w<l.length;w+=2)l[w]=(l[w]-f)/(g-f),l[w+1]=(l[w+1]-m)/(v-m);for(var S=x(s,t,i,e.tangentRotationMatrix),b=6*(a-1)*(n-1),T=_.createTypedArray(r,b),A=0,P=0,D=0;D<n-1;++D){for(var M=0;M<a-1;++M){var I=A,R=I+a,O=R+1,L=I+1;T[P++]=I,T[P++]=R,T[P++]=L,T[P++]=L,T[P++]=R,T[P++]=O,++A}++A}return S.indices=T,t.st&&(S.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:l})),S}function D(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],e}function M(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t++]=r[i+1],e}function I(e){var t,r=e.shadowVolume,n=e.vertexFormat,a=e.surfaceHeight,s=e.extrudedHeight,l=Math.min(s,a),u=Math.max(s,a),c=e.height,d=e.width,p=e.ellipsoid;r&&(e.vertexFormat=b.clone(n,W),e.vertexFormat.normal=!0);var v=P(e);if(g.equalsEpsilon(l,u,g.EPSILON10))return v;var C=y.scaleToGeodeticHeight(v.attributes.position.values,u,p,!1);C=new Float64Array(C);var w=C.length,S=2*w,E=new Float64Array(S);E.set(C);var T=y.scaleToGeodeticHeight(v.attributes.position.values,l,p);E.set(T,w),v.attributes.position.values=E;var x,I,R=n.normal?new Float32Array(S):void 0,O=n.tangent?new Float32Array(S):void 0,N=n.bitangent?new Float32Array(S):void 0,L=n.st?new Float32Array(S/3*2):void 0;if(n.normal){for(I=v.attributes.normal.values,R.set(I),t=0;t<w;t++)I[t]=-I[t];R.set(I,w),v.attributes.normal.values=R}if(r){I=v.attributes.normal.values,n.normal||(v.attributes.normal=void 0);var B=new Float32Array(S);for(t=0;t<w;t++)I[t]=-I[t];B.set(I,w),v.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:B})}if(n.tangent){var F=v.attributes.tangent.values;for(O.set(F),t=0;t<w;t++)F[t]=-F[t];O.set(F,w),v.attributes.tangent.values=O}if(n.bitangent){var k=v.attributes.bitangent.values;N.set(k),N.set(k,w),v.attributes.bitangent.values=N}n.st&&(x=v.attributes.st.values,L.set(x),L.set(x,w/3*2),v.attributes.st.values=L);var V=v.indices,z=V.length,U=w/3,q=_.createTypedArray(S/3,2*z);for(q.set(V),t=0;t<z;t+=3)q[t+z]=V[t+2]+U,q[t+1+z]=V[t+1]+U,q[t+2+z]=V[t]+U;v.indices=q;var j,Y=2*d+2*c-4,X=2*(Y+4),Z=new Float64Array(3*X),K=r?new Float32Array(3*X):void 0,Q=n.st?new Float32Array(2*X):void 0,J=0,$=0,ee=0,te=d*c;for(t=0;t<te;t+=d)j=3*t,Z=D(Z,J,j,C,T),J+=6,n.st&&(Q=M(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=I[j],K[ee++]=I[j+1],K[ee++]=I[j+2]);for(t=te-d;t<te;t++)j=3*t,Z=D(Z,J,j,C,T),J+=6,n.st&&(Q=M(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=I[j],K[ee++]=I[j+1],K[ee++]=I[j+2]);for(t=te-1;t>0;t-=d)j=3*t,Z=D(Z,J,j,C,T),J+=6,n.st&&(Q=M(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=I[j],K[ee++]=I[j+1],K[ee++]=I[j+2]);for(t=d-1;t>=0;t--)j=3*t,Z=D(Z,J,j,C,T),J+=6,n.st&&(Q=M(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=I[j],K[ee++]=I[j+1],K[ee++]=I[j+2]);var ie=A(Z,n,p);n.st&&(ie.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:Q})),r&&(ie.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:K}));var re,ne,oe,ae,se=_.createTypedArray(X,6*Y);w=Z.length/3;var le=0;for(t=0;t<w-1;t+=2){re=t,ae=(re+2)%w;var ue=i.fromArray(Z,3*re,G),ce=i.fromArray(Z,3*ae,H);i.equalsEpsilon(ue,ce,g.EPSILON10)||(ne=(re+1)%w,oe=(ne+2)%w,se[le++]=re,se[le++]=ne,se[le++]=ae,se[le++]=ae,se[le++]=ne,se[le++]=oe)}return ie.indices=se,ie=m.combineInstances([new f({geometry:v}),new f({geometry:ie})]),ie[0]}function R(e,t,i){if(0===i)return S.clone(e);S.northeast(e,Z[0]),S.northwest(e,Z[1]),S.southeast(e,Z[2]),S.southwest(e,Z[3]),t.cartographicArrayToCartesianArray(Z,X);var r=t.geodeticSurfaceNormalCartographic(S.center(e,j));w.fromAxisAngle(r,i,Y),v.fromQuaternion(Y,q);for(var n=0;n<4;++n)v.multiplyByVector(q,X[n],X[n]);return t.cartesianArrayToCartographicArray(X,Z),S.fromCartographicArray(Z)}function O(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,i=a(e.rotation,0);this._rectangle=t,this._granularity=a(e.granularity,g.RADIANS_PER_DEGREE),this._ellipsoid=c.clone(a(e.ellipsoid,c.WGS84)),this._surfaceHeight=a(e.height,0),this._rotation=i,this._stRotation=a(e.stRotation,0),this._vertexFormat=b.clone(a(e.vertexFormat,b.DEFAULT)),this._extrudedHeight=a(e.extrudedHeight,0),this._extrude=s(e.extrudedHeight),this._closeTop=a(e.closeTop,!0),this._closeBottom=a(e.closeBottom,!0),this._shadowVolume=a(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=R(this._rectangle,this._ellipsoid,i)}var N=new i,L=new i,B=new i,F=new i,k=new S,V=new t,z=new e,U=new e,G=new i,H=new i,W=new b,q=new v,j=new i,Y=new w,X=[new i,new i,new i,new i],Z=[new r,new r,new r,new r];O.packedLength=S.packedLength+c.packedLength+b.packedLength+S.packedLength+9,O.pack=function(e,t,i){return i=a(i,0),S.pack(e._rectangle,t,i),i+=S.packedLength,c.pack(e._ellipsoid,t,i),i+=c.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,S.pack(e._rotatedRectangle,t,i),i+=S.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i]=e._shadowVolume?1:0,t};var K=new S,Q=new S,J=c.clone(c.UNIT_SPHERE),$={rectangle:K,ellipsoid:J,vertexFormat:W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};O.unpack=function(e,t,i){t=a(t,0);var r=S.unpack(e,t,K);t+=S.packedLength;var n=c.unpack(e,t,J);t+=c.packedLength;var o=b.unpack(e,t,W);t+=b.packedLength;var l=S.unpack(e,t,Q);t+=S.packedLength;var u=e[t++],d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=1===e[t++],_=1===e[t++],g=1===e[t++],v=1===e[t];return s(i)?(i._rectangle=S.clone(r,i._rectangle),i._ellipsoid=c.clone(n,i._ellipsoid),i._vertexFormat=b.clone(o,i._vertexFormat),i._granularity=u,i._surfaceHeight=d,i._rotation=h,i._stRotation=p,i._extrudedHeight=m?f:void 0,i._extrude=m,i._closeTop=_,i._closeBottom=g,i._rotatedRectangle=l,i._shadowVolume=v,i):($.granularity=u,$.height=d,$.rotation=h,$.stRotation=p,$.extrudedHeight=m?f:void 0,$.closeTop=_,$.closeBottom=g,$.shadowVolume=v,new O($))};var ee=new v,te=new r,ie=new r,re=new w,ne=new r;return O.createGeometry=function(t){if(!g.equalsEpsilon(t._rectangle.north,t._rectangle.south,g.EPSILON10)&&!g.equalsEpsilon(t._rectangle.east,t._rectangle.west,g.EPSILON10)){var i=S.clone(t._rectangle,k),r=t._ellipsoid,n=t._surfaceHeight,o=t._extrude,a=t._extrudedHeight,s=t._rotation,l=t._stRotation,u=t._vertexFormat,c=E.computeOptions(t,i,te,ie),h=ee;if(0!==l||0!==s){var p=S.center(i,ne),f=r.geodeticSurfaceNormalCartographic(p,G);w.fromAxisAngle(f,-l,re),v.fromQuaternion(re,h)}else v.clone(v.IDENTITY,h);c.lonScalar=1/t._rectangle.width,c.latScalar=1/t._rectangle.height,c.vertexFormat=u,c.rotation=s,c.stRotation=l,c.tangentRotationMatrix=h,c.size=c.width*c.height;var m,_;if(i=t._rectangle,o){c.shadowVolume=t._shadowVolume,m=I(c);var C=e.fromRectangle3D(i,r,n,U),b=e.fromRectangle3D(i,r,a,z);_=e.union(C,b)}else m=P(c),m.attributes.position.values=y.scaleToGeodeticHeight(m.attributes.position.values,n,r,!1),_=e.fromRectangle3D(i,r,n);return u.position||delete m.attributes.position,new d({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:_})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:b.POSITION_ONLY,shadowVolume:!0})},l(O.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),O}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){var t,i=e.size,n=e.height,o=e.width,a=new Float64Array(3*i),s=0,h=0,p=S;for(t=0;t<o;t++)_.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,h=1;h<n;h++)_.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(h=n-1,t=o-2;t>=0;t--)_.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,h=n-2;h>0;h--)_.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var m=a.length/3*2,g=d.createTypedArray(a.length/3,m),v=0,y=0;y<a.length/3-1;y++)g[v++]=y,g[v++]=y+1;g[v++]=a.length/3-1,g[v++]=0;var C=new l({attributes:new c,primitiveType:f.LINES});return C.attributes.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a}),C.indices=g,C}function v(e){var t=e.surfaceHeight,i=e.extrudedHeight,r=e.ellipsoid,n=Math.min(i,t),o=Math.max(i,t),a=g(e);if(h.equalsEpsilon(n,o,h.EPSILON10))return a;var s=e.height,l=e.width,u=p.scaleToGeodeticHeight(a.attributes.position.values,o,r,!1),c=u.length,f=new Float64Array(2*c);f.set(u);var m=p.scaleToGeodeticHeight(a.attributes.position.values,n,r);f.set(m,c),a.attributes.position.values=f;var _=f.length/3*2+8,v=d.createTypedArray(f.length/3,_);c=f.length/6;for(var y=0,C=0;C<c-1;C++)v[y++]=C,v[y++]=C+1,v[y++]=C+c,v[y++]=C+c+1;return v[y++]=c-1,v[y++]=0,v[y++]=c+c-1,v[y++]=c,v[y++]=0,v[y++]=c,v[y++]=l-1,v[y++]=c+l-1,v[y++]=l+s-2,v[y++]=l+s-2+c,v[y++]=2*l+s-3,v[y++]=2*l+s-3+c,a.indices=v,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,i=n(e.granularity,h.RADIANS_PER_DEGREE),r=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=i,this._ellipsoid=r,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var C=new e,w=new e,S=new t,E=new m;y.packedLength=m.packedLength+s.packedLength+5,y.pack=function(e,t,i){return i=n(i,0),m.pack(e._rectangle,t,i),i+=m.packedLength,s.pack(e._ellipsoid,t,i),i+=s.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=o(e._extrudedHeight)?1:0,t[i]=n(e._extrudedHeight,0),t};var b=new m,T=s.clone(s.UNIT_SPHERE),x={rectangle:b,ellipsoid:T,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,i){t=n(t,0);var r=m.unpack(e,t,b);t+=m.packedLength;var a=s.unpack(e,t,T);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return o(i)?(i._rectangle=m.clone(r,i._rectangle),i._ellipsoid=s.clone(a,i._ellipsoid),i._surfaceHeight=u,i._rotation=c,i._extrudedHeight=d?h:void 0,i):(x.granularity=l,x.height=u,x.rotation=c,x.extrudedHeight=d?h:void 0,new y(x))};var A=new i;return y.createGeometry=function(t){var i=m.clone(t._rectangle,E),r=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=_.computeOptions(t,i,A);s.size=2*s.width+2*s.height-4;var u,c;if(i=t._rectangle,!h.equalsEpsilon(i.north,i.south,h.EPSILON10)&&!h.equalsEpsilon(i.east,i.west,h.EPSILON10)){if(o(a)){u=v(s);var d=e.fromRectangle3D(i,r,n,w),y=e.fromRectangle3D(i,r,a,C);c=e.union(d,y)}else u=g(s),u.attributes.position.values=p.scaleToGeodeticHeight(u.attributes.position.values,n,r,!1),c=e.fromRectangle3D(i,r,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:f.LINES,boundingSphere:c})}},y}),define("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),define("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function i(e){return r(e)}if("undefined"!=typeof window){var r=window.requestAnimationFrame;return function(){if(!e(r))for(var i=["webkit","moz","ms","o"],n=0,o=i.length;n<o&&!e(r);)r=window[i[n]+"RequestAnimationFrame"],++n;if(!e(r)){var a=1e3/60,s=0;r=function(e){var i=t(),r=Math.max(a-(i-s),0);return s=i+r,setTimeout(function(){e(s)},r)}}}(),i}}),define("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){function o(){t.ready?e(n(t,i,r),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise}function n(t,i,r){var n,s=t.tilingScheme,l=[],u={};for(n=0;n<r.length;++n){var c=s.positionToTileXY(r[n],i),d=c.toString();if(!u.hasOwnProperty(d)){var h={x:c.x,y:c.y,level:i,tilingScheme:s,terrainProvider:t,positions:[]};u[d]=h,l.push(h)}u[d].positions.push(r[n])}var p=[];for(n=0;n<l.length;++n){var f=l[n],m=f.terrainProvider.requestTileGeometry(f.x,f.y,f.level,!1),_=e(m,o(f),a(f));p.push(_)}return e.all(p,function(){return r})}function o(e){var t=e.positions,i=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var r=0;r<t.length;++r){var n=t[r];n.height=e.interpolateHeight(i,n.longitude,n.latitude)}}}function a(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){var i=t[e];i.height=void 0}}}return r}),define("Core/sampleTerrainMostDetailed",["../ThirdParty/when","./defined","./sampleTerrain","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n){return r.readyPromise.then(function(){for(var o=[],a=r.availability,s=0;s<n.length;++s){var l=n[s],u=a.computeMaximumLevelAtPosition(l),c=o[u];t(c)||(o[u]=c=[]),c.push(l)}return e.all(o.map(function(e,n){if(t(e))return i(r,n,e)})).then(function(){return n})})}return n}),define("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,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};return e(t)}),define("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./getTimestamp","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i){var r=e._element;if(r===document)return i.x=t.clientX,i.y=t.clientY,i;var n=r.getBoundingClientRect();return i.x=t.clientX-n.left,i.y=t.clientY-n.top,i}function d(e,t){var i=e;return r(t)&&(i+="+"+t),i}function h(e){return e.shiftKey?l.SHIFT:e.ctrlKey?l.CTRL:e.altKey?l.ALT:void 0}function p(e,t,i,r){function n(t){r(e,t)}i.addEventListener(t,n,!1),e._removalFunctions.push(function(){i.removeEventListener(t,n,!1)})}function f(e){var t=e._element,i=r(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(p(e,"pointerdown",t,P),p(e,"pointerup",t,D),p(e,"pointermove",t,M),p(e,"pointercancel",t,D)):(p(e,"mousedown",t,v),p(e,"mouseup",i,y),p(e,"mousemove",i,C),p(e,"touchstart",t,E),p(e,"touchend",i,b),p(e,"touchmove",i,x),p(e,"touchcancel",i,b)),p(e,"dblclick",t,w);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",p(e,n,t,S)}function m(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}function _(e){e._lastSeenTouchEvent=s()}function g(e){return s()-e._lastSeenTouchEvent>I.mouseEmulationIgnoreMilliseconds}function v(e,i){if(g(e)){var n=i.button;e._buttonDown=n;var o;if(n===R.LEFT)o=u.LEFT_DOWN;else if(n===R.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==R.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(i),l=e.getInputAction(o,s);r(l)&&(t.clone(a,O.position),l(O),i.preventDefault())}}function y(e,i){if(g(e)){var n=i.button;e._buttonDown=void 0;var o,a;if(n===R.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===R.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==R.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=h(i),l=e.getInputAction(o,s),d=e.getInputAction(a,s);if(r(l)||r(d)){var p=c(e,i,e._primaryPosition);if(r(l)&&(t.clone(p,N.position),l(N)),r(d)){var f=e._primaryStartPosition,m=f.x-p.x,_=f.y-p.y,v=Math.sqrt(m*m+_*_);v<e._clickPixelTolerance&&(t.clone(p,L.position),d(L))}}}}function C(e,i){if(g(e)){var n=h(i),o=c(e,i,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(u.MOUSE_MOVE,n);r(s)&&(t.clone(a,B.startPosition),t.clone(o,B.endPosition),s(B)),t.clone(o,a),r(e._buttonDown)&&i.preventDefault()}}function w(e,t){var i,n=t.button;if(n===R.LEFT){i=u.LEFT_DOUBLE_CLICK;var o=h(t),a=e.getInputAction(i,o);r(a)&&(c(e,t,F.position),a(F))}}function S(e,t){var i;if(r(t.deltaY)){var n=t.deltaMode;i=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=t.detail>0?t.detail*-120:t.wheelDelta;if(r(i)){var o=h(t),a=e.getInputAction(u.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function E(e,i){_(e);var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;r<s;++r)n=a[r],o=n.identifier,l.set(o,c(e,n,new t));T(e,i);var u=e._previousPositions;for(r=0;r<s;++r)n=a[r],o=n.identifier,u.set(o,t.clone(l.get(o)))}function b(e,t){_(e);var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;i<a;++i)r=o[i],n=r.identifier,s.remove(n);T(e,t);var l=e._previousPositions;for(i=0;i<a;++i)r=o[i],n=r.identifier,l.remove(n)}function T(e,i){var n,o,a=h(i),s=e._positions,l=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===R.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(u.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,z.position),n(z)),0===c&&(o=e.getInputAction(u.LEFT_CLICK,a),r(o)))){var d=e._primaryStartPosition,p=l.values[0],f=d.x-p.x,m=d.y-p.y,_=Math.sqrt(f*f+m*m);_<e._clickPixelTolerance&&(t.clone(e._primaryPosition,U.position),o(U))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(u.PINCH_END,a),r(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=R.LEFT,n=e.getInputAction(u.LEFT_DOWN,a),r(n)&&(t.clone(g,k.position),n(k)),i.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(u.PINCH_START,a),r(n)&&(t.clone(s.values[0],V.position1),t.clone(s.values[1],V.position2),n(V),i.preventDefault()))}function x(e,i){_(e);var n,o,a,s=i.changedTouches,l=s.length,u=e._positions;for(n=0;n<l;++n){o=s[n],a=o.identifier;var d=u.get(a);r(d)&&c(e,o,d)}A(e,i);var h=e._previousPositions;for(n=0;n<l;++n)o=s[n],a=o.identifier,t.clone(u.get(a),h.get(a))}function A(e,i){var n,o=h(i),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown===R.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(u.MOUSE_MOVE,o),r(n)&&(t.clone(d,G.startPosition),t.clone(c,G.endPosition),n(G)),t.clone(c,d),i.preventDefault()}else if(2===l&&e._isPinching&&(n=e.getInputAction(u.PINCH_MOVE,o),r(n))){var p=a.values[0],f=a.values[1],m=s.values[0],_=s.values[1],g=f.x-p.x,v=f.y-p.y,y=.25*Math.sqrt(g*g+v*v),C=_.x-m.x,w=_.y-m.y,S=.25*Math.sqrt(C*C+w*w),E=.125*(f.y+p.y),b=.125*(_.y+m.y),T=Math.atan2(v,g),x=Math.atan2(w,C);t.fromElements(0,S,H.distance.startPosition),t.fromElements(0,y,H.distance.endPosition),
t.fromElements(x,b,H.angleAndHeight.startPosition),t.fromElements(T,E,H.angleAndHeight.endPosition),n(H)}}function P(e,i){if(i.target.setPointerCapture(i.pointerId),"touch"===i.pointerType){var r=e._positions,n=i.pointerId;r.set(n,c(e,i,new t)),T(e,i);var o=e._previousPositions;o.set(n,t.clone(r.get(n)))}else v(e,i)}function D(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),T(e,t);var n=e._previousPositions;n.remove(r)}else y(e,t)}function M(e,i){if("touch"===i.pointerType){var n=e._positions,o=i.pointerId,a=n.get(o);if(!r(a))return;c(e,i,a),A(e,i);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else C(e,i)}function I(r){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._lastSeenTouchEvent=-I.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=i(r,document),f(this)}var R={LEFT:0,MIDDLE:1,RIGHT:2},O={position:new t},N={position:new t},L={position:new t},B={startPosition:new t,endPosition:new t},F={position:new t},k={position:new t},V={position1:new t,position2:new t},z={position:new t},U={position:new t},G={startPosition:new t,endPosition:new t},H={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return I.prototype.setInputAction=function(e,t,i){var r=d(t,i);this._inputEvents[r]=e},I.prototype.getInputAction=function(e,t){var i=d(e,t);return this._inputEvents[i]},I.prototype.removeInputAction=function(e,t){var i=d(e,t);delete this._inputEvents[i]},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){return m(this),n(this)},I.mouseEmulationIgnoreMilliseconds=800,I}),define("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return r(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return i(t)?(t[0]=e,t):new Uint8Array([e])},o}),define("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=r.addSeconds(e,C,t);var i=r.totalDays(t)-w;return t=r.addSeconds(t,l(i),t)}function c(i,r,a,s,l,u,c){a<0&&(a=-a,l+=n.PI);var p=i*(1-r),f=s-l,_=l,g=h(u-s,r);d(r,0);m(f,a,_,A);var v=p*(1+r),y=Math.cos(g),C=Math.sin(g),w=1+r*y,S=v/w;return t(c)?(c.x=S*y,c.y=S*C,c.z=0):c=new e(S*y,S*C,0),o.multiplyByVector(A,c,c)}function d(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function h(e,t){var i=p(e,t);return f(i,t)}function p(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r,o=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(r=0;r<P&&Math.abs(a-o)>D;++r){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+i*n.TWO_PI}function f(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,r);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=i*n.TWO_PI}function m(e,i,r,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(i),u=Math.sin(i),c=Math.cos(r),d=Math.sin(r);return t(n)?(n[0]=c*a-d*s*l,n[1]=d*a+c*s*l,n[2]=s*u,n[3]=-c*s-d*a*l,n[4]=-d*s+c*a*l,n[5]=a*u,n[6]=d*u,n[7]=-c*u,n[8]=l):n=new o(c*a-d*s*l,-c*s-d*a*l,d*u,d*a+c*s*l,-d*s+c*a*l,-c*u,s*u,a*u,l),n}function _(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=M+U*Math.cos(O*n)+Z*Math.sin(O*n)+G*Math.cos(N*n)+K*Math.sin(N*n)+H*Math.cos(L*n)+Q*Math.sin(L*n)+W*Math.cos(B*n)+J*Math.sin(B*n)+q*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(k*n)+ee*Math.sin(k*n)+Y*Math.cos(V*n)+te*Math.sin(V*n)+X*Math.cos(z*n)+ie*Math.sin(z*n),s=I+R*r+de*Math.cos(re*n)+ye*Math.sin(re*n)+he*Math.cos(ne*n)+Ce*Math.sin(ne*n)+pe*Math.cos(oe*n)+we*Math.sin(oe*n)+fe*Math.cos(ae*n)+Se*Math.sin(ae*n)+me*Math.cos(se*n)+Ee*Math.sin(se*n)+_e*Math.cos(le*n)+be*Math.sin(le*n)+ge*Math.cos(ue*n)+Te*Math.sin(ue*n)+ve*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*r,d=102.93734808*b+11612.3529*T*r,h=469.97289*T*r,p=174.87317577*b-8679.27034*T*r;return c(o,l,h,d,p,s,t)}function g(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,d=.055545526-1.6e-8*r,h=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,f=83.35324312*b,m=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+T*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*b+T*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),x=134.96340251*b+T*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*b+T*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*b-T*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),D=2*C,M=4*C,I=6*C,R=2*x,O=3*x,N=4*x,L=2*w;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-A)+181*Math.cos(D+x),d+=.014216*Math.cos(D-x)+.008551*Math.cos(D-R)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(M-O)-914e-6*Math.cos(M-R)+869e-6*Math.cos(D-A-x)-627e-6*Math.cos(D)-394e-6*Math.cos(M-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(M)+229e-6*Math.cos(I-N)-201e-6*Math.cos(R-L),p+=486.26*Math.cos(D-L)-40.13*Math.cos(D)+37.51*Math.cos(L)+25.73*Math.cos(R-L)+19.97*Math.cos(D-A-L),m+=-55609*Math.sin(D-x)-34711*Math.sin(D-R)-9792*Math.sin(x)+9385*Math.sin(M-O)+7505*Math.sin(M-R)+5318*Math.sin(D+x)+3484*Math.sin(M-N)-3417*Math.sin(D-A-x)-2530*Math.sin(I-N)-2376*Math.sin(D)-2075*Math.sin(D-O)-1883*Math.sin(R)-1736*Math.sin(I-5*x)+1626*Math.sin(A)-1370*Math.sin(I-O),g+=-5392*Math.sin(D-L)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(L)-288*Math.sin(R-L),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(D-A);var B=2*P,F=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(D-L+P)*r+.614*Math.cos(D-L-P)*r-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(D-L+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var k=2.116*Math.sin(P)*r-.111*Math.sin(D-L-P)*r-.0015*Math.sin(P)*n;m+=k,y+=k,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(D-L+P)*r+1.12*Math.sin(D-P)*r-1.06*Math.sin(L-P)*r+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(D-L+B)*n-.015*Math.sin(D-L+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=E;var V=h+p*T,z=f+m*T,U=v+y*T,G=_+g*T;return c(l,d,V,z,G,U,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,w=2451545,S=new r(2451545,0,s.TAI),E=1e3,b=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,A=new o,P=50,D=n.EPSILON8,M=1.0000010178*x,I=100.46645683*b,R=1295977422.83429*T,O=16002,N=21863,L=32004,B=10931,F=14529,k=16368,V=15318,z=32794,U=64e-7*x,G=-152e-7*x,H=62e-7*x,W=-8e-7*x,q=32e-7*x,j=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Z=1e-7*-150*x,K=-46e-7*x,Q=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,ie=22e-7*x,re=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,de=-325e-7,he=-322e-7,pe=1e-7*-79,fe=232*1e-7,me=1e-7*-52,_e=97e-7,ge=55e-7,ve=-41e-7,ye=-105e-7,Ce=-137e-7,we=258e-7,Se=35e-7,Ee=1e-7*-116,be=-88e-7,Te=-112e-7,xe=-8e-6,Ae=new r(0,0,s.TAI),Pe=.012300034,De=Pe/(Pe+1)*-1,Me=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Ie=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Ie=_(i,Ie),n=e.negate(Ie,n),v(i,Ie),e.subtract(n,Ie,n),o.multiplyByVector(Me,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Me,i,i),i},y}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,d=r.green,h=r.blue,f=r.alpha,m=n.red,_=n.green,g=n.blue,v=n.alpha;if(i.equals(r,n)){for(l=0;l<u;l++)a[s++]=i.floatToByte(c),a[s++]=i.floatToByte(d),a[s++]=i.floatToByte(h),a[s++]=i.floatToByte(f);return s}var y=(m-c)/u,C=(_-d)/u,w=(g-h)/u,S=(v-f)/u,E=s;for(l=0;l<u;l++)a[E++]=i.floatToByte(c+l*y),a[E++]=i.floatToByte(d+l*C),a[E++]=i.floatToByte(h+l*w),a[E++]=i.floatToByte(f+l*S);return E}function _(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,h.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+r.length*t.packedLength;u+=o(a)?1+a.length*i.packedLength:1,this.packedLength=u+s.packedLength+3}_.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;l<c;++l,a+=t.packedLength)t.pack(u[l],r,a);var d=e._colors;for(c=o(d)?d.length:0,r[a++]=c,l=0;l<c;++l,a+=i.packedLength)i.pack(d[l],r,a);return s.pack(e._ellipsoid,r,a),a+=s.packedLength,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity,r},_.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;l<u;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var d=u>0?new Array(u):void 0;for(l=0;l<u;++l,r+=i.packedLength)d[l]=i.unpack(e,r);var h=s.unpack(e,r);r+=s.packedLength;var p=1===e[r++],f=1===e[r++],m=e[r];return o(a)?(a._positions=c,a._colors=d,a._ellipsoid=h,a._colorsPerVertex=p,a._followSurface=f,a._granularity=m,a):new _({positions:c,colors:d,ellipsoid:h,colorsPerVertex:p,followSurface:f,granularity:m})};var g=new Array(2),v=new Array(2),y={positions:g,height:v,ellipsoid:void 0,minDistance:void 0};return _.createGeometry=function(n){var a,s,_,C,w,S=n._positions,E=n._colors,b=n._colorsPerVertex,T=n._followSurface,x=n._granularity,A=n._ellipsoid,P=h.chordLength(x,A.maximumRadius),D=o(E)&&!b,M=S.length,I=0;if(T){var R=p.extractHeights(S,A),O=y;if(O.minDistance=P,O.ellipsoid=A,D){var N=0;for(a=0;a<M-1;a++)N+=p.numberOfPoints(S[a],S[a+1],P)+1;s=new Float64Array(3*N),C=new Uint8Array(4*N),O.positions=g,O.height=v;var L=0;for(a=0;a<M-1;++a){g[0]=S[a],g[1]=S[a+1],v[0]=R[a],v[1]=R[a+1];var B=p.generateArc(O);if(o(E)){var F=B.length/3;w=E[a];for(var k=0;k<F;++k)C[L++]=i.floatToByte(w.red),C[L++]=i.floatToByte(w.green),C[L++]=i.floatToByte(w.blue),C[L++]=i.floatToByte(w.alpha)}s.set(B,I),I+=B.length}}else if(O.positions=S,O.height=R,s=new Float64Array(p.generateArc(O)),o(E)){for(C=new Uint8Array(s.length/3*4),a=0;a<M-1;++a){var V=S[a],z=S[a+1],U=E[a],G=E[a+1];I=m(V,z,U,G,P,C,I)}var H=E[M-1];C[I++]=i.floatToByte(H.red),C[I++]=i.floatToByte(H.green),C[I++]=i.floatToByte(H.blue),C[I++]=i.floatToByte(H.alpha)}}else{_=D?2*M-2:M,s=new Float64Array(3*_),C=o(E)?new Uint8Array(4*_):void 0;var W=0,q=0;for(a=0;a<M;++a){var j=S[a];if(D&&a>0&&(t.pack(j,s,W),W+=3,w=E[a-1],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha)),D&&a===M-1)break;t.pack(j,s,W),W+=3,o(E)&&(w=E[a],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),_=s.length/3;var X=2*(_-1),Z=d.createTypedArray(_,X),K=0;for(a=0;a<_-1;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:f.LINES,boundingSphere:e.fromPoints(S)})},_}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(t){var r=i(t.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,vertexFormat:t.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,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}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(t){var r=i(t.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,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}),define("Core/Spherical",["./Check","./defaultValue","./defined"],function(e,t,i){"use strict";function r(e,i,r){this.clock=t(e,0),this.cone=t(i,0),this.magnitude=t(r,1)}return r.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return i(t)||(t=new r),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},r.clone=function(e,t){if(i(e))return i(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new r(e.clock,e.cone,e.magnitude)},r.normalize=function(e,t){return i(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new r(e.clock,e.cone,1)},r.equals=function(e,t){return e===t||i(e)&&i(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},r.equalsEpsilon=function(e,r,n){return n=t(n,0),e===r||i(e)&&i(r)&&Math.abs(e.clock-r.clock)<=n&&Math.abs(e.cone-r.cone)<=n&&Math.abs(e.magnitude-r.magnitude)<=n},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}),define("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;n<r;){var o=Math.ceil((r-n)/t--);i.push(e.slice(n,n+o)),n+=o}return i}return i}),define("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{waterMask:{get:t.throwInstantiationError}}),i.prototype.interpolateHeight=t.throwInstantiationError,i.prototype.isChildAvailable=t.throwInstantiationError,i.prototype.createMesh=t.throwInstantiationError,i.prototype.upsample=t.throwInstantiationError,i.prototype.wasCreatedByUpsampling=t.throwInstantiationError,i}),define("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(e){}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),i.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,i.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,i.prototype.rectangleToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToRectangle=t.throwInstantiationError,i.prototype.positionToTileXY=t.throwInstantiationError,i}),define("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}function u(e){if(this._intervals=[],this._changedEvent=new o,i(e))for(var t=e.length,r=0;r<t;r++)this.addInterval(e[r])}r(u.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),u.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof u))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;o++)if(!s.equals(i[o],r[o],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1<i.length&&s.contains(i[r-1],t)?r-1:~r)},u.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var r=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;l<u;l++){var c=s[l];if((!i(r)||c.start.equals(r))&&(!i(n)||c.stop.equals(n))&&(!i(o)||c.isStartIncluded===o)&&(!i(a)||c.isStopIncluded===a))return s[l]}},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var n,o,u=this._intervals;if(0===u.length||a.greaterThan(t.start,u[u.length-1].stop))return u.push(t),void this._changedEvent.raiseEvent(this);for(o=e(u,t,l),o<0?o=~o:o>0&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o<u.length&&!t.isStartIncluded&&u[o].isStartIncluded&&u[o].start.equals(t.start)&&++o,o>0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o<u.length&&(n=a.compare(t.stop,u[o].start),n>0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,d=t.isStopIncluded;if(n>0){var h=r[n-1],p=h.stop;(a.greaterThan(p,o)||s.equals(p,o)&&h.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||h.isStopIncluded&&!d&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!d,isStopIncluded:h.isStopIncluded,data:h.data})),r[n-1]=new s({start:h.start,stop:o,isStartIncluded:h.isStartIncluded,isStopIncluded:!c,data:h.data}))}var f=r[n];for(n<r.length&&!c&&f.isStartIncluded&&o.equals(f.start)&&(i=!0,r.splice(n,0,new s({start:f.start,stop:f.start,isStartIncluded:!0,isStopIncluded:!0,data:f.data})),++n,f=r[n]);n<r.length&&a.greaterThan(u,f.stop);)i=!0,r.splice(n,1),f=r[n];return n<r.length&&u.equals(f.stop)&&(i=!0,!d&&f.isStopIncluded?(n+1<r.length&&r[n+1].start.equals(u)&&f.data===r[n+1].data?(r.splice(n,1),f=new s({start:f.start,stop:f.stop,isStartIncluded:!0,isStopIncluded:f.isStopIncluded,data:f.data})):f=new s({start:u,stop:u,isStartIncluded:!0,isStopIncluded:!0,data:f.data}),r[n]=f):r.splice(n,1)),n<r.length&&(a.greaterThan(u,f.start)||u.equals(f.start)&&d&&f.isStartIncluded)&&(i=!0,r[n]=new s({start:u,stop:f.stop,isStartIncluded:!d,isStopIncluded:f.isStopIncluded,data:f.data})),i&&this._changedEvent.raiseEvent(this),i},u.prototype.intersect=function(e,t,r){for(var n=0,o=0,l=new u,c=this._intervals,d=e._intervals;n<c.length&&o<d.length;){var h=c[n],p=d[o];if(a.lessThan(h.stop,p.start))++n;else if(a.lessThan(p.stop,h.start))++o;else{if(i(r)||i(t)&&t(h.data,p.data)||!i(t)&&p.data===h.data){var f=s.intersect(h,p,new s,r);f.isEmpty||l.addInterval(f,t)}a.lessThan(h.stop,p.stop)||h.stop.equals(p.stop)&&!h.isStopIncluded&&p.isStopIncluded?++n:++o}}return l},u}),define("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Quaternion"],function(e,t,i,r){"use strict";var n=new e(1,1,1),o=e.ZERO,a=r.IDENTITY,s=function(i,s,l){this.translation=e.clone(t(i,o)),this.rotation=r.clone(t(s,a)),this.scale=e.clone(t(l,n))};return s.prototype.equals=function(t){return this===t||i(t)&&e.equals(this.translation,t.translation)&&r.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},s}),define("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./Iso8601","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this.clock=t.clock,this.element=t.element,this.epoch=e(t.epoch,n.MINIMUM_VALUE),this.tolerance=e(t.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function s(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}return i(a.prototype,{clock:{get:function(){return this._clock},set:function(e){var i=this._clock;i!==e&&(t(i)&&(this._clockSubscription(),this._clockSubscription=void 0),t(e)&&(this._clockSubscription=e.onTick.addEventListener(a.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var i=this._element;i!==e&&(t(i)&&i.removeEventListener("seeked",this._seekFunction,!1),t(e)&&(this._seeking=!1,this._seekFunction=s(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),a.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,r(this)},a.prototype.isDestroyed=function(){return!1},a.prototype._onTick=function(i){var r=this._element;if(t(r)&&!(r.readyState<2)){var a=r.paused,s=i.shouldAnimate;if(s===a&&(s?r.play():r.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);r.playbackRate=i.multiplier;var l,u=i.currentTime,c=e(this.epoch,n.MINIMUM_VALUE),d=o.secondsDifference(u,c),h=r.duration,p=r.currentTime;r.loop?(d%=h,d<0&&(d=h-d),l=d):l=d>h?h:d<0?0:d;var f=s?e(this.tolerance,1):.001;Math.abs(l-p)>f&&(this._seeking=!0,r.currentTime=l)}},a}),define("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(e,t){this.rectangle=e,this.maxLevel=t}function y(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");_._tilingScheme=new l({ellipsoid:y});var i=e.getElementsByTagName("TileFormat")[0];_._heightmapWidth=parseInt(i.getAttribute("width"),10),_._heightmapHeight=parseInt(i.getAttribute("height"),10),_._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(_._heightmapWidth,_._heightmapHeight),_._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var a=r[n],s=p.toRadians(parseFloat(a.getAttribute("minx"))),u=p.toRadians(parseFloat(a.getAttribute("miny"))),c=p.toRadians(parseFloat(a.getAttribute("maxx"))),d=p.toRadians(parseFloat(a.getAttribute("maxy"))),h=parseInt(a.getAttribute("maxlevel"),10);_._rectangles.push(new v(new f(s,u,c,d),h))}_._ready=!0,_._readyPromise.resolve(!0)}function o(e){var t=i(e,"An error occurred while accessing "+_._url+".");d=g.handleError(d,_,_._errorEvent,t,void 0,void 0,void 0,u)}function u(){e(h(_._url),n,o)}r=i(r,i.EMPTY_OBJECT),this._url=r.url,this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=r.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var d,_=this,y=i(r.ellipsoid,a.WGS84);u()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var d=c.rectangle,h=f.intersection(d,s,S);r(h)&&(w(o,d,2*t,2*i,n+1)&&(l|=4),w(o,d,2*t+1,2*i,n+1)&&(l|=8),w(o,d,2*t,2*i+1,n+1)&&(l|=1),w(o,d,2*t+1,2*i+1,n+1)&&(l|=2))}}return l}function w(e,t,i,n,o){var a=e.tileXYToRectangle(i,n,o);return r(f.intersection(a,t,S))}n(y.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),y.prototype.requestTileGeometry=function(t,n,o,a){var s=this._tilingScheme.getNumberOfYTilesAtLevel(o),l=this._url+o+"/"+t+"/"+(s-n-1)+".tif?cesium=true",h=this._proxy;r(h)&&(l=h.getURL(l));var p;if(a=i(a,!0)){if(p=_(l,d),!r(p))return}else p=d(l);var f=this;return e(p,function(e){return new c({buffer:u(e),width:f._heightmapWidth,height:f._heightmapHeight,childTileMask:C(f,t,n,o),structure:f._terrainDataStructure})})},y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var S=new f;return y.prototype.getTileDataAvailable=function(e,t,i){},y}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function l(i,r,n,o){var a=r.length;if(!(a<2)){var l=t(o),u=t(n),h=!0,p=new Array(a),f=new Array(a),m=new Array(a),_=r[0];p[0]=_;var g=i.cartesianToCartographic(_,c);u&&(g.height=n[0]),h=h&&g.height<=0,f[0]=g.height,l?m[0]=o[0]:m[0]=0;for(var v=1,y=1;y<a;++y){var C=r[y],w=i.cartesianToCartographic(C,d);u&&(w.height=n[y]),h=h&&w.height<=0,s(g,w)?g.height<w.height&&(f[v-1]=w.height):(p[v]=C,f[v]=w.height,l?m[v]=o[y]:m[v]=0,e.clone(w,g),++v)}if(!(h||v<2))return p.length=v,f.length=v,m.length=v,{positions:p,topHeights:f,bottomHeights:m}}}var u={},c=new e,d=new e,h=new Array(2),p=new Array(2),f={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return u.computePositions=function(e,s,u,c,d,m){var _=l(e,s,u,c);if(t(_)){if(s=_.positions,u=_.topHeights,c=_.bottomHeights,s.length>=3){var g=i.fromPoints(s,e),v=g.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,C,w=s.length,S=w-2,E=r.chordLength(d,e.maximumRadius),b=f;if(b.minDistance=E,b.ellipsoid=e,m){var T,x=0;for(T=0;T<w-1;T++)x+=o.numberOfPoints(s[T],s[T+1],E)+1;y=new Float64Array(3*x),C=new Float64Array(3*x);var A=h,P=p;b.positions=A,b.height=P;var D=0;for(T=0;T<w-1;T++){A[0]=s[T],A[1]=s[T+1],P[0]=u[T],P[1]=u[T+1];var M=o.generateArc(b);y.set(M,D),P[0]=c[T],P[1]=c[T+1],C.set(o.generateArc(b),D),D+=M.length}}else b.positions=s,b.height=u,y=new Float64Array(o.generateArc(b)),b.height=c,C=new Float64Array(o.generateArc(b));return{bottomPositions:C,topPositions:y,numCorners:S}}},u}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.vertexFormat,p.DEFAULT),u=r(e.granularity,d.RADIANS_PER_DEGREE),c=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var h=1+i.length*t.packedLength+2;n(s)&&(h+=s.length),n(o)&&(h+=o.length),this.packedLength=h+a.packedLength+p.packedLength+1}var _=new t,g=new t,v=new t,y=new t,C=new t,w=new t,S=new t,E=new t;m.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,i[o++]=u,n(d))for(s=0;s<u;++s)i[o++]=d[s];return a.pack(e._ellipsoid,i,o),o+=a.packedLength,p.pack(e._vertexFormat,i,o),o+=p.packedLength,i[o]=e._granularity,i};var b=a.clone(a.UNIT_SPHERE),T=new p,x={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:b,vertexFormat:T,granularity:void 0};return m.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;s<l;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[i++];l=e[i++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[i++];var h=a.unpack(e,i,b);i+=a.packedLength;var f=p.unpack(e,i,T);i+=p.packedLength;var _=e[i];
return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._vertexFormat=p.clone(f,o._vertexFormat),o._granularity=_,o):(x.positions=u,x.minimumHeights=c,x.maximumHeights=d,x.granularity=_,new m(x))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(i[d]=s)}var h={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new m(h)},m.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,p=r._maximumHeights,m=r._vertexFormat,b=r._granularity,T=r._ellipsoid,x=f.computePositions(T,o,p,a,b,!0);if(n(x)){var A=x.bottomPositions,P=x.topPositions,D=x.numCorners,M=P.length,I=2*M,R=m.position?new Float64Array(I):void 0,O=m.normal?new Float32Array(I):void 0,N=m.tangent?new Float32Array(I):void 0,L=m.bitangent?new Float32Array(I):void 0,B=m.st?new Float32Array(I/3*2):void 0,F=0,k=0,V=0,z=0,U=0,G=E,H=S,W=w,q=!0;M/=3;var j,Y=0,X=1/(M-o.length+1);for(j=0;j<M;++j){var Z=3*j,K=t.fromArray(P,Z,_),Q=t.fromArray(A,Z,g);if(m.position&&(R[F++]=Q.x,R[F++]=Q.y,R[F++]=Q.z,R[F++]=K.x,R[F++]=K.y,R[F++]=K.z),m.st&&(B[U++]=Y,B[U++]=0,B[U++]=Y,B[U++]=1),m.normal||m.tangent||m.bitangent){var J,$=t.clone(t.ZERO,C),ee=T.scaleToGeodeticSurface(t.fromArray(P,Z,g),g);if(j+1<M&&(J=T.scaleToGeodeticSurface(t.fromArray(P,Z+3,v),v),$=t.fromArray(P,Z+3,C)),q){var te=t.subtract($,K,y),ie=t.subtract(ee,K,_);G=t.normalize(t.cross(ie,te,G),G),q=!1}t.equalsEpsilon(J,ee,d.EPSILON10)?q=!0:(Y+=X,m.tangent&&(H=t.normalize(t.subtract(J,ee,H),H)),m.bitangent&&(W=t.normalize(t.cross(G,H,W),W))),m.normal&&(O[k++]=G.x,O[k++]=G.y,O[k++]=G.z,O[k++]=G.x,O[k++]=G.y,O[k++]=G.z),m.tangent&&(N[z++]=H.x,N[z++]=H.y,N[z++]=H.z,N[z++]=H.x,N[z++]=H.y,N[z++]=H.z),m.bitangent&&(L[V++]=W.x,L[V++]=W.y,L[V++]=W.z,L[V++]=W.x,L[V++]=W.y,L[V++]=W.z)}}var re=new u;m.position&&(re.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:R})),m.normal&&(re.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),m.tangent&&(re.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),m.bitangent&&(re.bitangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(re.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:B}));var ne=I/3;I-=6*(D+1);var oe=c.createTypedArray(ne,I),ae=0;for(j=0;j<ne-2;j+=2){var se=j,le=j+2,ue=t.fromArray(R,3*se,_),ce=t.fromArray(R,3*le,g);if(!t.equalsEpsilon(ue,ce,d.EPSILON10)){var de=j+1,he=j+3;oe[ae++]=de,oe[ae++]=se,oe[ae++]=he,oe[ae++]=he,oe[ae++]=se,oe[ae++]=le}}return new s({attributes:re,indices:oe,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(R)})}},m}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.granularity,d.RADIANS_PER_DEGREE),u=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+i.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var m=new t,_=new t;f.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,i[o++]=u,n(d))for(s=0;s<u;++s)i[o++]=d[s];return a.pack(e._ellipsoid,i,o),o+=a.packedLength,i[o]=e._granularity,i};var g=a.clone(a.UNIT_SPHERE),v={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:g,granularity:void 0};return f.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;s<l;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[i++];l=e[i++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[i++];var h=a.unpack(e,i,g);i+=a.packedLength;var p=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._granularity=p,o):(v.positions=u,v.minimumHeights=c,v.maximumHeights=d,v.granularity=p,new f(v))},f.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(i[d]=s)}var h={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid};return new f(h)},f.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,f=r._maximumHeights,g=r._granularity,v=r._ellipsoid,y=p.computePositions(v,o,f,a,g,!1);if(n(y)){var C=y.bottomPositions,w=y.topPositions,S=w.length,E=2*S,b=new Float64Array(E),T=0;S/=3;var x;for(x=0;x<S;++x){var A=3*x,P=t.fromArray(w,A,m),D=t.fromArray(C,A,_);b[T++]=D.x,b[T++]=D.y,b[T++]=D.z,b[T++]=P.x,b[T++]=P.y,b[T++]=P.z}var M=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:b})}),I=E/3;E=2*I-4+I;var R=c.createTypedArray(I,E),O=0;for(x=0;x<I-2;x+=2){var N=x,L=x+2,B=t.fromArray(b,3*N,m),F=t.fromArray(b,3*L,_);if(!t.equalsEpsilon(B,F,d.EPSILON10)){var k=x+1,V=x+3;R[O++]=k,R[O++]=N,R[O++]=k,R[O++]=V,R[O++]=N,R[O++]=L}}return R[O++]=I-2,R[O++]=I-1,new s({attributes:M,indices:R,primitiveType:h.LINES,boundingSphere:new e.fromVertices(b)})}},f}),define("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,i,r,n,o,a){"use strict";function s(r){if(r=t(r,{}),this._ellipsoid=t(r.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(r.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(r.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),i(r.rectangleSouthwestInMeters)&&i(r.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=r.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=r.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var r=this._projection,n=r.project(o.southwest(e)),a=r.project(o.northeast(e));return i(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,r,n){var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,h=this._rectangleNortheastInMeters.y-t*d,p=this._rectangleNortheastInMeters.y-(t+1)*d;return i(n)?(n.west=u,n.south=p,n.east=c,n.north=h,n):new o(u,p,c,h)},s.prototype.tileXYToRectangle=function(t,i,r,n){var o=this.tileXYToNativeRectangle(t,i,r,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,r,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(r),l=this.getNumberOfYTilesAtLevel(r),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,d=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,h=d/l,p=this._projection,f=p.project(t),m=f.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-f.y,g=m/c|0;g>=s&&(g=s-1);var v=_/h|0;return v>=l&&(v=l-1),i(n)?(n.x=g,n.y=v,n):new e(g,v)}},s}),define("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),define("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,i){"use strict";function r(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new i,this.setValue(e)}return t(r.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),r.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},r.prototype.setValue=function(t){var i=this._value;if(i!==t){var r=e(t),n=r&&"function"==typeof t.clone,o=r&&"function"==typeof t.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!t.equals(i);a&&(this._value=n?t.clone():t,this._definitionChanged.raiseEvent(this))}},r.prototype.equals=function(e){return this===e||e instanceof r&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},r.prototype.valueOf=function(){return this._value},r.prototype.toString=function(){return String(this._value)},r}),define("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=void 0!==n;!l||t(n)&&t(n.getValue)||!t(o)||(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),define("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition)},a}),define("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),define("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),define("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),define("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),define("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i,r){"use strict";function n(){r.throwInstantiationError()}return i(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.equals=function(e,i){return e===i||t(e)&&e.equals(i)},n.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!n.equals(e[o],i[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,i,r){return t(e)?e.getValue(i,r):void 0},n.getValueOrDefault=function(i,r,n,o){return t(i)?e(i.getValue(r,o),n):n},n.getValueOrClonedDefault=function(e,i,r,n){var o;return t(e)&&(o=e.getValue(i,n)),t(o)||(o=r.clone(o)),o},n}),define("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function _(t,i){i.collectionChanged.addEventListener(_.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function g(e,t,i){o(e)&&(e.billboard=void 0,i.removeBillboard(t))}var v=n.WHITE,y=r.ZERO,C=c.NONE,w=i.ZERO,S=1,E=0,b=r.ZERO,T=d.CENTER,x=h.CENTER,A=!1,P=new r,D=new n,M=new r,I=new i,R=new u,O=new u,N=new u,L=new t,B=new l;return _.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,s=t[r],l=s.entity,u=l._billboard,c=s.billboard,d=l.isShowing&&l.isAvailable(e)&&f.getValueOrDefault(u._show,e,!0);if(d&&(P=f.getValueOrUndefined(l._position,e,P),a=f.getValueOrUndefined(u._image,e),d=o(P)&&o(a)),d){f.isConstant(l._position)||(i._clusterDirty=!0),o(c)||(c=i.getBillboard(l),c.id=l,c.image=void 0,s.billboard=c),c.show=d,o(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=P,c.color=f.getValueOrDefault(u._color,e,v,D),c.eyeOffset=f.getValueOrDefault(u._eyeOffset,e,y,M),c.heightReference=f.getValueOrDefault(u._heightReference,e,C),c.pixelOffset=f.getValueOrDefault(u._pixelOffset,e,w,I),c.scale=f.getValueOrDefault(u._scale,e,S),c.rotation=f.getValueOrDefault(u._rotation,e,E),c.alignedAxis=f.getValueOrDefault(u._alignedAxis,e,b),c.horizontalOrigin=f.getValueOrDefault(u._horizontalOrigin,e,T),c.verticalOrigin=f.getValueOrDefault(u._verticalOrigin,e,x),c.width=f.getValueOrUndefined(u._width,e),c.height=f.getValueOrUndefined(u._height,e),c.scaleByDistance=f.getValueOrUndefined(u._scaleByDistance,e,R),c.translucencyByDistance=f.getValueOrUndefined(u._translucencyByDistance,e,O),c.pixelOffsetScaleByDistance=f.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,N),c.sizeInMeters=f.getValueOrDefault(u._sizeInMeters,A),c.distanceDisplayCondition=f.getValueOrUndefined(u._distanceDisplayCondition,e,B);var h=f.getValueOrUndefined(u._imageSubRegion,e,L);o(h)&&c.setImageSubRegion(c._imageId,h)}else g(s,l,i)}return!0},_.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!o(i)||!o(i.billboard))return p.FAILED;var n=i.billboard;if(n.heightReference===c.NONE)t.center=r.clone(n.position,t.center);else{if(!o(n._clampedPosition))return p.PENDING;t.center=r.clone(n._clampedPosition,t.center)}return t.radius=0,p.DONE},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return a(this)},_.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new m(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new m(a)):(g(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],g(s.get(a.id),a,l),s.remove(a.id)},_}),define("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("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"}),define("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("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"}),define("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),define("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),define("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),define("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),define("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),define("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),define("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),define("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),define("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),define("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),define("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR;
}};return e(i)}),define("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),define("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),define("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){function r(e,t){t.arrayBufferView?v.texImage2D(e,0,f,p,p,0,f,m,t.arrayBufferView):v.texImage2D(e,0,f,f,m,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var h=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=h[0].width,o=h[0].height}else n=i.width,o=i.height;var p=n,f=e(i.pixelFormat,a.RGBA),m=e(i.pixelDatatype,c.UNSIGNED_BYTE),_=i.preMultiplyAlpha||f===a.RGB||f===a.LUMINANCE,g=e(i.flipY,!0),v=s._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),t(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,f,p,p,0,f,m,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=f,this._pixelDatatype=m,this._size=p,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this._positiveX=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,f,m,p,_,g),this._negativeX=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,f,m,p,_,g),this._positiveY=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,f,m,p,_,g),this._negativeY=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,f,m,p,_,g),this._positiveZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,f,m,p,_,g),this._negativeZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,f,m,p,_,g),this.sampler=t(i.sampler)?i.sampler:new d}return i(f.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=h.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),f.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},f}),define("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,o=r.width,a=r.height,u=r.source;i(u)&&(i(o)||(o=t(u.videoWidth,u.width)),i(a)||(a=t(u.videoHeight,u.height)));var c=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,d.UNSIGNED_BYTE),f=c,m=s.isCompressedFormat(f);n.webgl2&&(c===s.DEPTH_STENCIL?f=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===d.UNSIGNED_SHORT?f=l.DEPTH_COMPONENT16:p===d.UNSIGNED_INT&&(f=l.DEPTH_COMPONENT24)));var _=r.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,g=t(r.flipY,!0),v=n._gl,y=v.TEXTURE_2D,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),i(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),i(u.arrayBufferView)?m?v.compressedTexImage2D(y,0,f,o,a,0,u.arrayBufferView):v.texImage2D(y,0,f,o,a,0,c,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),v.copyTexImage2D(y,0,f,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):v.texImage2D(y,0,f,c,p,u)):v.texImage2D(y,0,f,o,a,0,c,p,null),v.bindTexture(y,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new h}return m.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),d=e.framebuffer,h=new m({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(d)?d:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return h},r(m.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===f.NEAREST_MIPMAP_NEAREST||t===f.NEAREST_MIPMAP_LINEAR||t===f.LINEAR_MIPMAP_NEAREST||t===f.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===d.FLOAT&&(t=n?f.NEAREST_MIPMAP_NEAREST:f.NEAREST,r=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),m.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},m.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},m.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},m}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\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;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\n#else\nfloat base = 0.99;\n#endif\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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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/loadCRN","../Core/loadImage","../Core/loadKTX","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I){"use strict";function R(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,O(e,this),s(this,{type:{value:this.type,writable:!1}}),a(R._uniformList[this.type])||(R._uniformList[this.type]=Object.keys(this._uniforms))}function O(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=R._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}F(i),a(l)||R._materialCache.addMaterial(i.type,i),k(i),U(i),W(i);var c=0===i._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var d=function(){return s(i)};i._translucentFunctions.push(d)}else i._translucentFunctions.push(s)}function N(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(r&&!o||!r&&o)&&i(n,t)}}function L(e,t){}function B(e,t){}function F(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;N(t,Y,L,!0),N(n,X,L,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);N(i,o,B,!1)}function k(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function V(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new v({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof v&&o!==c){i._texturePaths[e]=void 0;var f=i._textures[e];return f!==i._defaultTexture&&f.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}if(a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==R.DefaultImageId&&o!==i._texturePaths[e]){if("string"==typeof o){var m;m=K.test(o)?p(o):Q.test(o)?d(o):h(o),I(m,function(t){i._loadedImages.push({id:e,image:t})})}else o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o});i._texturePaths[e]=o}}}}function z(e){return function(t,i){var r=t.uniforms[e];if(r instanceof g){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==R.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];I.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function U(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&G(e,i)}function G(e,t){var i,r=(e._strict,e._template.uniforms),n=r[t],o=H(n);if("channels"===o)i=q(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";j(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},G(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(i=q(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(z(t));else if(o.indexOf("mat")!==-1){var c=new Z[o];e._uniforms[u]=function(){return Z[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function H(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===R.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function W(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new R({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;q(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";q(e,n,l)}}function q(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function j(e,t,i){return q(e,t,t,i)}R._uniformList={},R.fromType=function(e,t){var i=new R({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},R.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r<i;++r){var n=t[r];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},R.prototype.update=function(e){var t,i,r=this._loadedImages,n=r.length;for(t=0;t<n;++t){var o=r[t];i=o.id;var s,l=o.image;s=new v(a(l.internalFormat)?{context:e,pixelFormat:l.internalFormat,width:l.width,height:l.height,source:{arrayBufferView:l.bufferView}}:{context:e,source:l}),this._textures[i]=s;var u=i+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}r.length=0;var d=this._loadedCubeMaps;for(n=d.length,t=0;t<n;++t){var h=d[t];i=h.id;var p=h.images,f=new g({context:e,source:{positiveX:p[0],negativeX:p[1],positiveY:p[2],negativeY:p[3],positiveZ:p[4],negativeZ:p[5]}});this._textures[i]=f}d.length=0;var m=this._updateFunctions;for(n=m.length,t=0;t<n;++t)m[t](this,e);var _=this.materials;for(var y in _)_.hasOwnProperty(y)&&_[y].update(e)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];i!==this._defaultTexture&&i.destroy()}var r=this.materials;for(var n in r)r.hasOwnProperty(n)&&r[n].destroy();return l(this)};var Y=["type","materials","uniforms","components","source"],X=["diffuse","specular","shininess","normal","emission","alpha"],Z={mat2:f,mat3:m,mat4:_},K=/\.ktx$/i,Q=/\.crn$/i;return R._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},R.DefaultImageId="czm_defaultImage",R.DefaultCubeMapId="czm_defaultCubeMap",R.ColorType="Color",R._materialCache.addMaterial(R.ColorType,{fabric:{type:R.ColorType,uniforms:{color:new i(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),R.ImageType="Image",R._materialCache.addMaterial(R.ImageType,{fabric:{type:R.ImageType,uniforms:{image:R.DefaultImageId,repeat:new e(1,1),color:new i(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),R.DiffuseMapType="DiffuseMap",R._materialCache.addMaterial(R.DiffuseMapType,{fabric:{type:R.DiffuseMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),R.AlphaMapType="AlphaMap",R._materialCache.addMaterial(R.AlphaMapType,{fabric:{type:R.AlphaMapType,uniforms:{image:R.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),R.SpecularMapType="SpecularMap",R._materialCache.addMaterial(R.SpecularMapType,{fabric:{type:R.SpecularMapType,uniforms:{image:R.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),R.EmissionMapType="EmissionMap",R._materialCache.addMaterial(R.EmissionMapType,{fabric:{type:R.EmissionMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),R.BumpMapType="BumpMap",R._materialCache.addMaterial(R.BumpMapType,{fabric:{type:R.BumpMapType,uniforms:{image:R.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)
},source:y},translucent:!1}),R.NormalMapType="NormalMap",R._materialCache.addMaterial(R.NormalMapType,{fabric:{type:R.NormalMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:b},translucent:!1}),R.GridType="Grid",R._materialCache.addMaterial(R.GridType,{fabric:{type:R.GridType,uniforms:{color:new i(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:E},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),R.StripeType="Stripe",R._materialCache.addMaterial(R.StripeType,{fabric:{type:R.StripeType,uniforms:{horizontal:!0,evenColor:new i(1,1,1,.5),oddColor:new i(0,0,1,.5),offset:0,repeat:5},source:D},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),R.CheckerboardType="Checkerboard",R._materialCache.addMaterial(R.CheckerboardType,{fabric:{type:R.CheckerboardType,uniforms:{lightColor:new i(1,1,1,.5),darkColor:new i(0,0,0,.5),repeat:new e(5,5)},source:C},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),R.DotType="Dot",R._materialCache.addMaterial(R.DotType,{fabric:{type:R.DotType,uniforms:{lightColor:new i(1,1,0,.75),darkColor:new i(0,1,1,.75),repeat:new e(5,5)},source:w},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),R.WaterType="Water",R._materialCache.addMaterial(R.WaterType,{fabric:{type:R.WaterType,uniforms:{baseWaterColor:new i(.2,.3,.6,1),blendColor:new i(0,1,.699,1),specularMap:R.DefaultImageId,normalMap:R.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:M},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),R.RimLightingType="RimLighting",R._materialCache.addMaterial(R.RimLightingType,{fabric:{type:R.RimLightingType,uniforms:{color:new i(1,0,0,.7),rimColor:new i(1,1,1,.4),width:.3},source:P},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),R.FadeType="Fade",R._materialCache.addMaterial(R.FadeType,{fabric:{type:R.FadeType,uniforms:{fadeInColor:new i(1,0,0,1),fadeOutColor:new i(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:S},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),R.PolylineArrowType="PolylineArrow",R._materialCache.addMaterial(R.PolylineArrowType,{fabric:{type:R.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:T},translucent:!0}),R.PolylineGlowType="PolylineGlow",R._materialCache.addMaterial(R.PolylineGlowType,{fabric:{type:R.PolylineGlowType,uniforms:{color:new i(0,.5,1,1),glowPower:.25},source:x},translucent:!0}),R.PolylineOutlineType="PolylineOutline",R._materialCache.addMaterial(R.PolylineOutlineType,{fabric:{type:R.PolylineOutlineType,uniforms:{color:new i(1,1,1,1),outlineColor:new i(1,0,0,1),outlineWidth:1},source:A},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),R}),define("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=e(i.closed,!1),o=e(i.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(i.material)?i.material:h.fromType(h.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(i.fragmentShaderSource,o.fragmentShaderSource),this._renderState=d.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,!n)}return i(p.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),p.prototype.getFragmentShaderSource=d.prototype.getFragmentShaderSource,p.prototype.isTranslucent=d.prototype.isTranslucent,p.prototype.getRenderState=d.prototype.getRenderState,p.MaterialSupport={BASIC:r({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:r({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),define("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"}),define("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),d=c?a:n,h=c?o:r,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,d),this._fragmentShaderSource=e(t.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(i,u,t.renderState),this._closed=u,this._vertexFormat=p,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=i.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=i.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),define("Renderer/BufferUsage",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===i.STREAM_DRAW||e===i.STATIC_DRAW||e===i.DYNAMIC_DRAW}};return e(i)}),define("Renderer/DrawCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/PrimitiveType"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._cull=e(t.cull,!0),this._modelMatrix=t.modelMatrix,this._primitiveType=e(t.primitiveType,r.TRIANGLES),this._vertexArray=t.vertexArray,this._count=t.count,this._offset=e(t.offset,0),this._instanceCount=e(t.instanceCount,0),this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._executeInClosestFrustum=e(t.executeInClosestFrustum,!1),this._owner=t.owner,this._debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=e(t.castShadows,!1),this._receiveShadows=e(t.receiveShadows,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}return i(n.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=e,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}}}),n.shallowClone=function(e,i){if(t(e))return t(i)||(i=new n),i._boundingVolume=e._boundingVolume,i._orientedBoundingBox=e._orientedBoundingBox,i._cull=e._cull,i._modelMatrix=e._modelMatrix,i._primitiveType=e._primitiveType,i._vertexArray=e._vertexArray,i._count=e._count,i._offset=e._offset,i._instanceCount=e._instanceCount,i._shaderProgram=e._shaderProgram,i._uniformMap=e._uniformMap,i._renderState=e._renderState,i._framebuffer=e._framebuffer,i._pass=e._pass,i._executeInClosestFrustum=e._executeInClosestFrustum,i._owner=e._owner,i._debugShowBoundingVolume=e._debugShowBoundingVolume,i._debugOverlappingFrustums=e._debugOverlappingFrustums,i._castShadows=e._castShadows,i._receiveShadows=e._receiveShadows,i.dirty=!0,i.lastDirtyTime=0,i},n.prototype.execute=function(e,t){e.draw(this,t)},n}),define("Renderer/Pass",["../Core/freezeObject"],function(e){"use strict";var t={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,GROUND:3,OPAQUE:4,TRANSLUCENT:5,OVERLAY:6,NUMBER_OF_PASSES:7};return e(t)}),define("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits"],function(e,t,i,r,n,o,a,s){"use strict";function l(n){var s=i(n,{}),l=i(s.cull,{}),u=i(s.polygonOffset,{}),c=i(s.scissorTest,{}),d=i(c.rectangle,{}),h=i(s.depthRange,{}),p=i(s.depthTest,{}),f=i(s.colorMask,{}),m=i(s.blending,{}),_=i(m.color,{}),g=i(s.stencilTest,{}),v=i(g.frontOperation,{}),y=i(g.backOperation,{}),C=i(s.sampleCoverage,{}),w=s.viewport;this.frontFace=i(s.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:i(l.enabled,!1),face:i(l.face,o.BACK)},this.lineWidth=i(s.lineWidth,1),this.polygonOffset={enabled:i(u.enabled,!1),factor:i(u.factor,0),units:i(u.units,0)},this.scissorTest={enabled:i(c.enabled,!1),rectangle:e.clone(d)},this.depthRange={near:i(h.near,0),far:i(h.far,1)},this.depthTest={enabled:i(p.enabled,!1),func:i(p.func,o.LESS)},this.colorMask={red:i(f.red,!0),green:i(f.green,!0),blue:i(f.blue,!0),alpha:i(f.alpha,!0)},this.depthMask=i(s.depthMask,!0),this.stencilMask=i(s.stencilMask,-1),this.blending={enabled:i(m.enabled,!1),color:new t(i(_.red,0),i(_.green,0),i(_.blue,0),i(_.alpha,0)),equationRgb:i(m.equationRgb,o.FUNC_ADD),equationAlpha:i(m.equationAlpha,o.FUNC_ADD),functionSourceRgb:i(m.functionSourceRgb,o.ONE),functionSourceAlpha:i(m.functionSourceAlpha,o.ONE),functionDestinationRgb:i(m.functionDestinationRgb,o.ZERO),functionDestinationAlpha:i(m.functionDestinationAlpha,o.ZERO)},this.stencilTest={enabled:i(g.enabled,!1),frontFunction:i(g.frontFunction,o.ALWAYS),backFunction:i(g.backFunction,o.ALWAYS),reference:i(g.reference,0),mask:i(g.mask,-1),frontOperation:{fail:i(v.fail,o.KEEP),zFail:i(v.zFail,o.KEEP),zPass:i(v.zPass,o.KEEP)},backOperation:{fail:i(y.fail,o.KEEP),zFail:i(y.zFail,o.KEEP),zPass:i(y.zPass,o.KEEP)}},this.sampleCoverage={enabled:i(C.enabled,!1),value:i(C.value,1),invert:i(C.invert,!1)},this.viewport=r(w)?new e(w.x,w.y,w.width,w.height):void 0,this.id=0,this._applyFunctions=[]}function u(e,t,i){i?e.enable(t):e.disable(t)}function c(e,t){e.frontFace(t.frontFace)}function d(e,t){var i=t.cull,r=i.enabled;u(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function h(e,t){e.lineWidth(t.lineWidth)}function p(e,t){var i=t.polygonOffset,r=i.enabled;u(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function f(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(u(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function m(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function _(e,t){var i=t.depthTest,r=i.enabled;u(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function g(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function v(e,t){e.depthMask(t.depthMask)}function y(e,t){e.stencilMask(t.stencilMask)}function C(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function w(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;u(e,e.BLEND,o),o&&(C(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function S(e,t){var i=t.stencilTest,r=i.enabled;if(u(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,c=l.fail,d=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,c,d,h);var p=i.backOperation,f=p.fail,m=p.zFail,_=p.zPass;e.stencilOpSeparate(e.BACK,f,m,_)}}function E(e,t){var i=t.sampleCoverage,r=i.enabled;u(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function b(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=P,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function T(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(c),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||i.push(d),e.lineWidth!==t.lineWidth&&i.push(h),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||i.push(p),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||i.push(m),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||i.push(_),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||i.push(g),e.depthMask!==t.depthMask&&i.push(v),e.stencilMask!==t.stencilMask&&i.push(y),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||i.push(S),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||i.push(E),i}var x=0,A={};l.fromCache=function(e){var t=JSON.stringify(e),i=A[t];if(r(i))return++i.referenceCount,i.state;var n=new l(e),o=JSON.stringify(n);return i=A[o],r(i)||(n.id=x++,i={referenceCount:0,state:n},A[o]=i),++i.referenceCount,A[t]={referenceCount:1,state:i.state},i.state},l.removeFromCache=function(e){var t=new l(e),i=JSON.stringify(t),n=A[i],o=JSON.stringify(e),a=A[o];r(a)&&(--a.referenceCount,0===a.referenceCount&&(delete A[o],r(n)&&--n.referenceCount)),r(n)&&0===n.referenceCount&&delete A[i]},l.getCache=function(){return A},l.clearCache=function(){A={}};var P=new e;return l.apply=function(e,t,i){c(e,t),d(e,t),h(e,t),p(e,t),m(e,t),_(e,t),g(e,t),v(e,t),y(e,t),S(e,t),E(e,t),f(e,t,i),w(e,t,i),b(e,t,i)},l.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=T(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,i)}var c=r(n.scissorTest)?n.scissorTest:t.scissorTest,d=r(o.scissorTest)?o.scissorTest:i.scissorTest;(c!==d||a)&&f(e,i,o);var h=r(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,p=r(o.blendingEnabled)?o.blendingEnabled:i.blending.enabled;(h!==p||p&&t.blending!==i.blending)&&w(e,i,o),t===i&&n===o&&n.context===o.context||b(e,i,o)},l.getState=function(i){return{frontFace:i.frontFace,cull:{enabled:i.cull.enabled,face:i.cull.face},lineWidth:i.lineWidth,polygonOffset:{enabled:i.polygonOffset.enabled,factor:i.polygonOffset.factor,units:i.polygonOffset.units},scissorTest:{enabled:i.scissorTest.enabled,rectangle:e.clone(i.scissorTest.rectangle)},depthRange:{near:i.depthRange.near,far:i.depthRange.far},depthTest:{enabled:i.depthTest.enabled,func:i.depthTest.func},colorMask:{red:i.colorMask.red,green:i.colorMask.green,blue:i.colorMask.blue,alpha:i.colorMask.alpha},depthMask:i.depthMask,stencilMask:i.stencilMask,blending:{enabled:i.blending.enabled,color:t.clone(i.blending.color),equationRgb:i.blending.equationRgb,equationAlpha:i.blending.equationAlpha,functionSourceRgb:i.blending.functionSourceRgb,functionSourceAlpha:i.blending.functionSourceAlpha,functionDestinationRgb:i.blending.functionDestinationRgb,functionDestinationAlpha:i.blending.functionDestinationAlpha},stencilTest:{enabled:i.stencilTest.enabled,frontFunction:i.stencilTest.frontFunction,backFunction:i.stencilTest.backFunction,reference:i.stencilTest.reference,mask:i.stencilTest.mask,frontOperation:{fail:i.stencilTest.frontOperation.fail,zFail:i.stencilTest.frontOperation.zFail,zPass:i.stencilTest.frontOperation.zPass},backOperation:{fail:i.stencilTest.backOperation.fail,zFail:i.stencilTest.backOperation.zFail,zPass:i.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:i.sampleCoverage.enabled,value:i.sampleCoverage.value,invert:i.sampleCoverage.invert},viewport:r(i.viewport)?e.clone(i.viewport):void 0}},l}),define("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,i){"use strict";function r(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};o[i.FLOAT]="float",o[i.FLOAT_VEC2]="vec2",o[i.FLOAT_VEC3]="vec3",o[i.FLOAT_VEC4]="vec4",o[i.INT]="int",o[i.INT_VEC2]="ivec2",o[i.INT_VEC3]="ivec3",o[i.INT_VEC4]="ivec4",o[i.BOOL]="bool",o[i.BOOL_VEC2]="bvec2",o[i.BOOL_VEC3]="bvec3",o[i.BOOL_VEC4]="bvec4",o[i.FLOAT_MAT2]="mat2",o[i.FLOAT_MAT3]="mat3",o[i.FLOAT_MAT4]="mat4",o[i.SAMPLER_2D]="sampler2D",o[i.SAMPLER_CUBE]="samplerCube",r.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"};var a={czm_viewport:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new r({size:1,datatype:i.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_temeToPseudoFixed:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}})};return a}),define("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new d(e,t,i,r);case e.FLOAT_VEC2:return new h(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new f(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,i,r);case e.INT:case e.BOOL:return new _(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new w(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function d(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function h(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function f(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function m(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function _(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function g(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function v(e,i,r,n){this.name=r,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,r,n){this.name=r,this.value=void 0,this._value=new i,this._gl=e,this._location=n}function C(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=r}function w(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=r}function S(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=r}return d.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))},p.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):n(e.x)&&(t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},f.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},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},_.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},g.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},v.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;i.equals(e,this._value)||(i.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},C.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),
this._gl.uniformMatrix2fv(this._location,!1,this._value))},w.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},S.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),define("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new d(e,t,i,r);case e.FLOAT_VEC2:return new h(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new f(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,i,r);case e.INT:case e.BOOL:return new _(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new w(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function d(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function h(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function p(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function f(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function m(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function _(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function g(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function v(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function y(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function C(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function w(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function S(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}return d.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},h.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,r)},p.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,o=!1,a=0,s=0;s<i;++s){var l=e[s];n(l.red)?l.red===r[a]&&l.green===r[a+1]&&l.blue===r[a+2]||(r[a]=l.red,r[a+1]=l.green,r[a+2]=l.blue,o=!0):n(l.x)&&(t.equalsArray(l,r,a)||(t.pack(l,r,a),o=!0)),a+=3}o&&this._gl.uniform3fv(this._location,r)},f.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,a=!1,s=0,l=0;l<t;++l){var u=e[l];n(u.red)?r.equalsArray(u,o,s)||(r.pack(u,o,s),a=!0):n(u.x)&&(i.equalsArray(u,o,s)||(i.pack(u,o,s),a=!0)),s+=4}a&&this._gl.uniform4fv(this._location,o)},m.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;n<r;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},m.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;r<i;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},_.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},g.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,r)},v.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=e[a];t.equalsArray(s,r,o)||(t.pack(s,r,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,r)},y.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,n=!1,o=0,a=0;a<t;++a){var s=e[a];i.equalsArray(s,r,o)||(i.pack(s,r,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var s=e[o];a.equalsArray(s,i,n)||(a.pack(s,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},w.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];s.equalsArray(a,i,n)||(s.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},S.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];l.equalsArray(a,i,n)||(l.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)},c}),define("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var t=h(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=y++}function d(e){var i=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(t(r))for(var n=r.length,o=0;o<n;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);i.push(s)}return i}function h(e,t){var i={};if(!s.highpFloatSupported||!s.highpIntSupported){var r,n,o,a,l=d(e),u=d(t),c=l.length,h=u.length;for(r=0;r<c;r++)for(n=0;n<h;n++)if(l[r]===u[n]){o=l[r],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}function p(e,i){var r=i._vertexShaderText,n=i._fragmentShaderText,a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,r),e.compileShader(a);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,a),e.attachShader(l,s),e.deleteShader(a),e.deleteShader(s);var u=i._attributeLocations;if(t(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var d;if(!e.getProgramParameter(l,e.LINK_STATUS)){var h=i._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(s),console.error(C+"Fragment shader compile log: "+d),t(h)){var p=h.getTranslatedShaderSource(s);""!==p?console.error(C+"Translated fragment shader source:\n"+p):console.error(C+"Fragment shader translation failed.")}throw e.deleteProgram(l),new o("Fragment shader failed to compile.  Compile log: "+d)}if(!e.getShaderParameter(a,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(a),console.error(C+"Vertex shader compile log: "+d),t(h)){var f=h.getTranslatedShaderSource(a);""!==f?console.error(C+"Translated vertex shader source:\n"+f):console.error(C+"Vertex shader translation failed.")}throw e.deleteProgram(l),new o("Vertex shader failed to compile.  Compile log: "+d)}throw d=e.getProgramInfoLog(l),console.error(C+"Shader program link log: "+d),t(h)&&(console.error(C+"Translated vertex shader source:\n"+h.getTranslatedShaderSource(a)),console.error(C+"Translated fragment shader source:\n"+h.getTranslatedShaderSource(s))),e.deleteProgram(l),new o("Program failed to link.  Link log: "+d)}var m=i._logShaderCompilation;return m&&(d=e.getShaderInfoLog(a),t(d)&&d.length>0&&console.log(C+"Vertex shader compile log: "+d)),m&&(d=e.getShaderInfoLog(s),t(d)&&d.length>0&&console.log(C+"Fragment shader compile log: "+d)),m&&(d=e.getProgramInfoLog(l),t(d)&&d.length>0&&console.log(C+"Shader program link log: "+d)),l}function f(e,t,i){for(var r={},n=0;n<i;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function m(e,i){for(var r={},n=[],o=[],a=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var c=e.getActiveUniform(i,s),d="[0]",h=c.name.indexOf(d,c.name.length-d.length)!==-1?c.name.slice(0,c.name.length-3):c.name;if(0!==h.indexOf("gl_"))if(c.name.indexOf("[")<0){var p=e.getUniformLocation(i,h);if(null!==p){var f=l(e,c,h,p);r[h]=f,n.push(f),f._setSampler&&o.push(f)}}else{var m,_,g,v,y=h.indexOf("[");if(y>=0){if(m=r[h.slice(0,y)],!t(m))continue;_=m._locations,_.length<=1&&(g=m.value,v=e.getUniformLocation(i,h),null!==v&&(_.push(v),g.push(e.getUniform(i,v))))}else{_=[];for(var C=0;C<c.size;++C)v=e.getUniformLocation(i,h+"["+C+"]"),null!==v&&_.push(v);m=u(e,c,h,_),r[h]=m,n.push(m),m._setSampler&&o.push(m)}}}return{uniformsByName:r,uniforms:n,samplerUniforms:o}}function _(e,i){var r=[],n=[];for(var o in i)if(i.hasOwnProperty(o)){var s=i[o],l=o,u=e._duplicateUniformNames[l];t(u)&&(s.name=u,l=u);var c=a[l];t(c)?r.push({uniform:s,automaticUniform:c}):n.push(s)}return{automaticUniforms:r,manualUniforms:n}}function g(e,t,i){e.useProgram(t);for(var r=0,n=i.length,o=0;o<n;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function v(e){if(!t(e._program)){var i=e._gl,r=p(i,e,e._debugShaders),n=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),o=m(i,r),a=_(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=f(i,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=g(i,r,o.samplerUniforms)}}var y=0;c.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},c.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},i(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return v(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return v(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return v(this),this._uniformsByName}}});var C="[Cesium WebGL] ";return c.prototype._bind=function(){v(this),this._gl.useProgram(this._program)},c.prototype._setUniforms=function(e,i,r){var n,o;if(t(e)){var a=this._manualUniforms;for(n=a.length,o=0;o<n;++o){var s=a[o];s.value=e[s.name]()}}var l=this._automaticUniforms;for(n=l.length,o=0;o<n;++o){var u=l[o];u.uniform.value=u.automaticUniform.getValue(i)}var c=this._uniforms;for(n=c.length,o=0;o<n;++o)c[o].set();if(r){var d=this._gl,h=this._program;d.validateProgram(h)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},c.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),r(this)},c}),define("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),define("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),define("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),define("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),define("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),define("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),define("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),define("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),define("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),define("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),define("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),define("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),define("Shaders/Builtin/Constants/passCompute",[],function(){"use strict";return"const float czm_passCompute = 1.0;\n"}),define("Shaders/Builtin/Constants/passEnvironment",[],function(){"use strict";return"const float czm_passEnvironment = 0.0;\n"}),define("Shaders/Builtin/Constants/passGlobe",[],function(){"use strict";return"const float czm_passGlobe = 2.0;\n"}),define("Shaders/Builtin/Constants/passGround",[],function(){"use strict";return"const float czm_passGround = 3.0;\n"}),define("Shaders/Builtin/Constants/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 4.0;\n"}),define("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 6.0;\n"}),define("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 5.0;\n"}),define("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),define("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),define("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),define("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),define("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),define("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),define("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),define("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),define("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),define("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),define("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),define("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),define("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),define("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),define("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),define("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),define("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"}),define("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"}),define("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),define("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"}),define("Shaders/Builtin/Structs/shadowParameters",[],function(){"use strict";return"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n"}),define("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\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"}),define("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"}),define("Shaders/Builtin/Functions/cascadeColor",[],function(){"use strict";return"vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n"}),define("Shaders/Builtin/Functions/cascadeDistance",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n"}),define("Shaders/Builtin/Functions/cascadeMatrix",[],function(){"use strict";return"uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n"}),define("Shaders/Builtin/Functions/cascadeWeights",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n"}),define("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"}),define("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),define("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"}),define("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),define("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"}),define("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";
}),define("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"}),define("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),define("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"}),define("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),define("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"}),define("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),define("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),define("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),define("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),define("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"}),define("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x  , tangent.y  , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x   , normal.y   , normal.z);\n}\n"}),define("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"}),define("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),define("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"}),define("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),define("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;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn q;\n}\n"}),define("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"}),define("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:d,czm_passCompute:h,czm_passEnvironment:p,czm_passGlobe:f,czm_passGround:m,czm_passOpaque:_,czm_passOverlay:g,czm_passTranslucent:v,czm_pi:y,czm_piOverFour:C,czm_piOverSix:w,czm_piOverThree:S,czm_piOverTwo:E,czm_radiansPerDegree:b,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:A,czm_sceneModeMorphing:P,czm_solarRadius:D,czm_threePiOver2:M,czm_twoPi:I,czm_webMercatorMaxLatitude:R,czm_depthRangeStruct:O,czm_ellipsoid:N,czm_material:L,czm_materialInput:B,czm_ray:F,czm_raySegment:k,czm_shadowParameters:V,czm_alphaWeight:z,czm_antialias:U,czm_cascadeColor:G,czm_cascadeDistance:H,czm_cascadeMatrix:W,czm_cascadeWeights:q,czm_columbusViewMorph:j,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Z,czm_eastNorthUpToEyeCoordinates:K,czm_ellipsoidContainsPoint:Q,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:ie,czm_fog:re,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_hue:ce,czm_isEmpty:de,czm_isFull:he,czm_latitudeToWebMercatorFraction:pe,czm_luminance:fe,czm_metersPerPixel:me,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ge,czm_nearFarScalar:ve,czm_octDecode:ye,czm_packDepth:Ce,czm_phong:we,czm_pointAlongRay:Se,czm_rayEllipsoidIntersectionInterval:Ee,czm_RGBToXYZ:be,czm_saturation:Te,czm_shadowDepthCompare:xe,czm_shadowVisibility:Ae,czm_signNotZero:Pe,czm_tangentToEyeSpaceMatrix:De,czm_translateRelativeToEye:Me,czm_translucentPhong:Ie,czm_transpose:Re,czm_unpackDepth:Oe,czm_windowToEyeCoordinates:Ne,czm_XYZToRGB:Le}}),define("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r<t;++r)i+="\n";return i})}function a(e,i,r){for(var n,a=0;a<r.length;++a)r[a].name===e&&(n=r[a]);return t(n)||(i=o(i),n={name:e,glslSource:i,dependsOn:[],requiredBy:[],evaluated:!1},r.push(n)),n}function s(e,i){if(!e.evaluated){e.evaluated=!0;var r=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(r)&&null!==r&&(r=r.filter(function(e,t){return r.indexOf(e)===t}),r.forEach(function(t){if(t!==e.name&&d._czmBuiltinsAndUniforms.hasOwnProperty(t)){var r=a(t,d._czmBuiltinsAndUniforms[t],i);e.dependsOn.push(r),r.requiredBy.push(e),s(r,i)}}))}}function l(e){for(var t=[],i=[];e.length>0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o<n.dependsOn.length;++o){var a=n.dependsOn[o],s=a.requiredBy.indexOf(n);a.requiredBy.splice(s,1),0===a.requiredBy.length&&t.push(a)}}for(var l=[],u=0;u<i.length;++u)0!==i[u].requiredBy.length&&l.push(i[u])}function u(e){var t=[],i=a("main",e,t);s(i,t),l(t);for(var r="",n=t.length-1;n>=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,i){var r,n,a="",s=e.sources;if(t(s))for(r=0,n=s.length;r<n;++r)a+="\n#line 0\n"+s[r];a=o(a);var l;a=a.replace(/#version\s+(.*?)\n/gm,function(e,t){return l=t,"\n"}),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var c=e.pickColorQualifier;t(c)&&(a=d.createPickFragmentShaderSource(a,c));var h="";t(l)&&(h="#version "+l),i&&(h+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp float;\n#else\n    precision mediump float;\n#endif\n\n");var p=e.defines;if(t(p))for(r=0,n=p.length;r<n;++r){var f=p[r];0!==f.length&&(h+="#define "+f+"\n")}return e.includeBuiltIns&&(h+=u(a)),h+="\n#line 0\n",h+=a}function d(i){i=e(i,e.EMPTY_OBJECT);var r=i.pickColorQualifier;this.defines=t(i.defines)?i.defines.slice(0):[],this.sources=t(i.sources)?i.sources.slice(0):[],this.pickColorQualifier=r,this.includeBuiltIns=e(i.includeBuiltIns,!0)}d.prototype.clone=function(){return new d({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},d.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},d.prototype.createCombinedVertexShader=function(){return c(this,!1)},d.prototype.createCombinedFragmentShader=function(){return c(this,!0)},d._czmBuiltinsAndUniforms={};for(var h in r)r.hasOwnProperty(h)&&(d._czmBuiltinsAndUniforms[h]=r[h]);for(var p in n)if(n.hasOwnProperty(p)){var f=n[p];"function"==typeof f.getDeclaration&&(d._czmBuiltinsAndUniforms[p]=f.getDeclaration(p))}d.createPickVertexShaderSource=function(e){var t=d.replaceMain(e,"czm_old_main"),i="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    czm_pickColor = pickColor; \n}";return t+"\n"+i},d.createPickFragmentShaderSource=function(e,t){var i=d.replaceMain(e,"czm_old_main"),r=t+" vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    if (gl_FragColor.a == 0.0) { \n       discard; \n    } \n    gl_FragColor = czm_pickColor; \n}";return i+"\n"+r},d.findVarying=function(e,t){for(var i=e.sources,r=t.length,n=0;n<r;++n)for(var o=t[n],a=i.length,s=0;s<a;++s)if(i[s].indexOf(o)!==-1)return o};var m=["v_normalEC","v_normal"];d.findNormalVarying=function(e){return d.findVarying(e,m)};var _=["v_positionEC"];return d.findPositionVarying=function(e){return d.findVarying(e,_)},d}),define("Renderer/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl,n=i.bufferTarget,o=i.typedArray,a=i.sizeInBytes,s=i.usage,l=t(o);l&&(a=o.byteLength);var u=r.createBuffer();r.bindBuffer(n,u),r.bufferData(n,l?o:a,s),r.bindBuffer(n,null),this._gl=r,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return l.createVertexBuffer=function(e){return new l({context:e.context,bufferTarget:a.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},l.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=o.getSizeInBytes(r),s=new l({context:t,bufferTarget:a.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=s.sizeInBytes/n;return i(s,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),s},i(l.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),l.prototype._getBuffer=function(){return this._buffer},l.prototype.copyFromArrayView=function(t,i){i=e(i,0);var r=this._gl,n=this._bufferTarget;r.bindBuffer(n,this._buffer),r.bufferSubData(n,i,t),r.bindBuffer(n,null)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},l}),define("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(r,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0),instanceDivisor:t(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function f(e,t,r){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}i(r)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r._getBuffer())}function m(r){r=t(r,t.EMPTY_OBJECT);var n,o=r.context,a=o._gl,s=r.attributes,l=r.indexBuffer,u=[],c=1,d=!1,h=!1,m=s.length;for(n=0;n<m;++n)p(u,s[n],n,o);for(m=u.length,n=0;n<m;++n){var _=u[n];if(i(_.vertexBuffer)&&0===_.instanceDivisor){var g=_.strideInBytes||_.componentsPerAttribute*e.getSizeInBytes(_.componentDatatype);c=_.vertexBuffer.sizeInBytes/g;break}}for(n=0;n<m;++n)u[n].instanceDivisor>0&&(d=!0),i(u[n].value)&&(h=!0);var v;o.vertexArrayObject&&(v=o.glCreateVertexArray(),o.glBindVertexArray(v),f(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=d,this._hasConstantAttributes=h,this._context=o,this._gl=a,this._vao=v,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function v(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=_(t[a[0]]),r=1;r<l;++r){var c=_(t[a[r]]);if(c!==s)throw new u("Each attribute list must have the same number of vertices.  Attribute "+a[r]+" has a different number of vertices ("+c.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(i,r){return e.getSizeInBytes(t[r].componentDatatype)-e.getSizeInBytes(t[i].componentDatatype)});var d=0,h={};for(r=0;r<l;++r)n=a[r],o=t[n],h[n]=d,d+=g(o);if(d>0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),f=d%p;0!==f&&(d+=p-f);var m=s*d,v=new ArrayBuffer(m),y={};for(r=0;r<l;++r){n=a[r];var C=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,v),index:h[n]/C,strideInComponentType:d/C}}for(r=0;r<s;++r)for(var w=0;w<l;++w){n=a[w],o=t[n];for(var S=o.values,E=y[n],b=E.pointer,T=o.componentsPerAttribute,x=0;x<T;++x)b[E.index+x]=S[r*T+x];E.index+=E.strideInComponentType}return{buffer:v,offsetsInBytes:h,vertexSizeInBytes:d}}}function y(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=h.maximumVertexAttributes;if(i){var s=o.length;for(r=0;r<s;++r){var l=o[r];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(r=0;r<a;++r)n[r]>0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}function C(e,t){for(var r=e._attributes,n=r.length,o=0;o<n;++o){var a=r[o];a.enabled&&i(a.value)&&a.vertexAttrib(t)}}return m.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,h=r.context,p=t(r.geometry,t.EMPTY_OBJECT),f=t(r.bufferUsage,d.DYNAMIC_DRAW),_=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],w=p.attributes;if(g){var S=v(w);if(i(S)){u=c.createVertexBuffer({context:h,typedArray:S.buffer,usage:f});var E=S.offsetsInBytes,b=S.vertexSizeInBytes;for(n in w)w.hasOwnProperty(n)&&i(w[n])&&(o=w[n],i(o.values)?C.push({index:_[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:E[n],strideInBytes:b}):C.push({index:_[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in w)if(w.hasOwnProperty(n)&&i(w[n])){o=w[n];var T=o.componentDatatype;T===e.DOUBLE&&(T=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:h,typedArray:e.createTypedArray(T,o.values),usage:f})),C.push({index:_[n],vertexBuffer:u,value:o.value,componentDatatype:T,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,A=p.indices;return i(A)&&(x=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&h.elementIndexUint?c.createIndexBuffer({
context:h,typedArray:new Uint32Array(A),usage:f,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:h,typedArray:new Uint16Array(A),usage:f,indexDatatype:s.UNSIGNED_SHORT})),new m({context:h,attributes:C,indexBuffer:x})},r(m.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),m.prototype.getAttribute=function(e){return this._attributes[e]},m.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this),this._hasConstantAttributes&&C(this,this._gl)):f(this._gl,this._attributes,this._indexBuffer)},m.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r<e.length;++r){var n=e[r];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var r=e[t].vertexBuffer;i(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy()}var o=this._indexBuffer;return i(o)&&!o.isDestroyed()&&o.vertexArrayDestroyable&&o.destroy(),i(this._vao)&&this._context.glDeleteVertexArray(this._vao),n(this)},m}),define("Scene/BatchTable",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Core/PixelFormat","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(t,r,n){if(this._attributes=r,this._numberOfInstances=n,0!==r.length){var o=y(r),a=t.floatingPointTexture,s=o===p.FLOAT&&!a,l=w(r,s),u=S(l,r,s),c=Math.floor(h.maximumTextureSize/u),d=Math.min(n,c),f=u*d,m=Math.ceil(n/d),_=1/f,g=.5*_,v=1/m,C=.5*v;this._textureDimensions=new e(f,m),this._textureStep=new i(_,g,v,C),this._pixelDatatype=s?p.UNSIGNED_BYTE:o,this._packFloats=s,this._offsets=l,this._stride=u,this._texture=void 0;var E=4*f*m;this._batchValues=o!==p.FLOAT||s?new Uint8Array(E):new Float32Array(E),this._batchValuesDirty=!1}}function y(e){for(var t=!1,i=e.length,r=0;r<i;++r)if(e[r].componentDatatype!==n.UNSIGNED_BYTE){t=!0;break}return t?p.FLOAT:p.UNSIGNED_BYTE}function C(r,n){var o=r[n].componentsPerAttribute;return 2===o?e:3===o?t:4===o?i:Number}function w(e,t){for(var i=new Array(e.length),r=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;i[a]=r,l!==n.UNSIGNED_BYTE&&t?r+=4:++r}return i}function S(e,t,i){var r=e.length,o=e[r-1],a=t[r-1],s=a.componentDatatype;return s!==n.UNSIGNED_BYTE&&i?o+4:o+1}function E(e){var t=e.w/2,i=Math.floor(t),r=2*(t-i);if(i-=U,r=2*r-1,r=-r,i>=U)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*k;return n+=r*e.y*V,n+=r*e.z*z,n*Math.pow(10,i)}function b(e,t,r){var n=i.unpack(e,t,N),o=E(n);n=i.unpack(e,t+4,N);var a=E(n);n=i.unpack(e,t+8,N);var s=E(n);n=i.unpack(e,t+12,N);var l=E(n);return i.fromElements(o,a,s,l,r)}function T(e,t){if(G[0]=e,e=G[0],0===e)return i.clone(i.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(c.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=U);var o=e*L;return t.x=Math.floor(o),o=(o-t.x)*L,t.y=Math.floor(o),o=(o-t.y)*L,t.z=Math.floor(o),t.w=2*(r+U)+n,t}function x(e,t,r){var n=T(e.x,N);i.pack(n,t,r),n=T(e.y,n),i.pack(n,t,r+4),n=T(e.z,n),i.pack(n,t,r+8),n=T(e.w,n),i.pack(n,t,r+12)}function A(e,t){var i=e._textureDimensions;e._texture=new m({context:t,pixelFormat:d.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new f({minificationFilter:g.NEAREST,magnificationFilter:_.NEAREST})})}function P(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function D(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n    float stepX = batchTextureStep.x; \n    float centerX = batchTextureStep.y; \n    float numberOfAttributes = float("+t+"); \n    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n    float stepX = batchTextureStep.x; \n    float centerX = batchTextureStep.y; \n    float stepY = batchTextureStep.z; \n    float centerY = batchTextureStep.w; \n    float numberOfAttributes = float("+t+"); \n    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n    return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function M(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n    value *= 255.0; \n    float temp = value.w / 2.0; \n    float exponent = floor(temp); \n    float sign = (temp - exponent) * 2.0; \n    exponent = exponent - float("+U+"); \n    sign = sign * 2.0 - 1.0; \n    sign = -sign; \n    float unpacked = sign * value.x * float("+k+"); \n    unpacked += sign * value.y * float("+V+"); \n    unpacked += sign * value.z * float("+z+"); \n    return unpacked * pow(10.0, exponent); \n} \n":""}function I(e){return 1===e?"float":"vec"+e}function R(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function O(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=I(o),l=R(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n    vec2 st = computeSt(batchId); \n    st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&r.componentDatatype!==p.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":"    vec4 textureValue = texture2D(batchTexture, st); \n",c+="    "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||r.componentDatatype!==n.UNSIGNED_BYTE||r.normalize?e._pixelDatatype===p.FLOAT&&r.componentDatatype===n.UNSIGNED_BYTE&&r.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+="    return value; \n} \n"}a(v.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var N=new i,L=256,B=65536,F=16777216,k=1/L,V=1/B,z=1/F,U=38;if(u.supportsTypedArrays()){var G=new Float32Array(1),H=new i;v.prototype.getBatchedAttribute=function(e,t,r){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?b(this._batchValues,u,H):i.unpack(this._batchValues,u,H);var c=C(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var W=[void 0,void 0,new e,new t,new i],q=new i;return v.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=W[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=C(this._attributes,t),u=o(l.equals)?l.equals(s,r):s===r;if(!u){var c=q;c.x=o(r.x)?r.x:r,c.y=o(r.y)?r.y:0,c.z=o(r.z)?r.z:0,c.w=o(r.w)?r.w:0;var d=this._offsets[t],h=this._stride,f=4*h*e+4*d;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(c,this._batchValues,f):i.pack(c,this._batchValues,f),this._batchValuesDirty=!0}},v.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||A(this,e.context),P(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return r(t,i)}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=D(this)+"\n",t+=M(this)+"\n";for(var i=e.length,r=0;r<i;++r)t+=O(this,r);return function(e){var i=e.indexOf("void main"),r=e.substring(0,i),n=e.substring(i);return r+"\n"+t+"\n"+n}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),s(this)},v}}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t,r){var n,o=!r,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!h.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)i(e[n].geometry)&&c.transformToWorldCoordinates(e[n]);else h.multiplyTransformation(t,e[0].modelMatrix,t)}function m(e,i){var r=e.attributes,n=r.position,o=n.values.length/n.componentsPerAttribute;r.batchId=new l({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=r.batchId.values,s=0;s<o;++s)a[s]=i}function _(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];i(n.geometry)?m(n.geometry,r):i(n.westHemisphereGeometry)&&i(n.eastHemisphereGeometry)&&(m(n.westHemisphereGeometry,r),m(n.eastHemisphereGeometry,r))}}function g(r){var n,o,a,s=r.instances,l=r.projection,u=r.elementIndexUintSupported,d=r.scene3DOnly,h=r.vertexCacheOptimize,p=r.compressVertices,m=r.modelMatrix,g=s.length;for(n=0;n<g;++n)if(i(s[n].geometry)){a=s[n].geometry.primitiveType;break}if(f(s,m,d),!d)for(n=0;n<g;++n)i(s[n].geometry)&&c.splitLongitude(s[n]);if(_(s),h)for(n=0;n<g;++n){var v=s[n];i(v.geometry)?(c.reorderForPostVertexCache(v.geometry),c.reorderForPreVertexCache(v.geometry)):i(v.westHemisphereGeometry)&&i(v.eastHemisphereGeometry)&&(c.reorderForPostVertexCache(v.westHemisphereGeometry),c.reorderForPreVertexCache(v.westHemisphereGeometry),c.reorderForPostVertexCache(v.eastHemisphereGeometry),c.reorderForPreVertexCache(v.eastHemisphereGeometry))}var y=c.combineInstances(s);for(g=y.length,n=0;n<g;++n){o=y[n];var C,w=o.attributes;if(d)for(C in w)w.hasOwnProperty(C)&&w[C].componentDatatype===t.DOUBLE&&c.encodeAttribute(o,C,C+"3DHigh",C+"3DLow");else for(C in w)if(w.hasOwnProperty(C)&&w[C].componentDatatype===t.DOUBLE){var S=C+"3D",E=C+"2D";c.projectTo2D(o,C,S,E,l),i(o.boundingSphere)&&"position"===C&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),c.encodeAttribute(o,S,S+"High",S+"Low"),c.encodeAttribute(o,E,E+"High",E+"Low")}p&&c.compressVertices(o)}if(!u){var b=[];for(g=y.length,n=0;n<g;++n)o=y[n],b=b.concat(c.fitToUnsignedShortIndices(o));y=b}return y}function v(e,t,r,n){var o,a,s,l=n.length-1;if(l>=0){var u=n[l];o=u.offset+u.count,s=u.index,a=r[s].indices.length}else o=0,s=0,a=r[s].indices.length;for(var c=e.length,d=0;d<c;++d){var h=e[d],p=h[t];if(i(p)){var f=p.indices.length;o+f>a&&(o=0,a=r[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function y(e,t){var i=[];return v(e,"geometry",t,i),v(e,"westHemisphereGeometry",t,i),v(e,"eastHemisphereGeometry",t,i),i}function C(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o)&&i(o.values)&&t.push(o.values.buffer)}i(e.indices)&&t.push(e.indices.buffer)}function w(e,t){for(var i=e.length,r=0;r<i;++r)C(e[r],t)}function S(t){for(var r=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++r,i(a)){var s=a.attributes;r+=6+2*e.packedLength+(i(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&i(s[l])){var u=s[l];r+=5+u.values.length}}}return r}function E(e,t){var i=e.length,r=new Float64Array(1+16*i),n=0;r[n++]=i;for(var o=0;o<i;o++){var a=e[o];h.pack(a.modelMatrix,r,n),n+=h.packedLength}return t.push(r.buffer),r}function b(e){for(var t=e,i=new Array(t[0]),r=0,n=1;n<t.length;){var o=h.unpack(t,n);n+=h.packedLength,i[r++]={modelMatrix:o}}return i}function T(t){var r=t.length,n=1+(e.packedLength+1)*r,o=new Float32Array(n),a=0;o[a++]=r;for(var s=0;s<r;++s){var l=t[s];i(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function x(t){for(var i=new Array(t[0]),r=0,n=1;n<t.length;)1===t[n++]&&(i[r]=e.unpack(t,n)),++r,n+=e.packedLength;return i}if(!o.supportsTypedArrays())return{};var A={};return A.combineGeometry=function(t){var r,n,o=t.instances,a=o.length;a>0&&(r=g(t),r.length>0&&(n=c.createAttributeLocations(r[0])));var s;t.createPickOffsets&&r.length>0&&(s=y(o,r));for(var l=new Array(a),u=new Array(a),d=0;d<a;++d){var h=o[d],p=h.geometry;i(p)&&(l[d]=p.boundingSphere,u[d]=p.boundingSphereCV);var f=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;i(f)&&i(m)&&(i(f.boundingSphere)&&i(m.boundingSphere)&&(l[d]=e.union(f.boundingSphere,m.boundingSphere)),i(f.boundingSphereCV)&&i(m.boundingSphereCV)&&(u[d]=e.union(f.boundingSphereCV,m.boundingSphereCV)))}return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:s,boundingSpheres:l,boundingSpheresCV:u}},A.packCreateGeometryResults=function(t,r){var n=new Float64Array(S(t)),o=[],a={},s=t.length,l=0;n[l++]=s;for(var u=0;u<s;u++){var c=t[u],d=i(c);if(n[l++]=d?1:0,d){n[l++]=c.primitiveType,n[l++]=c.geometryType;var h=i(c.boundingSphere)?1:0;n[l++]=h,h&&e.pack(c.boundingSphere,n,l),l+=e.packedLength;var p=i(c.boundingSphereCV)?1:0;n[l++]=p,p&&e.pack(c.boundingSphereCV,n,l),l+=e.packedLength;var f=c.attributes,m=[];for(var _ in f)f.hasOwnProperty(_)&&i(f[_])&&(m.push(_),i(a[_])||(a[_]=o.length,o.push(_)));n[l++]=m.length;for(var g=0;g<m.length;g++){var v=m[g],y=f[v];n[l++]=a[v],n[l++]=y.componentDatatype,n[l++]=y.componentsPerAttribute,n[l++]=y.normalize?1:0,n[l++]=y.values.length,n.set(y.values,l),l+=y.values.length}var C=i(c.indices)?c.indices.length:0;n[l++]=C,C>0&&(n.set(c.indices,l),l+=C)}}return r.push(n.buffer),{stringTable:o,packedData:n}},A.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),c=0,h=1;h<o.length;){var p=1===o[h++];if(p){var f,m,_=o[h++],g=o[h++],v=1===o[h++];v&&(f=e.unpack(o,h)),h+=e.packedLength;var y=1===o[h++];y&&(m=e.unpack(o,h)),h+=e.packedLength;var C,w,S,E=new u,b=o[h++];for(r=0;r<b;r++){var T=n[o[h++]],x=o[h++];S=o[h++];var A=0!==o[h++];C=o[h++],w=t.createTypedArray(x,C);for(var P=0;P<C;P++)w[P]=o[h++];E[T]=new l({componentDatatype:x,componentsPerAttribute:S,normalize:A,values:w})}var D;if(C=o[h++],C>0){var M=w.length/S;for(D=d.createTypedArray(M,C),r=0;r<C;r++)D[r]=o[h++]}a[c++]=new s({primitiveType:_,geometryType:g,boundingSphere:f,boundingSphereCV:m,indices:D,attributes:E})}else a[c++]=void 0}return a},A.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;n<r;n++)t.push(i[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:E(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},A.unpackCombineGeometryParameters=function(e){for(var t=b(e.packedInstances),i=e.createGeometryResults,r=i.length,o=0,s=0;s<r;s++)for(var l=A.unpackCreateGeometryResults(i[s]),u=l.length,c=0;c<u;c++){var d=l[c],f=t[o];f.geometry=d,++o}var m=n.clone(e.ellipsoid),_=e.isGeographic?new a(m):new p(m);return{instances:t,ellipsoid:m,projection:_,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},A.packCombineGeometryResults=function(e,t){i(e.geometries)&&w(e.geometries,t);var r=T(e.boundingSpheres),n=T(e.boundingSpheresCV);return t.push(r.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:r,boundingSpheresCV:n}},A.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}},A}),define("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)}),define("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),define("Scene/ShadowMode",["../Core/freezeObject"],function(e){"use strict";var t={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4};return t.castShadows=function(e){return e===t.ENABLED||e===t.CAST_ONLY},t.receiveShadows=function(e){return e===t.ENABLED||e===t.RECEIVE_ONLY},t.fromCastReceive=function(e,i){return e&&i?t.ENABLED:e?t.CAST_ONLY:i?t.RECEIVE_ONLY:t.DISABLED},e(t)}),define("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/isArray","../Core/Matrix4","../Core/RuntimeError","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BatchTable","./CullFace","./PrimitivePipeline","./PrimitiveState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k){"use strict";function V(e){e=u(e,u.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=C.clone(u(e.modelMatrix,C.IDENTITY)),this._modelMatrix=new C,this.show=u(e.show,!0),this._vertexCacheOptimize=u(e.vertexCacheOptimize,!1),this._interleave=u(e.interleave,!1),this._releaseGeometryInstances=u(e.releaseGeometryInstances,!0),this._allowPicking=u(e.allowPicking,!0),this._asynchronous=u(e.asynchronous,!0),this._compressVertices=u(e.compressVertices,!0),this.cull=u(e.cull,!0),this.debugShowBoundingVolume=u(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=u(e.shadows,k.DISABLED),this._translucent=void 0,this._state=B.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=R.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}function z(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)){for(var o=n[t],a=!0,s=1;s<i;++s){var l=e[s].attributes[t];if(!c(l)||o.componentDatatype!==l.componentDatatype||o.componentsPerAttribute!==l.componentsPerAttribute||o.normalize!==l.normalize){a=!1;break}}a&&r.push(t)}return r}function U(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,le):3===n?i.unpack(e,0,ue):4===n?r.unpack(e,0,ce):void 0}function G(e,t){var i=e.geometryInstances,r=y(i)?i:[i],n=r.length;if(0!==n){var o,s,d,h=z(r),p=h.length,f=e.allowPicking,m=[],_={},g={},v=r[0],C=v.attributes;for(o=0;o<p;++o)s=h[o],d=C[s],_[s]=o,m.push({functionName:"czm_batchTable_"+s,componentDatatype:d.componentDatatype,componentsPerAttribute:d.componentsPerAttribute,normalize:d.normalize});h.indexOf("distanceDisplayCondition")!==-1&&(m.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:l.FLOAT,componentsPerAttribute:1}),g.center3DHigh=m.length-5,g.center3DLow=m.length-4,g.center2DHigh=m.length-3,g.center2DLow=m.length-2,g.radius=m.length-1),f&&m.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var w=m.length,S=new O(t,m,n);for(o=0;o<n;++o){var E=r[o];C=E.attributes;for(var b=0;b<p;++b){s=h[b],d=C[s];var T=U(d.value),x=_[s];S.setBatchedAttribute(o,x,T)}if(f){var A={primitive:u(E.pickPrimitive,e)};c(E.id)&&(A.id=E.id);var P=t.createPickId(A);e._pickIds.push(P);var D=P.color,M=ce;M.x=a.floatToByte(D.red),M.y=a.floatToByte(D.green),M.z=a.floatToByte(D.blue),M.w=a.floatToByte(D.alpha),S.setBatchedAttribute(o,w-1,M)}}e._batchTable=S,e._batchTableAttributeIndices=_,e._batchTableBoundingSphereAttributeIndices=g}}function H(e){var t;return t=y(e.values)?e.values.slice(0):new e.values.constructor(e.values),new g({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function W(t){var i=t.attributes,r=new v;for(var n in i)i.hasOwnProperty(n)&&c(i[n])&&(r[n]=H(i[n]));var o;if(c(t.indices)){var a=t.indices;o=y(a)?a.slice(0):new a.constructor(a)}return new _({attributes:r,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function q(e,t){return{geometry:t,modelMatrix:C.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function j(e,t){if(!e.compressVertices)return t;var i=t.search(/attribute\s+vec3\s+normal;/g)!==-1,r=t.search(/attribute\s+vec2\s+st;/g)!==-1;if(!i&&!r)return t;var n=t.search(/attribute\s+vec3\s+tangent;/g)!==-1,o=t.search(/attribute\s+vec3\s+bitangent;/g)!==-1,a=r&&i?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(r){c+="vec2 st;\n";var h=a>1?l+".x":l;d+="    st = czm_decompressTextureCoordinates("+h+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",d+="    czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, bitangent);\n"):(i&&(c+="vec3 normal;\n",d+="    normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",d+="    tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 bitangent;\n",d+="    bitangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+bitangent;/g,""),p=M.replaceMain(p,"czm_non_compressed_main");var f="void main() \n{ \n"+d+"    czm_non_compressed_main(); \n}";return[u,c,p,f].join("\n")}function Y(e,t){e.vertexAttributes}function X(e,t){return function(){return e[t]}}function Z(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===B.READY){i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=i.length,l=[],d=[];for(n=0;n<s;++n)r=i[n].geometry,a.push(i[n].id),d.push({moduleName:r._workerName,geometry:r});if(!c(he))for(he=new Array(pe),n=0;n<pe;n++)he[n]=new E("createGeometry",Number.POSITIVE_INFINITY);var h;for(d=S(d,pe),n=0;n<d.length;n++){var p=0,f=d[n],m=f.length;for(o=0;o<m;++o)h=f[o],r=h.geometry,c(r.constructor.pack)&&(h.offset=p,p+=u(r.constructor.packedLength,r.packedLength));var _;if(p>0){var g=new Float64Array(p);for(_=[g.buffer],o=0;o<m;++o)h=f[o],r=h.geometry,c(r.constructor.pack)&&(r.constructor.pack(r,g,h.offset),h.geometry=g)}l.push(he[n].scheduleTask({subTasks:d[n]},_))}e._state=B.CREATING,R.all(l,function(t){e._createGeometryResults=t,e._state=B.CREATED}).otherwise(function(i){se(e,t,B.FAILED,i)})}else if(e._state===B.CREATED){var v=[];i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var w=t.scene3DOnly,b=t.mapProjection,T=fe.scheduleTask(L.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,ellipsoid:b.ellipsoid,projection:b,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:w,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},v),v);e._createGeometryResults=void 0,e._state=B.COMBINING,R(T,function(i){var r=L.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e.modelMatrix=C.clone(r.modelMatrix,e.modelMatrix),e._pickOffsets=r.pickOffsets,e._instanceBoundingSpheres=r.boundingSpheres,e._instanceBoundingSpheresCV=r.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}).otherwise(function(i){se(e,t,B.FAILED,i)})}}function K(e,t){var i,r,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r<o;r++){i=n[r];var u,d=i.geometry;u=c(d.attributes)&&c(d.primitiveType)?W(d):d.constructor.createGeometry(d),a[l++]=q(i,u),s.push(i.id)}a.length=l;var h=t.scene3DOnly,p=t.mapProjection,f=L.combineGeometry({instances:a,ellipsoid:p.ellipsoid,projection:p,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=f.geometries,e._attributeLocations=f.attributeLocations,e.modelMatrix=C.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}function Q(t,i){var r=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(r&&!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,d=i.mapProjection,h=d.ellipsoid,p=t._batchTable,m=t._instanceBoundingSpheres,_=m.length,g=0;g<_;++g){var v=m[g];if(c(v)){var y=t.modelMatrix;c(y)&&(v=e.transform(v,y,ve));var C=v.center,w=v.radius,S=f.fromCartesian(C,me);p.setBatchedAttribute(g,o,S.high),p.setBatchedAttribute(g,a,S.low);var E=h.cartesianToCartographic(C,_e),b=d.project(E,ge);S=f.fromCartesian(b,me),p.setBatchedAttribute(g,s,S.high),p.setBatchedAttribute(g,l,S.low),p.setBatchedAttribute(g,u,w)}}t._batchTableBoundingSpheresUpdated=!0}}function J(t,i){for(var r=t._attributeLocations,n=t._geometries,o=i.scene3DOnly,a=i.context,s=[],l=n.length,u=0;u<l;++u){var d=n[u];if(s.push(I.fromGeometry({context:a,geometry:d,attributeLocations:r,bufferUsage:b.STATIC_DRAW,interleave:t._interleave})),c(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(i,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!o){var h=d.boundingSphereCV.center,p=h.x,f=h.y,m=h.z;h.x=m,h.y=p,h.z=f,t._boundingSphereCV.push(e.clone(d.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=s,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,se(t,i,B.COMPLETE,void 0)}function $(e,t,i,r){var n,a=i.getRenderState();r?(n=o(a,!1),n.cull={enabled:!0,face:N.BACK},e._frontFaceRS=P.fromCache(n),n.cull.face=N.FRONT,e._backFaceRS=P.fromCache(n)):(e._frontFaceRS=P.fromCache(a),e._backFaceRS=e._frontFaceRS),e.allowPicking?r?(n=o(a,!1),n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=e._frontFaceRS:(n=o(a,!1),n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r?(n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=P.fromCache(n))}function ee(e,t,i){var r=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);o=V._appendShowToShader(e,o),o=V._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=V._updateColorAttribute(e,o),o=j(e,o),o=V._modifyShaderPosition(e,o,t.scene3DOnly);var a=i.getFragmentShaderSource();if(e.allowPicking){var s=M.createPickVertexShaderSource(o);s=V._updatePickColorAttribute(s),e._pickSP=D.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:s,fragmentShaderSource:M.createPickFragmentShaderSource(a,"varying"),attributeLocations:n})}else e._pickSP=D.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});Y(e._pickSP,n),e._sp=D.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Y(e._sp,n)}function te(e,t,i,r,n,o,a,l){var u=c(i)?i._uniforms:void 0,d={},h=t.uniforms;if(c(h))for(var p in h)h.hasOwnProperty(p)&&(d[p]=X(h,p));var f=s(d,u);f=e._batchTable.getUniformMapCallback()(f),c(e.rtcCenter)&&(f.u_modifiedModelView=function(){var t=l.context.uniformState.view;return C.multiply(t,e._modelMatrix,ye),C.multiplyByPoint(ye,e.rtcCenter,Ce),C.setTranslation(ye,Ce,ye),ye});var m=r?A.TRANSLUCENT:A.OPAQUE;o.length=e._va.length*(n?2:1),a.length=e._va.length;for(var _=o.length,g=0,v=0,y=0;y<_;++y){var w;n&&(w=o[y],c(w)||(w=o[y]=new x({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[v],w.renderState=e._backFaceRS,w.shaderProgram=e._sp,w.uniformMap=f,w.pass=m,++y),w=o[y],c(w)||(w=o[y]=new x({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[v],w.renderState=e._frontFaceRS,w.shaderProgram=e._sp,w.uniformMap=f,w.pass=m;var S=a[g];c(S)||(S=a[g]=new x({owner:e,primitiveType:e._primitiveType})),S.vertexArray=e._va[v],S.renderState=e._pickRS,S.shaderProgram=e._pickSP,S.uniformMap=f,S.pass=m,++g,++v}}function ie(e,t){var i=e.appearance.pixelSize;if(c(i))for(var r=e._boundingSpheres.length,n=0;n<r;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],s=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),l=s*i;a.radius=o.radius+l}}function re(t,i,r,n,o,a,s,l){if(ie(t,i),!C.equals(o,t._modelMatrix)){C.clone(o,t._modelMatrix);for(var u=t._boundingSpheres.length,d=0;d<u;++d){var h=t._boundingSpheres[d];c(h)&&(t._boundingSphereWC[d]=e.transform(h,o,t._boundingSphereWC[d]),i.scene3DOnly||(t._boundingSphere2D[d]=e.clone(t._boundingSphereCV[d],t._boundingSphere2D[d]),t._boundingSphere2D[d].center.x=0,t._boundingSphereMorph[d]=e.union(t._boundingSphereWC[d],t._boundingSphereCV[d])));
}}var p;i.mode===F.SCENE3D?p=t._boundingSphereWC:i.mode===F.COLUMBUS_VIEW?p=t._boundingSphereCV:i.mode===F.SCENE2D&&c(t._boundingSphere2D)?p=t._boundingSphere2D:c(t._boundingSphereMorph)&&(p=t._boundingSphereMorph);var f=i.commandList,m=i.passes;if(m.render)for(var _=k.castShadows(t.shadows),g=k.receiveShadows(t.shadows),v=r.length,y=0;y<v;++y){var w=l?Math.floor(y/2):y,S=r[y];S.modelMatrix=o,S.boundingVolume=p[w],S.cull=a,S.debugShowBoundingVolume=s,S.castShadows=_,S.receiveShadows=g,f.push(S)}if(m.pick)for(var E=n.length,b=0;b<E;++b){var T=n[b];T.modelMatrix=o,T.boundingVolume=p[b],T.cull=a,f.push(T)}}function ne(e,t,i){return function(){var r=e.getBatchedAttribute(t,i),n=e.attributes[i],o=n.componentsPerAttribute,a=l.createTypedArray(n.componentDatatype,o);return c(r.constructor.pack)?r.constructor.pack(r,a,0):a[0]=r,a}}function oe(e,t,i){return function(r){var n=U(r);e.setBatchedAttribute(t,i,n)}}function ae(t,i,r){i.boundingSphere={get:function(){var i=t._instanceBoundingSpheres[r],n=t.modelMatrix;return c(n)&&c(i)&&(i=e.transform(i,n)),i}},i.boundingSphereCV={get:function(){return t._instanceBoundingSpheresCV[r]}}}function se(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===B.COMPLETE||e._state===B.FAILED,c(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}d(V.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var le=new t,ue=new i,ce=new r,de=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;V._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=de.exec(t));){var s=r[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),c(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=l+"\n{\n    return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=l+"\n{\n    return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(o+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",a+=l+"\n{\n    vec4 p;\n    if (czm_morphTime == 1.0)\n    {\n        p = czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n        p = czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy);\n    }\n    else\n    {\n        p = czm_columbusViewMorph(\n                czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy),\n                czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow),\n                czm_morphTime);\n    }\n    return p;\n}\n\n")}return[n,o,t,a].join("\n")},V._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;var i=M.replaceMain(t,"czm_non_show_main"),r="void main() \n{ \n    czm_non_show_main(); \n    gl_Position *= czm_batchTable_show(batchId); \n}";return i+"\n"+r},V._updateColorAttribute=function(e,t){if(!c(e._batchTableAttributeIndices.color))return t;if(t.search(/attribute\s+vec4\s+color;/g)===-1)return t;var i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},V._updatePickColorAttribute=function(e){var t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},V._appendDistanceDisplayConditionToShader=function(e,t,i){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var r=M.replaceMain(t,"czm_non_distanceDisplayCondition_main"),n="void main() \n{ \n    czm_non_distanceDisplayCondition_main(); \n    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return n+=i?"    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":"    vec4 centerRTE;\n    if (czm_morphTime == 1.0)\n    {\n        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n    }\n    else\n    {\n        centerRTE = czm_columbusViewMorph(\n                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n                czm_morphTime);\n    }\n",n+="    float radiusSq = boundingSphereRadius * boundingSphereRadius; \n    float distanceSq; \n    if (czm_sceneMode == czm_sceneMode2D) \n    { \n        distanceSq = czm_eyeHeight2D.y - radiusSq; \n    } \n    else \n    { \n        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n    } \n    distanceSq = max(distanceSq, 0.0); \n    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n    gl_Position *= show; \n}",r+"\n"+n};var he,pe=Math.max(m.hardwareConcurrency-1,1),fe=new E("combineGeometry",Number.POSITIVE_INFINITY),me=new f,_e=new n,ge=new i,ve=new e,ye=new C,Ce=new i;return V.prototype.update=function(e){if(!(!c(this.geometryInstances)&&0===this._va.length||c(this.geometryInstances)&&y(this.geometryInstances)&&0===this.geometryInstances.length||!c(this.appearance)||e.mode!==F.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==B.FAILED){var t=e.context;if(c(this._batchTable)||G(this,t),this._batchTable.attributes.length>0){if(0===T.maximumVertexTextureImageUnits)throw new w("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==B.COMPLETE&&this._state!==B.COMBINED&&(this.asynchronous?Z(this,e):K(this,e)),this._state===B.COMBINED&&(Q(this,e),J(this,e)),this.show&&this._state===B.COMPLETE){var i=this.appearance,r=i.material,n=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,n=!0,o=!0):this._material!==r&&(this._material=r,o=!0);var a=this._appearance.isTranslucent();this._translucent!==a&&(this._translucent=a,n=!0),c(this._material)&&this._material.update(t);var s=i.closed&&a;if(n){var l=u(this._createRenderStatesFunction,$);l(this,t,i,s)}if(o){var d=u(this._createShaderProgramFunction,ee);d(this,e,i)}if(n||o){var h=u(this._createCommandsFunction,te);h(this,i,r,a,s,this._colorCommands,this._pickCommands,e)}var p=u(this._updateAndQueueCommandsFunction,re);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,s)}}}},V.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o<n;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(t!==-1){var s=this._perInstanceAttributeCache[t];if(c(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var h={};for(var p in u)if(u.hasOwnProperty(p)){var f=u[p];h[p]={get:ne(l,t,f)};var m=!0,_=this._readOnlyInstanceAttributes;if(m&&c(_)){n=_.length;for(var g=0;g<n;++g)if(p===_[g]){m=!1;break}}m&&(h[p].set=oe(l,t,f))}return ae(this,h,t),d(s,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},V.prototype.isDestroyed=function(){return!1},V.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var i=this._va;for(e=i.length,t=0;t<e;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;t<e;++t)r[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,h(this)},V}),define("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"Color"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,i,r){"use strict";function n(i,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.clone(s.boundingSphere,a),r.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.clone(s.boundingSphere,a),r.DONE):t(n)&&!n.ready||t(o)&&!o.ready?r.PENDING:r.FAILED}return n}),define("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getType=r.throwInstantiationError,o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.getValue=function(i,r,o){var a;return t(r)&&(a=r.getType(i),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),r.getValue(i,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),define("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(i.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(i.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new i;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new f(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),d=this._distanceDisplayConditionProperty.getValue(t),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var _=i.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(t)),a=r.fromColor(_),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,i.BLACK),s=this._distanceDisplayConditionProperty.getValue(e);return new h({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.dimensions,h=e.position,f=a.show;if(!o(d)||!o(h)||o(f)&&f.isConstant&&!f.getValue(p.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=n(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=n(s,D),this._showProperty=n(f,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var C=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&d.isConstant&&E.isConstant(C)){var w=this._options;w.vertexFormat=v?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,w.dimensions=d.getValue(p.MINIMUM_VALUE,w.dimensions),this._outlineWidth=o(C)?C.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.box;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l._getModelMatrix(n),f=E.getValueOrUndefined(u.dimensions,n,d.dimensions);if(o(p)&&o(f)){d.dimensions=f;var v=this._geometryUpdater.shadowsProperty.getValue(n),y=this._geometryUpdater.distanceDisplayConditionProperty,C=y.getValue(n),w=c.fromDistanceDisplayCondition(C);if(E.getValueOrDefault(u.fill,n,!0)){var b=S.getValue(n,s.fillMaterialProperty,this._material);this._material=b;var T=new m({material:b,translucent:b.isTranslucent(),closed:!0});d.vertexFormat=T.vertexFormat,this._primitive=a.add(new g({geometryInstances:new h({id:l,geometry:e.fromDimensions(d),modelMatrix:p,attributes:{distanceDisplayCondition:w}}),appearance:T,asynchronous:!1,shadows:v}))}if(E.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=_.VERTEX_FORMAT;var x=E.getValueOrClonedDefault(u.outlineColor,n,i.BLACK,N),A=E.getValueOrDefault(u.outlineWidth,n,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new h({id:l,geometry:t.fromDimensions(d),modelMatrix:p,attributes:{color:r.fromColor(x),distanceDisplayCondition:w}}),appearance:new _({flat:!0,translucent:P,renderState:{lineWidth:s._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:v}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),define("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}var u=new e(1,1),c=!1,d=t.WHITE;return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._image)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:a("image"),repeat:a("repeat"),color:a("color"),transparent:a("transparent")}),l.prototype.getType=function(e){return"Image"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.image=s.getValueOrUndefined(this._image,e),t.repeat=s.getValueOrClonedDefault(this._repeat,e,u,t.repeat),t.color=s.getValueOrClonedDefault(this._color,e,d,t.color),s.getValueOrDefault(this._transparent,e,c)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._image,e._image)&&s.equals(this._color,e._color)&&s.equals(this._transparent,e._transparent)&&s.equals(this._repeat,e._repeat)},l}),define("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,i,r,n){"use strict";function o(t){if(t instanceof e)return new i(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var r=new n;return r.image=t,r}}function a(e,t){return r(e,t,o)}return a}),define("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new r,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),define("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}var u=t.WHITE,c=t.BLACK,d=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,d),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),define("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,i,r,n,o,a){"use strict";function s(){r.throwInstantiationError()}i(s.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError},referenceFrame:{get:r.throwInstantiationError}}),s.prototype.getValue=r.throwInstantiationError,s.prototype.getValueInReferenceFrame=r.throwInstantiationError,s.prototype.equals=r.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(i,r,s,u,c){if(!t(r))return r;if(t(c)||(c=new e),s===u)return e.clone(r,c);var d=a.computeIcrfToFixedMatrix(i,l);return t(d)||(d=a.computeTemeToPseudoFixedMatrix(i,l)),s===o.INERTIAL?n.multiplyByVector(d,r,c):s===o.FIXED?n.multiplyByVector(n.transpose(d,l),r,c):void 0},s}),define("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,r){this._definitionChanged=new o,this._value=e.clone(i),this._referenceFrame=t(r,a.FIXED)}return r(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,r){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l});define("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s});define("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function i(i,r){return e(i,r,t)}return i}),define("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),
this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor"),backgroundPadding:o("backgroundPadding"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),scaleByDistance:o("scaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.heightReference=this.heightReference,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.showBackground=e(this.showBackground,t.showBackground),this.backgroundColor=e(this.backgroundColor,t.backgroundColor),this.backgroundPadding=e(this.backgroundPadding,t.backgroundPadding),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.heightReference=e(this.heightReference,t.heightReference),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},a}),define("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,i){return t(i)||(i=new n),i.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,i.translation),i.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,i.rotation),i.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,i.scale),i},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l}),define("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;++o){var a=i[o],l=r.indexOf(a);if(l===-1)return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,i){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,i)};return i(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;t<i;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1},c.prototype.addProperty=function(i,r,n){var o=this._propertyNames;o.push(i),Object.defineProperty(this,i,a(i,!0,e(n,l))),t(r)&&(this[i]=r),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,i){t(i)||(i={});for(var r=this._propertyNames,n=0,o=r.length;n<o;n++){var a=r[n];i[a]=s.getValueOrUndefined(this[a],e,i[a])}return i},c.prototype.merge=function(e,i){for(var r=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;o<a;o++){var s=n[o],l=this[s],u=e[s];void 0===l&&r.indexOf(s)===-1&&this.addProperty(s,void 0,i),void 0!==u&&(void 0!==l?t(l)&&t(l.merge)&&l.merge(u):t(u)&&t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c}),define("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"),incrementallyLoadTextures:o("incrementallyLoadTextures"),shadows:o("shadows"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),silhouetteColor:o("silhouetteColor"),silhouetteSize:o("silhouetteSize"),color:o("color"),colorBlendMode:o("colorBlendMode"),colorBlendAmount:o("colorBlendAmount")}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.shadows=this.shadows,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e.heightReference=this._heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e):new c(this)},c.prototype.merge=function(i){this.show=e(this.show,i.show),this.scale=e(this.scale,i.scale),this.minimumPixelSize=e(this.minimumPixelSize,i.minimumPixelSize),this.maximumScale=e(this.maximumScale,i.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,i.incrementallyLoadTextures),this.shadows=e(this.shadows,i.shadows),this.uri=e(this.uri,i.uri),this.runAnimations=e(this.runAnimations,i.runAnimations),this.heightReference=e(this.heightReference,i.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,i.distanceDisplayCondition),this.silhouetteColor=e(this.silhouetteColor,i.silhouetteColor),this.silhouetteSize=e(this.silhouetteSize,i.silhouetteSize),this.color=e(this.color,i.color),this.colorBlendMode=e(this.colorBlendMode,i.colorBlendMode),this.colorBlendAmount=e(this.colorBlendAmount,i.colorBlendAmount);var r=i.nodeTransformations;if(t(r)){var n=this.nodeTransformations;t(n)?n.merge(r):this.nodeTransformations=new s(r,l)}},c}),define("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.heightReference=this.heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.heightReference=e(this.heightReference,t.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},a}),define("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._definitionChanged=new n,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,
this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("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","./PropertyBag","./RectangleGraphics","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M){"use strict";function I(e){return new p(e)}function R(e){return m(e,void 0,I)}function O(e,t){return m(e,void 0,function(e){return e instanceof t?e:new t(e)})}function N(e){e=i(e,i.EMPTY_OBJECT);var n=e.id;r(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=i(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","properties","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._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function L(e,t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n],a=o._show,s=!i&&a,l=i&&a;s!==l&&L(o,o._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}n(N.prototype,{availability:_("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:_("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var i=this.isShowing;t!==i&&L(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!r(this.entityCollection)||this.entityCollection.show)&&(!r(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var i=this.isShowing;if(r(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,r(e)&&e._children.push(this);var o=this.isShowing;i!==o&&L(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:O("billboard",d),box:O("box",h),corridor:O("corridor",f),cylinder:O("cylinder",g),description:m("description"),ellipse:O("ellipse",v),ellipsoid:O("ellipsoid",y),label:O("label",C),model:O("model",w),orientation:m("orientation"),path:O("path",S),point:O("point",E),polygon:O("polygon",b),polyline:O("polyline",T),polylineVolume:O("polylineVolume",x),properties:O("properties",P),position:R("position"),rectangle:O("rectangle",D),viewFrom:m("viewFrom"),wall:O("wall",M)}),N.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},N.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,_(e,!0))},N.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e]},N.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,n=r(e._propertyNames)?e._propertyNames:Object.keys(e),o=n.length,a=0;a<o;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];r(l)||t.indexOf(s)!==-1||this.addProperty(s),r(u)&&(r(l)?r(l.merge)&&l.merge(u):r(u.merge)&&r(u.clone)?this[s]=u.clone():this[s]=u)}}};var B=new s,F=new e,k=new u;return N.prototype._getModelMatrix=function(e,t){var i=A.getValueOrUndefined(this._position,e,F);if(r(i)){var n=A.getValueOrUndefined(this._orientation,e,k);return t=r(n)?l.fromRotationTranslation(s.fromQuaternion(n,B),i,t):c.eastNorthUpToFixedFrame(i,void 0,t)}},N}),define("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e){if(e._firing)return void(e._refire=!0);if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;if(0!==r.length||0!==t.length||0!==i.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=i.values.slice(0),a=r.values.slice(0);t.removeAll(),i.removeAll(),r.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function h(i){this._owner=i,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t(),this._show=!0,this._firing=!1,this._refire=!1}var p={id:void 0};return h.prototype.suspendEvents=function(){this._suspendCount++},h.prototype.resumeEvents=function(){this._suspendCount--,d(this)},h.collectionChangedEventCallback=void 0,r(h.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e!==this._show){this.suspendEvents();var t,i=[],r=this._entities.values,n=r.length;for(t=0;t<n;t++)i.push(r[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=i[t],a=r[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),h.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,r=this._entities.values,n=0,o=r.length;n<o;n++){var l=r[n],c=l.availability;if(i(c)){var d=c.start,h=c.stop;s.lessThan(d,e)&&!d.equals(a.MINIMUM_VALUE)&&(e=d),s.greaterThan(h,t)&&!h.equals(a.MAXIMUM_VALUE)&&(t=h)}}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})},h.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,i=this._entities;if(i.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),e},h.prototype.remove=function(e){return!!i(e)&&this.removeById(e.id)},h.prototype.contains=function(e){return this._entities.get(e.id)===e},h.prototype.removeById=function(e){if(!i(e))return!1;var t=this._entities,r=t.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,r),this._changedEntities.remove(e)),this._entities.remove(e),r.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),!0)},h.prototype.removeAll=function(){for(var e=this._entities,t=e.length,r=e.values,n=this._addedEntities,o=this._removedEntities,a=0;a<t;a++){var s=r[a],l=s.id,u=n.get(l);i(u)||(s.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),d(this)},h.prototype.getById=function(e){return this._entities.get(e)},h.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return i(t)||(p.id=e,t=new c(p),this.add(t)),t},h.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),d(this)},h}),define("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,i=t.length,r=0;r<i;r++)e[t[r]]=void 0}function l(e,t,i,r){m[0]=i,m[1]=r.id,t[JSON.stringify(m)]=r.definitionChanged.addEventListener(d.prototype._onDefinitionChanged,e)}function u(e,t,i,r){m[0]=i,m[1]=r.id;var n=JSON.stringify(m);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var i,r,n,c,h,p,m=e._collections,_=m.length,g=e._collectionsCopy,v=g.length,y=e._composite,C=new a(e),w=e._eventHash;for(i=0;i<v;i++)for(h=g[i],h.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--)r=n[c],u(e,w,p,r);for(i=_-1;i>=0;i--)for(h=m[i],h.collectionChanged.addEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--){r=n[c],l(e,w,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(f.id=r.id,S=new o(f)),C.add(S)),S.merge(r)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(i=0;i<E.length;i++)y.add(E[i]);y.resumeEvents()}}function d(i,r){this._owner=r,this._composite=new a(this),this._suspendCount=0,this._collections=t(i)?i.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function h(e,t){var i=e.indexOf(t);return i}function p(e,t,i){var r=e._collections;if(t=n.clamp(t,0,r.length-1),i=n.clamp(i,0,r.length-1),t!==i){var o=r[t];r[t]=r[i],r[i]=o,c(e)}}var f={id:void 0},m=new Array(2);return i(d.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),d.prototype.addCollection=function(e,i){var r=t(i);r?this._collections.splice(i,0,e):(i=this._collections.length,this._collections.push(e)),c(this)},d.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return t!==-1&&(this._collections.splice(t,1),c(this),!0)},d.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},d.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1},d.prototype.contains=function(e){return this._composite.contains(e)},d.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},d.prototype.getCollection=function(e){return this._collections[e]},d.prototype.getCollectionsLength=function(){return this._collections.length},d.prototype.raiseCollection=function(e){var t=h(this._collections,e);p(this,t,t+1)},d.prototype.lowerCollection=function(e){var t=h(this._collections,e);p(this,t,t-1)},d.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))},d.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))},d.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},d.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},d.prototype.computeAvailability=function(){return this._composite.computeAvailability()},d.prototype.getById=function(e){return this._composite.getById(e)},d.prototype._onCollectionChanged=function(e,i,r){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var d,h,p,m,_=r.length,g=this._eventHash,v=e.id;for(d=0;d<_;d++){var y=r[d];u(this,g,v,y);var C=y.id;for(h=a-1;h>=0;h--)p=n[h].getById(C),t(p)&&(t(m)||(m=c.getById(C),s(m)),m.merge(p));t(m)||c.removeById(C),m=void 0}var w=i.length;for(d=0;d<w;d++){var S=i[d];l(this,g,v,S);var E=S.id;for(h=a-1;h>=0;h--)p=n[h].getById(E),t(p)&&(t(m)||(m=c.getById(E),t(m)?s(m):(f.id=E,m=new o(f),c.add(m))),m.merge(p));m=void 0}c.resumeEvents()},d.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],d=!t(c),h=!0,p=s-1;p>=0;p--){var f=o[p].getById(e.id);if(t(f)){var m=f[i];if(t(m)){if(h){if(h=!1,!t(m.merge)||!t(m.clone)){c=m;break}c=m.clone(c)}c.merge(m)}}}d&&u.propertyNames.indexOf(i)===-1&&u.addProperty(i),u[i]=c},d}),define("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;l<s;l++){var u=n.get(l);e(u.data)&&a.indexOf(u.data)===-1&&i.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new r,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getValue(t,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),define("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var i=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getType(t)},a.prototype.getValue=function(t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getValue(t,i)},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return i(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._composite._intervals.findDataForIntervalContainingDate(e);if(t(n))return n.getValueInReferenceFrame(e,i,r)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),define("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\n#ifdef GL_EXT_frag_depth\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),define("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 extrudeDirection;\nattribute vec4 color;\nattribute float batchId;\nuniform float u_globeMinimumAltitude;\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),define("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),define("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),define("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP};return e(i)}),define("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/loadJson","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R){"use strict";function O(e){e=a(e,a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=a(e.show,!0),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=a(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._sp=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._uniformMap={u_globeMinimumAltitude:function(){return 55e3}},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=T.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=O._defaultMaxTerrainHeight,this._minTerrainHeight=O._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[];var t,i=new P({flat:!0});s(this.geometryInstances)&&p(this.geometryInstances)&&this.geometryInstances.length>1&&(t=Q),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:a(e.vertexCacheOptimize,!1),interleave:a(e.interleave,!1),releaseGeometryInstances:a(e.releaseGeometryInstances,!0),allowPicking:a(e.allowPicking,!0),asynchronous:a(e.asynchronous,!0),compressVertices:a(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function N(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function L(e){return function(t,i){return e._minHeight}}function B(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:I.ALWAYS,frontOperation:{fail:R.KEEP,zFail:R.DECREMENT_WRAP,zPass:R.DECREMENT_WRAP},backFunction:I.ALWAYS,backOperation:{fail:R.KEEP,zFail:R.INCREMENT_WRAP,zPass:R.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1}}function F(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:I.ALWAYS,frontOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.INCREMENT_WRAP},backFunction:I.ALWAYS,backOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:A.LESS_OR_EQUAL},depthMask:!1}}function k(e){return{stencilTest:{enabled:e,frontFunction:I.NOT_EQUAL,frontOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},backFunction:I.NOT_EQUAL,backOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:x.ALPHA_BLEND}}function V(e,t){var i=e.mapProjection.ellipsoid;{if(s(t.attributes)&&s(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=0;h<a;h+=3){var p=r.unpack(n,h,$),f=r.unpack(o,h,ee),m=r.add(p,f,te),_=i.cartesianToCartographic(m,ie),g=_.latitude,v=_.longitude;l=Math.min(l,g),u=Math.min(u,v),c=Math.max(c,g),d=Math.max(d,v)}var y=re;return y.north=c,y.south=l,y.east=d,y.west=u,y}if(s(t.rectangle))return t.rectangle}}function z(e){n.fromRadians(e.east,e.north,0,oe[0]),n.fromRadians(e.west,e.north,0,oe[1]),n.fromRadians(e.east,e.south,0,oe[2]),n.fromRadians(e.west,e.south,0,oe[3]);for(var t=0,i=0,r=0,o=0,a=O._terrainHeightsMaxLevel,s=0;s<=a;++s){for(var l=!1,u=0;u<4;++u){var c=oe[u];if(ne.positionToTileXY(c,s,ae),0===u)r=ae.x,o=ae.y;else if(r!==ae.x||o!==ae.y){l=!0;break}}if(l)break;t=r,i=o}if(0!==s)return{x:t,y:i,level:s>a?a:s-1}}function U(e,t,i){var n=z(t),o=O._defaultMinTerrainHeight,a=O._defaultMaxTerrainHeight;if(s(n)){var l=n.level+"-"+n.x+"-"+n.y,u=O._terrainHeights[l];s(u)&&(o=u[0],a=u[1]),i.cartographicToCartesian(g.northeast(t,ue),se),i.cartographicToCartesian(g.southwest(t,ue),le),r.subtract(le,se,ce),r.add(se,r.multiplyByScalar(ce,.5,ce),ce);var c=i.scaleToGeodeticSurface(ce,de);if(s(c)){var d=r.distance(ce,c);o=Math.min(o,-d)}else o=O._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(O._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function G(t,i){var r=z(t),n=O._defaultMaxTerrainHeight;if(s(r)){var o=r.level+"-"+r.x+"-"+r.y,a=O._terrainHeights[o];s(a)&&(n=a[1])}var l=e.fromRectangle3D(t,i,0);return e.fromRectangle3D(t,i,n,he),e.union(l,he,l)}function H(t,i,n){var o=i.mapProjection.ellipsoid,a=V(i,n);if(a.width<m.PI){var s=_.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!i.scene3DOnly){var c=i.mapProjection,d=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);r.fromElements(d.center.z,d.center.x,d.center.y,d.center),t._boundingVolumes2D.push(d)}}function W(e,t,i,r){if(!s(e._rsStencilPreloadPass)){var n=!e.debugShowShadowVolume;e._rsStencilPreloadPass=C.fromCache(B(n)),e._rsStencilDepthPass=C.fromCache(F(n)),e._rsColorPass=C.fromCache(k(n)),e._rsPickPass=C.fromCache(J)}}function q(e,t){if(!e.compressVertices)return t;if(t.search(/attribute\s+vec3\s+extrudeDirection;/g)!==-1){var i="compressedAttributes",r="attribute vec2 "+i+";",n="vec3 extrudeDirection;\n",o="    extrudeDirection = czm_octDecode("+i+", 65535.0);\n",a=t;a=a.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),a=S.replaceMain(a,"czm_non_compressed_main");var s="void main() \n{ \n"+o+"    czm_non_compressed_main(); \n}";return[r,n,a,s].join("\n")}}function j(e,t,i){if(!s(e._sp)){var r=t.context,n=e._primitive,o=b;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=D._appendShowToShader(n,o),o=D._appendDistanceDisplayConditionToShader(n,o),o=D._modifyShaderPosition(e,o,t.scene3DOnly),o=D._updateColorAttribute(n,o),o=q(n,o);var a=E,l=e._primitive._attributeLocations;if(e._sp=w.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:l}),e._primitive.allowPicking){var u=S.createPickVertexShaderSource(o);u=D._updatePickColorAttribute(u);var c=new S({sources:[a],pickColorQualifier:"varying"});e._spPick=w.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:l})}else e._spPick=w.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:l})}}function Y(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,o=i._batchTable.getUniformMapCallback()(e._uniformMap),a=0;a<r;a+=3){var l=i._va[n++],u=t[a];s(u)||(u=t[a]=new v({owner:e,primitiveType:i._primitiveType})),u.vertexArray=l,u.renderState=e._rsStencilPreloadPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=y.GROUND,u=t[a+1],s(u)||(u=t[a+1]=new v({owner:e,primitiveType:i._primitiveType})),u.vertexArray=l,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=y.GROUND,u=t[a+2],s(u)||(u=t[a+2]=new v({owner:e,primitiveType:i._primitiveType})),u.vertexArray=l,u.renderState=e._rsColorPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=y.GROUND}}function X(e,t){var i=e._primitive,r=i._pickOffsets,n=3*r.length;t.length=n;for(var o=0,a=i._batchTable.getUniformMapCallback()(e._uniformMap),l=0;l<n;l+=3){var u=r[o++],c=u.offset,d=u.count,h=i._va[u.index],p=t[l];s(p)||(p=t[l]=new v({owner:e,primitiveType:i._primitiveType})),p.vertexArray=h,p.offset=c,p.count=d,p.renderState=e._rsStencilPreloadPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=y.GROUND,p=t[l+1],s(p)||(p=t[l+1]=new v({owner:e,primitiveType:i._primitiveType})),p.vertexArray=h,p.offset=c,p.count=d,p.renderState=e._rsStencilDepthPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=y.GROUND,p=t[l+2],s(p)||(p=t[l+2]=new v({owner:e,primitiveType:i._primitiveType})),p.vertexArray=h,p.offset=c,p.count=d,p.renderState=e._rsPickPass,p.shaderProgram=e._spPick,p.uniformMap=a,p.pass=y.GROUND}}function Z(e,t,i,r,n,o,a){Y(e,o),X(e,a)}function K(e,t,i,r,n,o,a,l){var u;t.mode===M.SCENE3D?u=e._boundingVolumes:t.mode!==M.SCENE3D&&s(e._boundingVolumes2D)&&(u=e._boundingVolumes2D);var c=t.commandList,d=t.passes;if(d.render)for(var h=i.length,p=0;p<h;++p)i[p].modelMatrix=n,i[p].boundingVolume=u[Math.floor(p/3)],i[p].cull=o,i[p].debugShowBoundingVolume=a,c.push(i[p]);if(d.pick){var f=e._primitive,m=f._pickOffsets,_=3*m.length;r.length=_;for(var g=0,v=0;v<_;v+=3){var y=m[g++],C=u[y.index];r[v].modelMatrix=n,r[v].boundingVolume=C,r[v].cull=o,r[v+1].modelMatrix=n,r[v+1].boundingVolume=C,r[v+1].cull=o,r[v+2].modelMatrix=n,r[v+2].boundingVolume=C,r[v+2].cull=o,c.push(r[v],r[v+1],r[v+2])}}}var Q=["color"];l(O.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),O.isSupported=function(e){return e.context.stencilBuffer},O._defaultMaxTerrainHeight=9e3,O._defaultMinTerrainHeight=-1e5,O._terrainHeights=void 0,O._terrainHeightsMaxLevel=6;var J={stencilTest:{enabled:!0,frontFunction:I.NOT_EQUAL,frontOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},backFunction:I.NOT_EQUAL,backOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},$=new r,ee=new r,te=new r,ie=new n,re=new g,ne=new d,oe=[new n,new n,new n,new n],ae=new i,se=new r,le=new r,ue=new n,ce=new r,de=new r,he=new e;return O._initialized=!1,O._initPromise=void 0,O.initializeTerrainHeights=function(){var e=O._initPromise;return s(e)?e:(O._initPromise=f(t("Assets/approximateTerrainHeights.json")).then(function(e){O._initialized=!0,O._terrainHeights=e}),O._initPromise)},O.prototype.update=function(e){if(this.show&&(s(this._primitive)||s(this.geometryInstances))){
if(!O._initialized)return void O.initializeTerrainHeights();var t=this,i=this._primitiveOptions;if(!s(this._primitive)){var r,n,o,a,l,u=e.mapProjection.ellipsoid,c=p(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=c.length,f=new Array(d);for(a=0;a<d;++a){r=c[a],n=r.geometry;var m=V(e,n);s(l)?s(m)&&g.union(l,m,l):l=m;var _=r.id;if(s(_)&&s(m)){var v=G(m,u);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(v)}if(o=n.constructor,s(o)&&s(o.createShadowVolume)){r.attributes}}U(this,l,e.mapProjection.ellipsoid);var y=e.terrainExaggeration;for(this._minHeight=this._minTerrainHeight*y,this._maxHeight=this._maxTerrainHeight*y,a=0;a<d;++a)r=c[a],n=r.geometry,o=n.constructor,f[a]=new h({geometry:o.createShadowVolume(n,L(this),N(this)),attributes:r.attributes,id:r.id,pickPrimitive:this});i.geometryInstances=f,i._createBoundingVolumeFunction=function(e,i){H(t,e,i)},i._createRenderStatesFunction=function(e,i,r,n){W(t,i)},i._createShaderProgramFunction=function(e,i,r){j(t,i)},i._createCommandsFunction=function(e,i,r,n,o,a,s){Z(t,void 0,void 0,!0,!1,a,s)},i._updateAndQueueCommandsFunction=function(e,i,r,n,o,a,s,l){K(t,i,r,n,o,a,s,l)},this._primitive=new D(i),this._primitive.readyPromise.then(function(e){t._ready=!0,t.releaseGeometryInstances&&(t.geometryInstances=void 0);var i=e._error;s(i)?t._readyPromise.reject(i):t._readyPromise.resolve(t)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilPreloadPass=C.fromCache(B(!1)),this._rsStencilDepthPass=C.fromCache(F(!1)),this._rsColorPass=C.fromCache(k(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilPreloadPass=C.fromCache(B(!0)),this._rsStencilDepthPass=C.fromCache(F(!0)),this._rsColorPass=C.fromCache(k(!0))),this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},O.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},O.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),u(this)},O}),define("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new u),B=new e;return a(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),a(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayCondition}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new m(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(r));if(this._materialProperty instanceof w){var p=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(r)),a=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:a}}else n={show:u,distanceDisplayCondition:d};return new h({id:s,geometry:new i(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new h({id:n,geometry:new r(this._options),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(i))}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),s(this)},A.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,h=a.show;if(o(h)&&h.isConstant&&!h.getValue(p.MINIMUM_VALUE)||!o(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=n(a.material,D),y=m instanceof w;this._materialProperty=m,this._fillProperty=n(s,I),this._showProperty=n(h,M),this._showOutlineProperty=n(a.outline,R),this._outlineColorProperty=c?n(a.outlineColor,O):void 0,this._shadowsProperty=n(a.shadows,N),this._distanceDisplayCondition=n(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.width,x=a.outlineWidth,A=a.cornerType,P=l&&!o(C)&&!o(S)&&y&&_.isSupported(this._scene);if(c&&P&&(f(f.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=P,this._isClosed=o(S)||P,this._outlineEnabled=c,d.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&(!P||T.isConstant(m))){var B=this._options;B.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,B.positions=d.getValue(p.MINIMUM_VALUE,B.positions),B.height=o(C)?C.getValue(p.MINIMUM_VALUE):void 0,B.extrudedHeight=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,B.granularity=o(E)?E.getValue(p.MINIMUM_VALUE):void 0,B.width=o(b)?b.getValue(p.MINIMUM_VALUE):void 0,B.cornerType=o(A)?A.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(x)?x.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(n){var a=this._geometryUpdater,s=a._onTerrain,l=this._primitives,u=this._groundPrimitives;s?u.removeAndDestroy(this._primitive):(l.removeAndDestroy(this._primitive),l.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var d=a._entity,p=d.corridor;if(d.isShowing&&d.isAvailable(n)&&T.getValueOrDefault(p.show,n,!0)){var f=this._options,m=T.getValueOrUndefined(p.positions,n,f.positions),C=T.getValueOrUndefined(p.width,n);if(o(m)&&o(C)){f.positions=m,f.width=C,f.height=T.getValueOrUndefined(p.height,n),f.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,n),f.granularity=T.getValueOrUndefined(p.granularity,n),f.cornerType=T.getValueOrUndefined(p.cornerType,n);var w=this._geometryUpdater.shadowsProperty.getValue(n),S=this._geometryUpdater.distanceDisplayConditionProperty.getValue(n),E=c.fromDistanceDisplayCondition(S);if(!o(p.fill)||p.fill.getValue(n)){var x=a.fillMaterialProperty,A=b.getValue(n,x,this._material);if(this._material=A,s){var P=e.WHITE;o(x.color)&&(P=x.color.getValue(n)),this._primitive=u.add(new _({geometryInstances:new h({id:d,geometry:new i(f),attributes:{color:t.fromColor(P),distanceDisplayCondition:E}}),asynchronous:!1,shadows:w}))}else{var D=new g({material:A,translucent:A.isTranslucent(),closed:o(f.extrudedHeight)});f.vertexFormat=D.vertexFormat,this._primitive=l.add(new y({geometryInstances:new h({id:d,geometry:new i(f),attributes:{distanceDisplayCondition:E}}),appearance:D,asynchronous:!1,shadows:w}))}}if(!s&&o(p.outline)&&p.outline.getValue(n)){f.vertexFormat=v.VERTEX_FORMAT;var M=T.getValueOrClonedDefault(p.outlineColor,n,e.BLACK,B),I=T.getValueOrDefault(p.outlineWidth,n,1),R=1!==M.alpha;this._outlinePrimitive=l.add(new y({geometryInstances:new h({id:d,geometry:new r(f),attributes:{color:t.fromColor(M),distanceDisplayCondition:E}}),appearance:new v({flat:!0,translucent:R,renderState:{lineWidth:a._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:w}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},A}),define("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError},show:{get:t.throwInstantiationError},clustering:{get:t.throwInstantiationError}}),i.prototype.update=t.throwInstantiationError,i.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},i}),define("Scene/CullingVolume",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect","../Core/Plane"],function(e,t,i,r,n,o,a){"use strict";function s(e){this.planes=i(e,[])}var l=[new e,new e,new e];e.clone(e.UNIT_X,l[0]),e.clone(e.UNIT_Y,l[1]),e.clone(e.UNIT_Z,l[2]);var u=new e,c=new e,d=new a(new e,0);return s.fromBoundingSphere=function(i,n){r(n)||(n=new s);var o=l.length,a=n.planes;a.length=2*o;for(var d=i.center,h=i.radius,p=0,f=0;f<o;++f){var m=l[f],_=a[p],g=a[p+1];r(_)||(_=a[p]=new t),r(g)||(g=a[p+1]=new t),e.multiplyByScalar(m,-h,u),e.add(d,u,u),_.x=m.x,_.y=m.y,_.z=m.z,_.w=-e.dot(m,u),e.multiplyByScalar(m,h,u),e.add(d,u,u),g.x=-m.x,g.y=-m.y,g.z=-m.z,g.w=-e.dot(e.negate(m,c),u),p+=2}return n},s.prototype.computeVisibility=function(e){for(var t=this.planes,i=!1,r=0,n=t.length;r<n;++r){var s=e.intersectPlane(a.fromCartesian4(t[r],d));if(s===o.OUTSIDE)return o.OUTSIDE;s===o.INTERSECTING&&(i=!0)}return i?o.INTERSECTING:o.INSIDE},s.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===s.MASK_OUTSIDE||t===s.MASK_INSIDE)return t;for(var i=s.MASK_INSIDE,r=this.planes,n=0,l=r.length;n<l;++n){var u=n<31?1<<n:0;if(!(n<31&&0===(t&u))){var c=e.intersectPlane(a.fromCartesian4(r[n],d));if(c===o.OUTSIDE)return s.MASK_OUTSIDE;c===o.INTERSECTING&&(i|=u)}}return i},s.MASK_OUTSIDE=4294967295,s.MASK_INSIDE=0,s.MASK_INDETERMINATE=2147483647,s}),define("Scene/OrthographicOffCenterFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,d=new e,h=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,f=this.left,m=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,m,v),e.add(r,v,v);var y=d;e.multiplyByScalar(g,f,y),e.add(v,y,y);var C=a[0];return i(C)||(C=a[0]=new t),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-e.dot(g,y),e.multiplyByScalar(g,p,y),e.add(v,y,y),C=a[1],i(C)||(C=a[1]=new t),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-e.dot(e.negate(g,h),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],i(C)||(C=a[2]=new t),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),C=a[3],i(C)||(C=a[3]=new t),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-e.dot(e.negate(o,h),y),C=a[4],i(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,v),e.multiplyByScalar(n,_,y),e.add(r,y,y),C=a[5],i(C)||(C=a[5]=new t),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-e.dot(e.negate(n,h),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),define("Scene/OrthographicFrustum",["../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","./OrthographicOffCenterFrustum"],function(e,t,i,r,n){"use strict";function o(){this._offCenterFrustum=new n,this.width=void 0,this._width=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._useDeprecated=!1}function a(e){var t=e._offCenterFrustum;if((e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far)&&(e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far,!e._useDeprecated)){var i=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=i*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}return t(o.prototype,{projectionMatrix:{get:function(){return a(this),this._offCenterFrustum.projectionMatrix}},left:{get:function(){return i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._offCenterFrustum.left},set:function(e){i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._useDeprecated=!0,this._offCenterFrustum.left=e}},right:{get:function(){return i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._offCenterFrustum.right},set:function(e){i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._useDeprecated=!0,this._offCenterFrustum.right=e}},top:{get:function(){return i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._offCenterFrustum.top},set:function(e){i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._useDeprecated=!0,this._offCenterFrustum.top=e}},bottom:{get:function(){return i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._offCenterFrustum.bottom},set:function(e){i("OrthographicFrustum","OrthographicFrustum left, right, bottom and top properties were deprecated in 1.32 and will be removed in 1.33."),this._useDeprecated=!0,this._offCenterFrustum.bottom=e}}}),o.prototype.computeCullingVolume=function(e,t,i){return a(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},o.prototype.getPixelDimensions=function(e,t,i,r){return a(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},o.prototype.clone=function(t){return e(t)||(t=new o),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},o.prototype.equals=function(t){return!!e(t)&&(a(this),a(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))},o}),define("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/Transforms","./OrthographicFrustum","./OrthographicOffCenterFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,n,o){var a=n.viewMatrix,s=l.multiplyByVector(a,r.fromElements(e.x,e.y,e.z,1,C),C),u=i.multiplyComponents(t,i.normalize(s,w),w);return s.x+=t.x+u.x,s.y+=t.y+u.y,s.z+=u.z,l.multiplyByVector(n.frustum.projectionMatrix,s,o)}var f={},m=new r(0,0,0,1),_=new r,g=new e,v=new t,y=new t;f.wgs84ToWindowCoordinates=function(e,t,r){return f.wgs84WithEyeOffsetToWindowCoordinates(e,t,i.ZERO,r)};var C=new r,w=new i,S=new n(Math.PI,s.PI_OVER_TWO),E=new i,b=new i;f.wgs84WithEyeOffsetToWindowCoordinates=function(e,r,n,a){var C=e.frameState,w=f.computeActualWgs84Position(C,r,m);if(o(w)){var T=e.canvas,x=g;x.x=0,x.y=0,x.width=T.clientWidth,x.height=T.clientHeight;var A=e.camera,P=!1;if(C.mode===h.SCENE2D){var D=e.mapProjection,M=S,I=D.project(M,E),R=i.clone(A.position,b),O=A.frustum.clone(),N=l.computeViewportTransformation(x,0,1,new l),L=A.frustum.projectionMatrix,B=A.positionWC.y,F=i.fromElements(s.sign(B)*I.x-B,0,-A.positionWC.x),k=u.pointToGLWindowCoordinates(L,N,F);if(0===B||k.x<=0||k.x>=T.clientWidth)P=!0;else{if(k.x>.5*T.clientWidth){x.width=k.x,A.frustum.right=I.x-B,_=p(w,n,A,_),f.clipToGLWindowCoordinates(x,_,v),x.x+=k.x,A.position.x=-A.position.x;var V=A.frustum.right;A.frustum.right=-A.frustum.left,A.frustum.left=-V,_=p(w,n,A,_),f.clipToGLWindowCoordinates(x,_,y)}else{x.x+=k.x,x.width-=k.x,A.frustum.left=-I.x-B,_=p(w,n,A,_),f.clipToGLWindowCoordinates(x,_,v),x.x=x.x-x.width,A.position.x=-A.position.x;var z=A.frustum.left;A.frustum.left=-A.frustum.right,A.frustum.right=-z,_=p(w,n,A,_),f.clipToGLWindowCoordinates(x,_,y)}i.clone(R,A.position),A.frustum=O.clone(),a=t.clone(v,a),(a.x<0||a.x>T.clientWidth)&&(a.x=y.x)}}if(C.mode!==h.SCENE2D||P){if(_=p(w,n,A,_),_.z<0&&!(A.frustum instanceof c)&&!(A.frustum instanceof d))return;a=f.clipToGLWindowCoordinates(x,_,a)}return a.y=T.clientHeight-a.y,a}},f.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=f.wgs84ToWindowCoordinates(e,t,i),o(i))return f.transformWindowToDrawingBuffer(e,i,i)};var T=new i,x=new n;f.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===h.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,x);if(o(l)){if(a.project(l,T),n===h.COLUMBUS_VIEW)return i.fromElements(T.z,T.x,T.y,r);if(n===h.SCENE2D)return i.fromElements(0,T.x,T.y,r);var u=e.morphTime;return i.fromElements(s.lerp(T.z,t.x,u),s.lerp(T.x,t.y,u),s.lerp(T.y,t.z,u),r)}};var A=new i,P=new i,D=new l;f.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,A),l.computeViewportTransformation(e,0,1,D),l.multiplyByPoint(D,A,P),t.fromCartesian3(P,n)},f.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var M=new r,I=new r;return f.drawingBufferToWgs84Coordinates=function(e,t,n,a){var s=e.context,u=s.uniformState,c=e._passState.viewport,d=r.clone(r.UNIT_W,M);d.x=(t.x-c.x)/c.width*2-1,d.y=(t.y-c.y)/c.height*2-1,d.z=2*n-1,d.w=1;var h,p=e.camera.frustum;if(o(p.fovy)){h=l.multiplyByVector(u.inverseViewProjection,d,I);var f=1/h.w;i.multiplyByScalar(h,f,h)}else{o(p._offCenterFrustum)&&(p=p._offCenterFrustum);var m=u.currentFrustum;h=I,h.x=.5*(d.x*(p.right-p.left)+p.left+p.right),h.y=.5*(d.y*(p.top-p.bottom)+p.bottom+p.top),h.z=.5*(d.z*(m.x-m.y)-m.x-m.y),h.w=1,h=l.multiplyByVector(u.inverseView,h,h)}return i.fromCartesian4(h,a)},f}),define("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,f.NONE),this._verticalOrigin=s(e.verticalOrigin,v.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,m.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_.SCENE3D,this._clusterShow=!0,this._updateClamping()}function C(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var w=y.SHOW_INDEX=0,S=y.POSITION_INDEX=1,E=y.PIXEL_OFFSET_INDEX=2,b=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,A=y.SCALE_INDEX=6,P=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,M=y.ROTATION_INDEX=9,I=y.ALIGNED_AXIS_INDEX=10,R=y.SCALE_BY_DISTANCE_INDEX=11,O=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,L=y.DISTANCE_DISPLAY_CONDITION=14;y.NUMBER_OF_PROPERTIES=15,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,w))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),C(this,S))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),C(this,S))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),C(this,E))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),C(this,R))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),C(this,O))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),C(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),C(this,b))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,C(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,C(this,A))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),C(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,C(this,M))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),C(this,I))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,P))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,P))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,C(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){d.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=d.clone(e,this._distanceDisplayCondition),C(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,C(this,P))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),C(this,S)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,w))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var B=new n,F=new i;y._updateClamping=function(e,t){function r(e){if(t._heightReference===f.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var r=s.cartesianToCartographic(e,B);r.height+=h.height,s.cartographicToCartesian(r,e)}else e.x+=h.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,d=c!==t._mode;if(t._mode=c,(t._heightReference===f.NONE||d)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==f.NONE&&l(t._position)){var h=s.cartesianToCartographic(t._position);if(l(h)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(h,r),n.clone(h,B);var p=a.getHeight(h);l(p)&&(B.height=p),s.cartographicToCartesian(B,F),r(F)}}}},y.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,P)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),C(this,E))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),C(this,S)};var k=new r;y._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===_.SCENE3D?t:(h.multiplyByPoint(r,t,k),g.computeActualWgs84Position(i,k))};var V=new i;
y._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=h.multiplyByPoint(e,i,V),u=g.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=r.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==_.SCENE3D)){var a=e.mapProjection,s=a.ellipsoid,u=a.unproject(o,B);o=s.cartographicToCartesian(u,V),n=h.IDENTITY}var c=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,i);return c},y.getScreenSpaceBoundingBox=function(t,i,r){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=i.x;t.horizontalOrigin===m.RIGHT?s-=n:t.horizontalOrigin===m.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===v.BOTTOM||t.verticalOrigin===v.BASELINE?u-=o:t.verticalOrigin===v.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},y.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._heightReference===r._heightReference&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&p.equals(this._scaleByDistance,r._scaleByDistance)&&p.equals(this._translucencyByDistance,r._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&d.equals(this._distanceDisplayCondition,r._distanceDisplayCondition)},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),define("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,d,h=[],p={},f=l.length,m=0;m<f;++m){var _=l[m];_.vertexBuffer?h.push(_):(d=_.usage,c=p[d],i(c)||(c=p[d]=[]),c.push(_))}this._allBuffers=[];for(d in p)if(p.hasOwnProperty(d)){c=p[d],c.sort(s);var g=u._vertexSizeInBytes(c),v=c[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:v,needsCommit:!1,arrayBuffer:void 0,arrayViews:u._createArrayViews(c,g)};this._allBuffers.push(y)}this._size=0,this._instanced=t(a,!1),this._precreated=h,this._context=r,this.writers=void 0,this.va=void 0,this.resize(o)}function c(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes<n)return o&&r.destroy(),t.vertexBuffer=a.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function d(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function h(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n<r;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(i){for(var r=[],n=0;n<i.length;++n){var o=i[n],a={index:t(o.index,n),enabled:t(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:t(o.componentDatatype,e.FLOAT),normalize:t(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:t(o.usage,s.STATIC_DRAW)};r.push(a)}for(var l=new Array(r.length),u=0;u<r.length;++u){var c=r[u],d=c.index;l[d]=!0}return r},u._vertexSizeInBytes=function(t){for(var i=0,r=t.length,n=0;n<r;++n){var o=t[n];i+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=r>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;a<o;++a){var s=t[a],l=s.componentDatatype;r.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:i/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return r},u.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;i<r;++i){var n=t[i];u._resize(n,this._size),u._appendWriters(this.writers,n)}h(this)},u._resize=function(t,r){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l<s;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,d=0;d<c;++d){var h=u[d];h.view=e.createArrayBufferView(h.componentDatatype,n,h.offsetInBytes)}t.arrayBuffer=n}};var p=[function(e,t,i){return function(r,n){t[r*i]=n,e.needsCommit=!0}},function(e,t,i){return function(r,n,o){var a=r*i;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a){var s=r*i;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a,s){var l=r*i;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return u._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;n<r;++n){var o=i[n];e[o.index]=p[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},u.prototype.commit=function(e){var t,r,n,a=!1,s=this._allBuffers;for(r=0,n=s.length;r<n;++r)t=s[r],a=c(this,t)||a;if(a||!i(this.va)){h(this);for(var d=this.va=[],p=i(e)?Math.ceil(this._size/(o.SIXTY_FOUR_KILOBYTES-1)):1,f=0;f<p;++f){var m=[];for(r=0,n=s.length;r<n;++r){t=s[r];var _=f*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(m,t,_,this._instanced)}m=m.concat(this._precreated),d.push({va:new l({context:this._context,attributes:m,indexBuffer:e}),indicesCount:1.5*(f!==p-1?o.SIXTY_FOUR_KILOBYTES-1:this._size%(o.SIXTY_FOUR_KILOBYTES-1))})}}},u._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,o=n.length,a=0;a<o;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},u.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;r<n;++r)d(i[r],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return h(this),r(this)},u}),define("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate += originTranslate / czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y  * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),define("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";var t={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return e(t)}),define("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,d;if(t(i.colorTextures)){var h=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=h.length,u=0;u<c;++u)n=h[u],d=this._gl.COLOR_ATTACHMENT0+u,s(this,d,n),this._activeColorAttachments[u]=d,this._colorTextures[u]=n}if(t(i.colorRenderbuffers)){var p=i.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,u=0;u<c;++u)o=p[u],d=this._gl.COLOR_ATTACHMENT0+u,l(this,d,o),this._activeColorAttachments[u]=d,this._colorRenderbuffers[u]=o}t(i.depthTexture)&&(n=i.depthTexture,s(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),t(i.depthRenderbuffer)&&(o=i.depthRenderbuffer,l(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),t(i.stencilRenderbuffer)&&(o=i.stencilRenderbuffer,l(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),t(i.depthStencilTexture)&&(n=i.depthStencilTexture,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),t(i.depthStencilRenderbuffer)&&(o=i.depthStencilRenderbuffer,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(u.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),u.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},u.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},u.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},u.prototype.getColorTexture=function(e){return this._colorTextures[e]},u.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,i=this._colorTextures,n=i.length;e<n;++e){var o=i[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;e<n;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),r(this)},u}),define("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/Texture","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,i,n,o,a){this.bottomLeft=r(e,t.ZERO),this.topRight=r(i,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function m(e){e=r(e,r.EMPTY_OBJECT);var t=r(e.borderWidthInPixels,1),n=r(e.initialSize,y);this._context=e.context,this._pixelFormat=r(e.pixelFormat,u.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=i(),this._idHash={},this._initialSize=n,this._root=void 0}function _(e,i){var r=e._context,o=e.numberOfImages,a=2,s=e._borderWidthInPixels;if(o>0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+i.width+s),p=a*(u+i.height+s),m=l/c,_=u/p,g=new f(new t(l+s,s),new t(c,u)),v=new f(new t,new t(c,u),e._root,g),y=new f(new t(s,u+s),new t(c,p)),C=new f(new t,new t(c,p),v,y),w=0;w<e._textureCoordinates.length;w++){var S=e._textureCoordinates[w];n(S)&&(S.x*=m,S.y*=_,S.width*=m,S.height*=_)}var E=new h({context:e._context,width:c,height:p,pixelFormat:e._pixelFormat}),b=new d({context:r,colorTextures:[e._texture],destroyAttachments:!1});b._bind(),E.copyFromFramebuffer(0,0,0,0,c,p),b._unBind(),b.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=E,e._root=C}else{var T=a*(i.width+2*s),x=a*(i.height+2*s);T<e._initialSize.x&&(T=e._initialSize.x),x<e._initialSize.y&&(x=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new h({context:e._context,width:T,height:x,pixelFormat:e._pixelFormat}),e._root=new f(new t(s,s),new t(T,x))}}function g(e,i,r){if(n(i)){if(!n(i.childNode1)&&!n(i.childNode2)){if(n(i.imageIndex))return;var o=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,s=o-r.width,l=a-r.height;if(s<0||l<0)return;if(0===s&&0===l)return i;if(s>l){i.childNode1=new f(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u<i.topRight.x&&(i.childNode2=new f(new t(u,i.bottomLeft.y),new t(i.topRight.x,i.topRight.y)))}else{i.childNode1=new f(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.topRight.x,i.bottomLeft.y+r.height));var c=i.bottomLeft.y+r.height+e._borderWidthInPixels;c<i.topRight.y&&(i.childNode2=new f(new t(i.bottomLeft.x,c),new t(i.topRight.x,i.topRight.y)))}return g(e,i.childNode1,r)}return g(e,i.childNode1,r)||g(e,i.childNode2,r)}}function v(t,r,o){var a=g(t,t._root,r);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,d=a.bottomLeft.x/s,h=a.bottomLeft.y/l,p=u/s,f=c/l;t._textureCoordinates[o]=new e(d,h,p,f),t._texture.copyFrom(r,a.bottomLeft.x,a.bottomLeft.y)}else _(t,r),v(t,r,o);t._guid=i()}var y=new t(16,16);return o(m.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return n(this._texture)||(this._texture=new h({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),m.prototype.addImage=function(e,t){var i=this._idHash[e];if(n(i))return i;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var r=this;return i=p(t,function(e){if(r.isDestroyed())return-1;var t=r.numberOfImages;return v(r,e,t),t}),this._idHash[e]=i,i},m.prototype.addSubRegion=function(t,r){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return p(o,function(t){if(t===-1)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+r.x/n,c=l.y+r.y/o,d=r.width/n,h=r.height/o;return a._textureCoordinates.push(new e(u,c,d,h)),a._guid=i(),s})},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},m}),define("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./BlendOption","./HeightReference","./HorizontalOrigin","./SceneMode","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O){"use strict";function N(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._compiledShaderAlignedAxisPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(me),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new t,this._baseVolumeWC=new t,this._baseVolume2D=new t,this._boundingVolume=new t,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.blendOption=a(e.blendOption,P.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=I.SCENE3D,this._buffersUsage=[g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW];var i=this;this._uniforms={u_atlas:function(){return i._textureAtlas.texture}};var r=this._scene;s(r)&&(this._removeCallbackFunc=r.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)e[i]._updateClamping()},this))}function L(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function B(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function F(e){var t=16384,i=e.cache.billboardCollection_indexBufferBatched;if(s(i))return i;for(var r=6*t-6,n=new Uint16Array(r),o=0,a=0;o<r;o+=6,a+=4)n[o]=a,n[o+1]=a+1,n[o+2]=a+2,n[o+3]=a+0,n[o+4]=a+2,n[o+5]=a+3;return i=_.createIndexBuffer({context:e,typedArray:n,usage:g.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),i.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=i,i}function k(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=_.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:g.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function V(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=_.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:g.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function z(e,t,i,r){var n=[{index:$.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[te]},{index:$.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[te]},{index:$.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ie]},{index:$.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[he]},{index:$.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[le]},{index:$.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[re]},{index:$.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[de]},{index:$.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[pe]},{index:$.distanceDisplayCondition,componentsPerAttribute:2,componentDatatype:o.FLOAT,usage:i[fe]}];r&&n.push({index:$.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:V(e)});var a=r?t:4*t;return new E(e,n,a,r)}function U(e,i,r,n,o){var a,s=n[$.positionHighAndScale],l=n[$.positionLowAndRotation],u=o._getActualPosition();e._mode===I.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),d.fromCartesian(u,ye);var c=o.scale,h=o.rotation;0!==h&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=ye.high,f=ye.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,f.x,f.y,f.z,h)):(a=4*o._index,s(a+0,p.x,p.y,p.z,c),s(a+1,p.x,p.y,p.z,c),s(a+2,p.x,p.y,p.z,c),s(a+3,p.x,p.y,p.z,c),l(a+0,f.x,f.y,f.z,h),l(a+1,f.x,f.y,f.z,h),l(a+2,f.x,f.y,f.z,h),l(a+3,f.x,f.y,f.z,h))}function G(t,i,r,n,o){var a,s=n[$.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,d=o._translate,h=d.x,f=d.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+h),Math.abs(-c+f));var m=o.horizontalOrigin,_=o._verticalOrigin,g=o.show&&o.clusterShow;0===o.color.alpha&&(g=!1),_===O.BASELINE&&(_=O.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&m===M.CENTER,t._allVerticalCenter=t._allVerticalCenter&&_===O.CENTER;var v=0,y=0,C=0,w=0,S=o._imageIndex;if(S!==-1){var E=r[S];v=E.x,y=E.y,C=E.width,w=E.height}var b=v+C,T=y+w,x=Math.floor(p.clamp(u,-we,we)+we)*be;x+=(m+1)*Te,x+=(_+1)*xe,x+=(g?1:0)*Ae;var A=Math.floor(p.clamp(c,-we,we)+we)*Ee,P=Math.floor(p.clamp(h,-we,we)+we)*Ee,D=(p.clamp(f,-we,we)+we)*Pe,I=Math.floor(D),R=Math.floor((D-I)*Ee);A+=I,P+=R,Ce.x=v,Ce.y=y;var N=e.compressTextureCoordinates(Ce);Ce.x=b;var L=e.compressTextureCoordinates(Ce);Ce.y=T;var B=e.compressTextureCoordinates(Ce);Ce.x=v;var F=e.compressTextureCoordinates(Ce);t._instanced?(a=o._index,s(a,x,A,P,N)):(a=4*o._index,s(a+0,x+De,A,P,N),s(a+1,x+Me,A,P,L),s(a+2,x+Ie,A,P,B),s(a+3,x+Re,A,P,F))}function H(t,i,n,o,l){var u,c=o[$.compressedAttribute1],d=l.alignedAxis;r.equals(d,r.ZERO)||(t._shaderAlignedAxis=!0);var h=0,f=1,m=1,_=1,g=l.translucencyByDistance;s(g)&&(h=g.near,f=g.nearValue,m=g.far,_=g.farValue,1===f&&1===_||(t._shaderTranslucencyByDistance=!0));var v=0,y=l._imageIndex;if(y!==-1){var C=n[y];v=C.width}var w=t._textureAtlas.texture.width,S=Math.round(a(l.width,w*v));t._maxSize=Math.max(t._maxSize,S);var E=p.clamp(S,0,Se),b=0;Math.abs(r.magnitudeSquared(d)-1)<p.EPSILON6&&(b=e.octEncodeFloat(d)),f=p.clamp(f,0,1),f=1===f?255:255*f|0,E=E*Ee+f,_=p.clamp(_,0,1),_=1===_?255:255*_|0,b=b*Ee+_,t._instanced?(u=l._index,c(u,E,b,h,m)):(u=4*l._index,c(u+0,E,b,h,m),c(u+1,E,b,h,m),c(u+2,E,b,h,m),c(u+3,E,b,h,m))}function W(e,t,i,o,s){var l,u=o[$.compressedAttribute2],c=s.color,d=s.getPickId(t).color,h=s.sizeInMeters?1:0,f=Math.abs(r.magnitudeSquared(s.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===h;var m=0,_=s._imageIndex;if(_!==-1){var g=i[_];m=g.height}var v=e._textureAtlas.texture.dimensions,y=Math.round(a(s.height,v.y*m));e._maxSize=Math.max(e._maxSize,y);var C=n.floatToByte(c.red),w=n.floatToByte(c.green),S=n.floatToByte(c.blue),E=C*Se+w*Ee+S;C=n.floatToByte(d.red),w=n.floatToByte(d.green),S=n.floatToByte(d.blue);var b=C*Se+w*Ee+S,T=n.floatToByte(c.alpha)*Se+n.floatToByte(d.alpha)*Ee;
T+=2*h+f,e._instanced?(l=s._index,u(l,E,b,T,y)):(l=4*s._index,u(l+0,E,b,T,y),u(l+1,E,b,T,y),u(l+2,E,b,T,y),u(l+3,E,b,T,y))}function q(t,i,r,n,o){var a,s=n[$.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==D.NONE&&(u*=1.005),t._maxEyeOffset=Math.max(t._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(u)),t._instanced){var c=0,d=0,h=o._imageIndex;if(h!==-1){var p=r[h];c=p.width,d=p.height}Ce.x=c,Ce.y=d;var f=e.compressTextureCoordinates(Ce);a=o._index,s(a,l.x,l.y,u,f)}else a=4*o._index,s(a+0,l.x,l.y,u,0),s(a+1,l.x,l.y,u,0),s(a+2,l.x,l.y,u,0),s(a+3,l.x,l.y,u,0)}function j(e,t,i,r,n){var o,a=r[$.scaleByDistance],l=0,u=1,c=1,d=1,h=n.scaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function Y(e,t,i,r,n){var o,a=r[$.pixelOffsetScaleByDistance],l=0,u=1,c=1,d=1,h=n.pixelOffsetScaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function X(e,t,i,r,n){var o,a=r[$.distanceDisplayCondition],l=0,u=Number.MAX_VALUE,c=n.distanceDisplayCondition;s(c)&&(l=c.near,u=c.far,e._shaderDistanceDisplayCondition=!0),e._instanced?(o=n._index,a(o,l,u)):(o=4*n._index,a(o+0,l,u),a(o+1,l,u),a(o+2,l,u),a(o+3,l,u))}function Z(e,t,i,r,n){U(e,t,i,r,n),G(e,t,i,r,n),H(e,t,i,r,n),W(e,t,i,r,n),q(e,t,i,r,n),j(e,t,i,r,n),Y(e,t,i,r,n),X(e,t,i,r,n)}function K(e,i,r,n,o,a){var l;n.mode===I.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c<r;++c){var d=i[c],h=d.position,p=x._computeActualPosition(d,h,n,o);s(p)&&(d._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function Q(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==I.SCENE3D&&!f.equals(o,e.modelMatrix)?(e._mode=i,f.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==I.SCENE3D&&i!==I.SCENE2D&&i!==I.COLUMBUS_VIEW||K(e,r,r.length,t,o,!0)):i===I.MORPHING?K(e,r,r.length,t,o,!0):i!==I.SCENE2D&&i!==I.COLUMBUS_VIEW||K(e,n,e._billboardsToUpdateIndex,t,o,!1)}function J(e,t,i){var r=1;e._allSizedInMeters&&0===e._maxPixelOffset||(r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=r*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=n+o}var $,ee=x.SHOW_INDEX,te=x.POSITION_INDEX,ie=x.PIXEL_OFFSET_INDEX,re=x.EYE_OFFSET_INDEX,ne=x.HORIZONTAL_ORIGIN_INDEX,oe=x.VERTICAL_ORIGIN_INDEX,ae=x.SCALE_INDEX,se=x.IMAGE_INDEX_INDEX,le=x.COLOR_INDEX,ue=x.ROTATION_INDEX,ce=x.ALIGNED_AXIS_INDEX,de=x.SCALE_BY_DISTANCE_INDEX,he=x.TRANSLUCENCY_BY_DISTANCE_INDEX,pe=x.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,fe=x.DISTANCE_DISPLAY_CONDITION_INDEX,me=x.NUMBER_OF_PROPERTIES,_e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,distanceDisplayCondition:8},ge={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,distanceDisplayCondition:9};l(N.prototype,{length:{get:function(){return B(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),N.prototype.add=function(e){var t=new x(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},N.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},N.prototype.removeAll=function(){L(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},N.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},N.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},N.prototype.get=function(e){return B(this),this._billboards[e]};var ve;N.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<me;++r){var n=0===i[r]?g.STATIC_DRAW:g.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var ye=new d,Ce=new i,we=32768,Se=65536,Ee=256,be=128,Te=32,xe=8,Ae=4,Pe=1/256,De=0,Me=2,Ie=3,Re=1,Oe=[];return N.prototype.update=function(e){B(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,$=this._instanced?ge:_e,ve=this._instanced?k:F;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new R({context:n});for(var a=0;a<r;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){Q(this,e),i=this._billboards,r=i.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,d=this._propertiesChanged,h=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==h;this._textureAtlasGUID=h;var _,g=e.passes,E=g.pick;if(p||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<me;++x)d[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=z(n,r,this._buffersUsage,this._instanced),_=this._vaf.writers;for(var D=0;D<r;++D){var M=this._billboards[D];M._dirty=!1,Z(this,n,l,_,M)}this._vaf.commit(ve(n))}this._billboardsToUpdateIndex=0}else if(c>0){var O=Oe;O.length=0,(d[te]||d[ue]||d[ae])&&O.push(U),(d[se]||d[ie]||d[ne]||d[oe]||d[ee])&&(O.push(G),this._instanced&&O.push(q)),(d[se]||d[ce]||d[he])&&(O.push(H),O.push(W)),(d[se]||d[le])&&O.push(W),d[re]&&O.push(q),d[de]&&O.push(j),d[pe]&&O.push(Y),d[fe]&&O.push(X);var N=O.length;if(_=this._vaf.writers,c/r>.1){for(var L=0;L<c;++L){var V=u[L];V._dirty=!1;for(var K=0;K<N;++K)O[K](this,n,l,_,V)}this._vaf.commit(ve(n))}else{for(var ye=0;ye<c;++ye){var Ce=u[ye];Ce._dirty=!1;for(var we=0;we<N;++we)O[we](this,n,l,_,Ce);this._instanced?this._vaf.subCommit(Ce._index,1):this._vaf.subCommit(4*Ce._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Se,Ee=f.IDENTITY;e.mode===I.SCENE3D?(Ee=this.modelMatrix,Se=t.clone(this._baseVolumeWC,this._boundingVolume)):Se=t.clone(this._baseVolume2D,this._boundingVolume),J(this,e,Se);var be=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,be){this._blendOption===P.OPAQUE||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=C.fromCache({depthTest:{enabled:!0,func:m.LESS},depthMask:!0}):this._rsOpaque=void 0;var Te=this._blendOption===P.TRANSLUCENT;this._blendOption===P.TRANSLUCENT||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=C.fromCache({depthTest:{enabled:!0,func:Te?m.LEQUAL:m.LESS},depthMask:Te,blending:A.ALPHA_BLEND}):this._rsTranslucent=void 0}(be||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition)&&(De=new S({sources:[T]}),this._instanced&&De.defines.push("INSTANCED"),this._shaderRotation&&De.defines.push("ROTATION"),this._shaderAlignedAxis&&De.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&De.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&De.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&De.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&De.defines.push("DISTANCE_DISPLAY_CONDITION"),this._blendOption===P.OPAQUE_AND_TRANSLUCENT&&(Me=new S({defines:["OPAQUE"],sources:[b]}),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:De,fragmentShaderSource:Me,attributeLocations:$}),Me=new S({defines:["TRANSLUCENT"],sources:[b]}),this._spTranslucent=w.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:De,fragmentShaderSource:Me,attributeLocations:$})),this._blendOption===P.OPAQUE&&(Me=new S({sources:[b]}),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:De,fragmentShaderSource:Me,attributeLocations:$})),this._blendOption===P.TRANSLUCENT&&(Me=new S({sources:[b]}),this._spTranslucent=w.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:De,fragmentShaderSource:Me,attributeLocations:$})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayConditionPick||(De=new S({defines:["RENDER_FOR_PICK"],sources:[T]}),this._instanced&&De.defines.push("INSTANCED"),this._shaderRotation&&De.defines.push("ROTATION"),this._shaderAlignedAxis&&De.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&De.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&De.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&De.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&De.defines.push("DISTANCE_DISPLAY_CONDITION"),Me=new S({defines:["RENDER_FOR_PICK"],sources:[b]}),this._spPick=w.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:De,fragmentShaderSource:Me,attributeLocations:$}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition);var xe,Ae,Pe,De,Me,Ie,Re=e.commandList;if(g.render){var Ne=this._colorCommands,Le=this._blendOption===P.OPAQUE,Be=this._blendOption===P.OPAQUE_AND_TRANSLUCENT;xe=this._vaf.va,Ae=xe.length,Ne.length=Ae;var Fe=Be?2*Ae:Ae;for(Ie=0;Ie<Fe;++Ie){Pe=Ne[Ie],s(Pe)||(Pe=Ne[Ie]=new v);var ke=Le||Be&&Ie%2===0;Pe.pass=ke||!Be?y.OPAQUE:y.TRANSLUCENT,Pe.owner=this;var Ve=Be?Math.floor(Ie/2):Ie;Pe.boundingVolume=Se,Pe.modelMatrix=Ee,Pe.count=xe[Ve].indicesCount,Pe.shaderProgram=ke?this._sp:this._spTranslucent,Pe.uniformMap=this._uniforms,Pe.vertexArray=xe[Ve].va,Pe.renderState=ke?this._rsOpaque:this._rsTranslucent,Pe.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Pe.count=6,Pe.instanceCount=r),Re.push(Pe)}}if(E){var ze=this._pickCommands;for(xe=this._vaf.va,Ae=xe.length,ze.length=Ae,Ie=0;Ie<Ae;++Ie)Pe=ze[Ie],s(Pe)||(Pe=ze[Ie]=new v({pass:y.OPAQUE,owner:this})),Pe.boundingVolume=Se,Pe.modelMatrix=Ee,Pe.count=xe[Ie].indicesCount,Pe.shaderProgram=this._spPick,Pe.uniformMap=this._uniforms,Pe.vertexArray=xe[Ie].va,Pe.renderState=this._rsOpaque,this._instanced&&(Pe.count=6,Pe.instanceCount=r),Re.push(Pe)}}}},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return s(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),L(this._billboards),u(this)},N}),define("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),define("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function _(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function g(e,o){e=n(e,n.EMPTY_OBJECT),this._text=n(e.text,""),this._show=n(e.show,!0),this._font=n(e.font,"30px sans-serif"),this._fillColor=r.clone(n(e.fillColor,r.WHITE)),this._outlineColor=r.clone(n(e.outlineColor,r.BLACK)),this._outlineWidth=n(e.outlineWidth,1),this._showBackground=n(e.showBackground,!1),this._backgroundColor=n(e.backgroundColor,new r(.165,.165,.165,.8)),this._backgroundPadding=n(e.backgroundPadding,new t(7,5)),this._style=n(e.style,p.FILL),this._verticalOrigin=n(e.verticalOrigin,f.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,h.LEFT),this._pixelOffset=t.clone(n(e.pixelOffset,t.ZERO)),this._eyeOffset=i.clone(n(e.eyeOffset,i.ZERO)),this._position=i.clone(n(e.position,i.ZERO)),this._scale=n(e.scale,1),this._id=e.id,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._scaleByDistance=e.scaleByDistance,this._heightReference=n(e.heightReference,d.NONE),this._distanceDisplayCondition=e.distanceDisplayCondition,this._labelCollection=o,this._glyphs=[],this._backgroundBillboard=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this._updateClamping()}return a(g.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;o(n)&&(n.show=e)}var a=this._backgroundBillboard;o(a)&&(a.show=e)}}},position:{get:function(){return this._position},set:function(e){var t=this._position;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n].billboard;o(s)&&(s.position=e)}var l=this._backgroundBillboard;o(l)&&(l.position=e),this._heightReference!==d.NONE&&this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;o(n)&&(n.heightReference=e)}var a=this._backgroundBillboard;o(a)&&(a.heightReference=e),_(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,m(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,m(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;r.equals(t,e)||(r.clone(e,t),m(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),m(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,m(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;if(!r.equals(t,e)){r.clone(e,t);var i=this._backgroundBillboard;o(i)&&(i.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var i=this._backgroundPadding;t.equals(i,e)||(t.clone(e,i),_(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,m(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;if(!t.equals(i,e)){t.clone(e,i);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n];o(s.billboard)&&(s.billboard.pixelOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!u.equals(t,e)){this._translucencyByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.translucencyByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!u.equals(t,e)){this._pixelOffsetScaleByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;if(!u.equals(t,e)){this._scaleByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.scaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n];o(s.billboard)&&(s.billboard.eyeOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,_(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.verticalOrigin=e)}var a=this._backgroundBillboard;o(a)&&(a.verticalOrigin=e),_(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.scale=e)}var a=this._backgroundBillboard;o(a)&&(a.scale=e),_(this)}}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!l.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;o(a)&&(a.distanceDisplayCondition=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.id=e)}var a=this._backgroundBillboard;o(a)&&(a.id=e)}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition);var t=this._glyphs;e=n(e,this._position);for(var r=0,a=t.length;r<a;r++){var s=t[r];o(s.billboard)&&(s.billboard._clampedPosition=e,i.clone(e,s.billboard._position),i.clone(e,s.billboard._actualPosition))}var l=this._backgroundBillboard;o(l)&&(l._clampedPosition=e,i.clone(e,l._position),i.clone(e,l._actualPosition))}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;o(a)&&(a.clusterShow=e)}}}}),g.prototype._updateClamping=function(){c._updateClamping(this._labelCollection,this)},g.prototype.computeScreenSpacePosition=function(e,i){o(i)||(i=new t);var r=this._labelCollection,n=r.modelMatrix,a=o(this._actualClampedPosition)?this._actualClampedPosition:this._position,s=c._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,i);return s},g.getScreenSpaceBoundingBox=function(t,i,r){var n=0,a=0,s=0,l=0,u=t.scale,c=t._labelCollection._resolutionScale,d=t._backgroundBillboard;if(o(d))n=i.x+d._translate.x/c,a=i.y-d._translate.y/c,s=d.width*u,l=d.height*u,t.verticalOrigin===f.BOTTOM||t.verticalOrigin===f.BASELINE?a-=l:t.verticalOrigin===f.CENTER&&(a-=.5*l);else{n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(var h=0,p=0,m=t._glyphs,_=m.length,g=0;g<_;++g){var v=m[g],y=v.billboard;if(o(y)){var C=i.x+y._translate.x/c,w=i.y-y._translate.y/c,S=y.width*u,E=y.height*u;t.verticalOrigin===f.BOTTOM||t.verticalOrigin===f.BASELINE?w-=E:t.verticalOrigin===f.CENTER&&(w-=.5*E),n=Math.min(n,C),a=Math.min(a,w),h=Math.max(h,C+S),p=Math.max(p,w+E)}}s=h-n,l=p-a}return o(r)||(r=new e),r.x=n,r.y=a,r.width=s,r.height=l,r},g.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._text===e._text&&this._font===e._font&&i.equals(this._position,e._position)&&r.equals(this._fillColor,e._fillColor)&&r.equals(this._outlineColor,e._outlineColor)&&r.equals(this._backgroundColor,e._backgroundColor)&&t.equals(this._backgroundPadding,e._backgroundPadding)&&t.equals(this._pixelOffset,e._pixelOffset)&&i.equals(this._eyeOffset,e._eyeOffset)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&u.equals(this._scaleByDistance,e._scaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._id===e._id},g.prototype.isDestroyed=function(){return!1},g}),define("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./BlendOption","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function g(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function v(e,t){var i=document.createElement("canvas");i.width=D.x,i.height=D.y;var r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,i.width,i.height),e.addImage(P,i).then(function(e){t._whitePixelIndex=e})}function y(e,t,i,r,n,o,a){return I.font=t,I.fillColor=i,I.strokeColor=r,I.strokeWidth=n,a===m.CENTER?I.textBaseline="middle":a===m.TOP?I.textBaseline="top":I.textBaseline="bottom",I.fill=o===p.FILL||o===p.FILL_AND_OUTLINE,I.stroke=o===p.OUTLINE||o===p.FILL_AND_OUTLINE,l(e,I)}function C(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 w(e,t,i,r){e.addImage(t,i).then(function(e,t){r.index=e})}function S(e,t){var i,n,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(s<u)for(n=s;n<u;++n)C(e,l[n]);l.length=s;var c=t._showBackground&&a.split("\n").join("").length>0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(r(h)||(h=p.add({collection:e,image:P,imageSubRegion:M}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=d.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t._scale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition):r(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);var f=e._glyphTextureCache;for(o=0;o<s;++o){var m=a.charAt(o),v=t._font,S=t._fillColor,E=t._outlineColor,b=t._outlineWidth,T=t._style,x=t._verticalOrigin,A=JSON.stringify([m,v,S.toRgba(),E.toRgba(),b,+T,+x]),D=f[A];if(!r(D)){var I=y(m,v,S,E,b,T,x);D=new g(e,-1,I.dimensions),f[A]=D,I.width>0&&I.height>0&&w(e._textureAtlas,A,I,D)}if(i=l[o],r(i)?D.index===-1?C(e,i):r(i.textureInfo)&&(i.textureInfo=void 0):(i=new _,l[o]=i),i.textureInfo=D,i.dimensions=D.dimensions,D.index!==-1){var R=i.billboard,O=e._spareBillboards;r(R)||(R=O.length>0?O.pop():e._billboardCollection.add({collection:e}),i.billboard=R),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=d.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t._scale,R.pickPrimitive=t,R.id=t._id,R.image=A,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.scaleByDistance=t._scaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition}}t._repositionAllGlyphs=!0}function E(e,t,i){return t===d.CENTER?-e/2:t===d.RIGHT?-(e+i.x):i.x}function b(e,i){var n,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],h=Number.NEGATIVE_INFINITY,p=0,f=1,_=0,g=a.length,v=e._backgroundBillboard,y=O;for(t.clone(r(v)?e._backgroundPadding:t.ZERO,y),_=0;_<g;++_)"\n"===s.charAt(_)?(c.push(l),++f,l=0):(n=a[_],o=n.dimensions,p=Math.max(p,o.height-o.descent),h=Math.max(h,o.descent),l+=o.width-o.bounds.minx,_<g-1&&(l+=a[_+1].dimensions.bounds.minx),u=Math.max(u,l));c.push(l);var C=p+h,w=e._scale,S=e._horizontalOrigin,b=e._verticalOrigin,T=0,x=c[T],P=E(x,S,y),D=A*C,M=D*(f-1);R.x=P*w*i,R.y=0;var I=0;for(_=0;_<g;++_)if("\n"===s.charAt(_))++T,I+=D,x=c[T],P=E(x,S,y),R.x=P*w*i;else if(n=a[_],o=n.dimensions,b===m.TOP?R.y=o.height-p-y.y:b===m.CENTER?R.y=(M+o.height-p)/2:b===m.BASELINE?R.y=M:R.y=M+h+y.y,R.y=(R.y-o.descent-I)*w*i,r(n.billboard)&&n.billboard._setTranslate(R),_<g-1){var N=a[_+1];R.x+=(o.width-o.bounds.minx+N.dimensions.bounds.minx)*w*i}r(v)&&s.split("\n").join("").length>0&&(P=S===d.CENTER?-u/2-y.x:S===d.RIGHT?-(u+2*y.x):0,R.x=P*w*i,b===m.TOP?R.y=C-p-h:b===m.CENTER?R.y=(C-p)/2-h:b===m.BASELINE?R.y=-y.y-h:R.y=0,R.y=R.y*w*i,v.width=u+2*y.x,v.height=C+M+2*y.y,v._setTranslate(R))}function T(e,t){for(var i=t._glyphs,n=0,a=i.length;n<a;++n)C(e,i[n]);r(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,r(t._removeCallbackFunc)&&t._removeCallbackFunc(),o(t)}function x(e){e=i(e,i.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new u({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new u({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=s.clone(i(e.modelMatrix,s.IDENTITY)),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this.blendOption=i(e.blendOption,c.OPAQUE_AND_TRANSLUCENT)}var A=1.2,P="ID_WHITE_PIXEL",D=new t(4,4),M=new e(1,1,1,1),I={},R=new t,O=new t;return n(x.prototype,{length:{get:function(){return this._labels.length}}}),x.prototype.add=function(e){var t=new h(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},x.prototype.remove=function(e){if(r(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),T(this,e),!0}return!1},x.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;t<i;++t)T(this,e[t]);e.length=0},x.prototype.contains=function(e){return r(e)&&e._labelCollection===this},x.prototype.get=function(e){return this._labels[e]},x.prototype.update=function(e){var t=this._billboardCollection,i=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,i.modelMatrix=this.modelMatrix,i.debugShowBoundingVolume=this.debugShowBoundingVolume;var n=e.context;r(this._textureAtlas)||(this._textureAtlas=new f({context:n}),t.textureAtlas=this._textureAtlas),r(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new f({context:n,initialSize:D}),i.textureAtlas=this._backgroundTextureAtlas,v(this._backgroundTextureAtlas,this));var o=n.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=l.length,d=0;d<u;++d){var h=l[d];if(!h.isDestroyed()){var p=h._glyphs.length;h._rebindAllGlyphs&&(S(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(b(h,a),h._repositionAllGlyphs=!1);var m=h._glyphs.length-p;this._totalGlyphCount+=m}}var _=i.length>0?c.TRANSLUCENT:this.blendOption;t.blendOption=_,i.blendOption=_,this._labelsToUpdate.length=0,i.update(e),t.update(e)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),o(this)},x}),define("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){e=o(e,o.EMPTY_OBJECT),this._show=o(e.show,!0),this._position=i.clone(o(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._color=n.clone(o(e.color,n.WHITE)),this._outlineColor=n.clone(o(e.outlineColor,n.TRANSPARENT)),this._outlineWidth=o(e.outlineWidth,0),this._pixelSize=o(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=o(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}function m(e,t){var i=e._pointPrimitiveCollection;a(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var _=f.SHOW_INDEX=0,g=f.POSITION_INDEX=1,v=f.COLOR_INDEX=2,y=f.OUTLINE_COLOR_INDEX=3,C=f.OUTLINE_WIDTH_INDEX=4,w=f.PIXEL_SIZE_INDEX=5,S=f.SCALE_BY_DISTANCE_INDEX=6,E=f.TRANSLUCENCY_BY_DISTANCE_INDEX=7,b=f.DISTANCE_DISPLAY_CONDITION=8;f.NUMBER_OF_PROPERTIES=9,s(f.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,m(this,_))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),
i.clone(e,this._actualPosition),m(this,g))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),m(this,S))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),m(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,w))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),m(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),m(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this,C))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),m(this,b))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,m(this,_))}}}),f.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},f.prototype._getActualPosition=function(){return this._actualPosition},f.prototype._setActualPosition=function(e){i.clone(e,this._actualPosition),m(this,g)};var T=new r;f._computeActualPosition=function(e,t,i){return t.mode===h.SCENE3D?e:(c.multiplyByPoint(i,e,T),p.computeActualWgs84Position(t,T))};var x=new r;return f._computeScreenSpacePosition=function(e,t,i,n){var o=c.multiplyByVector(e,r.fromElements(t.x,t.y,t.z,1,x),x),a=p.wgs84ToWindowCoordinates(i,o,n);return a},f.prototype.computeScreenSpacePosition=function(e,i){var r=this._pointPrimitiveCollection;a(i)||(i=new t);var n=r.modelMatrix,o=f._computeScreenSpacePosition(n,this._actualPosition,e,i);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},f.getScreenSpaceBoundingBox=function(t,i,r){var n=t.pixelSize,o=.5*n,s=i.x-o,l=i.y-o,u=n,c=n;return a(r)||(r=new e),r.x=s,r.y=l,r.width=u,r.height=c,r},f.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&i.equals(this._position,e._position)&&n.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&n.equals(this._outlineColor,e._outlineColor)&&d.equals(this._scaleByDistance,e._scaleByDistance)&&d.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)},f.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},f}),define("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),define("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./BlendOption","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(Z),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(r(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=r(t.debugShowBoundingVolume,!1),this.blendOption=r(t.blendOption,b.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=x.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function P(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function D(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function M(e,t,r){return new C(e,[{index:K.positionHighAndSize,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:K.positionLowAndShow,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:K.compressedAttribute0,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[G]},{index:K.compressedAttribute1,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[Y]},{index:K.scaleByDistance,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[j]},{index:K.distanceDisplayCondition,componentsPerAttribute:2,componentDatatype:i.FLOAT,usage:r[X]}],t)}function I(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===x.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,Q);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=r[K.positionHighAndSize],d=Q.high;c(o,d.x,d.y,d.z,s);var h=r[K.positionLowAndOutline],p=Q.low;h(o,p.x,p.y,p.z,u)}function R(e,i,r,n){var o=n._index,a=n.color,s=n.getPickId(i).color,l=n.outlineColor,u=t.floatToByte(a.red),c=t.floatToByte(a.green),d=t.floatToByte(a.blue),h=u*J+c*$+d;u=t.floatToByte(l.red),c=t.floatToByte(l.green),d=t.floatToByte(l.blue);var p=u*J+c*$+d;u=t.floatToByte(s.red),c=t.floatToByte(s.green),d=t.floatToByte(s.blue);var f=u*J+c*$+d,m=t.floatToByte(a.alpha)*J+t.floatToByte(l.alpha)*$+t.floatToByte(s.alpha),_=r[K.compressedAttribute0];_(o,h,p,f,m)}function O(e,t,i,r){var o=r._index,a=0,s=1,l=1,c=1,d=r.translucencyByDistance;n(d)&&(a=d.near,s=d.nearValue,l=d.far,c=d.farValue,1===s&&1===c||(e._shaderTranslucencyByDistance=!0));var h=r.show&&r.clusterShow;0===r.color.alpha&&0===r.outlineColor.alpha&&(h=!1),s=u.clamp(s,0,1),s=1===s?255:255*s|0;var p=(h?1:0)*$+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var f=c,m=i[K.compressedAttribute1];m(o,p,f,a,l)}function N(e,t,i,r){var o=r._index,a=i[K.scaleByDistance],s=0,l=1,u=1,c=1,d=r.scaleByDistance;n(d)&&(s=d.near,l=d.nearValue,u=d.far,c=d.farValue,1===l&&1===c||(e._shaderScaleByDistance=!0)),a(o,s,l,u,c)}function L(e,t,i,r){var o=r._index,a=i[K.distanceDisplayCondition],s=0,l=Number.MAX_VALUE,u=r.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,e._shaderDistanceDisplayCondition=!0),a(o,s,l)}function B(e,t,i,r){I(e,t,i,r),R(e,t,i,r),O(e,t,i,r),N(e,t,i,r),L(e,t,i,r)}function F(t,i,r,o,a,s){var l;o.mode===x.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;c<r;++c){var d=i[c],h=d.position,p=T._computeActualPosition(h,o,a);n(p)&&(d._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function k(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==x.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=i,c.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==x.SCENE3D&&i!==x.SCENE2D&&i!==x.COLUMBUS_VIEW||F(e,r,r.length,t,o,!0)):i===x.MORPHING?F(e,r,r.length,t,o,!0):i!==x.SCENE2D&&i!==x.COLUMBUS_VIEW||F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function V(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var z=T.SHOW_INDEX,U=T.POSITION_INDEX,G=T.COLOR_INDEX,H=T.OUTLINE_COLOR_INDEX,W=T.OUTLINE_WIDTH_INDEX,q=T.PIXEL_SIZE_INDEX,j=T.SCALE_BY_DISTANCE_INDEX,Y=T.TRANSLUCENCY_BY_DISTANCE_INDEX,X=T.DISTANCE_DISPLAY_CONDITION_INDEX,Z=T.NUMBER_OF_PROPERTIES,K={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayCondition:5};o(A.prototype,{length:{get:function(){return D(this),this._pointPrimitives.length}}}),A.prototype.add=function(e){var t=new T(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},A.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},A.prototype.removeAll=function(){P(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},A.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},A.prototype.contains=function(e){return n(e)&&e._pointPrimitiveCollection===this},A.prototype.get=function(e){return D(this),this._pointPrimitives[e]},A.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<Z;++r){var n=0===i[r]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var Q=new l,J=65536,$=256,ee=[];return A.prototype.update=function(t){D(this),this._maxTotalPointSize=f.maximumAliasedPointSize,k(this,t);var i,r=this._pointPrimitives,o=r.length,a=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,p=t.context,C=t.passes,T=C.pick;if(u||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var A=0;A<Z;++A)l[A]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=M(p,o,this._buffersUsage),i=this._vaf.writers;for(var P=0;P<o;++P){var F=this._pointPrimitives[P];F._dirty=!1,B(this,p,i,F)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var Q=ee;Q.length=0,(l[U]||l[W]||l[q])&&Q.push(I),(l[G]||l[H])&&Q.push(R),(l[z]||l[Y])&&Q.push(O),l[j]&&Q.push(N),l[X]&&Q.push(L);var J=Q.length;if(i=this._vaf.writers,s/o>.1){for(var $=0;$<s;++$){var te=a[$];te._dirty=!1;for(var ie=0;ie<J;++ie)Q[ie](this,p,i,te)}this._vaf.commit()}else{for(var re=0;re<s;++re){var ne=a[re];ne._dirty=!1;for(var oe=0;oe<J;++oe)Q[oe](this,p,i,ne);this._vaf.subCommit(ne._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var ae,se=c.IDENTITY;t.mode===x.SCENE3D?(se=this.modelMatrix,ae=e.clone(this._baseVolumeWC,this._boundingVolume)):ae=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,ae);var le=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,le&&(this._blendOption===b.OPAQUE||this._blendOption===b.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=g.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===b.TRANSLUCENT||this._blendOption===b.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=g.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!1,blending:E.ALPHA_BLEND}):this._rsTranslucent=void 0),(le||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition)&&(pe=new y({sources:[S]}),this._shaderScaleByDistance&&pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._blendOption===b.OPAQUE_AND_TRANSLUCENT&&(fe=new y({defines:["OPAQUE"],sources:[w]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K}),fe=new y({defines:["TRANSLUCENT"],sources:[w]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K})),this._blendOption===b.OPAQUE&&(fe=new y({sources:[w]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K})),this._blendOption===b.TRANSLUCENT&&(fe=new y({sources:[w]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),(!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick)&&(pe=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&pe.defines.push("DISTANCE_DISPLAY_CONDITION"),fe=new y({defines:["RENDER_FOR_PICK"],sources:[w]}),this._spPick=v.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition);var ue,ce,de,he,pe,fe,me=t.commandList;if(C.render){var _e=this._colorCommands,ge=this._blendOption===b.OPAQUE,ve=this._blendOption===b.OPAQUE_AND_TRANSLUCENT;ue=this._vaf.va,ce=ue.length,_e.length=ce;var ye=ve?2*ce:ce;for(he=0;he<ye;++he){var Ce=ge||ve&&he%2===0;de=_e[he],n(de)||(de=_e[he]=new m),de.primitiveType=d.POINTS,de.pass=Ce||!ve?_.OPAQUE:_.TRANSLUCENT,de.owner=this;var we=ve?Math.floor(he/2):he;de.boundingVolume=ae,de.modelMatrix=se,de.shaderProgram=Ce?this._sp:this._spTranslucent,de.uniformMap=this._uniforms,de.vertexArray=ue[we].va,de.renderState=Ce?this._rsOpaque:this._rsTranslucent,de.debugShowBoundingVolume=this.debugShowBoundingVolume,me.push(de)}}if(T){var Se=this._pickCommands;for(ue=this._vaf.va,ce=ue.length,Se.length=ce,he=0;he<ce;++he)de=Se[he],n(de)||(de=Se[he]=new m({primitiveType:d.POINTS,pass:_.OPAQUE,owner:this})),de.boundingVolume=ae,de.modelMatrix=se,de.shaderProgram=this._spPick,de.uniformMap=this._uniforms,de.vertexArray=ue[he].va,de.renderState=this._rsOpaque,me.push(de)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),P(this._pointPrimitives),a(this)},A}),define("ThirdParty/kdbush",[],function(){"use strict";function e(e,i,r,n,o){return new t(e,i,r,n,o)}function t(e,t,n,a,s){t=t||i,n=n||r,s=s||Array,this.nodeSize=a||64,this.points=e,this.ids=new s(e.length),this.coords=new s(2*e.length);for(var l=0;l<e.length;l++)this.ids[l]=l,this.coords[2*l]=t(e[l]),this.coords[2*l+1]=n(e[l]);o(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function i(e){return e[0]}function r(e){return e[1]}function n(e,t,i,r,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var d=u.pop(),h=u.pop(),p=u.pop();if(h-p<=a)for(var f=p;f<=h;f++)s=t[2*f],l=t[2*f+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[f]);else{var m=Math.floor((p+h)/2);s=t[2*m],l=t[2*m+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[m]);var _=(d+1)%2;(0===d?i<=s:r<=l)&&(u.push(p),u.push(m-1),u.push(_)),(0===d?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(_))}}return c}function o(e,t,i,r,n,s){if(!(n-r<=i)){var l=Math.floor((r+n)/2);a(e,t,l,r,n,s%2),o(e,t,i,r,l-1,s+1),o(e,t,i,l+1,n,s+1)}}function a(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var l=n-r+1,u=i-r+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(i-u*d/l+h)),f=Math.min(n,Math.floor(i+(l-u)*d/l+h));a(e,t,i,p,f,o)}var m=t[2*i+o],_=r,g=n;for(s(e,t,r,i),t[2*n+o]>m&&s(e,t,r,n);_<g;){for(s(e,t,_,g),_++,g--;t[2*_+o]<m;)_++;for(;t[2*g+o]>m;)g--}t[2*r+o]===m?s(e,t,r,g):(g++,s(e,t,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}function s(e,t,i,r){l(e,i,r),l(t,2*i,2*r),l(t,2*i+1,2*r+1)}function l(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function u(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),d=a.pop(),h=a.pop();if(d-h<=o)for(var p=h;p<=d;p++)c(t[2*p],t[2*p+1],i,r)<=l&&s.push(e[p]);else{var f=Math.floor((h+d)/2),m=t[2*f],_=t[2*f+1];c(m,_,i,r)<=l&&s.push(e[f]);var g=(u+1)%2;(0===u?i-n<=m:r-n<=_)&&(a.push(h),a.push(f-1),a.push(g)),(0===u?i+n>=m:r+n>=_)&&(a.push(f+1),a.push(d),a.push(g))}}return s}function c(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}return t.prototype={range:function(e,t,i,r){return n(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return u(this.ids,this.coords,e,t,i,this.nodeSize)}},e}),define("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../Scene/SceneMode","../ThirdParty/kdbush"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){e=r(e,r.EMPTY_OBJECT),this._enabled=r(e.enabled,!1),this._pixelRange=r(e.pixelRange,80),this._minimumClusterSize=r(e.minimumClusterSize,2),this._clusterBillboards=r(e.clusterBillboards,!0),this._clusterLabels=r(e.clusterLabels,!0),this._clusterPoints=r(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new s}function v(e){return e.coord.x}function y(e){return e.coord.y}function C(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function w(t,i,r,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=d.getScreenSpaceBoundingBox(t,i,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,i,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,i,a)),C(a,r),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&b(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=d.getScreenSpaceBoundingBox(l,i,I);C(c,r),a=e.union(a,c,a)}return a}function S(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&b(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id],r=t._labelCollection.get(i);r.clusterShow=!0}}function E(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function b(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function T(e,t,i,r,o){if(n(e))for(var a=e.length,s=0;s<a;++s){var l=e.get(s);if(l.clusterShow=!1,l.show&&(o._scene.mode!==m.SCENE3D||r.isPointVisible(l.position))){var u=o._clusterLabels&&n(l._labelCollection),c=o._clusterBillboards&&n(l.id._billboard),d=o._clusterPoints&&n(l.id._point);if(!u||!d&&!c){var h=l.computeScreenSpacePosition(i);n(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}}}function x(r){return function(o){if(!(n(o)&&o<.05)&&r.enabled){var s=r._scene,d=r._labelCollection,p=r._billboardCollection,m=r._pointCollection;if((n(d)||n(p)||n(m))&&(r._clusterBillboards||r._clusterLabels||r._clusterPoints)){var g=r._clusterLabelCollection,C=r._clusterBillboardCollection,b=r._clusterPointCollection;n(g)?g.removeAll():g=r._clusterLabelCollection=new h({scene:s}),n(C)?C.removeAll():C=r._clusterBillboardCollection=new c({scene:s}),n(b)?b.removeAll():b=r._clusterPointCollection=new f;var x=r._pixelRange,A=r._minimumClusterSize,P=r._previousClusters,D=[],M=r._previousHeight,I=s.camera.positionCartographic.height,L=s.mapProjection.ellipsoid,B=s.camera.positionWC,F=new a(L,B),k=[];r._clusterLabels&&T(d,k,s,F,r),r._clusterBillboards&&T(p,k,s,F,r),r._clusterPoints&&T(m,k,s,F,r);var V,z,U,G,H,W,q,j,Y,X,Z,K,Q=_(k,v,y,64,Int32Array);if(I<M)for(U=P.length,V=0;V<U;++V){var J=P[V];if(F.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,i.ZERO,t.ZERO,s);if(n($)){var ee=1-I/M,te=J.width=J.width*ee,ie=J.height=J.height*ee;te=Math.max(te,J.minimumWidth),ie=Math.max(ie,J.minimumHeight);var re=$.x-.5*te,ne=$.y-.5*ie,oe=$.x+te,ae=$.y+ie;for(H=Q.range(re,ne,oe,ae),W=H.length,X=0,Y=[],z=0;z<W;++z)q=H[z],j=k[q],j.clustered||(++X,Z=j.collection,K=j.index,Y.push(Z.get(K).id));if(X>=A)for(E(J.position,X,Y,r),D.push(J),z=0;z<W;++z)k[H[z]].clustered=!0}}}for(U=k.length,V=0;V<U;++V){var se=k[V];if(!se.clustered){se.clustered=!0,Z=se.collection,K=se.index;var le=Z.get(K);G=w(le,se.coord,x,r,R);var ue=e.clone(G,O);H=Q.range(G.x,G.y,G.x+G.width,G.y+G.height),W=H.length;var ce=i.clone(le.position);for(X=1,Y=[le.id],z=0;z<W;++z)if(q=H[z],j=k[q],!j.clustered){var de=j.collection.get(j.index),he=w(de,j.coord,x,r,N);i.add(de.position,ce,ce),e.union(ue,he,ue),++X,Y.push(de.id)}if(X>=A){var pe=i.multiplyByScalar(ce,1/X,ce);for(E(pe,X,Y,r),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),z=0;z<W;++z)k[H[z]].clustered=!0}else S(le,r)}}0===g.length&&(g.destroy(),r._clusterLabelCollection=void 0),0===C.length&&(C.destroy(),r._clusterBillboardCollection=void 0),0===b.length&&(b.destroy(),r._clusterPointCollection=void 0),r._previousClusters=D,r._previousHeight=I}}}}function A(e,t,i,r){return function(o){var a=this[e];n(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var s=this._collectionIndicesByEntity[o.id];if(n(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),n(a)&&n(s[r]))return a.get(s[r]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[i];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function P(e,t){var i=e._collectionIndicesByEntity[t];n(i.billboardIndex)||n(i.labelIndex)||n(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function D(e){if(n(e))for(var t=e.length,i=0;i<t;++i)e.get(i).clusterShow=!0}function M(e){e.enabled||(n(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),n(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),n(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,D(e._labelCollection),D(e._billboardCollection),D(e._pointCollection))}var I=new e,R=new e,O=new e,N=new e;return g.prototype._initialize=function(e){this._scene=e;var t=x(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},o(g.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),g.prototype.getLabel=A("_labelCollection",h,"_unusedLabelIndices","labelIndex"),g.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._labelCollection)&&n(t)&&n(t.labelIndex)){var i=t.labelIndex;t.labelIndex=void 0,P(this,e.id);var r=this._labelCollection.get(i);r.show=!1,r.text="",r.id=void 0,this._unusedLabelIndices.push(i),this._clusterDirty=!0}},g.prototype.getBillboard=A("_billboardCollection",c,"_unusedBillboardIndices","billboardIndex"),g.prototype.removeBillboard=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._billboardCollection)&&n(t)&&n(t.billboardIndex)){var i=t.billboardIndex;t.billboardIndex=void 0,P(this,e.id);var r=this._billboardCollection.get(i);r.id=void 0,r.show=!1,r.image=void 0,this._unusedBillboardIndices.push(i),this._clusterDirty=!0}},g.prototype.getPoint=A("_pointCollection",f,"_unusedPointIndices","pointIndex"),g.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._pointCollection)&&n(t)&&n(t.pointIndex)){var i=t.pointIndex;t.pointIndex=void 0,P(this,e.id);var r=this._pointCollection.get(i);r.show=!1,r.id=void 0,this._unusedPointIndices.push(i),this._clusterDirty=!0}},g.prototype.update=function(e){if(n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length){
var t=e.commandList;e.commandList=[],this._labelCollection.update(e),e.commandList=t}this._enabledDirty&&(this._enabledDirty=!1,M(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),n(this._pointCollection)&&this._pointCollection.update(e)},g.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},g}),define("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new r,this._error=new r,this._isLoading=!1,this._loading=new r,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),define("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new f(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var _=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(r)),a=t.fromColor(_),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(i);return new h({id:n,geometry:new r(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=e.position,h=a.length,f=a.topRadius,g=a.bottomRadius,v=a.show;if(o(v)&&v.isConstant&&!v.getValue(p.MINIMUM_VALUE)||!o(d)||!o(h)||!o(f)||!o(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=n(a.material,A),w=C instanceof y;this._materialProperty=C,this._fillProperty=n(s,D),this._showProperty=n(v,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var S=a.slices,b=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(e.orientation)&&h.isConstant&&f.isConstant&&g.isConstant&&E.isConstant(S)&&E.isConstant(b)&&E.isConstant(T)){var x=this._options;x.vertexFormat=w?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,x.length=h.getValue(p.MINIMUM_VALUE),x.topRadius=f.getValue(p.MINIMUM_VALUE),x.bottomRadius=g.getValue(p.MINIMUM_VALUE),x.slices=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l._getModelMatrix(n),f=E.getValueOrUndefined(u.length,n),v=E.getValueOrUndefined(u.topRadius,n),y=E.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(f)&&o(v)&&o(y)){d.length=f,d.topRadius=v,d.bottomRadius=y,d.slices=E.getValueOrUndefined(u.slices,n),d.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty,b=w.getValue(n),T=c.fromDistanceDisplayCondition(b);if(E.getValueOrDefault(u.fill,n,!0)){var x=S.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var A=new m({material:x,translucent:x.isTranslucent(),closed:!0});d.vertexFormat=A.vertexFormat,this._primitive=a.add(new g({geometryInstances:new h({id:l,geometry:new i(d),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:A,asynchronous:!1,shadows:C}))}if(E.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=_.VERTEX_FORMAT;var P=E.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),D=E.getValueOrDefault(u.outlineWidth,n,1),M=1!==P.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new h({id:l,geometry:new r(d),modelMatrix:p,attributes:{color:t.fromColor(P),distanceDisplayCondition:T}}),appearance:new _({flat:!0,translucent:M,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:C}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),define("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var i={HIGHLIGHT:0,REPLACE:1,MIX:2};return i.getColorBlend=function(e,r){return e===i.HIGHLIGHT?0:e===i.REPLACE?1:e===i.MIX?t.clamp(r,t.EPSILON4,1):void 0},e(i)}),define("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(r){return i(r)||(r=new e),r.startTime=t(this.startTime,r.startTime),r.stopTime=t(this.stopTime,r.stopTime),r.currentTime=t(this.currentTime,r.currentTime),r.clockRange=t(this.clockRange,r.clockRange),r.multiplier=t(this.multiplier,r.multiplier),r.clockStep=t(this.clockStep,r.clockStep),r},l}),define("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,d=new e(8,8),h=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,d,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,h,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),define("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),define("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),define("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;r<i;r++)if(!s.isConstant(e[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._value;if(t(n)){var o=n.length;t(r)||(r=new Array(o));for(var a=0,s=0;a<o;){var l=n[a],u=l.getValueInReferenceFrame(e,i,r[a]);t(u)&&(r[s]=u,s++),a++}return r.length=s,r}},l.prototype.setValue=function(e){var i=this._eventHelper;if(i.removeAll(),t(e)){this._value=e.slice();for(var r=e.length,n=0;n<r;n++){var o=e[n];t(o)&&i.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),define("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new r,this._eventHelper=new n,this.setValue(e)}return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var i=t.length,r=0;r<i;r++)if(!o.isConstant(t[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,i){var r=this._value;if(e(r)){var n=r.length;e(i)||(i=new Array(n));for(var o=0,a=0;o<n;){var s=this._value[o],l=s.getValue(t,i[o]);e(l)&&(i[a]=l,a++),o++}return i.length=a,i}},a.prototype.setValue=function(t){var i=this._eventHelper;if(i.removeAll(),e(t)){this._value=t.slice();for(var r=t.length,n=0;n<r;n++){var o=t[n];e(o)&&i.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,i,r,n,o){"use strict";function a(t){var i=!0;if(t._resolveEntity){var r=t._targetCollection.getById(t._targetId);if(e(r)?(r.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=r,t._resolveEntity=!1):(r=t._targetEntity,i=!1),!e(r))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return i}function s(t){var i=t._targetProperty;if(t._resolveProperty){var r=a(t),o=t._targetPropertyNames;i=t._targetEntity;for(var s=o.length,l=0;l<s&&e(i);l++)i=i[o[l]];if(e(i))t._targetProperty=i,t._resolveProperty=!r;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return i}function l(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new r,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var i,r=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(i=a,n=!1,a=""):n||"."!==u?a+=u:(r.push(a),a="")}return r.push(a),new l(e,i,r)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s(this).getValueInReferenceFrame(e,t,i)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;n<r;n++)if(t[n]!==i[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,i,r){var n=this._targetEntity;e(n)&&(r.indexOf(n)!==-1?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),define("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,i,r){"use strict";var n={packedLength:1,pack:function(t,i,r){return r=e(r,0),i[r]=t,i},unpack:function(t,i,r){return i=e(i,0),t[i]},convertPackedArrayForInterpolation:function(t,i,n,o){i=e(i,0),n=e(n,t.length);for(var a,s=0,l=n-i+1;s<l;s++){var u=t[i+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-r.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,i,n,o){return o=e[0],o<0?o+r.TWO_PI:o}};return n}),define("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r,n=e.length,o=i.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(r=a-1;r>=t;r--)e[r]=e[s--]}for(r=0;r<o;r++)e[t++]=i[r]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function d(t,r,n,o,a){for(var l,d,h,p,_,g,v=0;v<o.length;){_=c(o[v],t),h=e(r,_,s.compare);var y=0,C=0;if(h<0){for(h=~h,p=h*a,d=void 0,g=r[h];v<o.length&&(_=c(o[v],t),!(i(d)&&s.compare(d,_)>=0||i(g)&&s.compare(_,g)>=0));){for(f[y++]=_,v+=1,l=0;l<a;l++)m[C++]=o[v],v+=1;d=_}y>0&&(m.length=C,u(n,p,m),f.length=y,u(r,h,f))}else{for(l=0;l<a;l++)v++,n[h*a+l]=o[v];v++}}}function h(e,r){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),d=0;if(i(r)){var h=r.length;s=new Array(h);for(var f=0;f<h;f++){var m=r[f];m===Number&&(m=p);var _=m.packedLength;u+=_,c+=t(m.packedInterpolationLength,_),s[f]=m}d=h}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=r,this._innerDerivativeTypes=s,this._inputOrder=d,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,i,r){r=t(r,0),i[r]=e},unpack:function(e,i,r){return i=t(i,0),e[i]}},f=[],m=[];return r(h.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))}}}),h.prototype.getValue=function(t,r){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,d=e(n,t,s.compare);if(d<0){if(d=~d,0===d){var h=n[d];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(h,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(d>=o){d=o-1;var p=n[d];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,r)}var f=this._xTable,m=this._yTable,_=this._interpolationAlgorithm,g=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(_.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,f.length=y,m.length=y*g)}var C=this._numberOfPoints-1;if(C<1)return;var w=0,S=o-1,E=S-w+1;if(E>=C+1){var b=d-(C/2|0)-1;b<w&&(b=w);var T=b+C;T>S&&(T=S,b=T-C,b<w&&(b=w)),w=b,S=T}for(var x=S-w+1,A=0;A<x;++A)f[A]=s.secondsDifference(n[w+A],n[S]);if(i(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,w,S,m);else for(var P=0,D=this._packedLength,M=w*D,I=(S+1)*D;M<I;)m[P]=c[M],M++,P++;var R,O=s.secondsDifference(t,n[S]);if(0!==v&&i(_.interpolate)){var N=Math.floor(g/(v+1));R=_.interpolate(O,f,m,N,v,v,this._interpolationResult)}else R=_.interpolateOrderZero(O,f,m,g,this._interpolationResult);return i(u.unpackInterpolationResult)?u.unpackInterpolationResult(R,c,w,S,r):u.unpack(R,0,r)}return u.unpack(c,d*this._packedLength,r)}},h.prototype.setInterpolationOptions=function(e){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},h.prototype.addSample=function(e,t,r){var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;u<l;u++)n[u].pack(r[u],s,s.length);d(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamples=function(e,t,r){for(var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=e.length,l=[],u=0;u<s;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=r[u],h=n.length,p=0;p<h;p++)n[p].pack(c[p],l,l.length);d(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamplesPackedArray=function(e,t){d(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.equals=function(e){if(this===e)return!0;if(!i(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,r=i(t),n=e._derivativeTypes,o=i(n);if(r!==o)return!1;var a,l;if(r){if(l=t.length,l!==n.length)return!1;for(a=0;a<l;a++)if(t[a]!==n[a])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(a=0;a<l;a++)if(!s.equals(u[a],c[a]))return!1;var d=this._values,h=e._values;for(a=0;a<l;a++)if(d[a]!==h[a])return!1;return!0},h._mergeNewSamples=d,h}),define("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i,r){r=t(r,0);var n;if(r>0){n=new Array(r);for(var s=0;s<r;s++)n[s]=e}this._numberOfDerivatives=r,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(i,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return r(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged;
}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,r){if(r=this._property.getValue(e,r),i(r))return s.convertToReferenceFrame(e,r,this._referenceFrame,t,r)},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},c.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),define("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),define("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}var u=s.HORIZONTAL,c=e.WHITE,d=e.BLACK,h=0,p=1;return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,d,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,h),t.repeat=a.getValueOrDefault(this._repeat,e,p),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),define("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return i(u.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._intervals.findDataForIntervalContainingDate(e);if(t(n))return s.convertToReferenceFrame(e,n,this._referenceFrame,i,r)},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),define("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)&&"function"==typeof r.clone?r.clone(i):r},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/VelocityVectorProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o,this._normalize=t(i,!0),this.position=e}r(l.prototype,{isConstant:{get:function(){return s.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(i(t)&&this._subscription(),this._position=e,i(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var u=new e,c=new e,d=new a,h=1/60;return l.prototype.getValue=function(e,t){return this._getValue(e,t)},l.prototype._getValue=function(t,r,n){i(r)||(r=new e);var o=this._position;if(s.isConstant(o))return this._normalize?void 0:e.clone(e.ZERO,r);var l=o.getValue(t,u),p=o.getValue(a.addSeconds(t,h,d),c);if(i(l)&&(i(p)||(p=l,l=o.getValue(a.addSeconds(t,-h,d),c),i(l)))){if(e.equals(l,p))return this._normalize?void 0:e.clone(e.ZERO,r);i(n)&&l.clone(n);var f=e.subtract(p,l,r);return this._normalize?e.normalize(f,r):e.divideByScalar(f,h,r)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),define("DataSources/CzmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/CornerType","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/NearFarScalar","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/ShadowMode","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./BoxGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./CylinderGraphics","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCluster","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineArrowMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De){"use strict";function Me(e,t){return"#"===t[0]&&(t=Mt+t),Ce.fromString(e,t)}function Ie(e){var t=e.rgbaf;if(c(t))return t;var i=e.rgba;if(c(i)){var r=i.length;if(r===a.packedLength)return[a.byteToFloat(i[0]),a.byteToFloat(i[1]),a.byteToFloat(i[2]),a.byteToFloat(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=a.byteToFloat(i[n+1]),t[n+2]=a.byteToFloat(i[n+2]),t[n+3]=a.byteToFloat(i[n+3]),t[n+4]=a.byteToFloat(i[n+4]);return t}}function Re(e,t){var i=u(e.uri,e);return c(t)&&(i=_(i,_(t))),i}function Oe(e){var t=e.wsen;if(c(t))return t;var i=e.wsenDegrees;if(c(i)){var r=i.length;if(r===P.packedLength)return[T.toRadians(i[0]),T.toRadians(i[1]),T.toRadians(i[2]),T.toRadians(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=T.toRadians(i[n+1]),t[n+2]=T.toRadians(i[n+2]),t[n+3]=T.toRadians(i[n+3]),t[n+4]=T.toRadians(i[n+4]);return t}}function Ne(e){var t=e.length;if(Rt.magnitude=1,2===t)return Rt.clock=e[0],Rt.cone=e[1],i.fromSpherical(Rt,It),[It.x,It.y,It.z];for(var r=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)r[o]=e[n],Rt.clock=e[n+1],Rt.cone=e[n+2],i.fromSpherical(Rt,It),r[o+1]=It.x,r[o+2]=It.y,r[o+3]=It.z;return r}function Le(e){var t=e.length;if(3===t)return Rt.clock=e[0],Rt.cone=e[1],Rt.magnitude=e[2],i.fromSpherical(Rt,It),[It.x,It.y,It.z];for(var r=new Array(t),n=0;n<t;n+=4)r[n]=e[n],Rt.clock=e[n+1],Rt.cone=e[n+2],Rt.magnitude=e[n+3],i.fromSpherical(Rt,It),r[n+1]=It.x,r[n+2]=It.y,r[n+3]=It.z;return r}function Be(e){var t=e.length;if(3===t)return Ot.longitude=e[0],Ot.latitude=e[1],Ot.height=e[2],p.WGS84.cartographicToCartesian(Ot,It),[It.x,It.y,It.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],Ot.longitude=e[r+1],Ot.latitude=e[r+2],Ot.height=e[r+3],p.WGS84.cartographicToCartesian(Ot,It),i[r+1]=It.x,i[r+2]=It.y,i[r+3]=It.z;return i}function Fe(e){var t=e.length;if(3===t)return Ot.longitude=T.toRadians(e[0]),Ot.latitude=T.toRadians(e[1]),Ot.height=e[2],p.WGS84.cartographicToCartesian(Ot,It),[It.x,It.y,It.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],Ot.longitude=T.toRadians(e[r+1]),Ot.latitude=T.toRadians(e[r+2]),Ot.height=e[r+3],p.WGS84.cartographicToCartesian(Ot,It),i[r+1]=It.x,i[r+2]=It.y,i[r+3]=It.z;return i}function ke(e){var t=e.cartesian;if(c(t))return t;var i=e.cartesianVelocity;if(c(i))return i;var r=e.unitCartesian;if(c(r))return r;var n=e.unitSpherical;if(c(n))return Ne(n);var o=e.spherical;if(c(o))return Le(o);var a=e.cartographicRadians;if(c(a))return Be(a);var s=e.cartographicDegrees;if(c(s))return Fe(s);throw new M(JSON.stringify(e)+" is not a valid CZML interval.")}function Ve(e,t){var i=e[t],r=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(i*i+r*r+n*n+o*o);e[t]=i*a,e[t+1]=r*a,e[t+2]=n*a,e[t+3]=o*a}function ze(e){var t=e.unitQuaternion;if(c(t)){if(4===t.length)return Ve(t,0),t;for(var i=1;i<t.length;i+=5)Ve(t,i)}return t}function Ue(r){return"boolean"==typeof r?Boolean:"number"==typeof r?Number:"string"==typeof r?String:r.hasOwnProperty("array")?Array:r.hasOwnProperty("boolean")?Boolean:r.hasOwnProperty("boundingRectangle")?e:r.hasOwnProperty("cartesian2")?t:r.hasOwnProperty("cartesian")||r.hasOwnProperty("unitCartesian")||r.hasOwnProperty("unitSpherical")||r.hasOwnProperty("spherical")||r.hasOwnProperty("cartographicRadians")||r.hasOwnProperty("cartographicDegrees")?i:r.hasOwnProperty("rgba")||r.hasOwnProperty("rgbaf")?a:r.hasOwnProperty("colorBlendMode")?N:r.hasOwnProperty("cornerType")?s:r.hasOwnProperty("heightReference")?L:r.hasOwnProperty("horizontalOrigin")?B:r.hasOwnProperty("date")?w:r.hasOwnProperty("labelStyle")?F:r.hasOwnProperty("number")?Number:r.hasOwnProperty("nearFarScalar")?x:r.hasOwnProperty("object")||r.hasOwnProperty("value")?Object:r.hasOwnProperty("unitQuaternion")?A:r.hasOwnProperty("shadowMode")?k:r.hasOwnProperty("string")?String:r.hasOwnProperty("stripeOrientation")?Te:r.hasOwnProperty("wsen")||r.hasOwnProperty("wsenDegrees")?P:r.hasOwnProperty("uri")?z:r.hasOwnProperty("verticalOrigin")?V:Object}function Ge(r,n,o){switch(r){case Array:return n.array;case Boolean:return u(n.boolean,n);case e:return n.boundingRectangle;case t:return n.cartesian2;case i:return ke(n);case a:return Ie(n);case N:return N[u(n.colorBlendMode,n)];case s:return s[u(n.cornerType,n)];case L:return L[u(n.heightReference,n)];case B:return B[u(n.horizontalOrigin,n)];case Image:return Re(n,o);case w:return w.fromIso8601(u(n.date,n));case F:return F[u(n.labelStyle,n)];case Number:return u(n.number,n);case x:return n.nearFarScalar;case Object:return u(u(n.object,n.value),n);case A:return ze(n);case we:return u(n.number,n);case k:return k[u(u(n.shadowMode,n.shadows),n)];case String:return u(n.string,n);case Te:return Te[u(n.stripeOrientation,n)];case P:return Oe(n);case z:return Re(n,o);case V:return V[u(n.verticalOrigin,n)];default:throw new M(r)}}function He(e,t){var i=e.interpolationAlgorithm;(c(i)||c(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:Lt[i],interpolationDegree:e.interpolationDegree});var r=e.forwardExtrapolationType;c(r)&&(t.forwardExtrapolationType=m[r]);var n=e.forwardExtrapolationDuration;c(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;c(o)&&(t.backwardExtrapolationType=m[o]);var a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}function We(e,t,i,r,n,o,a){var s,l=r.interval;c(l)?(Bt.iso8601=l,s=R.fromIso8601(Bt),c(n)&&(s=R.intersect(s,n,Nt))):c(n)&&(s=n);var d,h,p,f,m=c(r.reference),_=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);m||(p=Ge(e,r,o),d=u(e.packedLength,1),f=u(p.length,1),h=!c(r.array)&&"string"!=typeof p&&f>d&&e!==Object);var g="function"==typeof e.unpack&&e!==we;if(!h&&!_)return void(m?t[i]=Me(a,r.reference):g?t[i]=new Z(e.unpack(p,0)):t[i]=new Z(p));var v,y=t[i],S=r.epoch;if(c(S)&&(v=w.fromIso8601(S)),h&&!_)return y instanceof Ee||(y=new Ee(e),t[i]=y),y.addSamplesPackedArray(p,v),void He(r,y);var E;if(!h&&_)return s=s.clone(),m?s.data=Me(a,r.reference):g?s.data=e.unpack(p,0):s.data=p,c(y)||(y=m?new Y:new Ae,t[i]=y),void(!m&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=m?s.data:new Z(s.data),y.intervals.addInterval(s)):(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E),s.data=m?s.data:new Z(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[i]=y),y instanceof Y||(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E));var b=y.intervals;E=b.findInterval(s),c(E)&&E.data instanceof Ee||(E=s.clone(),E.data=new Ee(e),b.addInterval(E)),E.data.addSamplesPackedArray(p,v),He(r,E.data)}function qe(e,t,i,r,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s<l;s++)We(e,t,i,r[s],n,o,a);else We(e,t,i,r,n,o,a)}function je(e,t,r,n,o,a){var s,l=r.interval;c(l)?(Bt.iso8601=l,s=R.fromIso8601(Bt),c(n)&&(s=R.intersect(s,n,Nt))):c(n)&&(s=n);var d,h,p,f=!1,m=c(r.cartesianVelocity)?1:0,_=i.packedLength*(m+1),g=c(r.reference),v=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);if(g||(c(r.referenceFrame)&&(d=D[r.referenceFrame]),d=u(d,D.FIXED),h=ke(r),p=u(h.length,1),f=p>_),!f&&!v)return void(g?e[t]=Me(a,r.reference):e[t]=new X(i.unpack(h),d));var y,S=e[t],E=r.epoch;if(c(E)&&(y=w.fromIso8601(E)),f&&!v)return S instanceof Se&&(!c(d)||S.referenceFrame===d)||(S=new Se(d,m),e[t]=S),S.addSamplesPackedArray(h,y),void He(r,S);var b;if(!f&&v)return s=s.clone(),g?s.data=Me(a,r.reference):s.data=i.unpack(h),c(S)||(S=g?new j(d):new xe(d),e[t]=S),void(!g&&S instanceof xe&&c(d)&&S.referenceFrame===d?S.intervals.addInterval(s):S instanceof j?(s.data=g?s.data:new X(s.data,d),S.intervals.addInterval(s)):(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b),s.data=g?s.data:new X(s.data,d),S.intervals.addInterval(s)));c(S)?S instanceof j||(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b)):(S=new j(d),e[t]=S);var T=S.intervals;b=T.findInterval(s),c(b)&&b.data instanceof Se&&(!c(d)||b.data.referenceFrame===d)||(b=s.clone(),b.data=new Se(d,m),T.addInterval(b)),b.data.addSamplesPackedArray(h,y),He(r,b.data)}function Ye(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a<s;a++)je(e,t,i[a],r,n,o);else je(e,t,i,r,n,o)}function Xe(e,i,r,n,o,s){var l,u=r.interval;c(u)?(Bt.iso8601=u,l=R.fromIso8601(Bt),c(n)&&(l=R.intersect(l,n,Nt))):c(n)&&(l=n);var d,h,p=e[i];if(c(l)){p instanceof q||(p=new q,e[i]=p);var f=p.intervals;h=f.findInterval({start:l.start,stop:l.stop}),c(h)?d=h.data:(h=l.clone(),f.addInterval(h))}else d=p;var m;c(r.solidColor)?(d instanceof W||(d=new W),m=r.solidColor,qe(a,d,"color",m.color,void 0,void 0,s)):c(r.grid)?(d instanceof ne||(d=new ne),m=r.grid,qe(a,d,"color",m.color,void 0,o,s),qe(Number,d,"cellAlpha",m.cellAlpha,void 0,o,s),qe(t,d,"lineCount",m.lineCount,void 0,o,s),qe(t,d,"lineThickness",m.lineThickness,void 0,o,s),qe(t,d,"lineOffset",m.lineOffset,void 0,o,s)):c(r.image)?(d instanceof oe||(d=new oe),m=r.image,qe(Image,d,"image",m.image,void 0,o,s),qe(t,d,"repeat",m.repeat,void 0,o,s),qe(a,d,"color",m.color,void 0,o,s),qe(Boolean,d,"transparent",m.transparent,void 0,o,s)):c(r.stripe)?(d instanceof be||(d=new be),m=r.stripe,qe(Te,d,"orientation",m.orientation,void 0,o,s),qe(a,d,"evenColor",m.evenColor,void 0,o,s),qe(a,d,"oddColor",m.oddColor,void 0,o,s),qe(Number,d,"offset",m.offset,void 0,o,s),qe(Number,d,"repeat",m.repeat,void 0,o,s)):c(r.polylineOutline)?(d instanceof me||(d=new me),m=r.polylineOutline,qe(a,d,"color",m.color,void 0,o,s),qe(a,d,"outlineColor",m.outlineColor,void 0,o,s),qe(Number,d,"outlineWidth",m.outlineWidth,void 0,o,s)):c(r.polylineGlow)?(d instanceof pe||(d=new pe),m=r.polylineGlow,qe(a,d,"color",m.color,void 0,o,s),qe(Number,d,"glowPower",m.glowPower,void 0,o,s)):c(r.polylineArrow)&&(d instanceof he||(d=new he),m=r.polylineArrow,qe(a,d,"color",m.color,void 0,void 0,s)),c(h)?h.data=d:e[i]=d}function Ze(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a<s;a++)Xe(e,t,i[a],r,n,o);else Xe(e,t,i,r,n,o)}function Ke(e,t,i,r){e.name=u(t.name,e.name)}function Qe(e,t,i,r){var n=t.description;c(n)&&qe(String,e,"description",n,void 0,r,i)}function Je(e,t,i,r){var n=t.position;c(n)&&Ye(e,"position",n,void 0,r,i)}function $e(e,t,r,n){var o=t.viewFrom;c(o)&&qe(i,e,"viewFrom",o,void 0,n,r)}function et(e,t,i,r){var n=t.orientation;c(n)&&qe(A,e,"orientation",n,void 0,r,i)}function tt(e,t,i,r){var n=t.properties;if(c(n)){c(e.properties)||(e.properties=new ve);for(var o in n)if(n.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);var a=n[o];if(y(a))for(var s=0,l=a.length;s<l;s++)We(Ue(a[s]),e.properties,o,a[s],void 0,r,i);else We(Ue(a),e.properties,o,a,void 0,r,i)}}}function it(e,t,i,r){var n=i.references;if(c(n)){var o=n.map(function(e){return Me(r,e)}),a=i.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof j)){a.data=new ge(o);var s=new Y;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ge(o)}else qe(Array,e,t,i,void 0,void 0,r)}function rt(e,t,i,r){if(c(i))if(y(i))for(var n=0,o=i.length;n<o;++n)it(e,t,i[n],r);else it(e,t,i,r)}function nt(e,t,r,n){if(c(r.references)){var o=r.references.map(function(e){return Me(n,e)}),a=r.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof j)){a.data=new _e(o);var s=new j;s.intervals.addInterval(a),e[t]=s}}else e[t]=new _e(o)}else c(r.cartesian)?r.array=i.unpackArray(r.cartesian):c(r.cartographicRadians)?r.array=i.fromRadiansArrayHeights(r.cartographicRadians):c(r.cartographicDegrees)&&(r.array=i.fromDegreesArrayHeights(r.cartographicDegrees)),c(r.array)&&qe(Array,e,t,r,void 0,void 0,n)}function ot(e,t,i,r){if(c(i))if(y(i))for(var n=0,o=i.length;n<o;n++)nt(e,t,i[n],r);else nt(e,t,i,r)}function at(e,t,i,r){var n,o=t.availability;if(c(o)){var a;if(y(o))for(var s=o.length,l=0;l<s;l++)c(a)||(a=new O),Bt.iso8601=o[l],n=R.fromIso8601(Bt),a.addInterval(n);else Bt.iso8601=o,n=R.fromIso8601(Bt),a=new O,a.addInterval(n);e.availability=a}}function st(e,t,r,n,o){c(t)&&(c(t.velocityReference)?e.alignedAxis=new Pe(Me(o,t.velocityReference),!0):qe(i,e,"alignedAxis",t,r,n,o))}function lt(r,n,o,s){var l=n.billboard;if(c(l)){var u,d=l.interval;c(d)&&(Bt.iso8601=d,u=R.fromIso8601(Bt));var h=r.billboard;c(h)||(r.billboard=h=new G),qe(Boolean,h,"show",l.show,u,s,o),qe(Image,h,"image",l.image,u,s,o),qe(Number,h,"scale",l.scale,u,s,o),qe(t,h,"pixelOffset",l.pixelOffset,u,s,o),qe(i,h,"eyeOffset",l.eyeOffset,u,s,o),qe(B,h,"horizontalOrigin",l.horizontalOrigin,u,s,o),qe(V,h,"verticalOrigin",l.verticalOrigin,u,s,o),qe(L,h,"heightReference",l.heightReference,u,s,o),qe(a,h,"color",l.color,u,s,o),qe(we,h,"rotation",l.rotation,u,s,o),st(h,l.alignedAxis,u,s,o),qe(Boolean,h,"sizeInMeters",l.sizeInMeters,u,s,o),qe(Number,h,"width",l.width,u,s,o),qe(Number,h,"height",l.height,u,s,o),qe(x,h,"scaleByDistance",l.scaleByDistance,u,s,o),qe(x,h,"translucencyByDistance",l.translucencyByDistance,u,s,o),qe(x,h,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,s,o),qe(e,h,"imageSubRegion",l.imageSubRegion,u,s,o)}}function ut(e,t,r,n){var o=t.box;if(c(o)){var s,l=o.interval;c(l)&&(Bt.iso8601=l,s=R.fromIso8601(Bt));var u=e.box;c(u)||(e.box=u=new H),qe(Boolean,u,"show",o.show,s,n,r),qe(i,u,"dimensions",o.dimensions,s,n,r),qe(Boolean,u,"fill",o.fill,s,n,r),Ze(u,"material",o.material,s,n,r),qe(Boolean,u,"outline",o.outline,s,n,r),qe(a,u,"outlineColor",o.outlineColor,s,n,r),qe(Number,u,"outlineWidth",o.outlineWidth,s,n,r),qe(k,u,"shadows",o.shadows,s,n,r)}}function ct(e,t,i,r){var n=t.corridor;if(c(n)){var o,l=n.interval;c(l)&&(Bt.iso8601=l,o=R.fromIso8601(Bt));var u=e.corridor;c(u)||(e.corridor=u=new K),qe(Boolean,u,"show",n.show,o,r,i),ot(u,"positions",n.positions,i),qe(Number,u,"width",n.width,o,r,i),qe(Number,u,"height",n.height,o,r,i),qe(Number,u,"extrudedHeight",n.extrudedHeight,o,r,i),qe(s,u,"cornerType",n.cornerType,o,r,i),qe(Number,u,"granularity",n.granularity,o,r,i),qe(Boolean,u,"fill",n.fill,o,r,i),Ze(u,"material",n.material,o,r,i),qe(Boolean,u,"outline",n.outline,o,r,i),qe(a,u,"outlineColor",n.outlineColor,o,r,i),qe(Number,u,"outlineWidth",n.outlineWidth,o,r,i),qe(k,u,"shadows",n.shadows,o,r,i)}}function dt(e,t,i,r){var n=t.cylinder;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.cylinder;c(l)||(e.cylinder=l=new Q),qe(Boolean,l,"show",n.show,o,r,i),qe(Number,l,"length",n.length,o,r,i),qe(Number,l,"topRadius",n.topRadius,o,r,i),qe(Number,l,"bottomRadius",n.bottomRadius,o,r,i),qe(Boolean,l,"fill",n.fill,o,r,i),Ze(l,"material",n.material,o,r,i),qe(Boolean,l,"outline",n.outline,o,r,i),qe(a,l,"outlineColor",n.outlineColor,o,r,i),qe(Number,l,"outlineWidth",n.outlineWidth,o,r,i),qe(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),qe(Number,l,"slices",n.slices,o,r,i),qe(k,l,"shadows",n.shadows,o,r,i)}}function ht(e,t){var i=e.version;if(c(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new M("Cesium only supports CZML version 1.");t._version=i}}if(!c(t._version))throw new M("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function pt(e,t,i,r){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),qe(Boolean,l,"show",n.show,o,r,i),qe(Number,l,"semiMajorAxis",n.semiMajorAxis,o,r,i),qe(Number,l,"semiMinorAxis",n.semiMinorAxis,o,r,i),qe(Number,l,"height",n.height,o,r,i),qe(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),qe(we,l,"rotation",n.rotation,o,r,i),qe(we,l,"stRotation",n.stRotation,o,r,i),qe(Number,l,"granularity",n.granularity,o,r,i),qe(Boolean,l,"fill",n.fill,o,r,i),Ze(l,"material",n.material,o,r,i),qe(Boolean,l,"outline",n.outline,o,r,i),qe(a,l,"outlineColor",n.outlineColor,o,r,i),qe(Number,l,"outlineWidth",n.outlineWidth,o,r,i),qe(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),qe(k,l,"shadows",n.shadows,o,r,i)}}function ft(e,t,r,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Bt.iso8601=l,s=R.fromIso8601(Bt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),qe(Boolean,u,"show",o.show,s,n,r),qe(i,u,"radii",o.radii,s,n,r),qe(Boolean,u,"fill",o.fill,s,n,r),Ze(u,"material",o.material,s,n,r),qe(Boolean,u,"outline",o.outline,s,n,r),qe(a,u,"outlineColor",o.outlineColor,s,n,r),qe(Number,u,"outlineWidth",o.outlineWidth,s,n,r),qe(Number,u,"stackPartitions",o.stackPartitions,s,n,r),qe(Number,u,"slicePartitions",o.slicePartitions,s,n,r),qe(Number,u,"subdivisions",o.subdivisions,s,n,r),qe(k,u,"shadows",o.shadows,s,n,r)}}function mt(e,r,n,o){var s=r.label;if(c(s)){var l,u=s.interval;c(u)&&(Bt.iso8601=u,l=R.fromIso8601(Bt));var d=e.label;c(d)||(e.label=d=new ae),qe(Boolean,d,"show",s.show,l,o,n),qe(String,d,"text",s.text,l,o,n),qe(String,d,"font",s.font,l,o,n),qe(F,d,"style",s.style,l,o,n),qe(Number,d,"scale",s.scale,l,o,n),qe(Boolean,d,"showBackground",s.showBackground,l,o,n),qe(a,d,"backgroundColor",s.backgroundColor,l,o,n),qe(t,d,"backgroundPadding",s.backgroundPadding,l,o,n),qe(t,d,"pixelOffset",s.pixelOffset,l,o,n),qe(i,d,"eyeOffset",s.eyeOffset,l,o,n),qe(B,d,"horizontalOrigin",s.horizontalOrigin,l,o,n),qe(V,d,"verticalOrigin",s.verticalOrigin,l,o,n),qe(L,d,"heightReference",s.heightReference,l,o,n),qe(a,d,"fillColor",s.fillColor,l,o,n),qe(a,d,"outlineColor",s.outlineColor,l,o,n),qe(Number,d,"outlineWidth",s.outlineWidth,l,o,n),qe(x,d,"translucencyByDistance",s.translucencyByDistance,l,o,n),qe(x,d,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function _t(e,t,i,r){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.model;c(l)||(e.model=l=new se),qe(Boolean,l,"show",n.show,o,r,i),qe(z,l,"uri",n.gltf,o,r,i),qe(Number,l,"scale",n.scale,o,r,i),qe(Number,l,"minimumPixelSize",n.minimumPixelSize,o,r,i),qe(Number,l,"maximumScale",n.maximumScale,o,r,i),qe(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),qe(Boolean,l,"runAnimations",n.runAnimations,o,r,i),qe(k,l,"shadows",n.shadows,o,r,i),qe(L,l,"heightReference",n.heightReference,o,r,i),qe(a,l,"silhouetteColor",n.silhouetteColor,o,r,i),qe(Number,l,"silhouetteSize",n.silhouetteSize,o,r,i),qe(a,l,"color",n.color,o,r,i),qe(N,l,"colorBlendMode",n.colorBlendMode,o,r,i),qe(Number,l,"colorBlendAmount",n.colorBlendAmount,o,r,i);var u=n.nodeTransformations;if(c(u))if(y(u))for(var d=0,h=u.length;d<h;d++)gt(l,u[d],o,r,i);else gt(l,u,o,r,i)}}function gt(e,t,r,n,o){var a,s=t.interval;c(s)?(Bt.iso8601=s,a=R.fromIso8601(Bt),c(r)&&(a=R.intersect(a,r,Nt))):c(r)&&(a=r);for(var l=e.nodeTransformations,u=Object.keys(t),d=0,h=u.length;d<h;++d){var p=u[d];if("interval"!==p){var f=t[p];if(c(f)){c(l)||(e.nodeTransformations=l=new ve),l.hasProperty(p)||l.addProperty(p);var m=l[p];c(m)||(l[p]=m=new le),qe(i,m,"translation",f.translation,a,n,o),qe(A,m,"rotation",f.rotation,a,n,o),qe(i,m,"scale",f.scale,a,n,o)}}}}function vt(e,t,i,r){var n=t.path;if(c(n)){var o,a=n.interval;c(a)&&(Bt.iso8601=a,o=R.fromIso8601(Bt));var s=e.path;c(s)||(e.path=s=new ue),qe(Boolean,s,"show",n.show,o,r,i),qe(Number,s,"width",n.width,o,r,i),qe(Number,s,"resolution",n.resolution,o,r,i),qe(Number,s,"leadTime",n.leadTime,o,r,i),qe(Number,s,"trailTime",n.trailTime,o,r,i),Ze(s,"material",n.material,o,r,i)}}function yt(e,t,i,r){var n=t.point;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.point;c(l)||(e.point=l=new ce),qe(Boolean,l,"show",n.show,o,r,i),qe(Number,l,"pixelSize",n.pixelSize,o,r,i),qe(L,l,"heightReference",n.heightReference,o,r,i),qe(a,l,"color",n.color,o,r,i),qe(a,l,"outlineColor",n.outlineColor,o,r,i),qe(Number,l,"outlineWidth",n.outlineWidth,o,r,i),qe(x,l,"scaleByDistance",n.scaleByDistance,o,r,i),qe(x,l,"translucencyByDistance",n.translucencyByDistance,o,r,i)}}function Ct(e,t,i,r){var n=t.polygon;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.polygon;c(l)||(e.polygon=l=new de),qe(Boolean,l,"show",n.show,o,r,i),ot(l,"hierarchy",n.positions,i),qe(Number,l,"height",n.height,o,r,i),qe(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),qe(we,l,"stRotation",n.stRotation,o,r,i),qe(Number,l,"granularity",n.granularity,o,r,i),qe(Boolean,l,"fill",n.fill,o,r,i),Ze(l,"material",n.material,o,r,i),qe(Boolean,l,"outline",n.outline,o,r,i),qe(a,l,"outlineColor",n.outlineColor,o,r,i),qe(Number,l,"outlineWidth",n.outlineWidth,o,r,i),qe(Boolean,l,"perPositionHeight",n.perPositionHeight,o,r,i),qe(Boolean,l,"closeTop",n.closeTop,o,r,i),qe(Boolean,l,"closeBottom",n.closeBottom,o,r,i),qe(k,l,"shadows",n.shadows,o,r,i)}}function wt(e,t,i,r){var n=t.polyline;if(c(n)){var o,a=n.interval;c(a)&&(Bt.iso8601=a,o=R.fromIso8601(Bt));var s=e.polyline;c(s)||(e.polyline=s=new fe),qe(Boolean,s,"show",n.show,o,r,i),ot(s,"positions",n.positions,i),qe(Number,s,"width",n.width,o,r,i),qe(Number,s,"granularity",n.granularity,o,r,i),Ze(s,"material",n.material,o,r,i),qe(Boolean,s,"followSurface",n.followSurface,o,r,i),qe(k,s,"shadows",n.shadows,o,r,i)}}function St(e,t,i,r){var n=t.rectangle;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.rectangle;c(l)||(e.rectangle=l=new ye),qe(Boolean,l,"show",n.show,o,r,i),qe(P,l,"coordinates",n.coordinates,o,r,i),qe(Number,l,"height",n.height,o,r,i),qe(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),qe(we,l,"rotation",n.rotation,o,r,i),qe(we,l,"stRotation",n.stRotation,o,r,i),qe(Number,l,"granularity",n.granularity,o,r,i),qe(Boolean,l,"fill",n.fill,o,r,i),Ze(l,"material",n.material,o,r,i),qe(Boolean,l,"outline",n.outline,o,r,i),qe(a,l,"outlineColor",n.outlineColor,o,r,i),qe(Number,l,"outlineWidth",n.outlineWidth,o,r,i),qe(Boolean,l,"closeTop",n.closeTop,o,r,i),qe(Boolean,l,"closeBottom",n.closeBottom,o,r,i),qe(k,l,"shadows",n.shadows,o,r,i)}}function Et(e,t,i,r){var n=t.wall;if(c(n)){var o,s=n.interval;c(s)&&(Bt.iso8601=s,o=R.fromIso8601(Bt));var l=e.wall;c(l)||(e.wall=l=new De),qe(Boolean,l,"show",n.show,o,r,i),ot(l,"positions",n.positions,i),rt(l,"minimumHeights",n.minimumHeights,i),rt(l,"maximumHeights",n.maximumHeights,i),qe(Number,l,"granularity",n.granularity,o,r,i),qe(Boolean,l,"fill",n.fill,o,r,i),Ze(l,"material",n.material,o,r,i),
qe(Boolean,l,"outline",n.outline,o,r,i),qe(a,l,"outlineColor",n.outlineColor,o,r,i),qe(Number,l,"outlineWidth",n.outlineWidth,o,r,i),qe(k,l,"shadows",n.shadows,o,r,i)}}function bt(e,t,i,r,n){var o=e.id;if(c(o)||(o=l()),Mt=o,!c(n._version)&&"document"!==o)throw new M("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if("document"===o)ht(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;c(s)&&(a.parent=t.getOrCreateEntity(s));for(var u=i.length-1;u>-1;u--)i[u](a,e,t,r)}Mt=void 0}function Tt(e){var t,i=e._documentPacket.clock;if(!c(i)){if(!c(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(C.MINIMUM_VALUE)){var a=r.start,s=r.stop,l=w.secondsDifference(s,a),d=Math.round(l/120);return t=new $,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=d,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=C.MINIMUM_VALUE.clone(),t.stopTime=C.MAXIMUM_VALUE.clone(),t.currentTime=C.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(i.interval)){Bt.iso8601=i.interval;var h=R.fromIso8601(Bt);t.startTime=h.start,t.stopTime=h.stop}return c(i.currentTime)&&(t.currentTime=w.fromIso8601(i.currentTime)),c(i.range)&&(t.clockRange=u(n[i.range],n.LOOP_STOP)),c(i.step)&&(t.clockStep=u(o[i.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function xt(e,t,i,r){i=u(i,u.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=b(t),o=u(o,t)),J.setLoading(e,!0),U(n,function(t){return At(e,t,o,r)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),U.reject(t)})}function At(e,t,i,r){J.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new Pt,n.removeAll()),Dt._processCzml(t,n,i,void 0,e);var o=Tt(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(i)&&(e._name=g(i),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function Pt(){this.name=void 0,this.clock=void 0}function Dt(e){this._name=e,this._changed=new f,this._error=new f,this._isLoading=!1,this._loading=new f,this._clock=void 0,this._documentPacket=new Pt,this._version=void 0,this._entityCollection=new re(this),this._entityCluster=new ie}var Mt,It=new i,Rt=new I,Ot=new r,Nt=new R,Lt={HERMITE:v,LAGRANGE:S,LINEAR:E},Bt={iso8601:void 0};return Dt.load=function(e,t){return(new Dt).load(e,t)},d(Dt.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),Dt.updaters=[lt,ut,ct,dt,pt,ft,mt,_t,Ke,Qe,vt,yt,Ct,wt,tt,St,Je,$e,Et,et,at],Dt.prototype.process=function(e,t){return xt(this,e,t,!1)},Dt.prototype.load=function(e,t){return xt(this,e,t,!0)},Dt.processPacketData=qe,Dt.processPositionPacketData=Ye,Dt.processMaterialPacketData=Ze,Dt._processCzml=function(e,t,i,r,n){if(r=c(r)?r:Dt.updaters,y(e))for(var o=0,a=e.length;o<a;o++)bt(e[o],t,r,i,n);else bt(e,t,r,i,n)},Dt}),define("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return i(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,i=this._dataSources;return a(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,i){i=e(i,!1);var r=this._dataSources.indexOf(t);return r!==-1&&(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0)},s.prototype.removeAll=function(t){t=e(t,!1);for(var i=this._dataSources,r=0,n=i.length;r<n;++r){var o=i[r];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return this.indexOf(e)!==-1},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),r(this)},s}),define("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),c=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof w){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:c,distanceDisplayCondition:p,color:o}}else n={show:c,distanceDisplayCondition:p};return new h({id:a,geometry:new u(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new h({id:r,geometry:new c(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=this._entity.position,h=a.semiMajorAxis,m=a.semiMinorAxis,y=a.show;if(r(y)&&y.isConstant&&!y.getValue(p.MINIMUM_VALUE)||!r(d)||!r(h)||!r(m))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=i(a.material,D),S=C instanceof w;this._materialProperty=C,this._fillProperty=i(s,I),this._showProperty=i(y,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var E=a.rotation,b=a.height,x=a.extrudedHeight,A=a.granularity,P=a.stRotation,B=a.outlineWidth,F=a.numberOfVerticalLines,k=l&&!r(b)&&!r(x)&&S&&_.isSupported(this._scene);if(c&&k&&(f(f.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=k,this._isClosed=r(x)||k,this._outlineEnabled=c,d.isConstant&&h.isConstant&&m.isConstant&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&T.isConstant(F)&&(!k||T.isConstant(C))){var V=this._options;V.vertexFormat=S?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,V.center=d.getValue(p.MINIMUM_VALUE,V.center),V.semiMajorAxis=h.getValue(p.MINIMUM_VALUE,V.semiMajorAxis),V.semiMinorAxis=m.getValue(p.MINIMUM_VALUE,V.semiMinorAxis),V.rotation=r(E)?E.getValue(p.MINIMUM_VALUE):void 0,V.height=r(b)?b.getValue(p.MINIMUM_VALUE):void 0,V.extrudedHeight=r(x)?x.getValue(p.MINIMUM_VALUE):void 0,V.granularity=r(A)?A.getValue(p.MINIMUM_VALUE):void 0,V.stRotation=r(P)?P.getValue(p.MINIMUM_VALUE):void 0,V.numberOfVerticalLines=r(F)?F.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=r(B)?B.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var d=n._entity,p=d.ellipse;if(d.isShowing&&d.isAvailable(i)&&T.getValueOrDefault(p.show,i,!0)){var f=this._options,m=T.getValueOrUndefined(d.position,i,f.center),C=T.getValueOrUndefined(p.semiMajorAxis,i),w=T.getValueOrUndefined(p.semiMinorAxis,i);if(r(m)&&r(C)&&r(w)){f.center=m,f.semiMajorAxis=C,f.semiMinorAxis=w,f.rotation=T.getValueOrUndefined(p.rotation,i),f.height=T.getValueOrUndefined(p.height,i),f.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,i),f.granularity=T.getValueOrUndefined(p.granularity,i),f.stRotation=T.getValueOrUndefined(p.stRotation,i),f.numberOfVerticalLines=T.getValueOrUndefined(p.numberOfVerticalLines,i);var S=this._geometryUpdater.shadowsProperty.getValue(i),E=this._geometryUpdater.distanceDisplayConditionProperty,x=E.getValue(i),A=l.fromDistanceDisplayCondition(x);if(T.getValueOrDefault(p.fill,i,!0)){var P=n.fillMaterialProperty,D=b.getValue(i,P,this._material);if(this._material=D,o){var M=e.WHITE;r(P.color)&&(M=P.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new h({id:d,geometry:new u(f),attributes:{color:t.fromColor(M),distanceDisplayCondition:A}}),asynchronous:!1,shadows:S}))}else{var I=new g({material:D,translucent:D.isTranslucent(),closed:r(f.extrudedHeight)});f.vertexFormat=I.vertexFormat,this._primitive=a.add(new y({geometryInstances:new h({id:d,geometry:new u(f)}),attributes:{distanceDisplayCondition:A},appearance:I,asynchronous:!1,shadows:S}))}}if(!o&&T.getValueOrDefault(p.outline,i,!1)){f.vertexFormat=v.VERTEX_FORMAT;var R=T.getValueOrClonedDefault(p.outlineColor,i,e.BLACK,B),O=T.getValueOrDefault(p.outlineWidth,i,1),N=1!==R.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new h({id:d,geometry:new c(f),attributes:{color:t.fromColor(R),distanceDisplayCondition:A}}),appearance:new v({flat:!0,translucent:N,renderState:{lineWidth:n._scene.clampLineWidth(O)}}),asynchronous:!1,shadows:S}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),define("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function P(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new A(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function D(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new A(t._entity),this._modelMatrix=new m,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0}var M=new S(t.WHITE),I=new E(!0),R=new E(!0),O=new E(!1),N=new E(t.BLACK),L=new E(w.DISABLED),B=new E(new l),F=new e,k=new t,V=new e(1,1,1);return o(P,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new _(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),d=this._distanceDisplayConditionProperty.getValue(e),h=u.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof S){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),o=i.fromColor(m),r={show:l,distanceDisplayCondition:h,color:o}}else r={show:l,distanceDisplayCondition:h};return new p({id:a,geometry:new c(this._options),modelMatrix:a._getModelMatrix(f.MINIMUM_VALUE),attributes:r})},P.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),o=x.getValueOrDefault(this._outlineColorProperty,e,t.BLACK),a=this._distanceDisplayConditionProperty.getValue(e);return new p({id:r,geometry:new d(this._options),modelMatrix:r._getModelMatrix(f.MINIMUM_VALUE),attributes:{show:new _(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(o),distanceDisplayCondition:u.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),a(this)},P.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!n(s)||!s.isConstant||s.getValue(f.MINIMUM_VALUE),u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(f.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=e.position,h=a.radii,p=a.show;if(n(p)&&p.isConstant&&!p.getValue(f.MINIMUM_VALUE)||!n(d)||!n(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=r(a.material,M),_=m instanceof S;this._materialProperty=m,this._fillProperty=r(s,R),this._showProperty=r(p,I),this._showOutlineProperty=r(a.outline,O),this._outlineColorProperty=c?r(a.outlineColor,N):void 0,this._shadowsProperty=r(a.shadows,L),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,B),this._fillEnabled=l,this._outlineEnabled=c;var y=a.stackPartitions,C=a.slicePartitions,w=a.outlineWidth,E=a.subdivisions;if(d.isConstant&&x.isConstant(e.orientation)&&h.isConstant&&x.isConstant(y)&&x.isConstant(C)&&x.isConstant(w)&&x.isConstant(E)){var b=this._options;b.vertexFormat=_?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,b.radii=h.getValue(f.MINIMUM_VALUE,b.radii),b.stackPartitions=n(y)?y.getValue(f.MINIMUM_VALUE):void 0,b.slicePartitions=n(C)?C.getValue(f.MINIMUM_VALUE):void 0,b.subdivisions=n(E)?E.getValue(f.MINIMUM_VALUE):void 0,this._outlineWidth=n(w)?w.getValue(f.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e){return new D(e,this)},D.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!x.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=x.getValueOrUndefined(a.radii,e,F),h=o._getModelMatrix(e,this._modelMatrix);if(!n(h)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var f,w=x.getValueOrDefault(a.fill,e,!0),S=x.getValueOrDefault(a.outline,e,!1),E=x.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,k),b=T.getValue(e,r(a.material,M),this._material);this._material=b;var A=x.getValueOrUndefined(a.stackPartitions,e),P=x.getValueOrUndefined(a.slicePartitions,e),D=x.getValueOrUndefined(a.subdivisions,e),I=x.getValueOrDefault(a.outlineWidth,e,1),R=this._scene.mode,O=R===C.SCENE3D,N=this._options,L=this._geometryUpdater.shadowsProperty.getValue(e),B=this._geometryUpdater.distanceDisplayConditionProperty,z=B.getValue(e),U=u.fromDistanceDisplayCondition(z),G=!O||this._lastSceneMode!==R||!n(this._primitive)||N.stackPartitions!==A||N.slicePartitions!==P||N.subdivisions!==D||this._lastOutlineWidth!==I;if(G){var H=this._primitives;H.removeAndDestroy(this._primitive),H.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=I,N.stackPartitions=A,N.slicePartitions=P,N.subdivisions=D,N.radii=O?V:s,f=new g({material:b,translucent:b.isTranslucent(),closed:!0}),N.vertexFormat=f.vertexFormat,this._primitive=H.add(new y({geometryInstances:new p({id:o,geometry:new c(N),modelMatrix:O?void 0:h,attributes:{show:new _(w),distanceDisplayCondition:U}}),appearance:f,asynchronous:!1,shadows:L})),N.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=H.add(new y({geometryInstances:new p({id:o,geometry:new d(N),modelMatrix:O?void 0:h,attributes:{show:new _(S),color:i.fromColor(E),distanceDisplayCondition:U}}),appearance:new v({flat:!0,translucent:1!==E.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:L})),this._lastShow=w,this._lastOutlineShow=S,this._lastOutlineColor=t.clone(E,this._lastOutlineColor),this._lastDistanceDisplayCondition=z}else if(this._primitive.ready){var W=this._primitive,q=this._outlinePrimitive;W.show=!0,q.show=!0,f=W.appearance,f.material=b;var j=this._attributes;n(j)||(j=W.getGeometryInstanceAttributes(o),this._attributes=j),w!==this._lastShow&&(j.show=_.toValue(w,j.show),this._lastShow=w);var Y=this._outlineAttributes;n(Y)||(Y=q.getGeometryInstanceAttributes(o),this._outlineAttributes=Y),S!==this._lastOutlineShow&&(Y.show=_.toValue(S,Y.show),this._lastOutlineShow=S),t.equals(E,this._lastOutlineColor)||(Y.color=i.toValue(E,Y.color),t.clone(E,this._lastOutlineColor)),l.equals(z,this._lastDistanceDisplayCondition)||(j.distanceDisplayCondition=u.toValue(z,j.distanceDisplayCondition),Y.distanceDisplayCondition=u.toValue(z,Y.distanceDisplayCondition),l.clone(z,this._lastDistanceDisplayCondition))}O&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),h=m.multiplyByScale(h,s,h),this._primitive.modelMatrix=h,this._outlinePrimitive.modelMatrix=h)},D.prototype.getBoundingSphere=function(e,t){return b(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},P}),define("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,r,n,o){this.translucent=i,this.appearanceType=r,this.closed=n,this.shadows=o,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]}function d(e,t,i,r){this._solidBatch=new c(e,!1,t,i,r),this._translucentBatch=new c(e,!0,t,i,r)}var h=new t,p=new n;return c.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&u.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},c.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}},c.prototype.update=function(e){var l,c,d=!0,f=0,m=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values,v=g.length;if(v>0){for(r(m)&&(r(this.oldPrimitive)?_.remove(m):this.oldPrimitive=m),c=0;c<v;c++){var y=g[c],C=y.attributes;l=this.attributes.get(y.id.id),r(l)&&(r(C.show)&&(C.show.value=l.show),r(C.color)&&(C.color.value=l.color))}m=new s({asynchronous:!0,geometryInstances:g,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),shadows:this.shadows}),_.add(m),d=!1}else{r(m)&&(_.remove(m),m=void 0);var w=this.oldPrimitive;r(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(m)&&m.ready){r(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,b=this.waitingOnCreate;for(c=0;c<E;c++){var T=S[c],x=this.geometry.get(T.entity.id);if(l=this.attributes.get(x.id.id),r(l)||(l=m.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,l)),!T.fillMaterialProperty.isConstant||b){var A=T.fillMaterialProperty.color;A.getValue(e,h),t.equals(l._lastColor,h)||(l._lastColor=t.clone(h,l._lastColor),l.color=i.toValue(h,l.color),(this.translucent&&255===l.color[3]||!this.translucent&&255!==l.color[3])&&(this.itemsToRemove[f++]=T))}var P=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),D=1===l.show[0];P!==D&&(l.show=a.toValue(P,l.show));var M=T.distanceDisplayConditionProperty;if(!u.isConstant(M)){var I=M.getValue(e,p);n.equals(I,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(I,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(I,l.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else r(m)&&!m.ready&&(d=!1);return this.itemsToRemove.length=f,d},c.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},c.prototype.contains=function(e){return this.updaters.contains(e.id)},c.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return l.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},c.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},d.prototype.add=function(e,t){var i=t.createFillGeometryInstance(e);255===i.attributes.color.value[3]?this._solidBatch.add(t,i):this._translucentBatch.add(t,i)},d.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},d.prototype.update=function(e){var t,i,r=this._solidBatch.update(e);r=this._translucentBatch.update(e)&&r;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;t<o;t++)i=n[t],this._solidBatch.remove(i),this._translucentBatch.add(i,i.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;t<a;t++)i=n[t],this._translucentBatch.remove(i),this._solidBatch.add(i,i.createFillGeometryInstance(e));return(o>0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},d.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):l.FAILED},d.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},d}),define("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.shadows=o,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(u.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function c(e,t,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i,this._shadows=r}var d=new i;return u.prototype.onMaterialChanged=function(){this.invalidated=!0},u.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i||!!t(i)&&i.equals(r)},u.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&l.isConstant(t.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){
"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},u.prototype.remove=function(e){var i=e.entity.id;if(this.createPrimitive=this.geometry.remove(i)||this.createPrimitive,this.updaters.remove(i)){this.updatersWithAttributes.remove(i);var r=this.subscriptions.get(i);t(r)&&(r(),this.subscriptions.remove(i))}return this.createPrimitive},u.prototype.update=function(e){var a,u,c=!0,h=this.primitive,p=this.primitives,f=this.geometry.values;if(this.createPrimitive){var m=f.length;if(m>0){for(t(h)&&(t(this.oldPrimitive)?p.remove(h):this.oldPrimitive=h),u=0;u<m;u++){var _=f[u],g=_.attributes;a=this.attributes.get(_.id.id),t(a)&&(t(g.show)&&(g.show.value=a.show),t(g.color)&&(g.color.value=a.color))}this.material=s.getValue(e,this.materialProperty,this.material),h=new o({asynchronous:!0,geometryInstances:f,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),shadows:this.shadows}),p.add(h),c=!1}else{t(h)&&(p.remove(h),h=void 0);var v=this.oldPrimitive;t(v)&&(p.remove(v),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=h,this.createPrimitive=!1}else if(t(h)&&h.ready){t(this.oldPrimitive)&&(p.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=s.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var y=this.updatersWithAttributes.values,C=y.length;for(u=0;u<C;u++){var w=y[u],S=w.entity,E=this.geometry.get(S.id);a=this.attributes.get(E.id.id),t(a)||(a=h.getGeometryInstanceAttributes(E.id),this.attributes.set(E.id.id,a));var b=S.isShowing&&(w.hasConstantFill||w.isFilled(e)),T=1===a.show[0];b!==T&&(a.show=n.toValue(b,a.show));var x=w.distanceDisplayConditionProperty;if(!l.isConstant(x)){var A=x.getValue(e,d);i.equals(A,a._lastDistanceDisplayCondition)||(a._lastDistanceDisplayCondition=i.clone(A,a._lastDistanceDisplayCondition),a.distanceDisplayCondition=r.toValue(A,a.distanceDisplayCondition))}}this.updateShows(h)}else t(h)&&!h.ready&&(c=!1);return c},u.prototype.updateShows=function(e){for(var i=this.showsUpdated.values,r=i.length,o=0;o<r;o++){var a=i[o],s=a.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);t(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,d=1===u.show[0];c!==d&&(u.show=n.toValue(c,u.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,i){var r=this.primitive;if(!r.ready)return a.PENDING;var n=r.getGeometryInstanceAttributes(e);return!t(n)||!t(n.boundingSphere)||t(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(i),a.DONE)},u.prototype.destroy=function(e){var i=this.primitive,r=this.primitives;t(i)&&r.remove(i);var n=this.oldPrimitive;t(n)&&r.remove(n),this.removeMaterialSubscription()},c.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.isMaterial(t))return void o.add(e,t)}var a=new u(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed,this._shadows);a.add(e,t),i.push(a)},c.prototype.remove=function(e){for(var t=this._items,i=t.length,r=i-1;r>=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},c.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s<a;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;t<r;t++)l=i[t].update(e)&&l;return l},c.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return a.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0},c}),define("DataSources/StaticGroundGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r){this.primitives=t,this.color=i,this.key=r,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.isDirty=!1}function c(t){this._batches=new e,this._primitives=t}var d=new t,h=new r;u.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&l.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},u.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}};var p=new Array(4);return u.prototype.update=function(e){var s,u,c=!0,f=0,m=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values,v=g.length;if(v>0){for(i(m)&&(i(this.oldPrimitive)?_.remove(m):this.oldPrimitive=m),u=0;u<v;u++){var y=g[u],C=y.attributes;s=this.attributes.get(y.id.id),i(s)&&(i(C.show)&&(C.show.value=s.show),i(C.color)&&(C.color.value=s.color))}m=new a({asynchronous:!0,geometryInstances:g}),_.add(m),c=!1}else{i(m)&&(_.remove(m),m=void 0);var w=this.oldPrimitive;i(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(m)&&m.ready){i(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,b=this.waitingOnCreate;for(u=0;u<E;u++){var T=S[u],x=this.geometry.get(T.entity.id);if(s=this.attributes.get(x.id.id),i(s)||(s=m.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,s)),!T.fillMaterialProperty.isConstant||b){var A=T.fillMaterialProperty.color;if(A.getValue(e,d),!t.equals(s._lastColor,d)){s._lastColor=t.clone(d,s._lastColor);var P=this.color,D=d.toBytes(p);P[0]===D[0]&&P[1]===D[1]&&P[2]===D[2]&&P[3]===D[3]||(this.itemsToRemove[f++]=T)}}var M=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),I=1===s.show[0];M!==I&&(s.show=o.toValue(M,s.show));var R=T.distanceDisplayConditionProperty;if(!l.isConstant(R)){var O=R.getValue(e,h);r.equals(O,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=r.clone(O,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=n.toValue(O,s.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else i(m)&&!m.ready&&(c=!1);return this.itemsToRemove.length=f,c},u.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var a=t[n],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=o.toValue(u,l.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return s.PENDING;var n=r.getBoundingSphere(e);return i(n)?(n.clone(t),s.DONE):s.FAILED},u.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},c.prototype.add=function(e,t){var i,r=t.createFillGeometryInstance(e),n=this._batches,o=new Uint32Array(r.attributes.color.value.buffer)[0];return n.contains(o)?i=n.get(o):(i=new u(this._primitives,r.attributes.color.value,o),n.set(o,i)),i.add(t,r),i},c.prototype.remove=function(e){for(var t=this._batches.values,i=t.length,r=0;r<i;++r)if(t[r].remove(e))return},c.prototype.update=function(e){var t,i,r=!0,n=this._batches,o=n.values,a=o.length;for(t=0;t<a;++t)r=o[t].update(e)&&r;for(t=0;t<a;++t)for(var s=o[t],l=s.itemsToRemove,u=l.length,c=0;c<u;c++){i=l[c],s.remove(i);var d=this.add(e,i);s.isDirty=!0,d.isDirty=!0}var h=o.slice(),p=h.length;for(t=0;t<p;++t){var f=h[t];f.isDirty&&(r=h[t].update(e)&&r,f.isDirty=!1),0===f.geometry.length&&n.remove(f.key)}return r},c.prototype.getBoundingSphere=function(e,t){for(var i=this._batches.values,r=i.length,n=0;n<r;++n){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return s.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._batches.values,t=e.length,i=0;i<t;++i)e[i].removeAllPrimitives()},c}),define("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(t,i,r,n){this.translucent=i,this.width=r,this.shadows=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.subscriptions=new e,this.showsUpdated=new e}function h(t,i,r){this._primitives=t,this._scene=i,this._shadows=r,this._solidBatches=new e,this._translucentBatches=new e}d.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&c.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},d.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var p=new t,f=new n;return d.prototype.update=function(e){var u,d,h=!0,m=0,_=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,y=v.length;if(y>0){for(r(_)&&(r(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_),d=0;d<y;d++){var C=v[d],w=C.attributes;u=this.attributes.get(C.id.id),r(u)&&(r(w.show)&&(w.show.value=u.show),r(w.color)&&(w.color.value=u.color))}_=new l({asynchronous:!0,geometryInstances:v,appearance:new s({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),g.add(_),h=!1}else{r(_)&&(g.remove(_),_=void 0);var S=this.oldPrimitive;r(S)&&(g.remove(S),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=_,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(_)&&_.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var E=this.updatersWithAttributes.values,b=E.length,T=this.waitingOnCreate;for(d=0;d<b;d++){var x=E[d],A=this.geometry.get(x.entity.id);if(u=this.attributes.get(A.id.id),r(u)||(u=_.getGeometryInstanceAttributes(A.id),this.attributes.set(A.id.id,u)),!x.outlineColorProperty.isConstant||T){var P=x.outlineColorProperty;P.getValue(e,p),t.equals(u._lastColor,p)||(u._lastColor=t.clone(p,u._lastColor),u.color=i.toValue(p,u.color),(this.translucent&&255===u.color[3]||!this.translucent&&255!==u.color[3])&&(this.itemsToRemove[m++]=x))}var D=x.entity.isShowing&&(x.hasConstantOutline||x.isOutlineVisible(e)),M=1===u.show[0];D!==M&&(u.show=a.toValue(D,u.show));var I=x.distanceDisplayConditionProperty;if(!c.isConstant(I)){var R=I.getValue(e,f);n.equals(R,u._lastDistanceDisplayCondition)||(u._lastDistanceDisplayCondition=n.clone(R,u._lastDistanceDisplayCondition),u.distanceDisplayCondition=o.toValue(R,u.distanceDisplayCondition))}}this.updateShows(_),this.waitingOnCreate=!1}else r(_)&&!_.ready&&(h=!1);return this.itemsToRemove.length=m,h},d.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},d.prototype.contains=function(e){return this.updaters.contains(e.id)},d.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return u.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?u.FAILED:(n.boundingSphere.clone(t),u.DONE)},d.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},h.prototype.add=function(e,t){var i,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(i=this._solidBatches,n=i.get(a),r(n)||(n=new d(this._primitives,!1,a,this._shadows),i.set(a,n)),n.add(t,o)):(i=this._translucentBatches,n=i.get(a),r(n)||(n=new d(this._primitives,!0,a,this._shadows),i.set(a,n)),n.add(t,o))},h.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;t<r;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},h.prototype.update=function(e){var t,i,r,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,d=!1;do{for(d=!1,i=0;i<s;i++){n=a[i],c=n.update(e),o=n.itemsToRemove;var h=o.length;if(h>0)for(d=!0,t=0;t<h;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;i<u;i++){n=l[i],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(d=!0,t=0;t<p;t++)r=o[t],n.remove(r),this.add(e,r)}}while(d);return c},h.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;i<n;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(i=0;i<s;i++){var l=a[i];if(l.contains(e))return l.getBoundingSphere(e,t)}return u.FAILED},h.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;e<n;e++)r[e].removeAllPrimitives()},h}),define("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticOutlineGeometryBatch"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t,i){this._primitives=t,this._groundPrimitives=i,this._dynamicUpdaters=new e}function p(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function f(e,t,i){if(i.isDynamic)return void e._dynamicBatch.add(t,i);var r;(i.outlineEnabled||i.fillEnabled)&&(r=i.shadowsProperty.getValue(t)),i.outlineEnabled&&e._outlineBatches[r].add(t,i),i.fillEnabled&&(i.onTerrain?e._groundColorBatch.add(t,i):i.isClosed?i.fillMaterialProperty instanceof s?e._closedColorBatches[r].add(t,i):e._closedMaterialBatches[r].add(t,i):i.fillMaterialProperty instanceof s?e._openColorBatches[r].add(t,i):e._openMaterialBatches[r].add(t,i))}function m(t,i,r){this._type=t;var n=i.primitives,a=i.groundPrimitives;this._scene=i,this._primitives=n,this._groundPrimitives=a,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var s=o.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(s),this._closedColorBatches=new Array(s),this._closedMaterialBatches=new Array(s),this._openColorBatches=new Array(s),this._openMaterialBatches=new Array(s);for(var p=0;p<s;++p)this._outlineBatches[p]=new d(n,i,p),this._closedColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,!0,p),this._closedMaterialBatches[p]=new u(n,t.materialAppearanceType,!0,p),this._openColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,!1,p),this._openMaterialBatches[p]=new u(n,t.materialAppearanceType,!1,p);this._groundColorBatch=new c(a),this._dynamicBatch=new h(n,a),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatch,this._dynamicBatch),this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,_)}var _=[];h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives,this._groundPrimitives))},h.prototype.remove=function(e){var t=e.entity.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e);return!0},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},h.prototype.getBoundingSphere=function(e,t){var r=this._dynamicUpdaters.get(e.id);return i(r)&&i(r.getBoundingSphere)?r.getBoundingSphere(e,t):a.FAILED},m.prototype.update=function(e){var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(p(this,n),f(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),p(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),f(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,_=h.length;for(t=0;t<_;t++)d=h[t].update(e)&&d;return d};var g=[],v=new t;return m.prototype.getBoundingSphere=function(e,i){for(var r=g,n=v,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c<u;c++){if(s=l[c].getBoundingSphere(e,n),s===a.PENDING)return a.PENDING;s===a.DONE&&(r[o]=t.clone(n,r[o]),o++)}return 0===o?a.FAILED:(r.length=o,t.fromBoundingSpheres(r,i),a.DONE)},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,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(i=n.length,e=0;e<i;e++)n[e]();return this._subscriptions.removeAll(),r(this)},m._onGeometryChanged=function(e){var t=this._removedObjects,r=this._changedObjects,n=e.entity,o=n.id;i(t.get(o))||i(r.get(o))||r.set(o,n)},m.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},m}),define("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){this.entity=e,this.label=void 0,this.index=void 0}function g(t,i){i.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t,i){o(e)&&(e.label=void 0,i.removeLabel(t))}var y=1,C="30px sans-serif",w=h.FILL,S=r.WHITE,E=r.BLACK,b=1,T=!1,x=new r(.165,.165,.165,.8),A=new t(7,5),P=t.ZERO,D=i.ZERO,M=c.NONE,I=d.CENTER,R=p.CENTER,O=new i,N=new r,L=new r,B=new r,F=new t,k=new i,V=new t,z=new u,U=new u,G=new u,H=new l;return g.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,s=t[r],l=s.entity,u=l._label,c=s.label,d=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(u._show,e,!0);d&&(O=m.getValueOrUndefined(l._position,e,O),a=m.getValueOrUndefined(u._text,e),d=o(O)&&o(a)),d?(m.isConstant(l._position)||(i._clusterDirty=!0),o(c)||(c=i.getLabel(l),c.id=l,s.label=c),c.show=!0,c.position=O,c.text=a,c.scale=m.getValueOrDefault(u._scale,e,y),c.font=m.getValueOrDefault(u._font,e,C),c.style=m.getValueOrDefault(u._style,e,w),c.fillColor=m.getValueOrDefault(u._fillColor,e,S,N),c.outlineColor=m.getValueOrDefault(u._outlineColor,e,E,L),c.outlineWidth=m.getValueOrDefault(u._outlineWidth,e,b),c.showBackground=m.getValueOrDefault(u._showBackground,e,T),c.backgroundColor=m.getValueOrDefault(u._backgroundColor,e,x,B),c.backgroundPadding=m.getValueOrDefault(u._backgroundPadding,e,A,F),c.pixelOffset=m.getValueOrDefault(u._pixelOffset,e,P,V),c.eyeOffset=m.getValueOrDefault(u._eyeOffset,e,D,k),c.heightReference=m.getValueOrDefault(u._heightReference,e,M),c.horizontalOrigin=m.getValueOrDefault(u._horizontalOrigin,e,I),c.verticalOrigin=m.getValueOrDefault(u._verticalOrigin,e,R),c.translucencyByDistance=m.getValueOrUndefined(u._translucencyByDistance,e,z),c.pixelOffsetScaleByDistance=m.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,U),c.scaleByDistance=m.getValueOrUndefined(u._scaleByDistance,e,G),c.distanceDisplayCondition=m.getValueOrUndefined(u._distanceDisplayCondition,e,H)):v(s,l,i)}return!0},g.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);if(!o(r)||!o(r.label))return f.FAILED;var a=r.label;return t.center=i.clone(n(a._clampedPosition,a.position),t.center),t.radius=0,f.DONE},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return a(this)},g.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new _(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new _(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),define("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function d(e){i(e.images)||(e.images={})}function h(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var d=s.spot;i(d.color)||(d.color=[1,1,1]),d.constantAttenuation=t(d.constantAttenuation,1),d.fallOffAngle=t(d.fallOffAngle,3.14159265),d.fallOffExponent=t(d.fallOffExponent,0),d.linearAttenuation=t(d.linearAttenuation,0),d.quadraticAttenuation=t(d.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function f(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u<l;++u){var c=s[u];i(c.attributes)||(c.attributes={});var d=t(c.primitive,n.TRIANGLES);c.mode=t(c.mode,d)}}}function m(t){i(t.nodes)||(t.nodes={});var n=t.nodes,o=parseFloat(t.asset.version)<1,a=new e,s=new r;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l];if(i(u.children)||(u.children=[]),o&&i(u.rotation)){var c=u.rotation;e.fromArray(c,0,a),r.fromAxisAngle(a,c[3],s),u.rotation=[s.x,s.y,s.z,s.w]}i(u.matrix)||(i(u.translation)||i(u.rotation)||i(u.scale)?(i(u.translation)||(u.translation=[0,0,0]),i(u.rotation)||(u.rotation=[0,0,0,1]),i(u.scale)||(u.scale=[1,1,1])):u.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var d=u.instanceSkin;i(d)&&(u.skeletons=d.skeletons,u.skin=d.skin,u.meshes=d.meshes,delete u.instanceSkin)}}function _(e){i(e.programs)||(e.programs={});var t=e.programs;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.attributes)||(n.attributes=[])}}function g(e){i(e.samplers)||(e.samplers={});var r=e.samplers;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.magFilter=t(a.magFilter,n.LINEAR),a.minFilter=t(a.minFilter,n.NEAREST_MIPMAP_LINEAR),a.wrapS=t(a.wrapS,n.REPEAT),a.wrapT=t(a.wrapT,n.REPEAT)}}function v(e){i(e.scenes)||(e.scenes={});var t=e.scenes;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.node)||(n.node=[])}}function y(e){i(e.shaders)||(e.shaders={})}function C(e){i(e.skins)||(e.skins={});var t=e.skins;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.bindShapeMatrix)||(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function w(e){i(e.enable)||(e.enable=[]),i(e.disable)||(e.disable=[])}function S(e){i(e.techniques)||(e.techniques={});var r=e.techniques;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.parameters)||(o.parameters={});var a=o.parameters;for(var s in a){var l=a[s];l.node=t(l.node,l.source),l.source=void 0}var u=o.passes;if(i(u)){var c=t(o.pass,"defaultPass");if(u.hasOwnProperty(c)){var d=u[c],h=d.instanceProgram;o.attributes=t(o.attributes,h.attributes),o.program=t(o.program,h.program),o.uniforms=t(o.uniforms,h.uniforms),o.states=t(o.states,d.states)}o.passes=void 0,o.pass=void 0}i(o.attributes)||(o.attributes={}),i(o.uniforms)||(o.uniforms={}),i(o.states)||(o.states={}),w(o.states)}}function E(e){i(e.textures)||(e.textures={});var r=e.textures;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.format=t(a.format,n.RGBA),a.internalFormat=t(a.internalFormat,a.format),a.target=t(a.target,n.TEXTURE_2D),a.type=t(a.type,n.UNSIGNED_BYTE)}}var b=function(e){if(i(e))return i(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0),e.extensionsUsed=t(e.extensionsUsed,[]),o(e),a(e),s(e),l(e),u(e),c(e),d(e),h(e),p(e),f(e),m(e),_(e),g(e),v(e),y(e),C(e),S(e),E(e),e};return b}),define("Scene/Axis",["../Core/Check","../Core/freezeObject","../Core/Math","../Core/Matrix3","../Core/Matrix4"],function(e,t,i,r,n){"use strict";var o={X:0,Y:1,Z:2,Y_UP_TO_Z_UP:n.fromRotationTranslation(r.fromRotationX(i.PI_OVER_TWO)),Z_UP_TO_Y_UP:n.fromRotationTranslation(r.fromRotationX(-i.PI_OVER_TWO)),X_UP_TO_Z_UP:n.fromRotationTranslation(r.fromRotationY(-i.PI_OVER_TWO)),Z_UP_TO_X_UP:n.fromRotationTranslation(r.fromRotationY(i.PI_OVER_TWO)),X_UP_TO_Y_UP:n.fromRotationTranslation(r.fromRotationZ(i.PI_OVER_TWO)),Y_UP_TO_X_UP:n.fromRotationTranslation(r.fromRotationZ(-i.PI_OVER_TWO)),fromName:function(e){return o[e]}};return t(o)}),define("Scene/getAttributeOrUniformBySemantic",[],function(){"use strict";function e(e,t){var i=e.techniques;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r],o=n.parameters,a=n.attributes,s=n.uniforms;for(var l in a)if(a.hasOwnProperty(l)&&o[a[l]].semantic===t)return l;for(var u in s)if(s.hasOwnProperty(u)&&o[s[u]].semantic===t)return u}}return e}),define("Scene/getBinaryAccessor",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t,i=e.componentType;t="string"==typeof i?r.fromName(i):i;var n=l[e.type],o=u[e.type];return{componentsPerAttribute:n,classType:o,createArrayBufferView:function(e,i,o){return r.createArrayBufferView(t,e,i,n*o)}}}var l={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u={SCALAR:void 0,VEC2:e,VEC3:t,VEC4:i,MAT2:n,MAT3:o,MAT4:a};return s}),define("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","./getBinaryAccessor"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){}function c(e,t){var i=e.gltf,r=i.buffers,n=i.bufferViews,o=n[t.bufferView],a=r[o.buffer],s=o.byteOffset+t.byteOffset,u=t.count*l(t).componentsPerAttribute,c=p.test(a.uri)?"":a.uri;return e.cacheKey+"//"+c+"/"+s+"/"+u}function d(e,t,i){return e.cacheKey+"//"+t+"/"+i}function h(e){this._value=e}var p=/^data\:/i,f={},m=new e;u.getAnimationParameterValues=function(t,r){var n=c(t,r),a=f[n];if(!i(a)){var u,d=t._loadResources,h=t.gltf,p=parseFloat(h.asset.version)<1,_=h.bufferViews,g=_[r.bufferView],v=r.componentType,y=r.type,C=r.count,w=d.getBuffer(g),S=l(r).createArrayBufferView(w.buffer,w.byteOffset+r.byteOffset,C);if(v===s.FLOAT&&"SCALAR"===y)a=S;else if(v===s.FLOAT&&"VEC3"===y)for(a=new Array(C),u=0;u<C;++u)a[u]=e.fromArray(S,3*u);else if(v===s.FLOAT&&"VEC4"===y)for(a=new Array(C),u=0;u<C;++u){var E=4*u;p?a[u]=o.fromAxisAngle(e.fromArray(S,E,m),S[E+3]):a[u]=o.unpack(S,E)}i(t.cacheKey)&&(f[n]=a)}return a};var _={};h.prototype.evaluate=function(e,t){return this._value},u.getAnimationSpline=function(e,t,n,o,l,u){var c=d(e,t,o),p=_[c];if(!i(p)){
var f=u[l.input],m=e.gltf.accessors[n.parameters[l.output]],g=u[l.output];if(1===f.length&&1===g.length)p=new h(g[0]);else{var v=m.componentType,y=m.type;"LINEAR"===l.interpolation&&(v===s.FLOAT&&"VEC3"===y?p=new r({times:f,points:g}):v===s.FLOAT&&"VEC4"===y&&(p=new a({times:f,points:g})))}i(e.cacheKey)&&(_[c]=p)}return p};var g={};return u.getSkinInverseBindMatrices=function(e,t){var r=c(e,t),o=g[r];if(!i(o)){var a=e._loadResources,u=e.gltf,d=u.bufferViews,h=d[t.bufferView],p=t.componentType,f=t.type,m=t.count,_=a.getBuffer(h),v=l(t).createArrayBufferView(_.buffer,_.byteOffset+t.byteOffset,m);if(o=new Array(m),p===s.FLOAT&&"MAT4"===f)for(var y=0;y<m;++y)o[y]=n.fromArray(v,16*y);g[r]=o}return o},u}),define("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),define("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),define("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o){"use strict";function a(t,a,s){this._name=t.name,this._startTime=r.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new i,this.update=new i,this.stop=new i,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),define("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function h(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}function p(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}r(d.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),d.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,r=i._runtime.animations,n=r[e.name],o=new l(e,i,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(i,o),o},d.prototype.addAll=function(i){i=t(i,t.EMPTY_OBJECT),i=e(i);for(var r=[],n=this._model._animationIds,o=n.length,a=0;a<o;++a)i.name=n[a],r.push(this.add(i));return r},d.prototype.remove=function(e){if(i(e)){var t=this._scheduledAnimations,r=t.indexOf(e);if(r!==-1)return t.splice(r,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},d.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;r<i;++r)this.animationRemoved.raiseEvent(e,t[r])},d.prototype.contains=function(e){return!!i(e)&&this._scheduledAnimations.indexOf(e)!==-1},d.prototype.get=function(e){return this._scheduledAnimations[e]};var f=[];return d.prototype.update=function(e){var r=this._scheduledAnimations,n=r.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,d=this._model,m=0;m<n;++m){var _=r[m],g=_._runtimeAnimation;i(_._computedStartTime)||(_._computedStartTime=a.addSeconds(t(_.startTime,l),_.delay,new a)),i(_._duration)||(_._duration=g.stopTime*(1/_.speedup));var v=_._computedStartTime,y=_._duration,C=_.stopTime,w=0!==y?a.secondsDifference(l,v)/y:0,S=w>=0,E=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT,b=(S||E&&!i(_.startTime))&&(w<=1||E)&&(!i(C)||a.lessThanOrEquals(l,C));if(b){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&e.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)w-=Math.floor(w);else if(_.loop===u.MIRRORED_REPEAT){var T=Math.floor(w),x=w-T;w=T%2===1?1-x:x}_.reverse&&(w=1-w);var A=w*y*_.speedup;A=s.clamp(A,g.startTime,g.stopTime),h(g,A),_.update.numberOfListeners>0&&(_._updateEventTime=A,e.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&e.afterRender.push(_._raiseStopEvent),_.removeOnStop&&f.push(_))}n=f.length;for(var P=0;P<n;++P){var D=f[P];r.splice(r.indexOf(D),1),e.afterRender.push(p(this,d,D))}return f.length=0,o},d}),define("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i){"use strict";function r(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i]}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var i=this._uniformMap.values[e];i.value=i.clone(t,i.value)},r.prototype.getValue=function(t){var i=this._uniformMap.values[t];if(e(i))return i.value},r}),define("Scene/modelMaterialsCommon",["../Core/defaultValue","../Core/defined","../Core/WebGLConstants"],function(e,t,i){"use strict";function r(e){switch(e){case i.FLOAT:return"float";case i.FLOAT_VEC2:return"vec2";case i.FLOAT_VEC3:return"vec3";case i.FLOAT_VEC4:return"vec4";case i.FLOAT_MAT2:return"mat2";case i.FLOAT_MAT3:return"mat3";case i.FLOAT_MAT4:return"mat4";case i.SAMPLER_2D:return"sampler2D"}}function n(e){var r,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(r=e.extensions.KHR_materials_common.lights),t(r)){var o=e.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(t(s.extensions)&&t(s.extensions.KHR_materials_common)){var l=s.extensions.KHR_materials_common.light;t(l)&&t(r[l])&&(r[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in r)if(r.hasOwnProperty(c)){var d=r[c],h=d.type;if("ambient"!==h&&!t(d.node)){delete r[c];continue}var p="light"+u.toString();switch(d.baseName=p,h){case"ambient":var f=d.ambient;n[p+"Color"]={type:i.FLOAT_VEC3,value:f.color};break;case"directional":var m=d.directional;n[p+"Color"]={type:i.FLOAT_VEC3,value:m.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4});break;case"point":var _=d.point;n[p+"Color"]={type:i.FLOAT_VEC3,value:_.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[_.constantAttenuation,_.linearAttenuation,_.quadraticAttenuation]};break;case"spot":var g=d.spot;n[p+"Color"]={type:i.FLOAT_VEC3,value:g.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4},n[p+"InverseTransform"]={node:d.node,semantic:"MODELVIEWINVERSE",type:i.FLOAT_MAT4,useInFragment:!0}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]},n[p+"FallOff"]={type:i.FLOAT_VEC2,value:[g.fallOffAngle,g.fallOffExponent]}}++u}}return n}function o(i,r,n){var o,a=e(n,0);do o=r+(a++).toString();while(t(i[o]));return o}function a(n,a,l){var u,f=n.techniques,m=n.shaders,_=n.programs,g=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(u=n.extensions.KHR_materials_common.lights);var v=e(a.jointCount,0),y=v>0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(f,"technique",c),b=o(m,"vertexShader",d),T=o(m,"fragmentShader",h),x=o(_,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:v,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var D,M=!1;for(var I in C)if(C.hasOwnProperty(I)&&"transparent"!==I&&"doubleSided"!==I){var R=s(I,C[I]);D=I.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[D]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var B=P[L];N["u_"+L]=L;var F=t(B.count)?"["+B.count+"]":"";B.type!==i.FLOAT_MAT3&&B.type!==i.FLOAT_MAT4||B.useInFragment?(S+="uniform "+r(B.type)+" u_"+L+F+";\n",delete B.useInFragment):w+="uniform "+r(B.type)+" u_"+L+F+";\n"}var k="";y&&(k+="  mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",k+="  skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",k+="  skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",k+="  skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var V={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",k+=y?"  vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":"  vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",k+="  v_positionEC = pos.xyz;\n",k+="  gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(V.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",k+=y?"  v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":"  v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(V.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",k+="  "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(V.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},V.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,H=!1,W="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;W+="  {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(H=!0,W+="    ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",k+="  "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(W+="    vec3 l = normalize("+Z+");\n")),"directional"!==Y?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",k+="  "+K+" = u_"+X+"Transform[3].xyz;\n",W+="    vec3 VP = "+K+" - v_positionEC;\n",W+="    vec3 l = normalize(VP);\n",W+="    float range = length(VP);\n",W+="    float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",W+="(u_"+X+"Attenuation.y * range) + ",W+="(u_"+X+"Attenuation.z * range * range));\n"):W+="    float attenuation = 1.0;\n","spot"===Y&&(W+="    float spotDot = dot(l, normalize("+Z+"));\n",W+="    if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",W+="    {\n",W+="      attenuation = 0.0;\n",W+="    }\n",W+="    else\n",W+="    {\n",W+="        attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",W+="    }\n"),W+="    diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(W+="    vec3 h = normalize(l + viewDir);\n",W+="    float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(W+="    vec3 reflectDir = reflect(-l, normal);\n",W+="    float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),W+="    specularLight += "+Q+" * specularIntensity;\n")),W+="  }\n"}H||(W+="  ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(W+="  vec3 l = normalize(czm_sunDirectionEC);\n",W+="  diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(W+="  vec3 h = normalize(l + viewDir);\n",W+="  float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(W+="  vec3 reflectDir = reflect(-l, normal);\n",W+="  float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),W+="  specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=k,w+="}\n",S+="void main(void) {\n";var J="  vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+="  vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+="  if (gl_FrontFacing == false)\n",S+="  {\n",S+="    normal = -normal;\n",S+="  }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?"  vec4 diffuse = texture2D(u_diffuse, "+z+");\n":"  vec4 diffuse = u_diffuse;\n",S+="  vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+="  color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?"  vec3 specular = texture2D(u_specular, "+z+").rgb;\n":"  vec3 specular = u_specular.rgb;\n",S+="  vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+="  color += specular * specularLight;\n"),$=t(P.transparency)?"  gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":"  gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?"  gl_FragColor = vec4(color, u_transparency);\n":"  gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?"  vec3 emission = texture2D(u_emission, "+z+").rgb;\n":"  vec3 emission = u_emission.rgb;\n",J+="  color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?"  vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":"  vec3 ambient = u_ambient.rgb;\n":"  vec3 ambient = diffuse.rgb;\n",J+="  color += ambient * ambientLight;\n"),S+="  vec3 viewDir = -normalize(v_positionEC);\n",S+="  vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=W,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},f[E]={attributes:V,parameters:P,program:x,states:ee,uniforms:N},m[b]={type:i.VERTEX_SHADER,uri:"",extras:{source:w}},m[T]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(V);return _[x]={attributes:te,fragmentShader:T,vertexShader:b},E}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;a<o;++a){var l=n[a];r.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(i+=l+":"+s(l,r[l]),i+=";")}var u=e(t.doubleSided,!1);i+=u.toString()+";";var c=e(t.transparent,!1);i+=c.toString()+";";var d=e(t.jointCount,0);return i+=d.toString()+";"}function u(e){if(t(e)){var i=!1,r=e.extensionsUsed;if(t(r))for(var o=r.length,s=0;s<o;++s)if("KHR_materials_common"===r[s]){i=!0,r.splice(s,1);break}if(i){t(e.programs)||(e.programs={}),t(e.shaders)||(e.shaders={}),t(e.techniques)||(e.techniques={});var u=n(e),c={},d=e.materials;for(var h in d)if(d.hasOwnProperty(h)){var p=d[h];if(t(p.extensions)&&t(p.extensions.KHR_materials_common)){var f=p.extensions.KHR_materials_common,m=l(f),_=c[m];t(_)||(_=a(e,f,u),c[m]=_),p.values={};var g=f.values;for(var v in g)if(g.hasOwnProperty(v)){var y=g[v];t(y.value)?p.values[v]=y.value:p.values[v]=y}p.technique=_,delete p.extensions.KHR_materials_common}}t(e.extensions)&&delete e.extensions.KHR_materials_common}return e}}var c=0,d=0,h=0,p=0;return u}),define("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,i){for(var r=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];r[a]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),define("Scene/ModelNode",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function i(e,i,r,n,o){this._model=e,this._runtimeNode=r,this._name=i.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=t.clone(o)}return e(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=t.clone(e,this._matrix),this.useMatrix=!0;var i=this._model;i._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=i._maxDirtyNumber}}}),i.prototype.setMatrix=function(e){t.clone(e,this._matrix)},i}),define("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadCRN","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadKTX","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./Axis","./BlendingState","./ColorBlendMode","./getAttributeOrUniformBySemantic","./getBinaryAccessor","./HeightReference","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de){"use strict";function he(){this.buffersToCreate=new O,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new O,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new O,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new O,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesIds=[]}function pe(e,t){e._cachedGltf=t,e._animationIds=me(t)}function fe(e){this._gltf=se(Z(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function me(e){var t=[];if(u(e)&&u(e.gltf)){var i=e.gltf.animations;for(var r in i)i.hasOwnProperty(r)&&t.push(r)}return t}function _e(t){t=l(t,l.EMPTY_OBJECT);var i=t.cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=l(t.releaseGltfJson,!1),this._animationIds=void 0;var r;if(u(i)&&u(mi[i])&&mi[i].ready)r=mi[i],++r.count;else{var n=t.gltf;if(u(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=Ce(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),r=new fe({gltf:o.glTF,bgltf:n,ready:!0})}else r=new fe({gltf:t.gltf,ready:!0});r.count=1,u(i)&&(mi[i]=r)}}pe(this,r),this._basePath=l(t.basePath,"");var s=new K(document.location.href),c=new K(this._basePath);this._baseUri=c.resolve(s),this.show=l(t.show,!0),this.silhouetteColor=l(t.silhouetteColor,a.RED),this._silhouetteColor=new a,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=l(t.silhouetteSize,0),this.modelMatrix=D.clone(l(t.modelMatrix,D.IDENTITY)),this._modelMatrix=D.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=l(t.scale,1),this._scale=this.scale,this.minimumPixelSize=l(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.heightReference=l(t.heightReference,re.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var d=t.scene;this._scene=d,u(d)&&d.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this),this.pickPrimitive=t.pickPrimitive,this._allowPicking=l(t.allowPicking,!0),this._ready=!1,this._readyPromise=Q.defer(),this.activeAnimations=new oe(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=l(t.incrementallyLoadTextures,!0),this._asynchronous=l(t.asynchronous,!0),this.shadows=l(t.shadows,de.ENABLED),this._shadows=this.shadows,this.color=l(t.color,a.WHITE),this._color=new a,this._colorPreviousAlpha=1,this.colorBlendMode=l(t.colorBlendMode,ee.HIGHLIGHT),this.colorBlendAmount=l(t.colorBlendAmount,.5),this.debugShowBoundingVolume=l(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=l(t.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=t.distanceDisplayCondition,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=l(t.ignoreCommands,!1),this._upAxis=l(t.upAxis,J.Y),this.cull=l(t.cull,!0),this._computedModelMatrix=new D,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=pi.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function ge(e){return e.stencilBuffer}function ve(e,t,i){return e.subarray(t,t+i)}function ye(e){var t=g(e);return"glTF"===t}function Ce(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;i+=_i,i+=_i,i+=_i;var r=t.getUint32(i,!0);i+=_i+_i;var n=i,o=n+r,a=v(e,n,r);return{glTF:JSON.parse(a),binaryOffset:o}}function we(e,t,i){return e._runtime[t][i]}function Se(e,t){var i=e.accessors[t],r=i.extensions,n=i.min,o=i.max;if(u(r)){var a=r.WEB3D_quantized_attributes;u(a)&&(n=a.decodedMin,o=a.decodedMax)}return{min:n,max:o}}function Ee(t,r){for(var n=r.nodes,o=r.meshes,a=r.scenes[r.scene].nodes,s=a.length,l=[],c=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=0;h<s;++h){var p=n[a[h]];for(p._transformToRoot=Oe(p),l.push(p);l.length>0;){p=l.pop();var f=p._transformToRoot,m=p.meshes;if(u(m))for(var _=m.length,g=0;g<_;++g)for(var v=o[m[g]].primitives,y=v.length,C=0;C<y;++C){var w=v[C].attributes.POSITION;if(u(w)){var S=Se(r,w),E=i.fromArray(S.min,0,gi),b=i.fromArray(S.max,0,vi);u(c)&&u(d)&&(D.multiplyByPoint(f,E,E),D.multiplyByPoint(f,b,b),i.minimumByComponent(c,E,c),i.maximumByComponent(d,b,d))}}for(var T=p.children,x=T.length,A=0;A<x;++A){var P=n[T[A]];P._transformToRoot=Oe(P),D.multiplyTransformation(f,P._transformToRoot,P._transformToRoot),l.push(P)}delete p._transformToRoot}}var M=e.fromCornerPoints(c,d);return t._upAxis===J.Y?e.transformWithoutScale(M,J.Y_UP_TO_Z_UP,M):t._upAxis===J.X&&e.transformWithoutScale(M,J.X_UP_TO_Z_UP,M),M}function be(e,t,i){return function(){e._state=pi.FAILED,e._readyPromise.reject(new N("Failed to load "+t+": "+i))}}function Te(e,t){return function(i){var r=e._loadResources;r.buffers[t]=new Uint8Array(i),--r.pendingBufferLoads}}function xe(e){var t=e.gltf.buffers;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if("binary_glTF"===i||"KHR_binary_glTF"===i){var n=e._loadResources;n.buffers[i]=e._cachedGltf.bgltf}else if("arraybuffer"===r.type){++e._loadResources.pendingBufferLoads;var o=new K(r.uri),a=o.resolve(e._baseUri).toString();C(a).then(Te(e,i)).otherwise(be(e,"buffer",a))}}}function Ae(e){var t=e.gltf.bufferViews;for(var i in t)t.hasOwnProperty(i)&&t[i].target===B.ARRAY_BUFFER&&e._loadResources.buffersToCreate.enqueue(i)}function Pe(e,t){return function(i){var r=e._loadResources;r.shaders[t]={source:i,bufferView:void 0},--r.pendingShaderLoads}}function De(e){var t=e.gltf.shaders;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(u(r.extras)&&u(r.extras.source))e._loadResources.shaders[i]={source:r.extras.source,bufferView:void 0};else if(u(r.extensions)&&u(r.extensions.KHR_binary_glTF)){var n=r.extensions.KHR_binary_glTF;e._loadResources.shaders[i]={source:void 0,bufferView:n.bufferView}}else{++e._loadResources.pendingShaderLoads;var o=new K(r.uri),a=o.resolve(e._baseUri).toString();T(a).then(Pe(e,i)).otherwise(be(e,"shader",a))}}}function Me(e){var t=e.gltf.programs;for(var i in t)t.hasOwnProperty(i)&&e._loadResources.programsToCreate.enqueue(i)}function Ie(e,t){return function(i){var r=e._loadResources;--r.pendingTextureLoads,r.texturesToCreate.enqueue({id:t,image:i,bufferView:i.bufferView,width:i.width,height:i.height,internalFormat:i.internalFormat})}}function Re(e,t){var i=e.gltf.images,r=e.gltf.textures;for(var n in r)if(r.hasOwnProperty(n)){var o=i[r[n].source],a=o.extras,s=void 0,l=void 0;if(u(a)&&u(a.compressedImage3DTiles)){var c=a.compressedImage3DTiles.crunch,d=a.compressedImage3DTiles.s3tc,h=a.compressedImage3DTiles.pvrtc1,p=a.compressedImage3DTiles.etc1;t.s3tc&&u(c)?u(c.extensions)&&u(c.extensions.KHR_binary_glTF)?s=c.extensions.KHR_binary_glTF:l=c.uri:t.s3tc&&u(d)?u(d.extensions)&&u(d.extensions.KHR_binary_glTF)?s=d.extensions.KHR_binary_glTF:l=d.uri:t.pvrtc&&u(h)?u(h.extensions)&&u(h.extensions.KHR_binary_glTF)?s=h.extensions.KHR_binary_glTF:l=h.uri:t.etc1&&u(p)&&(u(p.extensions)&&u(p.extensions.KHR_binary_glTF)?s=p.extensions.KHR_binary_glTF:l=p.uri)}if(u(s)||u(l)||(u(o.extensions)&&u(o.extensions.KHR_binary_glTF)?s=o.extensions.KHR_binary_glTF:l=new K(o.uri)),u(s))e._loadResources.texturesToCreateFromBufferView.enqueue({id:n,image:void 0,bufferView:s.bufferView,mimeType:s.mimeType});else{++e._loadResources.pendingTextureLoads,l=new K(l);var f=l.resolve(e._baseUri).toString();yi.test(f)?b(f).then(Ie(e,n)).otherwise(be(e,"image",f)):Ci.test(f)?w(f).then(Ie(e,n)).otherwise(be(e,"image",f)):S(f).then(Ie(e,n)).otherwise(be(e,"image",f))}}}function Oe(e){return u(e.matrix)?D.fromArray(e.matrix):D.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,wi),R.unpack(e.rotation,0,Si),i.fromArray(e.scale,0,Ei))}function Ne(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],l={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new D,computedMatrix:new D,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};l.publicNode=new ue(e,s,l,a,Oe(s)),t[a]=l,i[s.name]=l,u(s.skin)&&(n.push(a),r.push(l))}e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function Le(e){var t={},i={},r=e.gltf.materials,n=e._uniformMaps;for(var o in r)if(r.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=r[o],s=new ae(e,a,o);t[a.name]=s,i[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=i}function Be(e){var t={},i=e._runtime.materialsById,r=e.gltf.meshes,n=ke(e,"WEB3D_quantized_attributes");for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];if(t[a.name]=new le(a,i,o),n)for(var s=a.primitives,l=s.length,c=0;c<l;c++){var d=s[c],h=He(e,d),p=e._programPrimitives[h];u(p)||(p=[],e._programPrimitives[h]=p),p.push(d)}}e._runtime.meshesByName=t}function Fe(e,t){e._loadRendererResourcesFromCache||(xe(e),Ae(e),De(e),Me(e),Re(e,t)),Le(e),Be(e),Ne(e)}function ke(e,t){var i=e._extensionsUsed;if(!u(i)){var r=e.gltf.extensionsUsed;i={};for(var n=r.length,o=0;o<n;o++)i[r[o]]=!0}return u(i[t])}function Ve(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){for(var r,n=e.gltf.bufferViews,o=e._rendererResources.buffers;i.buffersToCreate.length>0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=F.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:k.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var l=e.gltf.accessors;for(var c in l)if(l.hasOwnProperty(c)){var d=l[c];if(r=n[d.bufferView],r.target===B.ELEMENT_ARRAY_BUFFER&&!u(o[d.bufferView])){var h=F.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:k.STATIC_DRAW,indexDatatype:d.componentType});h.vertexArrayDestroyable=!1,o[d.bufferView]=h}}}}function ze(e,t){var i,r={},n=t.length;for(i=1;i<n;++i){var o=t[i];if(/position/i.test(o)){t[i]=t[0],t[0]=o;break}}for(i=0;i<n;++i)r[t[i]]=i;return r}function Ue(e,t){if(u(t.source))return t.source;var i=e._loadResources,r=e.gltf,n=r.bufferViews[t.bufferView];return v(i.getBuffer(n))}function Ge(e,t,i){var r=e.indexOf(t);return e.replace(new RegExp(t,"g"),function(e,t,n){return r===t?e:i})}function He(e,t){var i=e.gltf,r=t.material,n=i.materials[r],o=n.technique,a=i.techniques[o];return a.program}function We(e,t){var i=e.gltf,r=i.accessors[t],n=r.extensions;if(u(n))return n.WEB3D_quantized_attributes}function qe(e,t,i){var r=e.gltf,n=t.material,o=r.materials[n],a=o.technique,s=r.techniques[a];for(var l in s.parameters)if(s.parameters.hasOwnProperty(l)){var u=s.parameters[l].semantic;if(u===i){var c=s.attributes;for(var d in c)if(c.hasOwnProperty(d)){var h=c[d];if(h===l)return d}}}}function je(e,t,i,r){var n={};i._quantizedUniforms[t]=n;for(var o=i._programPrimitives[t],a=0;a<o.length;a++){var s=o[a];if(He(i,s)===t)for(var l in s.attributes)if(s.attributes.hasOwnProperty(l)){var c="gltf_u_dec_"+l.toLowerCase(),d=c+"_scale",h=c+"_translate";if(!u(n[c])&&!u(n[d])){var p=s.attributes[l],f=We(i,p);if(u(f)){var m=qe(i,s,l),_=f.decodeMatrix,g="gltf_decoded_"+l,v=m.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(_.length));e=Ge(e,m,v);var C;C=y>2?"vec"+(y-1):"float",e=C+" "+v+";\n"+e;var w="";5===y?(e="uniform mat4 "+d+";\n"+e,e="uniform vec4 "+h+";\n"+e,w="\nvoid main() {\n    "+v+" = "+d+" * "+m+" + "+h+";\n    "+g+"();\n}\n",n[d]={mat:4},n[h]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,w="\nvoid main() {\n    "+v+" = "+C+"("+c+" * vec"+y+"("+m+",1.0));\n    "+g+"();\n}\n",n[c]={mat:y}),e=W.replaceMain(e,g),e+=w}}}}return i._programPrimitives[t]=void 0,e}function Ye(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function Xe(e,t){return e=W.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n    gltf_blend_main(); \n",t&&(e+="    float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n    gl_FragColor.rgb /= alpha; \n"),
e+="    gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n    float highlight = ceil(gltf_colorBlend); \n    gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n    gl_FragColor.a *= gltf_color.a; \n} \n"}function Ze(e,t,i){return u(i)&&(e=i(e,t)),e}function Ke(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=ze(t,o.attributes),s=Ue(t,n[o.vertexShader]),l=Ue(t,n[o.fragmentShader]),c=o.attributes.length,d=t._precreatedAttributes;if(u(d))for(var h in d)d.hasOwnProperty(h)&&(a[h]=c++);ke(t,"WEB3D_quantized_attributes")&&(s=je(s,e,t,i));var p=Ye(t),f=Xe(l,p),m=Ze(s,e,t._vertexShaderLoaded),_=Ze(f,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=H.fromCache({context:i,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:a}),t.allowPicking){var g=Ze(s,e,t._pickVertexShaderLoaded),v=Ze(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=W.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=H.fromCache({context:i,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a})}}function Qe(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),Ke(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),Ke(i,e,t)}function Je(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function $e(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=be(e,"image","id: "+i.id+", bufferView: "+i.bufferView);if("image/ktx"===i.mimeType)b(t.getBuffer(n)).then(Ie(e,i.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else if("image/crn"===i.mimeType)w(t.getBuffer(n)).then(Ie(e,i.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else{var a=Je(t,i);E(t.getBuffer(n),i.mimeType).then(a).otherwise(o),++t.pendingBufferViewToImage}}}function et(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new G({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function tt(e,t,i){var r,n=t.gltf.textures,o=n[e.id],a=t._rendererResources.samplers,s=a[o.sampler],l=e.internalFormat,c=!(u(l)&&M.isCompressedFormat(l)||s.minificationFilter!==j.NEAREST_MIPMAP_NEAREST&&s.minificationFilter!==j.NEAREST_MIPMAP_LINEAR&&s.minificationFilter!==j.LINEAR_MIPMAP_NEAREST&&s.minificationFilter!==j.LINEAR_MIPMAP_LINEAR),d=c||s.wrapS===Y.REPEAT||s.wrapS===Y.MIRRORED_REPEAT||s.wrapT===Y.REPEAT||s.wrapT===Y.MIRRORED_REPEAT,h=e.image;if(u(l)&&o.target===B.TEXTURE_2D)r=new q({context:i,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:l,sampler:s});else if(u(h)){var p=!x.isPowerOfTwo(h.width)||!x.isPowerOfTwo(h.height);if(d&&p){var f=document.createElement("canvas");f.width=x.nextPowerOfTwo(h.width),f.height=x.nextPowerOfTwo(h.height);var m=f.getContext("2d");m.drawImage(h,0,0,h.width,h.height,0,0,f.width,f.height),h=f}o.target===B.TEXTURE_2D&&(r=new q({context:i,source:h,pixelFormat:o.internalFormat,pixelDatatype:o.type,sampler:s,flipY:!1})),c&&r.generateMipmap()}t._rendererResources.textures[e.id]=r}function it(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),tt(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),tt(i,e,t)}function rt(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,l=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var d in c)if(c.hasOwnProperty(d)){var h=l[d],p=c[d].index;if(u(h)){var f=s[h];o[f.semantic]=p}else o[d]=p}return o}function nt(e,t,i){for(var r=e.length,n=0;n<r;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c<u;++c)o.push(l[c])}}function ot(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],c=o[u],d=n[u],h=t[d.skin];c.inverseBindMatrices=h.inverseBindMatrices,c.bindShapeMatrix=h.bindShapeMatrix;for(var p=[],f=d.skeletons,m=f.length,_=0;_<m;++_)p.push(f[_]);for(var g=r[d.skin].jointNames,v=g.length,y=0;y<v;++y){var C=g[y],w=o[nt(p,C,n)];c.joints.push(w)}}}function at(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n=i.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=r[l.inverseBindMatrices];D.equals(l.bindShapeMatrix,D.IDENTITY)||(s=D.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:ne.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}ot(e,o)}}function st(e,t,i,r){return function(n){t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber}}function lt(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var i=e._runtime.nodes,r=e.gltf.animations,n=e.gltf.accessors;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],s=a.channels,l=a.parameters,u=a.samplers,c={};for(var d in l)l.hasOwnProperty(d)&&(c[d]=ne.getAnimationParameterValues(e,n[l[d]]));for(var h=Number.MAX_VALUE,p=-Number.MAX_VALUE,f=s.length,m=new Array(f),_=0;_<f;++_){var g=s[_],v=g.target,y=u[g.sampler],C=c[y.input];h=Math.min(h,C[0]),p=Math.max(p,C[C.length-1]);var w=ne.getAnimationSpline(e,o,a,g.sampler,y,c);m[_]=st(e,i[v.id],v.path,w)}e._runtime.animations[o]={startTime:h,stopTime:p,channelEvaluators:m}}}}function ut(e,t){var i=e._loadResources;if(i.finishedBuffersCreation()&&i.finishedProgramCreation()&&i.createVertexArrays){i.createVertexArrays=!1;var r=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var l in s)if(s.hasOwnProperty(l))for(var c=s[l].primitives,d=c.length,h=0;h<d;++h){var p,f,m,_=c[h],g=rt(e,_),v=[],y=_.attributes;for(p in y)if(y.hasOwnProperty(p)&&(f=g[p],u(f))){var C=a[y[p]];v.push({index:f,vertexBuffer:r[C.bufferView],componentsPerAttribute:ie(C).componentsPerAttribute,componentDatatype:C.componentType,normalize:!1,offsetInBytes:C.byteOffset,strideInBytes:C.byteStride})}var w=e._precreatedAttributes;if(u(w))for(p in w)w.hasOwnProperty(p)&&(f=g[p],u(f)&&(m=w[p],m.index=f,v.push(m)));var S;if(u(_.indices)){var E=a[_.indices];S=r[E.bufferView]}n[l+".primitive."+h]=new X({context:t,attributes:v,indexBuffer:S})}}}function ct(e){var t={};t[B.BLEND]=!1,t[B.CULL_FACE]=!1,t[B.DEPTH_TEST]=!1,t[B.POLYGON_OFFSET_FILL]=!1,t[B.SCISSOR_TEST]=!1;var i,r=e.enable,n=r.length;for(i=0;i<n;++i)t[r[i]]=!0;return t}function dt(e,t){var i=e._loadResources,r=e.gltf.techniques;if(i.createRenderStates){i.createRenderStates=!1;for(var n in r)r.hasOwnProperty(n)&&ht(e,n,t)}}function ht(e,t,i){var r=e._rendererResources.renderStates,n=e.gltf.techniques,o=n[t],a=o.states,s=ct(a),c=l(a.functions,l.EMPTY_OBJECT),d=l(c.blendColor,[0,0,0,0]),h=l(c.blendEquationSeparate,[B.FUNC_ADD,B.FUNC_ADD]),p=l(c.blendFuncSeparate,[B.ONE,B.ZERO,B.ONE,B.ZERO]),f=l(c.colorMask,[!0,!0,!0,!0]),m=l(c.depthRange,[0,1]),_=l(c.polygonOffset,[0,0]),g=l(c.scissor,[0,0,0,0]);s[B.BLEND]&&Ye(e)&&p[0]===B.ONE&&p[1]===B.ONE_MINUS_SRC_ALPHA&&(p[0]=B.SRC_ALPHA,p[1]=B.ONE_MINUS_SRC_ALPHA,p[2]=B.SRC_ALPHA,p[3]=B.ONE_MINUS_SRC_ALPHA),r[t]=U.fromCache({frontFace:u(c.frontFace)?c.frontFace[0]:B.CCW,cull:{enabled:s[B.CULL_FACE],face:u(c.cullFace)?c.cullFace[0]:B.BACK},lineWidth:u(c.lineWidth)?c.lineWidth[0]:1,polygonOffset:{enabled:s[B.POLYGON_OFFSET_FILL],factor:_[0],units:_[1]},scissorTest:{enabled:s[B.SCISSOR_TEST],rectangle:{x:g[0],y:g[1],width:g[2],height:g[3]}},depthRange:{near:m[0],far:m[1]},depthTest:{enabled:s[B.DEPTH_TEST],func:u(c.depthFunc)?c.depthFunc[0]:B.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:!u(c.depthMask)||c.depthMask[0],blending:{enabled:s[B.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:h[0],equationAlpha:h[1],functionSourceRgb:p[0],functionDestinationRgb:p[1],functionSourceAlpha:p[2],functionDestinationAlpha:p[3]}})}function pt(e,t){var i={value:e,clone:function(e,t){return e},func:function(){return i.value}};return i}function ft(e,i){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function mt(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function _t(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function gt(e,t){var i={value:A.fromColumnMajorArray(e),clone:A.clone,func:function(){return i.value}};return i}function vt(e,t){var i={value:P.fromColumnMajorArray(e),clone:P.clone,func:function(){return i.value}};return i}function yt(e,t){var i={value:D.fromColumnMajorArray(e),clone:D.clone,func:function(){return i.value}};return i}function Ct(e,t){this._value=void 0,this._textureId=e,this._model=t}function wt(e,t){var i=new Ct(e,t);return i.func=function(){return i.value},i}function St(e,t,i,r){var n=t._runtime.nodes[e];return Ai[i](r,t,n)}function Et(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=r.materials,o=r.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var l,c=n[s],d=c.values,h=o[c.technique],p=h.parameters,f=h.uniforms,m={},_={};for(var g in f)if(f.hasOwnProperty(g)){var v=f[g],y=p[v];if(u(d[v])){var C=xi[y.type](d[v],e);m[g]=C.func,_[v]=C}else if(u(y.node))m[g]=St(y.node,e,y.semantic,t.uniformState);else if(u(y.semantic))"JOINTMATRIX"!==y.semantic?m[g]=Ti[y.semantic](t.uniformState,e):l=g;else if(u(y.value)){var w=xi[y.type](y.value,e);m[g]=w.func,_[v]=w}}var S=a[s];S.uniformMap=m,S.values=_,S.jointMatrixUniformName=l}}}function bt(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function Tt(e){return[e[20],e[21],e[22],e[23]]}function xt(e,t,i){var r=e.gltf,n=r.accessors,o=He(e,t),a=e._quantizedUniforms[o],s={},l={};for(var c in t.attributes)if(t.attributes.hasOwnProperty(c)){var d=t.attributes[c],h=n[d],p=h.extensions;if(u(p)){var f=p.WEB3D_quantized_attributes;if(u(f)){var m=f.decodeMatrix,_="gltf_u_dec_"+c.toLowerCase();switch(h.type){case"SCALAR":l[_]=gt(m,e).func,s[_]=!0;break;case"VEC2":l[_]=vt(m,e).func,s[_]=!0;break;case"VEC3":l[_]=yt(m,e).func,s[_]=!0;break;case"VEC4":var g=_+"_scale",v=_+"_translate";l[g]=yt(bt(m),e).func,l[v]=_t(Tt(m),e).func,s[g]=!0,s[v]=!0}}}}for(var y in a)if(a.hasOwnProperty(y)&&!s[y]){var C=a[y];u(C.mat)&&(2===C.mat?l[y]=gt(A.IDENTITY,e).func:3===C.mat?l[y]=vt(P.IDENTITY,e).func:4===C.mat&&(l[y]=yt(D.IDENTITY,e).func)),u(C.vec)&&4===C.vec&&(l[y]=_t([0,0,0,0],e).func)}return l}function At(e){return function(){return e}}function Pt(e){return function(){return e.computedJointMatrices}}function Dt(e){return function(){return e.silhouetteColor}}function Mt(e){return function(){return e.silhouetteSize}}function It(e){return function(){return e.color}}function Rt(e){return function(){return ee.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function Ot(t,r,n,o,a){for(var c=t._nodeCommands,d=t._pickIds,h=t.allowPicking,p=t._runtime.meshesByName,f=t._rendererResources,m=f.vertexArrays,_=f.programs,g=f.pickPrograms,v=f.renderStates,C=t._uniformMaps,w=t.gltf,S=w.accessors,E=w.meshes,b=w.techniques,T=w.materials,x=r.meshes,A=x.length,P=0;P<A;++P)for(var M=x[P],I=E[M],R=I.primitives,O=R.length,N=0;N<O;++N){var L,B=R[N],F=S[B.indices],k=T[B.material],U=b[k.technique],G=U.program,H=B.attributes.POSITION;if(u(H)){var W=Se(w,H);L=e.fromCornerPoints(i.fromArray(W.min),i.fromArray(W.max))}var q,j,Y=m[M+".primitive."+N];if(u(F))j=F.count,q=F.byteOffset/y.getSizeInBytes(F.componentType);else{var X=S[B.attributes.POSITION];j=X.count,q=0}var Z=C[B.material],K=Z.uniformMap;if(u(Z.jointMatrixUniformName)){var Q={};Q[Z.jointMatrixUniformName]=Pt(n),K=s(K,Q)}if(K=s(K,{gltf_color:It(t),gltf_colorBlend:Rt(t)}),u(t._uniformMapLoaded)&&(K=t._uniformMapLoaded(K,G,n)),ke(t,"WEB3D_quantized_attributes")){var J=xt(t,B,o);K=s(K,J)}var $,ee=v[k.technique],te=ee.blending.enabled,ie={primitive:l(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[I.name]},re=de.castShadows(t._shadows),ne=de.receiveShadows(t._shadows),oe=new V({boundingVolume:new e,cull:t.cull,modelMatrix:new D,primitiveType:B.mode,vertexArray:Y,count:j,offset:q,shaderProgram:_[U.program],castShadows:re,receiveShadows:ne,uniformMap:K,renderState:ee,owner:ie,pass:te?z.TRANSLUCENT:z.OPAQUE});if(h){var ae;if(u(t._pickFragmentShaderLoaded))ae=u(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(K):s(K);else{var se=o.createPickId(ie);d.push(se);var le={czm_pickColor:At(se.color)};ae=s(K,le)}$=new V({boundingVolume:new e,cull:t.cull,modelMatrix:new D,primitiveType:B.mode,vertexArray:Y,count:j,offset:q,shaderProgram:g[U.program],uniformMap:ae,renderState:ee,owner:ie,pass:te?z.TRANSLUCENT:z.OPAQUE})}var ue,ce;a||(ue=V.shallowClone(oe),ue.boundingVolume=new e,ue.modelMatrix=new D,h&&(ce=V.shallowClone($),ce.boundingVolume=new e,ce.modelMatrix=new D));var he={show:!0,boundingSphere:L,command:oe,pickCommand:$,command2D:ue,pickCommand2D:ce,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0};n.commands.push(he),c.push(he)}}function Nt(e,t,r){var n=e._loadResources;if(n.finishedEverythingButTextureCreation()&&n.createRuntimeNodes){n.createRuntimeNodes=!1;for(var o=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,c=s.scenes[s.scene],d=c.nodes,h=d.length,p=[],f=0;f<h;++f)for(p.push({parentRuntimeNode:void 0,gltfNode:l[d[f]],id:d[f]});p.length>0;){var m=p.pop(),_=m.parentRuntimeNode,g=m.gltfNode,v=a[m.id];if(0===v.parents.length)if(u(g.matrix))v.matrix=D.fromColumnMajorArray(g.matrix);else{var y=g.rotation;v.translation=i.fromArray(g.translation),v.rotation=R.unpack(y),v.scale=i.fromArray(g.scale)}u(_)?(_.children.push(v),v.parents.push(_)):o.push(v),u(g.meshes)&&Ot(e,g,v,t,r);for(var C=g.children,w=C.length,S=0;S<w;++S)p.push({parentRuntimeNode:v,gltfNode:l[C[S]],id:C[S]})}e._runtime.rootNodes=o,e._runtime.nodes=a}}function Lt(e,t){var i=t.context,r=t.scene3DOnly;if(e._loadRendererResourcesFromCache){var n=e._rendererResources,o=e._cachedRendererResources;n.buffers=o.buffers,n.vertexArrays=o.vertexArrays,n.programs=o.programs,n.pickPrograms=o.pickPrograms,n.silhouettePrograms=o.silhouettePrograms,n.textures=o.textures,n.samplers=o.samplers,n.renderStates=o.renderStates,u(e._precreatedAttributes)&&ut(e,i)}else Ve(e,i),Qe(e,i),et(e,i),$e(e),it(e,i);at(e),lt(e),e._loadRendererResourcesFromCache||(ut(e,i),dt(e,i)),Et(e,i),Nt(e,i,r)}function Bt(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&u(r)?D.clone(r,t):u(e.matrix)?D.clone(e.matrix,t):(D.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}function Ft(t,n,o,a){var s=t._maxDirtyNumber,l=t.allowPicking,c=t._runtime.rootNodes,d=c.length,h=Pi,p=t._computedModelMatrix;if(t._mode!==ce.SCENE3D){var f=D.getColumn(p,3,Di);if(r.equals(f,r.UNIT_W)){var m=t.boundingSphere.center,_=L.wgs84To2DModelMatrix(a,m,Mi);p=D.multiply(_,p,Mi),u(t._rtcCenter)&&(D.setTranslation(p,r.UNIT_W,p),t._rtcCenter=t._rtcCenter2D)}else p=L.basisTo2D(a,p,Mi),t._rtcCenter=t._rtcCenter3D}for(var g=0;g<d;++g){var v=c[g];for(Bt(v,v.transformToRoot),h.push(v);h.length>0;){v=h.pop();var y=v.transformToRoot,C=v.commands;if(v.dirtyNumber===s||n||o){var w=D.multiplyTransformation(p,y,v.computedMatrix),S=C.length;if(S>0)for(var E=0;E<S;++E){var b=C[E],T=b.command;if(D.clone(w,T.modelMatrix),e.transform(b.boundingSphere,T.modelMatrix,T.boundingVolume),u(t._rtcCenter)&&i.add(t._rtcCenter,T.boundingVolume.center,T.boundingVolume.center),l){var A=b.pickCommand;D.clone(T.modelMatrix,A.modelMatrix),e.clone(T.boundingVolume,A.boundingVolume)}if(T=b.command2D,u(T)&&t._mode===ce.SCENE2D&&(D.clone(w,T.modelMatrix),T.modelMatrix[13]-=2*x.sign(T.modelMatrix[13])*x.PI*a.ellipsoid.maximumRadius,e.transform(b.boundingSphere,T.modelMatrix,T.boundingVolume),l)){var P=b.pickCommand2D;D.clone(T.modelMatrix,P.modelMatrix),e.clone(T.boundingVolume,P.boundingVolume)}}}for(var M=v.children,I=M.length,R=0;R<I;++R){var O=M[R];O.dirtyNumber=Math.max(O.dirtyNumber,v.dirtyNumber),(O.dirtyNumber===s||o)&&(Bt(O,O.transformToRoot),D.multiplyTransformation(y,O.transformToRoot,O.transformToRoot)),h.push(O)}}}++t._maxDirtyNumber}function kt(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];Ii=D.inverseTransformation(n.transformToRoot,Ii);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,c=l.length,d=0;d<c;++d)u(o[d])||(o[d]=new D),o[d]=D.multiplyTransformation(Ii,a[d].transformToRoot,o[d]),o[d]=D.multiplyTransformation(o[d],l[d],o[d]),u(s)&&(o[d]=D.multiplyTransformation(o[d],s,o[d]))}}function Vt(e){for(var t=e._runtime.rootNodes,i=t.length,r=Pi,n=0;n<i;++n){var o=t[n];for(o.computedShow=o.publicNode.show,r.push(o);r.length>0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u<l;++u)s[u].show=a;for(var c=o.children,d=c.length,h=0;h<d;++h){var p=c[h];p.computedShow=a&&p.publicNode.show,r.push(p)}}}}function zt(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;o<n;++o)r[o].object.id=i}}function Ut(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?I.LINES:I.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function Gt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.debugShowBoundingVolume=t}}function Ht(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=de.castShadows(e.shadows),i=de.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,o=0;o<n;o++){var a=r[o];a.command.castShadows=t,a.command.receiveShadows=i}}}function Wt(e){var t=o(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=$.ALPHA_BLEND,U.fromCache(t)}function qt(e){var t=V.shallowClone(e);return t.pass=z.TRANSLUCENT,t.renderState=Wt(e.renderState),t}function jt(e,t){var i=t.scene3DOnly,r=e.color.alpha;if(r>0&&r<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a<o;++a){var s=n[a],l=s.command;if(s.translucentCommand=qt(l),!i){var c=s.command2D;s.translucentCommand2D=qt(c)}}}}function Yt(e,t){var i=e._rendererResources.programs;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t)return r}function Xt(e,t,i){var r=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;r=W.replaceMain(r,"gltf_silhouette_main"),r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n    gltf_silhouette_main(); \n    vec3 n = normalize(czm_normal3D * "+o+"); \n    n.x *= czm_projection[0][0]; \n    n.y *= czm_projection[1][1]; \n    vec4 clip = gl_Position; \n    clip.xy += n.xy * clip.w * gltf_silhouetteSize / czm_viewport.z; \n    gl_Position = clip; \n}";var a="uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n    gl_FragColor = gltf_silhouetteColor; \n}";return H.fromCache({context:i.context,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:n})}function Zt(e,t){return ge(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function Kt(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r){var n=t[r],o=n.command;if(o.pass===z.TRANSLUCENT)return!0}return!1}function Qt(e){return e.color.alpha>0&&e.color.alpha<1}function Jt(e){return 0===e.color.alpha}function $t(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function ei(e,t){for(var i=++Ri%255,r=Kt(e)||Qt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,d=0;d<c;++d){var h=l[d],p=h.command,f=Qt(e)?h.translucentCommand:p,m=V.shallowClone(f),_=o(f.renderState);_.stencilTest={enabled:!0,frontFunction:B.ALWAYS,backFunction:B.ALWAYS,reference:i,mask:-1,frontOperation:{fail:B.KEEP,zFail:B.KEEP,zPass:B.REPLACE},backOperation:{fail:B.KEEP,zFail:B.KEEP,zPass:B.REPLACE}},Jt(e)&&(_.colorMask={red:!1,green:!1,blue:!1,alpha:!1},_.depthMask=!1),_=U.fromCache(_),m.renderState=_,h.silhouetteModelCommand=m;var g=V.shallowClone(p);_=o(p.renderState,!0),_.depthTest.enabled=!0,_.cull.enabled=!1,r&&(g.pass=z.TRANSLUCENT,_.depthMask=!1,_.blending=$.ALPHA_BLEND),_.stencilTest={enabled:!0,frontFunction:B.NOTEQUAL,backFunction:B.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:B.KEEP,zFail:B.KEEP,zPass:B.KEEP},backOperation:{fail:B.KEEP,zFail:B.KEEP,zPass:B.KEEP}},_=U.fromCache(_);var v=p.shaderProgram,y=Yt(e,v),C=n[y];u(C)||(C=Xt(e,v,t),n[y]=C);var w=s(p.uniformMap,{gltf_silhouetteColor:Dt(e),gltf_silhouetteSize:Mt(e)});if(g.renderState=_,g.shaderProgram=C,g.uniformMap=w,g.castShadows=!1,g.receiveShadows=!1,h.silhouetteColorCommand=g,!a){var S=h.command2D,E=V.shallowClone(m);E.boundingVolume=S.boundingVolume,E.modelMatrix=S.modelMatrix,h.silhouetteModelCommand2D=E;var b=V.shallowClone(g);E.boundingVolume=S.boundingVolume,E.modelMatrix=S.modelMatrix,h.silhouetteColorCommand2D=b}}}function ti(e,t){if(Zt(e,t)){var i=e._nodeCommands,r=$t(e.color.alpha,e._colorPreviousAlpha)||$t(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!u(i[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,r&&ei(e,t)}}function ii(e,t,i){return Oi.center=e,Oi.radius=t,i.camera.getPixelSize(Oi,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function ri(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Ni.x=a[12],Ni.y=a[13],Ni.z=a[14],u(e._rtcCenter)&&i.add(e._rtcCenter,Ni,Ni),e._mode!==ce.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(Ni,Li);s.project(l,Ni),i.fromElements(Ni.z,Ni.x,Ni.y,Ni)}var c=e.boundingSphere.radius,d=ii(Ni,c,t),h=1/d,p=Math.min(h*(2*c),o);p<e.minimumPixelSize&&(r=e.minimumPixelSize*d/(2*e._initialRadius))}return u(e.maximumScale)?Math.min(e.maximumScale,r):r}function ni(e){u(e._cacheKey)&&u(e._cachedGltf)&&0===--e._cachedGltf.count&&delete mi[e._cacheKey],e._cachedGltf=void 0}function oi(e){var t=e.gltf.extensionsUsed;if(u(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n&&"WEB3D_quantized_attributes"!==n)throw new N("Unsupported glTF Extension: "+n)}}function ai(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function si(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function li(e){si(e.buffers),si(e.vertexArrays),si(e.programs),si(e.pickPrograms),si(e.silhouettePrograms),si(e.textures)}function ui(e,t,i){return function(r){if(e.heightReference===re.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(r,Li);n.height+=i.height,t.cartographicToCartesian(n,r)}var o=e._clampedModelMatrix;D.clone(e.modelMatrix,o),o[12]=r.x,o[13]=r.y,o[14]=r.z,e._heightChanged=!0}}function ci(e){u(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!u(t)||e.heightReference===re.NONE)return void(e._clampedModelMatrix=void 0);var i=t.globe,r=i.ellipsoid,o=e.modelMatrix;Ni.x=o[12],Ni.y=o[13],Ni.z=o[14];var a=r.cartesianToCartographic(Ni);u(e._clampedModelMatrix)||(e._clampedModelMatrix=D.clone(o,new D));var s=i._surface;e._removeUpdateHeightCallback=s.updateHeight(a,ui(e,r,a));var l=i.getHeight(a);if(u(l)){var c=ui(e,r,a);n.clone(a,Li),Li.height=l,r.cartographicToCartesian(Li,Ni),c(Ni)}}function di(e,t){var r,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===ce.SCENE2D){var s=t.camera.frustum.right-t.camera.frustum.left;r=.5*s,r*=r}else{var l=D.getTranslation(e.modelMatrix,Bi);if(t.mode===ce.COLUMBUS_VIEW){var u=t.mapProjection,c=u.ellipsoid,d=c.cartesianToCartographic(l,Fi);l=u.project(d,l),i.fromElements(l.z,l.x,l.y,l)}r=i.distanceSquared(l,t.camera.positionWC)}return r>=o&&r<=a}if(!f.supportsTypedArrays())return{};var hi=new i,pi={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},fi="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";he.prototype.getBuffer=function(e){return ve(this.buffers[e.buffer],e.byteOffset,e.byteLength)},he.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},he.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},he.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},he.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},he.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},he.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(fe.prototype,{gltf:{set:function(e){this._gltf=se(Z(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),fe.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;n<r;++n){var o=i[n];o.isDestroyed()||pe(o,this)}this.modelsToLoad=void 0,this.ready=!0};var mi={};c(_e.prototype,{gltf:{get:function(){return u(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==re.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=D.getScale(e,hi),r=u(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;i.multiplyByScalar(t,r,t);var n=this._scaledBoundingSphere;return n.center=i.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=i.maximumComponent(t)*this._initialRadius,u(this._rtcCenter)&&i.add(this._rtcCenter,n.center,n.center),n}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return u(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=p.clone(e,this._distanceDisplayCondition)}},upAxis:{get:function(){return this._upAxis}}});var _i=Uint32Array.BYTES_PER_ELEMENT;_e.silhouetteSupported=function(e){return ge(e.context)},_e.fromGltf=function(e){var t=e.url,i=l(e.cacheKey,m(t));e=o(e),e.basePath=_(t),e.cacheKey=i;var r=new _e(e);e.headers=u(e.headers)?o(e.headers):{},u(e.headers.Accept)||(e.headers.Accept=fi);var n=mi[i];return u(n)?n.ready||(++n.count,n.modelsToLoad.push(r)):(n=new fe({ready:!1}),n.count=1,n.modelsToLoad.push(r),pe(r,n),mi[i]=n,C(t,e.headers).then(function(e){var t=new Uint8Array(e);if(ye(t)){var i=Ce(t);0!==i.binaryOffset&&(t=t.subarray(i.binaryOffset)),n.makeReady(i.glTF,t)}else{var r=v(t);n.makeReady(JSON.parse(r))}}).otherwise(be(r,"model",t))),r},_e._gltfCache=mi,_e.prototype.getNode=function(e){var t=we(this,"nodesByName",e);return u(t)?t.publicNode:void 0},_e.prototype.getMesh=function(e){return we(this,"meshesByName",e)},_e.prototype.getMaterial=function(e){return we(this,"materialsByName",e)};var gi=new i,vi=new i,yi=/(^data:image\/ktx)|(\.ktx$)/i,Ci=/(^data:image\/crn)|(\.crn$)/i,wi=new i,Si=new R,Ei=new i,bi=new i,Ti={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var r=new D;return function(){return u(t._rtcCenter)?(D.getTranslation(e.model,bi),i.add(bi,t._rtcCenter,bi),D.multiplyByPoint(e.view,bi,bi),D.setTranslation(e.modelView,bi,r)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};c(Ct.prototype,{value:{get:function(){if(!u(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!u(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),Ct.prototype.clone=function(e,t){return e},Ct.prototype.func=void 0;var xi={};xi[B.FLOAT]=pt,xi[B.FLOAT_VEC2]=ft,xi[B.FLOAT_VEC3]=mt,xi[B.FLOAT_VEC4]=_t,xi[B.INT]=pt,xi[B.INT_VEC2]=ft,xi[B.INT_VEC3]=mt,xi[B.INT_VEC4]=_t,xi[B.BOOL]=pt,xi[B.BOOL_VEC2]=ft,xi[B.BOOL_VEC3]=mt,xi[B.BOOL_VEC4]=_t,xi[B.FLOAT_MAT2]=gt,xi[B.FLOAT_MAT3]=vt,xi[B.FLOAT_MAT4]=yt,xi[B.SAMPLER_2D]=wt;var Ai={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new D;return function(){return D.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new D;return function(){return D.multiplyTransformation(e.view,i.computedMatrix,r),D.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new D;return function(){return D.multiplyTransformation(e.view,i.computedMatrix,r),D.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new D;return function(){return D.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new D,n=new D;return function(){return D.multiplyTransformation(e.view,i.computedMatrix,r),D.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new D,n=new D;return function(){return D.multiplyTransformation(e.view,i.computedMatrix,r),D.multiply(e._projection,r,r),D.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new D,n=new P;return function(){return D.inverse(i.computedMatrix,r),D.getRotation(r,n),P.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new D,n=new D,o=new P;return function(){return D.multiplyTransformation(e.view,i.computedMatrix,r),D.inverse(r,n),D.getRotation(n,o),P.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},Pi=[],Di=new r,Mi=new D,Ii=new D,Ri=0,Oi=new e,Ni=new i,Li=new n;ai.prototype.release=function(){
if(0===--this.count)return u(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],li(this),d(this)};var Bi=new i,Fi=new n;return _e.prototype.update=function(e){if(e.mode!==ce.MORPHING){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===pi.NEEDS_LOAD&&u(this.gltf)){var r,n=this.cacheKey;if(u(n)){t.cache.modelRendererResourceCache=l(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(r=o[this.cacheKey],u(r)){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else r=new ai(t,n),r.count=1,o[this.cacheKey]=r;this._cachedRendererResources=r}else r=new ai(t),r.count=1,this._cachedRendererResources=r;if(this._state=pi.LOADING,this._boundingSphere=Ee(this,this.gltf),this._initialRadius=this._boundingSphere.radius,oi(this),this._state!==pi.FAILED){var a=this.gltf.extensions;if(u(a)&&u(a.CESIUM_RTC)){var s=i.fromArray(a.CESIUM_RTC.center);if(!i.equals(s,i.ZERO)){this._rtcCenter3D=s;var c=e.mapProjection,d=c.ellipsoid,h=d.cartesianToCartographic(this._rtcCenter3D),p=c.project(h);i.fromElements(p.z,p.x,p.y,p),this._rtcCenter2D=p,this._rtcCenterEye=new i,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new he,Fe(this,t)}}var f=this._loadResources,m=this._incrementallyLoadTextures,_=!1;if(this._state===pi.LOADING&&(Lt(this,e),(f.finished()||m&&f.finishedEverythingButTextureCreation())&&(this._state=pi.LOADED,_=!0)),u(f)&&this._state===pi.LOADED&&(m&&!_&&Lt(this,e),f.finished())){this._loadResources=void 0;var g=this._rendererResources,v=this._cachedRendererResources;v.buffers=g.buffers,v.vertexArrays=g.vertexArrays,v.programs=g.programs,v.pickPrograms=g.pickPrograms,v.silhouettePrograms=g.silhouettePrograms,v.textures=g.textures,v.samplers=g.samplers,v.renderStates=g.renderStates,v.ready=!0,this._normalAttributeName=te(this.gltf,"NORMAL"),u(this._precreatedAttributes)&&(v.vertexArrays={}),this.releaseGltfJson&&ni(this)}var y=Zt(this,e),C=Qt(this),w=Jt(this),S=!u(this.distanceDisplayCondition)||di(this,e),E=this.show&&S&&0!==this.scale&&(!w||y);if(E&&this._state===pi.LOADED||_){var b=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var T=this.modelMatrix,A=e.mode!==this._mode;this._mode=e.mode;var P=!D.equals(this._modelMatrix,T)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||A;if(P||_){D.clone(T,this._modelMatrix),ci(this),u(this._clampedModelMatrix)&&(T=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var M=ri(this,e),I=this._computedModelMatrix;D.multiplyByUniformScale(T,M,I),this._upAxis===J.Y?D.multiplyTransformation(I,J.Y_UP_TO_Z_UP,I):this._upAxis===J.X&&D.multiplyTransformation(I,J.X_UP_TO_Z_UP,I)}(b||P||_)&&(Ft(this,P,_,e.mapProjection),this._dirty=!0,(b||_)&&kt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,Vt(this)),zt(this,t),Ut(this),Gt(this),Ht(this),jt(this,e),ti(this,e)}if(_){var R=this;return void e.afterRender.push(function(){R._ready=!0,R._readyPromise.resolve(R)})}if(E&&!this._ignoreCommands){var O,N,L,B=e.commandList,F=e.passes,k=this._nodeCommands,V=k.length,z=e.mapProjection.ellipsoid.maximumRadius*x.PI;if(F.render){for(O=0;O<V;++O)if(N=k[O],N.show){var U=C?N.translucentCommand:N.command;if(U=y?N.silhouetteModelCommand:U,B.push(U),L=N.command.boundingVolume,e.mode===ce.SCENE2D&&(L.center.y+L.radius>z||L.center.y-L.radius<z)){var G=C?N.translucentCommand2D:N.command2D;G=y?N.silhouetteModelCommand2D:G,B.push(G)}}if(y)for(O=0;O<V;++O)N=k[O],N.show&&(B.push(N.silhouetteColorCommand),L=N.command.boundingVolume,e.mode===ce.SCENE2D&&(L.center.y+L.radius>z||L.center.y-L.radius<z)&&B.push(N.silhouetteColorCommand2D))}if(F.pick&&this.allowPicking)for(O=0;O<V;++O)if(N=k[O],N.show){var H=N.pickCommand;B.push(H),L=H.boundingVolume,e.mode===ce.SCENE2D&&(L.center.y+L.radius>z||L.center.y-L.radius<z)&&B.push(N.pickCommand2D)}}}},_e.prototype.isDestroyed=function(){return!1},_e.prototype.destroy=function(){u(this._precreatedAttributes)&&si(this._rendererResources.vertexArrays),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return ni(this),d(this)},_e}),define("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/Model","../Scene/ModelAnimationLoop","../Scene/ShadowMode","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=i,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(i,i.values,[],[])}function m(e,t,i,n){var o=i[t.id];r(o)&&(n.removeAndDestroy(o.modelPrimitive),delete i[t.id])}function _(e,t){var i=t[e.id];r(i)&&(i.nodeTransformationsScratch={})}function g(e){console.error(e)}var v=1,y=0,C=!0,w=d.ENABLED,S=l.NONE,E=i.RED,b=0,T=i.WHITE,x=s.HIGHLIGHT,A=.5,P=new a,D=new a;return f.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._modelHash,n=this._primitives,o=0,s=t.length;o<s;o++){var l,d,h=t[o],f=h._model,m=i[h.id],_=h.isShowing&&h.isAvailable(e)&&p.getValueOrDefault(f._show,e,!0);if(_&&(d=h._getModelMatrix(e,P),l=p.getValueOrUndefined(f._uri,e),_=r(d)&&r(l)),_){var M=r(m)?m.modelPrimitive:void 0;if(r(M)&&l===m.uri||(r(M)&&(n.removeAndDestroy(M),delete i[h.id]),M=u.fromGltf({url:l,incrementallyLoadTextures:p.getValueOrDefault(f._incrementallyLoadTextures,e,C),scene:this._scene}),M.readyPromise.otherwise(g),M.id=h,n.add(M),m={modelPrimitive:M,uri:l,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},i[h.id]=m),M.show=!0,M.scale=p.getValueOrDefault(f._scale,e,v),M.minimumPixelSize=p.getValueOrDefault(f._minimumPixelSize,e,y),M.maximumScale=p.getValueOrUndefined(f._maximumScale,e),M.modelMatrix=a.clone(d,M.modelMatrix),M.shadows=p.getValueOrDefault(f._shadows,e,w),M.heightReference=p.getValueOrDefault(f._heightReference,e,S),M.distanceDisplayCondition=p.getValueOrUndefined(f._distanceDisplayCondition,e),M.silhouetteColor=p.getValueOrDefault(f._silhouetteColor,e,E,M._silhouetteColor),M.silhouetteSize=p.getValueOrDefault(f._silhouetteSize,e,b),M.color=p.getValueOrDefault(f._color,e,T,M._color),M.colorBlendMode=p.getValueOrDefault(f._colorBlendMode,e,x),M.colorBlendAmount=p.getValueOrDefault(f._colorBlendAmount,e,A),M.ready){var I=p.getValueOrDefault(f._runAnimations,e,!0);m.animationsRunning!==I&&(I?M.activeAnimations.addAll({loop:c.REPEAT}):M.activeAnimations.removeAll(),m.animationsRunning=I);var R=p.getValueOrUndefined(f._nodeTransformations,e,m.nodeTransformationsScratch);if(r(R))for(var O=m.originalNodeMatrixHash,N=Object.keys(R),L=0,B=N.length;L<B;++L){var F=N[L],k=R[F];if(r(k)){var V=M.getNode(F);if(r(V)){var z=O[F];r(z)||(z=V.matrix.clone(),O[F]=z);var U=a.fromTranslationRotationScale(k,D);V.matrix=a.multiply(z,U,U)}}}}}else r(m)&&(m.modelPrimitive.show=!1)}return!0},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;r>-1;r--)m(this,e[r],t,i);return n(this)},f.prototype.getBoundingSphere=function(e,i){var n=this._modelHash[e.id];if(!r(n))return h.FAILED;var o=n.modelPrimitive;if(!r(o)||!o.show)return h.FAILED;if(!o.ready)return h.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!r(o._clampedModelMatrix))return h.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return h.DONE},f.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],r(a._model)&&r(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],r(a._model)&&r(a._position)?(_(a,l),s.set(a.id,a)):(m(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],m(this,a,l,u),s.remove(a.id)},f}),define("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance =  -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),define("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"}),define("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2  v_st;\nvarying float v_width;\nvarying vec4  czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),define("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=d.fromType(d.ColorType,{color:new r(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,i.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(i.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var h;o(s)&&(h=u.clone(s.modelMatrix)),this._modelMatrix=h,this._segments=c.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(C),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;o(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var f=h.POSITION_INDEX=0,m=h.SHOW_INDEX=1,_=h.WIDTH_INDEX=2,g=h.MATERIAL_INDEX=3,v=h.POSITION_SIZE_INDEX=4,y=h.DISTANCE_DISPLAY_CONDITION=5,C=h.NUMBER_OF_PROPERTIES=6;return a(h.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,m))}},positions:{get:function(){return this._positions},set:function(r){var n=e(r,i.equalsEpsilon);this._loop&&n.length>2&&(n===r&&(n=r.slice()),n.push(i.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=r,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,f),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,g))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,_))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!i.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(i.clone(t[0]))):t.length>2&&i.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),h.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,n=this._propertiesChanged[f]>0||this._propertiesChanged[v]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==i)p(this,v);else for(var a=r.length,s=0;s<a;++s)if(r[s]!==this._segments.lengths[s]){p(this,v);break}},h.prototype.getPickId=function(e){return o(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;t<C-1;++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}),define("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Core/RuntimeError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BatchTable","./BlendingState","./Material","./Polyline","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L){"use strict";function B(e){e=s(e,s.EMPTY_OBJECT),this.modelMatrix=_.clone(s(e.modelMatrix,_.IDENTITY)),this._modelMatrix=_.clone(_.IDENTITY),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(re),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:C.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1}function F(e,t){l(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:a.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:a.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:a.FLOAT,componentsPerAttribute:2}];e._batchTable=new I(t,i,e._polylines.length)}function k(t,i,r,n,o){for(var a=i.context,s=i.commandList,u=r.length,c=0,d=!0,h=t._vertexArrays,p=t.debugShowBoundingVolume,f=t._batchTable,m=f.getUniformMapCallback(),_=h.length,g=0;g<_;++g)for(var v=h[g],y=v.buckets,C=y.length,w=0;w<C;++w){for(var b,T,x,A=y[w],P=A.offset,D=o?A.bucket.shaderProgram:A.bucket.pickShaderProgram,M=A.bucket.polylines,I=M.length,R=0,O=0;O<I;++O){var N=M[O],B=U(N._material);if(B!==b){if(l(b)&&R>0){var F=T.isTranslucent();c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(T._uniforms),x.count=R,x.offset=P,P+=R,R=0,d=!0,s.push(x)}T=N._material,T.update(a),b=B}for(var k=N._locatorBuckets,V=k.length,z=0;z<V;++z){var G=k[z];G.locator===A&&(R+=G.count)}var H;i.mode===L.SCENE3D?H=N._boundingVolumeWC:i.mode===L.COLUMBUS_VIEW?H=N._boundingVolume2D:i.mode===L.SCENE2D?l(N._boundingVolume2D)&&(H=e.clone(N._boundingVolume2D,ue),H.center.x=0):l(N._boundingVolumeWC)&&l(N._boundingVolume2D)&&(H=e.union(N._boundingVolumeWC,N._boundingVolume2D,ue)),d?(d=!1,e.clone(H,le)):e.union(H,le,le)}l(b)&&R>0&&(c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(T._uniforms),x.count=R,x.offset=P,d=!0,s.push(x)),b=void 0}r.length=c}function V(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[$]?r.bufferUsage!==C.STREAM_DRAW?(t=!0,r.bufferUsage=C.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==C.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=C.STATIC_DRAW):r.frameCount--),t}function z(e,t,i){e._createVertexArray=!1,q(e),j(e),G(e);var r,n,o=[[]],s=o[0],u=e._batchTable,c=[0],d=0,h=[[]],f=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,u),f+=n.lengthOfPositions);if(f>0){var g,v=e._mode,w=new Float32Array(6*f*3),S=new Float32Array(4*f),E=0,b=0,T=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(w,S,E,b,T,u,t,i),v===L.MORPHING&&(l(g)||(g=new Float32Array(6*f*3)),n.writeForMorph(g,E));var x=n.lengthOfPositions;E+=6*x*3,b+=4*x,T+=4*x,d=n.updateIndices(o,c,h,d)}var P=e._positionBufferUsage.bufferUsage,D=C.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:P});var M;l(g)&&(M=y.createVertexBuffer({context:t,typedArray:g,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:S,usage:D});for(var I=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,O=0,N=o.length,B=0;B<N;++B)if(s=o[B],s.length>0){var F=new Uint16Array(s),k=y.createIndexBuffer({context:t,typedArray:F,usage:C.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});O+=c[B];var V,z,U,H,W=6*(B*(I*m.SIXTY_FOUR_KILOBYTES)-O*I),Y=I+W,X=I+Y,Z=I+X,K=I+Z,Q=I+K,J=B*(R*m.SIXTY_FOUR_KILOBYTES)-O*R,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:W,strideInBytes:6*I},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:W,strideInBytes:6*I},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];v===L.SCENE3D?(V=e._positionBuffer,z="vertexBuffer",U=ce,H="value"):v===L.SCENE2D||v===L.COLUMBUS_VIEW?(V=ce,z="value",U=e._positionBuffer,H="vertexBuffer"):(V=M,z="vertexBuffer",U=e._positionBuffer,H="vertexBuffer"),$[0][z]=V,$[1][z]=V,$[2][H]=U,$[3][H]=U,$[4][z]=V,$[5][z]=V,$[6][H]=U,$[7][H]=U,$[8][z]=V,$[9][z]=V,$[10][H]=U,$[11][H]=U;var ee=new A({context:t,attributes:$,indexBuffer:k});e._vertexArrays.push({va:ee,buckets:h[B]})}}}function U(e){var t=O._uniformList[e.type],i=t.length;de.length=2*i;for(var r=0,n=0;n<i;++n){var o=t[n];de[r]=o,de[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(de)}function G(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;a<o;++a){var s=n[a];if(s._actualPositions.length>1){s.update();var u=s.material,c=r[u.type];l(c)||(c=r[u.type]=new Z(u,t,i)),c.addPolyline(s)}}}function H(e,t){var i=t.mode;e._mode===i&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function W(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r<i;++r){var o=e._polylines[r];l(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function q(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)if(l(t[r])){var n=t[r]._bucket;l(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function j(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function Y(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)l(t[r])&&t[r]._destroy()}function X(e,t,i){this.count=e,this.offset=t,this.bucket=i}function Z(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=i}function K(e){return i.dot(i.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(g.ORIGIN_ZX_PLANE)===f.INTERSECTING}var Q=N.SHOW_INDEX,J=N.WIDTH_INDEX,$=N.POSITION_INDEX,ee=N.MATERIAL_INDEX,te=N.POSITION_SIZE_INDEX,ie=N.DISTANCE_DISPLAY_CONDITION,re=N.NUMBER_OF_PROPERTIES,ne={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};u(B.prototype,{length:{get:function(){return W(this),this._polylines.length}}}),B.prototype.add=function(e){var t=new N(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},B.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},B.prototype.removeAll=function(){q(this),Y(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},B.prototype.contains=function(e){return l(e)&&e._polylineCollection===this},B.prototype.get=function(e){return W(this),this._polylines[e]};var oe=new h,ae=new r,se=new t;B.prototype.update=function(e){if(W(this),0!==this._polylines.length){H(this,e);var i,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===w.maximumVertexTextureImageUnits)throw new v("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");F(this,n),this._createBatchTable=!1}if(this._createVertexArray||V(this))z(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==L.SCENE3D)for(var u=s.length,c=0;c<u;++c)i=s[c],i.update();if(a[te]||a[ee])z(this,n,o);else for(var d=s.length,p=this._polylineBuckets,f=0;f<d;++f){i=s[f],a=i._propertiesChanged;var m=i._bucket,g=0;for(var y in p)if(p.hasOwnProperty(y)){if(p[y]===m){a[$]&&m.writeUpdate(g,i,this._positionBuffer,o);break}g+=p[y].lengthOfPositions}if((a[Q]||a[J])&&this._batchTable.setBatchedAttribute(i._index,0,new t(i._width,i._show)),this._batchTable.attributes.length>2){if(a[$]||a[te]){var C=e.mode===L.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,S=h.fromCartesian(C.center,oe),E=r.fromElements(S.low.x,S.low.y,S.low.z,C.radius,ae);this._batchTable.setBatchedAttribute(i._index,2,S.high),this._batchTable.setBatchedAttribute(i._index,3,E)}if(a[ie]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=i.distanceDisplayCondition;l(x)&&(T.x=x.near,T.x=x.far),this._batchTable.setBatchedAttribute(i._index,4,T)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var A=0;A<re;++A)a[A]=0;var P=_.IDENTITY;e.mode===L.SCENE3D&&(P=this.modelMatrix);var D=e.passes,M=0!==e.morphTime;if(l(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===M||(this._opaqueRS=b.fromCache({depthMask:M,depthTest:{enabled:M}})),l(this._translucentRS)&&this._translucentRS.depthTest.enabled===M||(this._translucentRS=b.fromCache({blending:R.ALPHA_BLEND,depthMask:!M,depthTest:{enabled:M}})),this._batchTable.update(e),D.render){var I=this._colorCommands;k(this,e,I,P,!0)}if(D.pick){var O=this._pickCommands;k(this,e,O,P,!1)}}};var le=new e,ue=new e;B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return j(this),q(this),Y(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),c(this)};var ce=[0,0,0],de=[];B.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},Z.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Z.prototype.updateShader=function(e,t){if(!l(this.shaderProgram)){var i=["DISTANCE_DISPLAY_CONDITION"],r=t.getVertexShaderCallback()(M),n=new x({defines:i,sources:[P,r]}),o=new x({sources:[this.material.shaderSource,D]}),a=new x({sources:o.sources,pickColorQualifier:"varying"});this.shaderProgram=T.fromCache({context:e,
vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:ne}),this.pickShaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:ne})}},Z.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===L.SCENE3D||!K(e))return t=e._actualPositions.length,4*t-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;n<t;++n)i+=4*r[n]-4;return i};var he=new i,pe=new i,fe=new i,me=new i,_e=new r,ge=new t;Z.prototype.write=function(e,t,n,a,s,u,c,d){for(var p=this.mode,f=d.ellipsoid.maximumRadius*m.PI,_=this.polylines,g=_.length,v=0;v<g;++v){for(var y,C=_[v],w=C.width,S=C.show&&w>0,E=C._index,b=this.getSegments(C,d),T=b.positions,x=b.lengths,A=T.length,P=C.getPickId(c).color,D=0,M=0,I=0;I<A;++I){0===I?C._loop?y=T[A-2]:(y=me,i.subtract(T[0],T[1],y),i.add(T[0],y,y)):y=T[I-1],i.clone(y,pe),i.clone(T[I],he),I===A-1?C._loop?y=T[1]:(y=me,i.subtract(T[A-1],T[A-2],y),i.add(T[A-1],y,y)):y=T[I+1],i.clone(y,fe);var R=x[D];I===M+R&&(M+=R,++D);var O=I-M===0,N=I===M+x[D]-1;p===L.SCENE2D&&(pe.z=0,he.z=0,fe.z=0),p!==L.SCENE2D&&p!==L.MORPHING||(O||N)&&f-Math.abs(he.x)<1&&((he.x<0&&pe.x>0||he.x>0&&pe.x<0)&&i.clone(he,pe),(he.x<0&&fe.x>0||he.x>0&&fe.x<0)&&i.clone(he,fe));for(var B=O?2:0,F=N?2:4,k=B;k<F;++k){h.writeElements(he,e,n),h.writeElements(pe,e,n+6),h.writeElements(fe,e,n+12);var V=k-2<0?-1:1;t[s]=I/(A-1),t[s+1]=2*(k%2)-1,t[s+2]=V,t[s+3]=E,n+=18,s+=4}}var z=_e;z.x=o.floatToByte(P.red),z.y=o.floatToByte(P.green),z.z=o.floatToByte(P.blue),z.w=o.floatToByte(P.alpha);var U=ge;U.x=w,U.y=S?1:0;var G=p===L.SCENE2D?C._boundingVolume2D:C._boundingVolumeWC,H=h.fromCartesian(G.center,oe),W=H.high,q=r.fromElements(H.low.x,H.low.y,H.low.z,G.radius,ae),j=se;j.x=0,j.y=Number.MAX_VALUE;var Y=C.distanceDisplayCondition;l(Y)&&(j.x=Y.near,j.y=Y.far),u.setBatchedAttribute(E,0,U),u.setBatchedAttribute(E,1,z),u.attributes.length>2&&(u.setBatchedAttribute(E,2,W),u.setBatchedAttribute(E,3,q),u.setBatchedAttribute(E,4,j))}};var ve=new i,ye=new i,Ce=new i,we=new i;Z.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;a<o;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,d=0,p=0,f=0;f<c;++f){var m;0===f?s._loop?m=l[c-2]:(m=we,i.subtract(l[0],l[1],m),i.add(l[0],m,m)):m=l[f-1],m=_.multiplyByPoint(r,m,ye);var g,v=_.multiplyByPoint(r,l[f],ve);f===c-1?s._loop?g=l[1]:(g=we,i.subtract(l[c-1],l[c-2],g),i.add(l[c-1],g,g)):g=l[f+1],g=_.multiplyByPoint(r,g,Ce);var y=u[d];f===p+y&&(p+=y,++d);for(var C=f-p===0,w=f===p+u[d]-1,S=C?2:0,E=w?2:4,b=S;b<E;++b)h.writeElements(v,e,t),h.writeElements(m,e,t+6),h.writeElements(g,e,t+12),t+=18}};var Se=new Array(1);Z.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new X(0,r,this);i[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d<c;++d){var h=u[d];h._locatorBuckets=[];var p;if(this.mode===L.SCENE3D){p=Se;var f=h._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=h._segments.lengths;var _=p.length;if(_>0){for(var g=0,v=0;v<_;++v)for(var y=p[v]-1,C=0;C<y;++C)l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(h._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new X(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;h._locatorBuckets.push({locator:o,count:g}),l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new X(0,0,this),i[++n]=[o])}h._clean()}return o.count=a,r},Z.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n<r;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var Ee={positions:void 0,lengths:void 0},be=new Array(1),Te=new i,xe=new n;Z.prototype.getSegments=function(t,r){var n=t._actualPositions;if(this.mode===L.SCENE3D)return be[0]=n.length,Ee.positions=n,Ee.lengths=be,Ee;K(t)&&(n=t._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=Te,d=0;d<u;++d)o=n[d],c=_.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,xe)));if(s.length>0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var h=t._boundingVolume2D.center;t._boundingVolume2D.center=new i(h.z,h.x,h.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var Ae;return Z.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*m.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Ae,c=6*s*3;!l(u)||u.length<c?u=Ae=new Float32Array(c):u.length>c&&(u=new Float32Array(u.buffer,0,c));var d,p=this.getSegments(t,n),f=p.positions,_=p.lengths,g=0,v=0,y=0;s=f.length;for(var C=0;C<s;++C){0===C?t._loop?d=f[s-2]:(d=me,i.subtract(f[0],f[1],d),i.add(f[0],d,d)):d=f[C-1],i.clone(d,pe),i.clone(f[C],he),C===s-1?t._loop?d=f[1]:(d=me,i.subtract(f[s-1],f[s-2],d),i.add(f[s-1],d,d)):d=f[C+1],i.clone(d,fe);var w=_[v];C===y+w&&(y+=w,++v);var S=C-y===0,E=C===y+_[v]-1;o===L.SCENE2D&&(pe.z=0,he.z=0,fe.z=0),o!==L.SCENE2D&&o!==L.MORPHING||(S||E)&&a-Math.abs(he.x)<1&&((he.x<0&&pe.x>0||he.x>0&&pe.x<0)&&i.clone(he,pe),(he.x<0&&fe.x>0||he.x>0&&fe.x<0)&&i.clone(he,fe));for(var b=S?2:0,T=E?2:4,x=b;x<T;++x)h.writeElements(he,u,g),h.writeElements(pe,u,g+6),h.writeElements(fe,u,g+12),g+=18}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e)}},B}),define("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,i,n){if(e(this._value))return n=this._value.getValueInReferenceFrame(t,i,n),e(n)?r.WGS84.scaleToGeodeticSurface(n,n):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),define("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function w(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function S(e,t,r,n,a,s,l,u,c){var d,h=u;d=e.getValueInReferenceFrame(t,s,c[h]),i(d)&&(c[h++]=d);for(var p,f,m,_=!i(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,r),g=0,v=n.length,y=n[g],C=r,w=!1;g<v;){if(!_&&o.greaterThanOrEquals(y,a)&&(d=e.getValueInReferenceFrame(a,s,c[h]),i(d)&&(c[h++]=d),_=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(d=e.getValueInReferenceFrame(y,s,c[h]),i(d)&&(c[h++]=d)),g<v-1){if(l>0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),f=0,m=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&f<p){y=o.addSeconds(y,m,new o),f++;continue}}w=!1,g++,y=n[g]}return d=e.getValueInReferenceFrame(r,s,c[h]),i(d)&&(c[h++]=d),h}function E(e,t,r,n,a,s,l,u){for(var c,d=0,h=l,p=t,f=Math.max(s,60),m=!i(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,r);o.lessThan(p,r);)!m&&o.greaterThanOrEquals(p,n)&&(m=!0,c=e.getValueInReferenceFrame(n,a,u[h]),i(c)&&(u[h]=c,h++)),c=e.getValueInReferenceFrame(p,a,u[h]),i(c)&&(u[h]=c,h++),d++,p=o.addSeconds(t,f*d,new o);return c=e.getValueInReferenceFrame(r,a,u[h]),i(c)&&(u[h]=c,h++),h}function b(e,t,r,n,a,s,l,c){L.start=t,L.stop=r;for(var d=l,h=e.intervals,p=0;p<h.length;p++){var f=h.get(p);if(!u.intersect(f,L,O).isEmpty){var m=f.start;f.isStartIncluded||(m=f.isStopIncluded?f.stop:o.addSeconds(f.start,o.secondsDifference(f.stop,f.start)/2,new o));var _=e.getValueInReferenceFrame(m,a,c[d]);i(_)&&(c[d]=_,d++)}}return d}function T(e,t,r,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return i(u)&&(l[s++]=u),s}function x(e,t,i,r,n,a,s,l){N.start=t,N.stop=i;for(var c=s,d=e.intervals,h=0;h<d.length;h++){var p=d.get(h);if(!u.intersect(p,N,O).isEmpty){var f=p.start,m=p.stop,_=t;o.greaterThan(f,_)&&(_=f);var g=i;o.lessThan(m,g)&&(g=m),c=A(p.data,_,g,r,n,a,c,l)}}return c}function A(e,t,i,r,n,o,a,s){for(;e instanceof g;)e=e.resolvedProperty;if(e instanceof v){var l=e._property._times;a=S(e,t,i,l,r,n,o,a,s)}else a=e instanceof p?x(e,t,i,r,n,o,a,s):e instanceof C?b(e,t,i,r,n,o,a,s):e instanceof f||e instanceof y&&_.isConstant(e)?T(e,t,i,r,n,o,a,s):E(e,t,i,r,n,o,a,s);return a}function P(e,t,r,n,o,a,s){i(s)||(s=[]);var l=A(e,t,r,n,o,a,0,s);return s.length=l,s}function D(e,t){this._unusedIndexes=[],this._polylineCollection=new d,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function M(t,i){i.collectionChanged.addEventListener(M.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}var I=60,R=1,O=new u,N=new u,L=new u,B=new a;return D.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var r=c.computeIcrfToFixedMatrix(e,B);i(r)||(r=c.computeTemeToPseudoFixedMatrix(e,B)),s.fromRotationTranslation(r,t.ZERO,this._polylineCollection.modelMatrix)}},D.prototype.updateObject=function(e,t){var r,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,d=a.isShowing&&(!i(u)||u.getValue(e));if(d){var h=_.getValueOrUndefined(s._leadTime,e),p=_.getValueOrUndefined(s._trailTime,e),f=a._availability,g=i(f),v=i(h),y=i(p);if(d=g||v&&y){if(y&&(r=o.addSeconds(e,-p,new o)),v&&(n=o.addSeconds(e,h,new o)),g){var C=f.start,w=f.stop;y&&!o.greaterThan(C,r)||(r=C),v&&!o.lessThan(w,n)||(n=w)}d=o.lessThan(r,n)}}if(!d)return void(i(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!i(c)){var S=this._unusedIndexes,E=S.length;if(E>0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=_.getValueOrDefault(s._resolution,e,I);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,T,c.positions.slice()),c.material=m.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,R),c.distanceDisplayCondition=_.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;o<a;o++){var s=n[o],u=s.entity,c=u._position,d=s.updater,p=l.FIXED;this._scene.mode===h.SCENE3D&&(p=c.referenceFrame);var f=this._updaters[p];d===f&&i(f)?f.updateObject(e,s):(i(d)&&d.removeObject(s),i(f)||(f=new D(this._scene,p),f.update(e),this._updaters[p]=f),s.updater=f,i(f)&&f.updateObject(e,s))}return!0},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(M.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return r(this)},M.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new w(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new w(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(i(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function h(t,i){i.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function p(e,t,i){if(r(e)){var n=e.pointPrimitive;if(r(n))return e.pointPrimitive=void 0,void i.removePoint(t);var o=e.billboard;r(o)&&(e.billboard=void 0,i.removeBillboard(t))}}function f(e,t,i,r,n){return function(o){var a=document.createElement("canvas"),s=n+2*r;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==r&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=i,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var m=i.WHITE,_=i.BLACK,g=0,v=1,y=new i,C=new t,w=new i,S=new s,E=new s,b=new a;return h.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o<a;o++){var s=t[o],u=s.entity,d=u._point,h=s.pointPrimitive,T=s.billboard,x=c.getValueOrDefault(d._heightReference,e,l.NONE),A=u.isShowing&&u.isAvailable(e)&&c.getValueOrDefault(d._show,e,!0);if(A&&(C=c.getValueOrUndefined(u._position,e,C),A=r(C)),A){c.isConstant(u._position)||(n._clusterDirty=!0);var P=!1;if(x===l.NONE||r(T)?x!==l.NONE||r(h)||(r(T)&&(p(s,u,n),T=void 0),h=n.getPoint(u),h.id=u,s.pointPrimitive=h):(r(h)&&(p(s,u,n),h=void 0),T=n.getBillboard(u),T.id=u,T.image=void 0,s.billboard=T,P=!0),r(h))h.show=!0,h.position=C,h.scaleByDistance=c.getValueOrUndefined(d._scaleByDistance,e,S),h.translucencyByDistance=c.getValueOrUndefined(d._translucencyByDistance,e,E),h.color=c.getValueOrDefault(d._color,e,m,y),h.outlineColor=c.getValueOrDefault(d._outlineColor,e,_,w),h.outlineWidth=c.getValueOrDefault(d._outlineWidth,e,g),h.pixelSize=c.getValueOrDefault(d._pixelSize,e,v),h.distanceDisplayCondition=c.getValueOrUndefined(d._distanceDisplayCondition,e,b);else{T.show=!0,T.position=C,T.scaleByDistance=c.getValueOrUndefined(d._scaleByDistance,e,S),T.translucencyByDistance=c.getValueOrUndefined(d._translucencyByDistance,e,E),T.distanceDisplayCondition=c.getValueOrUndefined(d._distanceDisplayCondition,e,b),T.heightReference=x;var D=c.getValueOrDefault(d._color,e,m,y),M=c.getValueOrDefault(d._outlineColor,e,_,w),I=Math.round(c.getValueOrDefault(d._outlineWidth,e,g)),R=Math.max(1,Math.round(c.getValueOrDefault(d._pixelSize,e,v)));if(I>0?(T.scale=1,P=P||I!==s.outlineWidth||R!==s.pixelSize||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)):(T.scale=R/50,R=50,P=P||I!==s.outlineWidth||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)),P){s.color=i.clone(D,s.color),s.outlineColor=i.clone(M,s.outlineColor),s.pixelSize=R,s.outlineWidth=I;var O=D.alpha,N=D.toCssColorString(),L=M.toCssColorString(),B=JSON.stringify([N,R,L,I]);T.setImage(B,f(O,N,L,I,R))}}}else p(s,u,n)}return!0},h.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return u.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return u.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,u.DONE},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},h.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new d(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new d(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],p(s.get(a.id),a,l),s.remove(a.id)},h}),define("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new P(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function M(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new P(i._entity)}var I=new E(e.WHITE),R=new b(!0),O=new b(!0),N=new b(!1),L=new b(e.BLACK),B=new b(S.DISABLED),F=new b(new s),k=new e;return n(D,{perInstanceColorAppearanceType:{value:C},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new g(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof E){var p=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(i)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new f(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=A.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new _(this._options),attributes:{show:new g(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.perPositionHeight,c=r(u)&&(!u.isConstant||u.getValue(h.MINIMUM_VALUE)),f=a.outline,_=r(f);if(_&&f.isConstant&&(_=f.getValue(h.MINIMUM_VALUE)),!l&&!_)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=a.hierarchy,w=a.show;if(r(w)&&w.isConstant&&!w.getValue(h.MINIMUM_VALUE)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var S=i(a.material,I),b=S instanceof E;this._materialProperty=S,this._fillProperty=i(s,O),this._showProperty=i(w,R),this._showOutlineProperty=i(a.outline,N),this._outlineColorProperty=_?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,B),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,P=a.granularity,D=a.stRotation,M=a.outlineWidth,k=l&&!r(T)&&!r(x)&&b&&!c&&v.isSupported(this._scene);_&&k&&(p(p.geometryOutlines),_=!1);var V=a.perPositionHeight,z=a.closeTop,U=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=k,this._outlineEnabled=_,g.isConstant&&A.isConstant(T)&&A.isConstant(x)&&A.isConstant(P)&&A.isConstant(D)&&A.isConstant(M)&&A.isConstant(u)&&A.isConstant(V)&&A.isConstant(z)&&A.isConstant(U)&&(!k||A.isConstant(S))){var G=this._options;G.vertexFormat=b?C.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var H=g.getValue(h.MINIMUM_VALUE);d(H)&&(H=new m(H));var W=A.getValueOrUndefined(T,h.MINIMUM_VALUE),q=A.getValueOrDefault(z,h.MINIMUM_VALUE,!0),j=A.getValueOrDefault(U,h.MINIMUM_VALUE,!0),Y=A.getValueOrUndefined(x,h.MINIMUM_VALUE);G.polygonHierarchy=H,G.height=W,G.extrudedHeight=Y,G.granularity=A.getValueOrUndefined(P,h.MINIMUM_VALUE),G.stRotation=A.getValueOrUndefined(D,h.MINIMUM_VALUE),G.perPositionHeight=A.getValueOrUndefined(V,h.MINIMUM_VALUE),G.closeTop=q,G.closeBottom=j,this._outlineWidth=A.getValueOrDefault(M,h.MINIMUM_VALUE,1),this._isClosed=r(Y)&&Y!==W&&q&&j,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new M(e,t,this)},M.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(i)&&A.getValueOrDefault(u.show,i,!0)){var h=this._options,p=A.getValueOrUndefined(u.hierarchy,i);if(r(p)){d(p)?h.polygonHierarchy=new m(p):h.polygonHierarchy=p;var g=A.getValueOrDefault(u.closeTop,i,!0),S=A.getValueOrDefault(u.closeBottom,i,!0);h.height=A.getValueOrUndefined(u.height,i),h.extrudedHeight=A.getValueOrUndefined(u.extrudedHeight,i),h.granularity=A.getValueOrUndefined(u.granularity,i),h.stRotation=A.getValueOrUndefined(u.stRotation,i),h.perPositionHeight=A.getValueOrUndefined(u.perPositionHeight,i),h.closeTop=g,h.closeBottom=S;var E=this._geometryUpdater.shadowsProperty.getValue(i);if(A.getValueOrDefault(u.fill,i,!0)){var b=n.fillMaterialProperty,T=x.getValue(i,b,this._material);if(this._material=T,o){var P=e.WHITE;r(b.color)&&(P=b.color.getValue(i)),this._primitive=s.add(new v({geometryInstances:new c({id:l,geometry:new f(h),attributes:{color:t.fromColor(P)}}),asynchronous:!1,shadows:E}))}else{var D=new y({material:T,translucent:T.isTranslucent(),closed:r(h.extrudedHeight)&&h.extrudedHeight!==h.height&&g&&S});h.vertexFormat=D.vertexFormat,this._primitive=a.add(new w({geometryInstances:new c({id:l,geometry:new f(h)}),appearance:D,asynchronous:!1,shadows:E}))}}if(!o&&A.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=C.VERTEX_FORMAT;var M=A.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,k),I=A.getValueOrDefault(u.outlineWidth,i,1),R=1!==M.alpha;this._outlinePrimitive=a.add(new w({geometryInstances:new c({id:l,geometry:new _(h),attributes:{color:t.fromColor(M)}}),appearance:new C({flat:!0,translucent:R,renderState:{lineWidth:n._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:E}))}}}},M.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),define("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),define("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,d=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),define("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,
this._distanceDisplayConditionProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function A(e,t){var i=t._scene.id,r=P[i];!n(r)||r.isDestroyed()?(r=new _,P[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],O.ellipsoid=t._scene.globe.ellipsoid}var P={},D=new w(t.WHITE),M=new S(!0),I=new S(y.DISABLED),R=new S(new l);o(x,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&b.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new m(s&&a.isShowing&&this._showProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),h=u.fromDistanceDisplayCondition(c);if(this._materialProperty instanceof w){var f=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(e)),r=i.fromColor(f),o={show:l,distanceDisplayCondition:h,color:r}}else o={show:l,distanceDisplayCondition:h};return new d({id:a,geometry:new p(this._options),attributes:o})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,D),c=u instanceof w;this._materialProperty=u,this._showProperty=r(l,M),this._shadowsProperty=r(a.shadows,I),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R),this._fillEnabled=!0;var d=a.width,p=a.followSurface,f=a.granularity;if(s.isConstant&&b.isConstant(d)&&b.isConstant(p)&&b.isConstant(f)){var m=this._options,_=s.getValue(h.MINIMUM_VALUE,m.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));m.vertexFormat=c?g.VERTEX_FORMAT:v.VERTEX_FORMAT,m.positions=_,m.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,m.followSurface=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,m.granularity=n(f)?f.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new A(e,this)};var O={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!b.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=b.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=b.getValueOrDefault(r._followSurface,e,!0);l&&(O.positions=s,O.granularity=b.getValueOrUndefined(r._granularity,e),O.height=f.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=f.generateCartesianArc(O)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=b.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=b.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition)},A.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),C.DONE):C.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=P[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete P[t]),a(this)},x}),define("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new p(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.shape,f=a.show;if(!r(h)||!r(p)||r(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=i(s,D),this._showProperty=i(f,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var C=a.granularity,w=a.outlineWidth,S=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&p.isConstant&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=v?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,b.polylinePositions=h.getValue(d.MINIMUM_VALUE,b.polylinePositions),b.shapePositions=p.getValue(d.MINIMUM_VALUE,b.shape),b.granularity=r(C)?C.getValue(d.MINIMUM_VALUE):void 0,b.cornerType=r(S)?S.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.polylinePositions),d=E.getValueOrUndefined(s.shape,i);if(r(u)&&r(d)){l.polylinePositions=u,l.shapePositions=d,l.granularity=E.getValueOrUndefined(s.granularity,i),l.cornerType=E.getValueOrUndefined(s.cornerType,i);var f=this._geometryUpdater.shadowsProperty.getValue(i);if(!r(s.fill)||s.fill.getValue(i)){var v=S.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var y=new m({material:v,translucent:v.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new h(l)}),appearance:y,asynchronous:!1,shadows:f}))}if(r(s.outline)&&s.outline.getValue(i)){l.vertexFormat=_.VERTEX_FORMAT;var C=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),w=E.getValueOrDefault(s.outlineWidth,i,1),b=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(C)}}),appearance:new _({flat:!0,translucent:b,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:f}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),define("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof w){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new p(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new f(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,D),y=m instanceof w;this._materialProperty=m,this._fillProperty=i(s,I),this._showProperty=i(f,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.stRotation,x=a.rotation,A=a.outlineWidth,P=a.closeBottom,B=a.closeTop,F=l&&!r(C)&&!r(S)&&y&&_.isSupported(this._scene);if(c&&F&&(h(h.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&(!F||T.isConstant(m))){var k=this._options;k.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,k.rectangle=p.getValue(d.MINIMUM_VALUE,k.rectangle),k.height=r(C)?C.getValue(d.MINIMUM_VALUE):void 0,k.extrudedHeight=r(S)?S.getValue(d.MINIMUM_VALUE):void 0,k.granularity=r(E)?E.getValue(d.MINIMUM_VALUE):void 0,k.stRotation=r(b)?b.getValue(d.MINIMUM_VALUE):void 0,k.rotation=r(x)?x.getValue(d.MINIMUM_VALUE):void 0,k.closeBottom=r(P)?P.getValue(d.MINIMUM_VALUE):void 0,k.closeTop=r(B)?B.getValue(d.MINIMUM_VALUE):void 0,this._isClosed=r(S)&&r(k.closeTop)&&r(k.closeBottom)&&k.closeTop&&k.closeBottom,this._outlineWidth=r(A)?A.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(i)&&T.getValueOrDefault(u.show,i,!0)){var d=this._options,h=T.getValueOrUndefined(u.coordinates,i,d.rectangle);if(r(h)){d.rectangle=h,d.height=T.getValueOrUndefined(u.height,i),d.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,i),d.granularity=T.getValueOrUndefined(u.granularity,i),d.stRotation=T.getValueOrUndefined(u.stRotation,i),d.rotation=T.getValueOrUndefined(u.rotation,i),d.closeBottom=T.getValueOrUndefined(u.closeBottom,i),d.closeTop=T.getValueOrUndefined(u.closeTop,i);var m=this._geometryUpdater.shadowsProperty.getValue(i);if(T.getValueOrDefault(u.fill,i,!0)){var C=n.fillMaterialProperty,w=b.getValue(i,C,this._material);if(this._material=w,o){var S=e.WHITE;r(C.color)&&(S=C.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new p(d),attributes:{color:t.fromColor(S)}}),asynchronous:!1,shadows:m}))}else{var E=new g({material:w,translucent:w.isTranslucent(),closed:r(d.extrudedHeight)});d.vertexFormat=E.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(d)}),appearance:E,asynchronous:!1,shadows:m}))}}if(!o&&T.getValueOrDefault(u.outline,i,!1)){d.vertexFormat=v.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,B),A=T.getValueOrDefault(u.outlineWidth,i,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new f(d),attributes:{color:t.fromColor(x)}}),appearance:new v({flat:!0,translucent:P,renderState:{lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:m}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),define("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new h(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),f=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:f,color:o}}else n={show:u,distanceDisplayCondition:f};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new f(this._options),attributes:{show:new h(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.show;if(r(p)&&p.isConstant&&!p.getValue(d.MINIMUM_VALUE)||!r(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=i(a.material,A),g=f instanceof y;this._materialProperty=f,this._fillProperty=i(s,D),this._showProperty=i(p,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var v=a.minimumHeights,C=a.maximumHeights,w=a.outlineWidth,S=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(v)&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=g?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,b.positions=h.getValue(d.MINIMUM_VALUE,b.positions),b.minimumHeights=r(v)?v.getValue(d.MINIMUM_VALUE,b.minimumHeights):void 0,b.maximumHeights=r(C)?C.getValue(d.MINIMUM_VALUE,b.maximumHeights):void 0,b.granularity=r(S)?S.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.positions);if(r(u)){l.positions=u,l.minimumHeights=E.getValueOrUndefined(s.minimumHeights,i,l.minimumHeights),l.maximumHeights=E.getValueOrUndefined(s.maximumHeights,i,l.maximumHeights),l.granularity=E.getValueOrUndefined(s.granularity,i);var d=this._geometryUpdater.shadowsProperty.getValue(i);if(E.getValueOrDefault(s.fill,i,!0)){var h=S.getValue(i,o.fillMaterialProperty,this._material);this._material=h;var v=new m({material:h,translucent:h.isTranslucent(),closed:r(l.extrudedHeight)});l.vertexFormat=v.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:v,asynchronous:!1,shadows:d}))}if(E.getValueOrDefault(s.outline,i,!1)){l.vertexFormat=_.VERTEX_FORMAT;var y=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),C=E.getValueOrDefault(s.outlineWidth,i,1),w=1!==y.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new f(l),attributes:{color:t.fromColor(y)}}),appearance:new _({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:d}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),define("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){s.initializeTerrainHeights();var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;n<o;n++)this._onDataSourceAdded(r,r.get(n));var l=new h;this._onDataSourceAdded(void 0,l),this._defaultDataSource=l,this._ready=!1}x.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new l(t,r),new _(c,e,r),new _(p,e,r),new _(d,e,r),new _(f,e,r),new _(m,e,r),new _(w,e,r),new _(S,e,r),new _(E,e,r),new _(b,e,r),new _(T,e,r),new g(t,r),new v(e,r),new C(t,r),new y(e,r)]},r(x.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));
return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){if(!s._initialized)return this._ready=!1,!1;var t,r,n,o,a=!0,l=this._dataSourceCollection,u=l.length;for(t=0;t<u;t++){var c=l.get(t);for(i(c.update)&&(a=c.update(e)&&a),n=c._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a;return this._ready=a,a};var A=[],P=new e;return x.prototype.getBoundingSphere=function(t,r,n){if(!this._ready)return u.PENDING;var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var l=this._dataSourceCollection;for(a=l.length,o=0;o<a;o++){var c=l.get(o);if(c.entities.contains(t)){s=c;break}}}if(!i(s))return u.FAILED;var d=A,h=P,p=0,f=u.DONE,m=s._visualizers,_=m.length;for(o=0;o<_;o++){var g=m[o];if(i(g.getBoundingSphere)){if(f=m[o].getBoundingSphere(t,h),!r&&f===u.PENDING)return u.PENDING;f===u.DONE&&(d[p]=e.clone(h,d[p]),p++)}}return 0===p?u.FAILED:(d.length=p,e.fromBoundingSpheres(d,n),u.DONE)},x.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=t.clustering;r._initialize(i),i.primitives.add(r),t._visualizers=this._visualizersCallback(i,r,t)},x.prototype._onDataSourceRemoved=function(e,t){var i=this._scene,r=t.clustering;i.primitives.remove(r);for(var n=t._visualizers,o=n.length,a=0;a<o;a++)n[a].destroy();t._visualizers=void 0},x}),define("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("DataSources/EntityView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(t,r,n,o,a,c,p){var f=t.scene.mode,A=a.getValue(c,t._lastCartesian);if(i(A)){var P,D,M,I=!1;if(f===h.SCENE3D){T=s.addSeconds(c,.001,T);var R=a.getValue(T,y);if(i(R)){var O,N=d.computeFixedToIcrfMatrix(c,m),L=d.computeFixedToIcrfMatrix(T,_);i(N)&&i(L)?O=u.transpose(N,g):(O=d.computeTemeToPseudoFixedMatrix(c,g),N=u.transpose(O,m),L=d.computeTemeToPseudoFixedMatrix(T,_),u.transpose(L,L));var B=u.multiplyByVector(N,A,E),F=u.multiplyByVector(L,R,b);e.subtract(B,F,S);var k=1e3*e.magnitude(S),V=3986004418e5,z=-V/(k*k-2*V/e.magnitude(B));z<0||z>x*p.maximumRadius?(P=C,e.normalize(A,P),e.negate(P,P),M=e.clone(e.UNIT_Z,w),D=e.cross(M,P,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(P,P),e.normalize(D,D),M=e.cross(P,D,w),e.normalize(M,M),I=!0)):e.equalsEpsilon(A,R,l.EPSILON7)||(M=C,e.normalize(B,M),e.normalize(F,F),D=e.cross(M,F,w),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(P=e.cross(D,M,y),u.multiplyByVector(O,P,P),u.multiplyByVector(O,D,D),u.multiplyByVector(O,M,M),e.normalize(P,P),e.normalize(D,D),e.normalize(M,M),I=!0))}}i(t.boundingSphere)&&(A=t.boundingSphere.center);var U,G,H;o&&(U=e.clone(r.position,S),G=e.clone(r.direction,E),H=e.clone(r.up,b));var W=v;I?(W[0]=P.x,W[1]=P.y,W[2]=P.z,W[3]=0,W[4]=D.x,W[5]=D.y,W[6]=D.z,W[7]=0,W[8]=M.x,W[9]=M.y,W[10]=M.z,W[11]=0,W[12]=A.x,W[13]=A.y,W[14]=A.z,W[15]=0):d.eastNorthUpToFixedFrame(A,p,W),r._setTransform(W),o&&(e.clone(U,r.position),e.clone(G,r.direction),e.clone(H,r.up),e.cross(G,H,r.right))}if(n){var q=f===h.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;r.lookAtTransform(r.transform,q)}}function f(i,r,n){this.entity=i,this.scene=r,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var m=new u,_=new u,g=new u,v=new c,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new s,x=1.25;r(f,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),f.defaultOffset3D=new e(-14e3,3500,3500);var A=new a,P=new e;return f.prototype.update=function(t,r){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==h.MORPHING){var u=o.position,c=o!==this._lastEntity,d=s!==this._mode,m=this._offset3D,_=n.camera,g=c||d,v=!0;if(c){var y=o.viewFrom,C=i(y);if(!C&&i(r)){var w=n.screenSpaceCameraController;w.minimumZoomDistance=Math.min(w.minimumZoomDistance,.5*r.radius),A.pitch=-l.PI_OVER_FOUR,A.range=0;var S=u.getValue(t,P);if(i(S)){var E=2-1/Math.max(1,e.magnitude(S)/a.maximumRadius);A.pitch*=E}_.viewBoundingSphere(r,A),this.boundingSphere=r,g=!1,v=!1}else C&&i(y.getValue(t,m))||e.clone(f._defaultOffset3D,m)}else d||n.mode===h.MORPHING||this._mode===h.SCENE2D||e.clone(_.position,m);this._lastEntity=o,this._mode=n.mode!==h.MORPHING?n.mode:this._mode,n.mode!==h.MORPHING&&p(this,_,g,v,u,t,a)}},f}),!function(){function e(e,t){function i(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],t<0?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[e<0?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in d&&(u=e,d[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],d={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var h=0,p=t.arcs.length;h<p;++h)l.push(h);return{type:"MultiLineString",arcs:e(t,l)}}function i(t,i){function r(e){e.forEach(function(t){t.forEach(function(t){(s[t=t<0?~t:t]||(s[t]=[])).push(e)})}),l.push(e)}function o(e){return d(a(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var s={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var a,l=o(i[0][0]),u=0;u<n;++u)if(l===o(r[u])){a=r[0],r[0]=r[u],r[u]=a;break}return r})}}function r(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return o(e,t)})}:o(e,t)}function o(e,t){var i={type:"Feature",id:t.id,properties:t.properties||{},geometry:a(e,t)};return null==t.id&&delete i.id,i}function a(e,t){function i(e,t){t.length&&t.pop();for(var i,r=c[e<0?~e:e],n=0,o=r.length;n<o;++n)t.push(i=r[n].slice()),u(i,n);e<0&&s(t,o)}function r(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],r=0,n=e.length;r<n;++r)i(e[r],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in d?{type:t,coordinates:d[t](e)}:null}var u=m(e.transform),c=e.arcs,d={Point:function(e){return r(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(r)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return l(t)}function s(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i}function l(e,t){for(var i=0,r=e.length;i<r;){var n=i+r>>>1;e[n]<t?i=n+1:r=n}return i}function u(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var i=n[e];i?i.push(t):n[e]=[t]})}function i(e,i){e.forEach(function(e){t(e,i)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach(function(e){i(e,t)})}};e.forEach(r);for(var s in n)for(var u=n[s],c=u.length,d=0;d<c;++d)for(var h=d+1;h<c;++h){var p,f=u[d],m=u[h];(p=o[f])[s=l(p,m)]!==m&&p.splice(s,0,m),(p=o[m])[s=l(p,f)]!==f&&p.splice(s,0,f)}return o}function c(e,t){function i(e){o.remove(e),e[1][2]=t(e),o.push(e)}var r=m(e.transform),n=_(e.transform),o=f();return t||(t=h),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,d=e.length;c<d;++c)s=e[c],r(e[c]=[s[0],s[1],1/0],c);for(var c=1,d=e.length-1;c<d;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,d=l.length;c<d;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var h=a.previous,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],h&&(h.next=p,h[2]=a[2],i(h)),p&&(p.previous=h,p[0]=a[0],i(p))}e.forEach(n)}),e}function d(e){for(var t,i=-1,r=e.length,n=e[r-1],o=0;++i<r;)t=n,n=e[i],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function h(e){var t=e[0],i=e[1],r=e[2];return Math.abs((t[0]-r[0])*(i[1]-t[1])-(t[0]-i[0])*(r[1]-t[1]))}function p(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var i=(t+1>>1)-1,n=r[i];if(p(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(o<n&&p(r[o],s)<0&&(s=r[a=o]),i<n&&p(r[i],s)<0&&(s=r[a=i]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var i={},r=[],n=0;return i.push=function(t){return e(r[t._=n]=t,n++),n},i.pop=function(){if(!(n<=0)){var e,i=r[0];return--n>0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(p(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function m(e){if(!e)return g;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function _(e){if(!e)return g;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function g(){}var v={version:"1.6.18",mesh:function(e){return a(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return a(e,i.apply(this,arguments))},mergeArcs:i,feature:r,neighbors:u,presimplify:c};"function"==typeof define&&define.amd?define("ThirdParty/topojson",v):"object"==typeof module&&module.exports?module.exports=v:this.topojson=v}(),define("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||ue.indexOf(r)!==-1)continue;var o=e[r];n(o)&&(i+="object"==typeof o?"<tr><th>"+r+"</th><td>"+D(o)+"</td></tr>":"<tr><th>"+r+"</th><td>"+o+"</td></tr>")}return i.length>0&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function M(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new v(M(D,e,t),!0)}function R(e,t,r){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=i();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.properties=u;var c,d=u.title;if(n(d))l.name=d,c="title";else{var h=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var f=p.toLowerCase();if(h>1&&"title"===f){h=1,c=p;break}h>2&&"name"===f?(h=2,c=p):h>3&&/title/i.test(p)?(h=3,c=p):h>4&&/name/i.test(p)&&(h=4,c=p)}n(c)&&(l.name=u[c])}var m=u.description;null!==m&&(l.description=n(m)?new w(m):r(u,c))}return l}function O(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}function N(e,t,i,r,o){if(null===t.geometry)return void R(t,e._entityCollection,o.describe);if(!n(t.geometry))throw new h("feature.geometry is required.");var a=t.geometry.type,s=de[a];if(!n(s))throw new h("Unknown geometry type: "+a);s(e,t,t.geometry,r,o)}function L(e,t,i,r,n){for(var o=t.features,a=0,s=o.length;a<s;a++)N(e,o[a],void 0,r,n)}function B(e,t,i,r,o){for(var a=i.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,d=de[c];if(!n(d))throw new h("Unknown geometry type: "+c);d(e,t,u,r,o)}}function F(e,i,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,d=i.properties;if(n(d)){var h=d["marker-color"];n(h)&&(u=t.fromCssColorString(h)),c=r(le[d["marker-size"]],c);var m=d["marker-symbol"];n(m)&&(l=m)}var v;v=n(l)?1===l.length?e._pinBuilder.fromText(l.toUpperCase(),u,c):e._pinBuilder.fromMakiIconId(l,u,c):e._pinBuilder.fromColor(u,c);var y=new g;y.verticalOrigin=new w(f.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=p.CLAMP_TO_GROUND);var S=R(i,e._entityCollection,s.describe);S.billboard=y,S.position=new C(o(a));var E=_(v).then(function(e){y.image=new w(e)}).otherwise(function(){y.image=new w(e._pinBuilder.fromColor(u,c))});e._promises.push(E)}function k(e,t,i,r,n){F(e,t,r,i.coordinates,n)}function V(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)F(e,t,r,o[a],n)}function z(e,i,r,o,a){var s=a.strokeMaterialProperty,l=a.strokeWidthProperty,u=i.properties;if(n(u)){var c=u["stroke-width"];n(c)&&(l=new w(c));var d,h=u.stroke;n(h)&&(d=t.fromCssColorString(h));var p=u["stroke-opacity"];n(p)&&1!==p&&(n(d)||(d=s.color.clone()),d.alpha=p),n(d)&&(s=new y(d))}var f,m=R(i,e._entityCollection,a.describe);a.clampToGround?(f=new S,m.corridor=f):(f=new A,m.polyline=f),f.material=s,f.width=l,f.positions=new w(O(o,r))}function U(e,t,i,r,n){z(e,t,r,i.coordinates,n)}function G(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)z(e,t,r,o[a],n)}function H(e,i,r,o,a){if(0!==o.length&&0!==o[0].length){var s=a.strokeMaterialProperty.color,l=a.fillMaterialProperty,u=a.strokeWidthProperty,c=i.properties;if(n(c)){var h=c["stroke-width"];n(h)&&(u=new w(h));var p,f=c.stroke;n(f)&&(p=t.fromCssColorString(f));var m=c["stroke-opacity"];n(m)&&1!==m&&(n(p)||(p=a.strokeMaterialProperty.color.clone()),p.alpha=m),n(p)&&(s=new w(p));var _,g=c.fill;n(g)&&(_=t.fromCssColorString(g),_.alpha=l.color.alpha),m=c["fill-opacity"],n(m)&&m!==l.color.alpha&&(n(_)||(_=l.color.clone()),_.alpha=m),n(_)&&(l=new y(_))}var v=new x;v.outline=new w(!0),v.outlineColor=s,v.outlineWidth=u,v.material=l;for(var C=[],S=1,E=o.length;S<E;S++)C.push(new d(O(o[S],r)));var b=o[0];v.hierarchy=new w(new d(O(b,r),C)),b[0].length>2?v.perPositionHeight=new w(!0):a.clampToGround||(v.height=0);var T=R(i,e._entityCollection,a.describe);T.polygon=v}}function W(e,t,i,r,n){H(e,t,r,i.coordinates,n)}function q(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)H(e,t,r,o[a],n)}function j(e,t,i,r,n){for(var o in i.objects)if(i.objects.hasOwnProperty(o)){var a=m.feature(i,i.objects[o]),s=ce[a.type];s(e,a,a,r,n)}}function Y(e){this._name=e,this._changed=new s,this._error=new s,this._isLoading=!1,this._loading=new s,this._entityCollection=new T(this),this._promises=[],this._pinBuilder=new c,this._entityCluster=new b}function X(e,t,i,r){var o;n(r)&&(o=l(r)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=ce[t.type];if(!n(a))throw new h("Unsupported GeoJSON object type: "+t.type);var s=t.crs,u=null!==s?P:null;if(n(s)){if(!n(s.properties))throw new h("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(u=K[c.name],!n(u))throw new h("Unknown crs name: "+c.name)}else if("link"===s.type){var d=Q[c.href];if(n(d)||(d=J[c.type]),!n(d))throw new h("Unable to resolve crs link: "+JSON.stringify(c));u=d(c)}else{if("EPSG"!==s.type)throw new h("Unknown crs type: "+s.type);if(u=K["EPSG:"+c.code],!n(u))throw new h("Unknown crs EPSG code: "+c.code)}}return _(u,function(r){return e._entityCollection.removeAll(),null!==r&&a(e,t,t,r,i),_.all(e._promises,function(){return e._promises.length=0,E.setLoading(e,!1),e})})}var Z,K={"urn:ogc:def:crs:OGC:1.3:CRS84":P,"EPSG:4326":P,"urn:ogc:def:crs:EPSG::4326":P},Q={},J={},$=48,ee=t.ROYALBLUE,te=t.YELLOW,ie=2,re=t.fromBytes(255,255,0,100),ne=!1,oe=new w(ie),ae=new y(te),se=new y(re),le={small:24,medium:48,large:64},ue=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],ce={Feature:N,FeatureCollection:L,GeometryCollection:B,LineString:U,MultiLineString:G,MultiPoint:V,MultiPolygon:q,Point:k,Polygon:W,Topology:j},de={GeometryCollection:B,LineString:U,MultiLineString:G,MultiPoint:V,MultiPolygon:q,Point:k,Polygon:W,Topology:j};return Y.load=function(e,t){return(new Y).load(e,t)},o(Y,{markerSize:{get:function(){return $},set:function(e){$=e}},markerSymbol:{get:function(){return Z},set:function(e){Z=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e,ae.color.setValue(e)}},strokeWidth:{get:function(){return ie},set:function(e){ie=e,oe.setValue(e)}},fill:{get:function(){return re},set:function(e){re=e,se=new y(re)}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return K}},crsLinkHrefs:{get:function(){return Q}},crsLinkTypes:{get:function(){return J}}}),o(Y.prototype,{name:{get:function(){return this._name}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),Y.prototype.load=function(e,t){E.setLoading(this,!0);var i=e;t=r(t,r.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),i=u(e)),t={describe:r(t.describe,I),markerSize:r(t.markerSize,$),markerSymbol:r(t.markerSymbol,Z),markerColor:r(t.markerColor,ee),strokeWidthProperty:new w(r(t.strokeWidth,ie)),strokeMaterialProperty:new y(r(t.stroke,te)),fillMaterialProperty:new y(r(t.fill,re)),clampToGround:r(t.clampToGround,ne)};var a=this;return _(i,function(e){return X(a,e,t,o)}).otherwise(function(e){return E.setLoading(a,!1),a._error.raiseEvent(a,e),console.log(e),_.reject(e)})},Y}),define("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(e,i){t.throwInstantiationError()}return e(i,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(i.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError},outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),i.prototype.isOutlineVisible=t.throwInstantiationError,i.prototype.isFilled=t.throwInstantiationError,i.prototype.createFillGeometryInstance=t.throwInstantiationError,i.prototype.createOutlineGeometryInstance=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i.prototype.createDynamicUpdater=t.throwInstantiationError,i}),function(e,t){"function"==typeof define&&define.amd?define("ThirdParty/Autolinker",[],function(){return e.Autolinker=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t);var i=this.hashtag;if(i!==!1&&"twitter"!==i&&"facebook"!==i)throw new Error("invalid `hashtag` cfg - see docs")};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),i=t.parse(e),r=0,n=[],o=0,a=i.length;o<a;o++){var s=i[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===r){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var i;if(this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i)return i;if(i===!1)return t.getMatchedText();if(i instanceof e.HtmlTag)return i.toAnchorString();var r=this.getTagBuilder(),n=r.build(t);return n.toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,i){var r=new e(i);return r.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},extend:function(t,i){var r=t.prototype,n=function(){};n.prototype=r;var o;o=i.hasOwnProperty("constructor")?i.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=r,delete i.constructor,e.Util.assign(a,i),o},ellipsis:function(e,t,i){return e.length>t&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var i=this.getAttrs();return i[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var i=this.getAttrs();return e.Util.assign(i,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);i=s.shift();)o(a,i)===-1&&a.push(i);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);a.length&&(i=s.shift());){var l=o(a,i);l!==-1&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var d=e.substring(n);d&&(i=this.parseTextAndEntityNodes(d),o.push.apply(o,i))}return o},parseTextAndEntityNodes:function(t){for(var i=[],r=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=r.length;n<o;n+=2){var a=r[n],s=r[n+1];a&&i.push(this.createTextNode(a)),s&&i.push(this.createEntityNode(s))}return i},createCommentNode:function(t,i){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(i)})},createElementNode:function(t,i,r){return new e.htmlParser.ElementNode({text:t,tagName:i.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,i=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",i.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",r.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,i){var r=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,d,h,p,f,m){var _=r.processCandidateMatch(e,n,o,a,s,l,u,c,d,h,p,f,m);if(_){var g=t.call(i,_.match);return _.prefixStr+g+_.suffixStr}return e})},processCandidateMatch:function(t,i,r,n,o,a,s,l,u,c,d,h,p){var f,m=l||u,_="",g="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||i&&!this.twitter||d&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,m))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),g=")"),o)f=new e.match.Email({matchedText:t,email:o});else if(i)r&&(_=r,t=t.slice(1)),f=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var v=t.replace(/\D/g,"");f=new e.match.Phone({matchedText:t,number:v})}else if(d)h&&(_=h,t=t.slice(1)),f=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(m){var y=m.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(_=y,t=t.slice(1))}f=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!m,stripPrefix:this.stripPrefix})}return{prefixStr:_,suffixStr:g,match:f}},matchHasUnbalancedClosingParen:function(e){
var t=e.charAt(e.length-1);if(")"===t){var i=e.match(/\(/g),r=e.match(/\)/g),n=i&&i.length||0,o=r&&r.length||0;if(n<o)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,i){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(i))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&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}),define("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var i={};return function(i){function r(){var e=-1,t=this;t.append=function(i){var r,n=t.table;for(r=0;r<i.length;r++)e=e>>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),d=t-3*Math.floor(l/4);for(a=d;a<d+i;a++)s.array[a-d]=c.charCodeAt(a);n(s.array)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function u(e){function t(t){this.size=e.size,t()}function i(t,i,r,o){var a=new FileReader;a.onload=function(e){r(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,i))}var r=this;r.size=0,r.init=t,r.readUint8Array=i}function c(){}function d(e){function t(e){n=new Blob([],{type:z}),e()}function i(e,t){n=new Blob([n,P?e:e.buffer],{type:z}),t()}function r(t,i){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=i,r.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function h(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function i(e,t){var i,r=a.length,n=a;for(a="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i<e.length;i++)a+=String.fromCharCode(e[i]);n.length>2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function f(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,d,!1),s(f)}function d(e){var t=e.data,r=t.data;t.onappend&&(f+=r.length,i.writeUint8Array(r,function(){o(!1,r),h()},u)),t.onflush&&(r?(f+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function h(){p=m*F,p<n?t.readUint8Array(r+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),m++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,f,m=0;f=0,e.addEventListener(U,d,!1),h()}function m(e,t,i,r,n,o,a,s,l,u){function c(){var f;d=h*F,d<n?t.readUint8Array(r+d,Math.min(F,n-d),function(t){var s=e.append(t,function(){a&&a(r+d,n)});p+=s.length,o(!0,t),i.writeUint8Array(s,function(){o(!1,s),h++,setTimeout(c,1)},u),a&&a(d,n)},l):(f=e.flush(),f?(p+=f.length,i.writeUint8Array(f,function(){o(!1,f),s(p)},u)):s(p))}var d,h=0,p=0;c()}function _(e,t,n,o,a,s,l,u,c){function d(e,t){a&&!e&&_.append(t)}function h(e){s(e,_.get())}var p,_=new r;return i.zip.useWebWorkers?(p=new Worker(i.zip.workerScriptsPath+k),f(p,e,t,n,o,d,l,h,u,c)):m(new i.zip.Inflater,e,t,n,o,d,l,h,u,c),p}function g(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function d(){h.removeEventListener(U,d,!1),f(h,e,t,0,e.size,u,a,c,s,l)}var h,p=new r;return i.zip.useWebWorkers?(h=new Worker(i.zip.workerScriptsPath+V),h.addEventListener(U,d,!1),h.postMessage({init:!0,level:n})):m(new i.zip.Deflater,e,t,0,e.size,u,a,c,s,l),h}function v(e,t,i,n,o,a,s,l,u){function c(){var r=d*F;r<n?e.readUint8Array(i+r,Math.min(F,n-r),function(e){o&&h.append(e),s&&s(r,n,e),t.writeUint8Array(e,function(){d++,c()},u)},l):a(n,h.get())}var d=0,h=new r;c()}function y(e){var t,i,r="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)i=255&e.charCodeAt(t),r+=i>127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function w(e){var t,i="";for(t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return i}function S(e){var t=(4294901760&e)>>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}function E(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(I):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function b(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){h&&h.terminate(),h=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function d(){s(t,N)}var h,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(D):(E(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?v(e,i,s,p.compressedSize,a,u,n,c,d):h=_(e,i,s,p.compressedSize,a,u,n,c,d)},d))},c)},{getEntries:function(n){return e.size<22?void t(D):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,d=[],h=o(e.length,e);for(r=0;r<s;r++){if(a=new i,1347092738!=h.view.getUint32(c))return void t(D);E(a,h,c+6,!0,t),a.commentLength=h.view.getUint16(c+32,!0),a.directory=16==(16&h.view.getUint8(c+38)),a.offset=h.view.getUint32(c+42,!0),l=w(h.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?C(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=w(h.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?C(u):y(u),d.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(d)},function(){t(R)})})},close:function(e){e&&e()}}}function T(e){return unescape(encodeURIComponent(e))}function x(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function A(e,t,i){function r(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){r(t,O)}function a(){r(t,L)}var s,l={},u=[],c=0;return{add:function(d,h,p,f,m){function _(t){var r;E=m.lastModDate||new Date,w=o(26),l[d]={headerArray:w.array,directory:m.directory,filename:S,offset:c,comment:x(T(m.comment||""))},w.view.setUint32(0,335546376),m.version&&w.view.setUint8(0,m.version),i||0===m.level||m.directory||w.view.setUint16(4,2048),w.view.setUint16(6,(E.getHours()<<6|E.getMinutes())<<5|E.getSeconds()/2,!0),w.view.setUint16(8,(E.getFullYear()-1980<<4|E.getMonth()+1)<<5|E.getDate(),!0),w.view.setUint16(22,S.length,!0),r=o(30+S.length),r.view.setUint32(0,1347093252),r.array.set(w.array,4),r.array.set(S,30),c+=r.array.length,e.writeUint8Array(r.array,t,n)}function y(t,i){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),"undefined"!=typeof i&&(w.view.setUint32(10,i,!0),a.view.setUint32(4,i,!0)),h&&(a.view.setUint32(8,t,!0),w.view.setUint32(14,t,!0),a.view.setUint32(12,h.size,!0),w.view.setUint32(18,h.size,!0)),e.writeUint8Array(a.array,function(){c+=16,r(p)},n)}function C(){return m=m||{},d=d.trim(),m.directory&&"/"!=d.charAt(d.length-1)&&(d+="/"),l.hasOwnProperty(d)?void t(B):(S=x(T(d)),u.push(d),void _(function(){h?i||0===m.level?v(h,e,0,h.size,!0,y,f,a,n):s=g(h,e,m.level,y,f,a,n):y()},n))}var w,S,E;h?h.init(C,a):C()},close:function(t){var i,a,s,d=0,h=0;for(a=0;a<u.length;a++)s=l[u[a]],d+=46+s.filename.length+s.comment.length;for(i=o(d+22),a=0;a<u.length;a++)s=l[u[a]],i.view.setUint32(h,1347092738),i.view.setUint16(h+4,5120),i.array.set(s.headerArray,h+6),i.view.setUint16(h+32,s.comment.length,!0),s.directory&&i.view.setUint8(h+38,16),i.view.setUint32(h+42,s.offset,!0),i.array.set(s.filename,h+46),i.array.set(s.comment,h+46+s.filename.length),h+=46+s.filename.length+s.comment.length;i.view.setUint32(h,1347093766),i.view.setUint16(h+8,u.length,!0),i.view.setUint16(h+10,u.length,!0),i.view.setUint32(h+12,d,!0),i.view.setUint32(h+16,c,!0),e.writeUint8Array(i.array,function(){r(function(){e.getData(t)})},n)}}}var P,D="File format is not recognized.",M="File contains encrypted entry.",I="File is using Zip64 (4gb+ file size).",R="Error while reading zip file.",O="Error while writing zip file.",N="Error while writing file data.",L="Error while reading file data.",B="File already exists.",F=524288,k="inflate.js",V="deflate.js",z="text/plain",U="message";try{P=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}r.prototype.table=function(){var e,t,i,r=[];for(e=0;e<256;e++){for(i=e,t=0;t<8;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},d.prototype=new c,d.prototype.constructor=d,h.prototype=new c,h.prototype.constructor=h,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:h,TextWriter:d,createReader:function(e,t,i){e.init(function(){t(b(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),define("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),i=F.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function oe(e){var t=F.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function ae(e,t,i,r){t.getData(new k.TextWriter,function(e){i.kml=gt.parseFromString(e,"application/xml"),r.resolve()})}function se(e,t,i,r){var n=u(_t.detectFromFilename(t.filename),"application/octet-stream");t.getData(new k.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function le(e,t,i,r){for(var n=r.keys,o=new B("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(i),c=new B(u).resolve(o).toString(),d=n.indexOf(c);if(d!==-1){var h=n[d];l.setAttribute(i,r[h]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",h)}}}function ue(e,t){return c(t)&&new B(e).isAbsolute()&&(e=t.getURL(e)),e}function ce(e,t,i){var r=me(e,"id");r=c(r)&&0!==r.length?r:l(),c(i)&&(r=i+r);var n=t.getById(r);return c(n)&&(r=l(),c(i)&&(r=i+r)),n=t.add(new W({id:r})),c(n.kml)||(n.addProperty("kml"),n.kml=new mt),n}function de(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function he(e){if(!c(e))return r.fromDegrees(0,0,0);var t=e.match(/[^\s,\n]+/g);if(!c(t))return r.fromDegrees(0,0,0);var i=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return i=isNaN(i)?0:i,n=isNaN(n)?0:n,o=isNaN(o)?0:o,r.fromDegrees(i,n,o)}function pe(e){if(c(e)){var t=e.textContent.match(/[^\s\n]+/g);if(c(t)){for(var i=t.length,r=new Array(i),n=0,o=0;o<i;o++)r[n++]=he(t[o]);return r}}}function fe(e,t){if(c(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function me(e,t){if(c(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function _e(e,t,i){if(c(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&i.indexOf(a.namespaceURI)!==-1)return a}}function ge(e,t,i){if(c(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&i.indexOf(s.namespaceURI)!==-1&&r.push(s)}return r}}function ve(e,t,i){if(!c(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&i.indexOf(s.namespaceURI)!==-1&&r.push(s)}return r}function ye(e,t,i){var r=_e(e,t,i);if(c(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function Ce(e,t,i){var r=_e(e,t,i);if(c(r))return r.textContent.trim()}function we(e,t,i){var r=_e(e,t,i);if(c(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Se(e,t,i,r){if(c(e)){var n=!1;if(c(r)){var o=r[e];if(c(o))n=!0,e=o;else{var a=m(e,i);o=r[a],c(o)&&(n=!0,e=o)}}return!n&&c(i)&&(e=m(e,m(i)),e=ue(e,t)),e}}function Ee(e,t){if(c(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?Pt.maximumRed=o:Pt.red=0,n>0?Pt.maximumGreen=n:Pt.green=0,r>0?Pt.maximumBlue=r:Pt.blue=0,Pt.alpha=i,s.fromRandom(Pt)):new s(o,n,r,i)}}function be(e,t,i){var r=Ce(e,t,i);if(c(r))return Ee(r,"random"===Ce(e,"colorMode",i))}function Te(e){var t=_e(e,"TimeStamp",At.kmlgx),i=Ce(t,"when",At.kmlgx);if(c(t)&&c(i)&&0!==i.length){var r=C.fromIso8601(i),n=new M;return n.addInterval(new D({start:r,stop:v.MAXIMUM_VALUE})),n}}function xe(e){var t=_e(e,"TimeSpan",At.kmlgx);if(c(t)){var i,r=_e(t,"begin",At.kmlgx),n=c(r)?C.fromIso8601(r.textContent):void 0,o=_e(t,"end",At.kmlgx),a=c(o)?C.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(C.lessThan(a,n)){var s=n;n=a,a=s}i=new M,i.addInterval(new D({start:n,stop:a}))}else c(n)?(i=new M,i.addInterval(new D({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(i=new M,i.addInterval(new D({start:v.MINIMUM_VALUE,stop:a})));return i}}function Ae(){var e=new V;return e.width=yt,e.height=yt,e.scaleByDistance=new b(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new b(Ct,wt,St,Et),e}function Pe(){var e=new Z;return e.outline=!0,e.outlineColor=s.WHITE,e}function De(){var e=new Y;return e.translucencyByDistance=new b(3e6,1,5e6,0),e.pixelOffset=new i(17,0),e.horizontalOrigin=R.LEFT,e.font="16px sans-serif",e.style=O.FILL_AND_OUTLINE,e}function Me(e,t,i,r,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(ye(e,"x",At.gx),0),l=u(ye(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var d=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+d+".png"}if(o=Se(o,t._proxy,i,r),n){var h=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===h||"onExpire"===h?console.log("KML - Unsupported Icon refreshMode: "+h):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p);var f=u(Ce(e,"viewBoundScale",At.kml),1),m="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=u(Ce(e,"viewFormat",At.kml),m),g=Ce(e,"httpQuery",At.kml),v=ot(_,g),C=y(o,v,!1);return at(t._camera,t._canvas,C,f,t._lastCameraView.bbox)}return o}}function Ie(e,n,o,a,s){var l=ye(n,"scale",At.kml),d=ye(n,"heading",At.kml),h=be(n,"color",At.kml),p=_e(n,"Icon",At.kml),f=Me(p,e,a,s,!1),m=ye(p,"x",At.gx),_=ye(p,"y",At.gx),g=ye(p,"w",At.gx),v=ye(p,"h",At.gx),y=_e(n,"hotSpot",At.kml),C=fe(y,"x"),w=fe(y,"y"),S=me(y,"xunits"),b=me(y,"yunits"),T=o.billboard;c(T)||(T=Ae(),o.billboard=T),T.image=f,T.scale=l,T.color=h,(c(m)||c(_)||c(g)||c(v))&&(T.imageSubRegion=new t(m,_,g,v)),c(d)&&0!==d&&(T.rotation=E.toRadians(-d),T.alignedAxis=r.UNIT_Z),l=u(l,1);var x,A;c(C)&&("pixels"===S?x=-C*l:"insetPixels"===S?x=(C-yt)*l:"fraction"===S&&(x=-C*yt*l),x+=.5*yt*l),c(w)&&("pixels"===b?A=w*l:"insetPixels"===b?A=(-w+yt)*l:"fraction"===b&&(A=w*yt*l),A-=.5*yt*l),(c(x)||c(A))&&(T.pixelOffset=new i(x,A))}function Re(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o<a;o++){var l=t.childNodes.item(o);if("IconStyle"===l.localName)Ie(e,l,i,r,n);else if("LabelStyle"===l.localName){var d=i.label;c(d)||(d=De(),i.label=d),d.scale=u(ye(l,"scale",At.kml),d.scale),d.fillColor=u(be(l,"color",At.kml),d.fillColor),d.text=i.name}else if("LineStyle"===l.localName){var h=i.polyline;c(h)||(h=new K,i.polyline=h),h.width=ye(l,"width",At.kml),h.material=be(l,"color",At.kml),c(be(l,"outerColor",At.gx))&&console.log("KML - gx:outerColor is not supported in a LineStyle"),c(ye(l,"outerWidth",At.gx))&&console.log("KML - gx:outerWidth is not supported in a LineStyle"),c(ye(l,"physicalWidth",At.gx))&&console.log("KML - gx:physicalWidth is not supported in a LineStyle"),c(we(l,"labelVisibility",At.gx))&&console.log("KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===l.localName){var p=i.polygon;c(p)||(p=Pe(),i.polygon=p),p.material=u(be(l,"color",At.kml),p.material),p.fill=u(we(l,"fill",At.kml),p.fill),p.outline=u(we(l,"outline",At.kml),p.outline)}else if("BalloonStyle"===l.localName){var f=u(Ee(Ce(l,"bgColor",At.kml)),s.WHITE),m=u(Ee(Ce(l,"textColor",At.kml)),s.BLACK),_=Ce(l,"text",At.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:f,textColor:m,text:_}}else if("ListStyle"===l.localName){var g=Ce(l,"listItemType",At.kml);"radioFolder"!==g&&"checkOffOnly"!==g||console.log("KML - Unsupported ListStyle with listItemType: "+g)}}}function Oe(e,t,i,r,n,o){for(var a,s=new W,l=-1,u=i.childNodes,d=u.length,h=0;h<d;h++){var p=u[h];"Style"!==p.localName&&"StyleMap"!==p.localName||(l=h)}if(l!==-1){var f=u[l];if("Style"===f.localName)Re(t,f,s,n,o);else for(var _=ve(f,"Pair",At.kml),g=0;g<_.length;g++){var v=_[g],y=Ce(v,"key",At.kml);if("normal"===y){var C=Ce(v,"styleUrl",At.kml);if(c(C))a=r.getById(C),c(a)||(a=r.getById("#"+C)),c(a)&&s.merge(a);else{var w=_e(v,"Style",At.kml);Re(t,w,s,n,o)}}else console.log("KML - Unsupported StyleMap key: "+y)}}var S=Ce(i,"styleUrl",At.kml);if(c(S)){var E=S;if("#"!==S[0]&&S.indexOf("#")!==-1){var b=S.split("#"),T=b[0];c(n)&&(T=m(T,m(n))),E=T+"#"+b[1]}a=r.getById(E),c(a)||(a=r.getById("#"+E)),c(a)&&s.merge(a)}return s}function Ne(e,t,i){return S(ue(t,e._proxy)).then(function(r){return Le(e,r,i,t,!0)})}function Le(e,t,i,r,n,o){var a,s,l,u,d=ge(t,"Style",At.kml);if(c(d)){var h=d.length;for(a=0;a<h;a++)u=d[a],s=me(u,"id"),c(s)&&(s="#"+s,n&&c(r)&&(s=r+s),c(i.getById(s))||(l=new W({id:s}),i.add(l),Re(e,u,l,r,o)))}var p=ge(t,"StyleMap",At.kml);if(c(p)){var f=p.length;for(a=0;a<f;a++){var _=p[a];if(s=me(_,"id"),c(s))for(var g=ve(_,"Pair",At.kml),v=0;v<g.length;v++){var y=g[v],C=Ce(y,"key",At.kml);if("normal"===C){if(s="#"+s,n&&c(r)&&(s=r+s),!c(i.getById(s))){l=i.getOrCreateEntity(s);var w=Ce(y,"styleUrl",At.kml);if(c(w)){"#"!==w[0]&&(w="#"+w),n&&c(r)&&(w=r+w);var S=i.getById(w);c(S)&&l.merge(S)}else u=_e(y,"Style",At.kml),Re(e,u,l,r,o)}}else console.log("KML - Unsupported StyleMap key: "+C)}}}var E={},b=[],T=t.getElementsByTagName("styleUrl"),x=T.length;for(a=0;a<x;a++){var A=T[a].textContent;if("#"!==A[0]){var P=A.split("#");if(2===P.length){var D=P[0];c(E[D])||(c(r)&&(D=m(D,m(r))),b.push(Ne(e,D,i,r)))}}}return b}function Be(e,t,i){var r=new $(e,t.id,["position"]),n=new te(t.position);t.polyline=c(i.polyline)?i.polyline.clone():new K,t.polyline.positions=new Q([r,n])}function Fe(e,t){return!c(e)&&!c(t)||"clampToGround"===e?I.CLAMP_TO_GROUND:"relativeToGround"===e?I.RELATIVE_TO_GROUND:"absolute"===e?I.NONE:"clampToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),I.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),I.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):console.log("KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),I.CLAMP_TO_GROUND)}function ke(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i)),new te(e))}function Ve(e,t,i){if(c(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i));for(var r=e.length,n=0;n<r;n++){var o=e[n];p.WGS84.scaleToGeodeticSurface(o,o)}return e}}function ze(e,t,r,n){var o=t.label;c(o)||(o=c(r.label)?r.label.clone():De(),t.label=o),o.text=t.name;var a=t.billboard;c(a)||(a=c(r.billboard)?r.billboard.clone():Ae(),t.billboard=a),c(a.image)||(a.image=e._pinBuilder.fromColor(s.YELLOW,64));var l=1;c(a.scale)&&(l=a.scale.getValue(),0!==l?o.pixelOffset=new i(16*l+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Ue(e,t,i){var r=t.path;c(r)||(r=new X,r.leadTime=0,t.path=r);var n=i.polyline;c(n)&&(r.material=n.material,r.width=n.width)}function Ge(e,t,i,r,n){var o=Ce(i,"coordinates",At.kml),a=Ce(i,"altitudeMode",At.kml),s=Ce(i,"altitudeMode",At.gx),l=we(i,"extrude",At.kml),u=he(o);return r.position=u,ze(e,r,n,Fe(a,s)),l&&de(a,s)&&Be(t,r,n),!0}function He(e,t,i,r,n){var o=_e(i,"coordinates",At.kml),a=Ce(i,"altitudeMode",At.kml),l=Ce(i,"altitudeMode",At.gx),d=we(i,"extrude",At.kml),h=we(i,"tessellate",At.kml),p=de(a,l);c(ye(i,"drawOrder",At.gx))&&console.log("KML - gx:drawOrder is not supported in LineStrings");var f=pe(o),m=n.polyline;if(p&&d){var _=new re;r.wall=_,_.positions=f;var g=n.polygon;c(g)&&(_.fill=g.fill,_.material=g.material),_.outline=!0,c(m)?(_.outlineColor=c(m.material)?m.material.color:s.WHITE,_.outlineWidth=m.width):c(g)&&(_.outlineColor=c(g.material)?g.material.color:s.WHITE)}else if(e._clampToGround&&!p&&h){var y=new U;r.corridor=y,y.positions=f,c(m)?(y.material=c(m.material)?m.material.color.getValue(v.MINIMUM_VALUE):s.WHITE,y.width=u(m.width,1)):(y.material=s.WHITE,y.width=1)}else m=c(m)?m.clone():new K,r.polyline=m,m.positions=Ve(f,a,l),h&&!p||(m.followSurface=!1);return!0}function We(e,t,i,r,n){var o=_e(i,"outerBoundaryIs",At.kml),a=_e(o,"LinearRing",At.kml),l=_e(a,"coordinates",At.kml),u=pe(l),d=we(i,"extrude",At.kml),h=Ce(i,"altitudeMode",At.kml),p=Ce(i,"altitudeMode",At.gx),f=de(h,p),m=c(n.polygon)?n.polygon.clone():Pe(),_=n.polyline;if(c(_)&&(m.outlineColor=c(_.material)?_.material.color:s.WHITE,m.outlineWidth=_.width),r.polygon=m,f?(m.perPositionHeight=!0,m.extrudedHeight=d?0:void 0):e._clampToGround||(m.height=0),c(u)){for(var g=new x(u),v=ve(i,"innerBoundaryIs",At.kml),y=0;y<v.length;y++){a=ve(v[y],"LinearRing",At.kml);for(var C=0;C<a.length;C++)l=_e(a[C],"coordinates",At.kml),u=pe(l),c(u)&&g.holes.push(new x(u))}m.hierarchy=g}return!0}function qe(e,t,i,r,n){var o=Ce(i,"altitudeMode",At.kml),a=Ce(i,"altitudeMode",At.gx),s=ve(i,"coord",At.gx),l=ve(i,"angles",At.gx),u=ve(i,"when",At.kml),c=we(i,"extrude",At.kml),d=de(o,a);l.length>0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var h=Math.min(s.length,u.length),p=[],f=[],m=0;m<h;m++){var _=he(s[m].textContent);p.push(_),f.push(C.fromIso8601(u[m].textContent))}var g=new ee;return g.addSamples(f,p),r.position=g,ze(e,r,n,Fe(o,a)),Ue(e,r,n),r.availability=new M,u.length>0&&r.availability.addInterval(new D({start:f[0],stop:f[f.length-1]})),d&&c&&Be(t,r,n),!0}function je(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],d=new ee;d.addSamples(e,t),i.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:ke(d,a,s)})),r.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Ye(e,t,i,r,n){for(var o,a,s,l=we(i,"interpolate",At.gx),u=ve(i,"Track",At.gx),d=!1,h=new ie,p=new M,f=new z,m=0,_=u.length;m<_;m++){var g=u[m],v=ve(g,"when",At.kml),y=ve(g,"coord",At.gx),w=Ce(g,"altitudeMode",At.kml),S=Ce(g,"altitudeMode",At.gx),E=de(w,S),b=we(g,"extrude",At.kml),T=Math.min(y.length,v.length),x=[];o=[];for(var A=0;A<T;A++){var P=he(y[A].textContent);x.push(P),o.push(C.fromIso8601(v[A].textContent))}l&&(c(a)&&je([a,o[0]],[s,x[0]],f,p,h,!1,"absolute",void 0,!1),a=o[T-1],s=x[x.length-1]),je(o,x,f,p,h,E&&b,w,S,!0),d=d||E&&b}return r.availability=p,r.position=f,ze(e,r,n),Ue(e,r,n),d&&(Be(t,r,n),r.polyline.show=h),!0}function Xe(e,t,i,r,n,o){for(var a=i.childNodes,s=!1,l=0,u=a.length;l<u;l++){var d=a.item(l),h=Mt[d.localName];if(c(h)){var p=ce(d,t,o);p.parent=r,p.name=r.name,p.availability=r.availability,p.description=r.description,p.kml=r.kml,h(e,t,d,p,n)&&(s=!0)}}return s}function Ze(e,t,i,r,n){return console.log("KML - Unsupported geometry: "+i.localName),!1}function Ke(e,t){var i=_e(e,"ExtendedData",At.kml);if(c(i)){c(_e(i,"SchemaData",At.kml))&&console.log("KML - SchemaData is unsupported"),c(me(i,"xmlns:prefix"))&&console.log("KML - ExtendedData with xmlns:prefix is unsupported");var r={},n=ve(i,"Data",At.kml);if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=me(s,"name");c(l)&&(r[l]={displayName:Ce(s,"displayName",At.kml),value:Ce(s,"value",At.kml)})}t.kml.extendedData=r}}function Qe(e,t,i,r){var n,o,a,l=t.kml,d=l.extendedData,h=Ce(e,"description",At.kml),p=u(t.balloonStyle,i.balloonStyle),f=s.WHITE,m=s.BLACK,_=h;c(p)&&(f=u(p.bgColor,s.WHITE),m=u(p.textColor,s.BLACK),_=u(p.text,h));var g;if(c(_)){if(_=_.replace("$[name]",u(t.name,"")),_=_.replace("$[description]",u(h,"")),_=_.replace("$[address]",u(l.address,"")),_=_.replace("$[Snippet]",u(l.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),c(d)){var v=_.match(/\$\[.+?\]/g);if(null!==v)for(n=0;n<v.length;n++){var y=v[n],C=y.substr(2,y.length-3),w=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=d[C],c(g)&&(g=w?g.displayName:g.value),c(g)&&(_=_.replace(y,u(g,"")))}}}else if(c(d)&&(a=Object.keys(d),a.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',n=0;n<a.length;n++)o=a[n],g=d[o],_+="<tr><th>"+u(g.displayName,o)+"</th><td>"+u(g.value,"")+"</td></tr>";_+="</tbody></table>"}if(c(_)){_=vt.link(_),Dt.innerHTML=_;var S=Dt.querySelectorAll("a");for(n=0;n<S.length;n++)S[n].setAttribute("target","_blank");c(r)&&r.keys.length>1&&(le(Dt,"a","href",r),le(Dt,"img","src",r));var E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+="background-color:"+f.toCssColorString()+";",E+="color:"+m.toCssColorString()+";",E+='">',E+=Dt.innerHTML+"</div>",Dt.innerHTML="",t.description=E}}function Je(e,t,i,r,n,o,a,s,l){function d(e){return!e||e.show&&d(e.parent)}var h=ce(i,r,l),p=h.kml,f=Oe(h,e,i,n,o,a),m=Ce(i,"name",At.kml);h.name=m,h.parent=t;var _=xe(i);c(_)||(_=Te(i)),h.availability=_,
pt(h);var g=we(i,"visibility",At.kml);h.show=d(t)&&u(g,!0);var v=_e(i,"author",At.atom),y=p.author;y.name=Ce(v,"name",At.atom),y.uri=Ce(v,"uri",At.atom),y.email=Ce(v,"email",At.atom);var C=_e(i,"link",At.atom),w=p.link;return w.href=me(C,"href"),w.hreflang=me(C,"hreflang"),w.rel=me(C,"rel"),w.type=me(C,"type"),w.title=me(C,"title"),w.length=me(C,"length"),p.address=Ce(i,"address",At.kml),p.phoneNumber=Ce(i,"phoneNumber",At.kml),p.snippet=Ce(i,"Snippet",At.kml),Ke(i,h),Qe(i,h,f,a),c(_e(i,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(_e(i,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(_e(i,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:h,styleEntity:f}}function $e(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(Bt),c=u.length,d=0;d<c;d++)for(var h=u[d],p=Bt[h],f=i.childNodes,m=f.length,_=0;_<m;_++){var g=f[_];g.localName!==h||At.kml.indexOf(g.namespaceURI)===-1&&At.gx.indexOf(g.namespaceURI)===-1||p(e,t,g,r,n,o,a,s,l)}}function et(e,t,i,r,n,o,a,s,l){var u=Je(e,t,i,r,n,o,a,s,l);$e(e,u.entity,i,r,n,o,a,s,l)}function tt(e,t,i,r,n,o,a,s,l){for(var u=Je(e,t,i,r,n,o,a,s,l),d=u.entity,h=u.styleEntity,p=!1,f=i.childNodes,m=0,_=f.length;m<_&&!p;m++){var g=f.item(m),v=Mt[g.localName];c(v)&&(v(e,r,g,d,h,d.id),p=!0)}p||(d.merge(h),ze(e,d,h))}function it(e,t,i,r,n,o,a,s,l){var u,d=Je(e,t,i,r,n,o,a,s,l),h=d.entity,p=!1,f=pe(_e(i,"LatLonQuad",At.gx));if(c(f))u=Pe(),u.hierarchy=new x(f),h.polygon=u,p=!0;else{u=new J,h.rectangle=u;var m=_e(i,"LatLonBox",At.kml);if(c(m)){var _=ye(m,"west",At.kml),g=ye(m,"south",At.kml),v=ye(m,"east",At.kml),y=ye(m,"north",At.kml);c(_)&&(_=E.negativePiToPi(E.toRadians(_))),c(g)&&(g=E.clampToLatitudeRange(E.toRadians(g))),c(v)&&(v=E.negativePiToPi(E.toRadians(v))),c(y)&&(y=E.clampToLatitudeRange(E.toRadians(y))),u.coordinates=new A(_,g,v,y);var C=ye(m,"rotation",At.kml);c(C)&&(u.rotation=E.toRadians(C))}}var w=_e(i,"Icon",At.kml),S=Me(w,e,o,a,!0);if(c(S)){p&&console.log("KML - gx:LatLonQuad Icon does not support texture projection.");var b=ye(w,"x",At.gx),T=ye(w,"y",At.gx),P=ye(w,"w",At.gx),D=ye(w,"h",At.gx);(c(b)||c(T)||c(P)||c(D))&&console.log("KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),u.material=S,u.material.color=be(i,"color",At.kml),u.material.transparent=!0}else u.material=be(i,"color",At.kml);var M=Ce(i,"altitudeMode",At.kml);c(M)?"absolute"===M?u.height=ye(i,"altitude",At.kml):"clampToGround"!==M&&console.log("KML - Unknown altitudeMode: "+M):(M=Ce(i,"altitudeMode",At.gx),"relativeToSeaFloor"===M?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),u.height=ye(i,"altitude",At.kml)):"clampToSeaFloor"===M?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(M)&&console.log("KML - Unknown altitudeMode: "+M))}function rt(e,t,i,r,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,i,r,n,o,a),console.log("KML - Unsupported feature: "+i.localName)}function nt(e){if(!c(e)||0===e.length)return"";var t=e[0];return"&"===t&&e.splice(0,1),"?"!==t&&(e="?"+e),e}function ot(e,t){var i="";return(c(e)&&e.length>0||c(t)&&t.length>0)&&(i+=y(nt(e),nt(t),!1)),i}function at(e,t,i,n,o){function a(e){return e<-E.PI_OVER_TWO?-E.PI_OVER_TWO:e>E.PI_OVER_TWO?E.PI_OVER_TWO:e}function s(e){return e>E.PI?e-E.TWO_PI:e<-E.PI?e+E.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,d,h=p.WGS84;if(o=u(o,Rt),c(t)&&(Nt.x=.5*t.clientWidth,Nt.y=.5*t.clientHeight,l=e.pickEllipsoid(Nt,h,Lt)),c(l)?d=h.cartesianToCartographic(l,Ot):(d=A.center(o,Ot),l=h.cartographicToCartesian(d)),c(n)&&!E.equalsEpsilon(n,1,E.EPSILON9)){var f=o.width*n*.5,m=o.height*n*.5;o=new A(s(d.longitude-f),a(d.latitude-m),s(d.longitude+f),a(d.latitude+m))}i=i.replace("[bboxWest]",E.toDegrees(o.west).toString()),i=i.replace("[bboxSouth]",E.toDegrees(o.south).toString()),i=i.replace("[bboxEast]",E.toDegrees(o.east).toString()),i=i.replace("[bboxNorth]",E.toDegrees(o.north).toString());var _=E.toDegrees(d.longitude).toString(),g=E.toDegrees(d.latitude).toString();i=i.replace("[lookatLon]",_),i=i.replace("[lookatLat]",g),i=i.replace("[lookatTilt]",E.toDegrees(e.pitch).toString()),i=i.replace("[lookatHeading]",E.toDegrees(e.heading).toString()),i=i.replace("[lookatRange]",r.distance(e.positionWC,l)),i=i.replace("[lookatTerrainLon]",_),i=i.replace("[lookatTerrainLat]",g),i=i.replace("[lookatTerrainAlt]",d.height.toString()),h.cartesianToCartographic(e.positionWC,Ot),i=i.replace("[cameraLon]",E.toDegrees(Ot.longitude).toString()),i=i.replace("[cameraLat]",E.toDegrees(Ot.latitude).toString()),i=i.replace("[cameraAlt]",E.toDegrees(Ot.height).toString());var v=e.frustum,y=v.aspectRatio,C="",w="";if(c(y)){var S=E.toDegrees(v.fov);y>1?(C=S,w=S/y):(w=S,C=S*y)}i=i.replace("[horizFov]",C.toString()),i=i.replace("[vertFov]",w.toString())}else i=i.replace("[bboxWest]","-180"),i=i.replace("[bboxSouth]","-90"),i=i.replace("[bboxEast]","180"),i=i.replace("[bboxNorth]","90"),i=i.replace("[lookatLon]",""),i=i.replace("[lookatLat]",""),i=i.replace("[lookatRange]",""),i=i.replace("[lookatTilt]",""),i=i.replace("[lookatHeading]",""),i=i.replace("[lookatTerrainLon]",""),i=i.replace("[lookatTerrainLat]",""),i=i.replace("[lookatTerrainAlt]",""),i=i.replace("[cameraLon]",""),i=i.replace("[cameraLat]",""),i=i.replace("[cameraAlt]",""),i=i.replace("[horizFov]",""),i=i.replace("[vertFov]","");return c(t)?(i=i.replace("[horizPixels]",t.clientWidth),i=i.replace("[vertPixels]",t.clientHeight)):(i=i.replace("[horizPixels]",""),i=i.replace("[vertPixels]","")),i=i.replace("[terrainEnabled]","1"),i=i.replace("[clientVersion]","1"),i=i.replace("[kmlVersion]","2.2"),i=i.replace("[clientName]","Cesium"),i=i.replace("[language]","English")}function st(e,t,i,r,n,o,a,s,d){var h=Je(e,t,i,r,n,o,a,s,d),p=h.entity,f=_e(i,"Link",At.kml);if(c(f)||(f=_e(i,"Url",At.kml)),c(f)){var _=Ce(f,"href",At.kml);if(c(_)){var g=_;_=Se(_,void 0,o,a);var v;if(/^data:/.test(_))v=_,/\.kmz/i.test(o)||(g=m(g,o));else{g=_;var w=Ce(f,"viewRefreshMode",At.kml),S=u(Ce(f,"viewBoundScale",At.kml),1),E="onStop"===w?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=u(Ce(f,"viewFormat",At.kml),E),T=Ce(f,"httpQuery",At.kml),x=ot(b,T);v=at(e._camera,e._canvas,y(_,x,!1),S,e._lastCameraView.bbox)}var A={sourceUri:g,uriResolver:a,context:p.id},P=new j,D=dt(e,P,v,A).then(function(t){var i=e._entityCollection,r=P.values;i.suspendEvents();for(var n=0;n<r.length;n++){var o=r[n];c(o.parent)||(o.parent=p,pt(o)),i.add(o)}i.resumeEvents();var a=Ce(f,"refreshMode",At.kml),s=u(ye(f,"refreshInterval",At.kml),0);if("onInterval"===a&&s>0||"onExpire"===a||"onStop"===w){var d=_e(t,"NetworkLinkControl",At.kml),h=c(d),m=C.now(),g={id:l(),href:_,cookie:"",queryString:x,lastUpdated:m,updating:!1,entity:p,viewBoundScale:S,needsUpdate:!1,cameraUpdateTime:m},v=0;if(h&&(g.cookie=u(Ce(d,"cookie",At.kml),""),v=u(ye(d,"minRefreshPeriod",At.kml),0)),"onInterval"===a)h&&(s=Math.max(v,s)),g.refreshMode=It.INTERVAL,g.time=s;else if("onExpire"===a){var y;if(h&&(y=Ce(d,"expires",At.kml)),c(y))try{var E=C.fromIso8601(y),b=C.secondsDifference(E,m);b>0&&b<v&&C.addSeconds(m,v,E),g.refreshMode=It.EXPIRE,g.time=E}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date")}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(g.refreshMode=It.STOP,g.time=u(ye(f,"viewRefreshTime",At.kml),0)):console.log("A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");c(g.refreshMode)&&e._networkLinks.set(g.id,g)}else"onRegion"===w&&console.log("KML - Unsupported viewRefreshMode: onRegion")});s.push(D)}}}function lt(e,t,i,r,n,o,a,s,l){var u=Bt[t.localName];c(u)?u(e,i,t,r,n,o,a,s,l):rt(e,i,t,r,n,o,a,s,l)}function ut(e,t,i,r,n,o){t.removeAll();var a=[],s=i.documentElement,l="Document"===s.localName?s:_e(s,"Document",At.kml),u=Ce(l,"name",At.kml);!c(u)&&c(r)&&(u=g(r)),c(e._name)||(e._name=u);var d=new j(e);return F.all(Le(e,i,d,r,!1,n,o)).then(function(){var s=i.documentElement;if("kml"===s.localName)for(var l=s.childNodes,u=0;u<l.length;u++){var h=l[u];if(c(Bt[h.localName])){s=h;break}}return t.suspendEvents(),lt(e,s,void 0,t,d,r,n,a,o),t.resumeEvents(),F.all(a).then(function(){return i.documentElement})})}function ct(e,t,i,r){var n=F.defer();return k.createReader(new k.BlobReader(i),function(i){i.getEntries(function(o){for(var a,s,l=[],u={},d=0;d<o.length;d++){var h=o[d];if(!h.directory){var p=F.defer();l.push(p.promise),/\.kml$/i.test(h.filename)?c(a)&&/\//i.test(h.filename)?se(i,h,u,p):(c(a)&&se(i,a,u,s),a=h,s=p):se(i,h,u,p)}}c(a)&&ae(i,a,u,s),F.all(l).then(function(){return i.close(),c(u.kml)?(u.keys=Object.keys(u),ut(e,t,u.kml,r,u)):void n.reject(new P("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function dt(e,t,i,r){r=u(r,u.EMPTY_OBJECT);var n=r.sourceUri,o=r.uriResolver,a=r.context,s=i;return"string"==typeof i&&(s=w(ue(i,e._proxy)),n=u(n,i)),F(s).then(function(i){return i instanceof Blob?ne(i).then(function(r){return r?ct(e,t,i,n):oe(i).then(function(i){var r,s;try{r=gt.parseFromString(i,"application/xml")}catch(e){s=e.toString()}if(c(s)||r.body||"parsererror"===r.documentElement.tagName){var l=c(s)?s:r.documentElement.firstChild.nodeValue;throw l||(l=r.body.innerText),new P(l)}return ut(e,t,r,n,o,a)})}):ut(e,t,i,n,o,a)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),F.reject(t)})}function ht(t){t=u(t,{});var i=t.camera,n=t.canvas;this._changed=new f,this._error=new f,this._loading=new f,this._refresh=new f,this._unsupportedNode=new f,this._clock=void 0,this._entityCollection=new j(this),this._name=void 0,this._isLoading=!1,this._proxy=t.proxy,this._pinBuilder=new T,this._networkLinks=new e,this._entityCluster=new q,this._canvas=n,this._camera=i,this._lastCameraView={position:c(i)?r.clone(i.positionWC):void 0,direction:c(i)?r.clone(i.directionWC):void 0,up:c(i)?r.clone(i.upWC):void 0,bbox:c(i)?i.computeViewRectangle():A.clone(A.MAX_VALUE)}}function pt(e){var t=e.parent;if(c(t)){var i=t.availability;if(c(i)){var r=e.availability;c(r)?r.intersect(i):e.availability=i}}}function ft(e,t,i,r,n){return function(o){function a(e){w.remove(e);for(var t=e._children,i=t.length,r=0;r<i;++r)a(t[r])}if(r.contains(t.id)){var s=!1,l=_e(o,"NetworkLinkControl",At.kml),d=c(l),h=0;if(d){if(c(_e(l,"Update",At.kml)))return console.log("KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void r.remove(t.id);t.cookie=u(Ce(l,"cookie",At.kml),""),h=u(ye(l,"minRefreshPeriod",At.kml),0)}var p=C.now(),f=t.refreshMode;if(f===It.INTERVAL)c(l)&&(t.time=Math.max(h,t.time));else if(f===It.EXPIRE){var m;if(c(l)&&(m=Ce(l,"expires",At.kml)),c(m))try{var _=C.fromIso8601(m),g=C.secondsDifference(_,p);g>0&&g<h&&C.addSeconds(p,h,_),t.time=_}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date"),s=!0}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var y=t.entity,w=e._entityCollection,S=i.values;w.suspendEvents();for(var E=w.values.slice(),b=0;b<E.length;++b){var T=E[b];T.parent===y&&(T.parent=void 0,a(T))}for(w.resumeEvents(),w.suspendEvents(),b=0;b<S.length;b++){var x=S[b];c(x.parent)||(x.parent=y,pt(x)),w.add(x)}w.resumeEvents(),s?r.remove(t.id):t.lastUpdated=p;var A=w.computeAvailability(),P=A.start,D=A.stop,M=C.equals(P,v.MINIMUM_VALUE),I=C.equals(D,v.MAXIMUM_VALUE);if(!M||!I){var R=e._clock;R.startTime===P&&R.stopTime===D||(R.startTime=P,R.stopTime=D,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n)}}}function mt(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}if("undefined"==typeof DOMParser)return{};var _t={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=_(t),_t[t]}},gt=new DOMParser,vt=new L({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),yt=32,Ct=2414016,wt=1,St=16093e3,Et=.1,bt=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Tt=["http://www.google.com/kml/ext/2.2"],xt=["http://www.w3.org/2005/Atom"],At={kml:bt,gx:Tt,atom:xt,kmlgx:bt.concat(Tt)},Pt={},Dt=document.createElement("div"),Mt={Point:Ge,LineString:He,LinearRing:He,Polygon:We,Track:qe,MultiTrack:Ye,MultiGeometry:Xe,Model:Ze},It={INTERVAL:0,EXPIRE:1,STOP:2},Rt=new A,Ot=new n,Nt=new i,Lt=new r,Bt={Document:$e,Folder:et,Placemark:tt,NetworkLink:st,GroundOverlay:it,PhotoOverlay:rt,ScreenOverlay:rt,Tour:rt};ht.load=function(e,t){t=u(t,u.EMPTY_OBJECT);var i=new ht(t);return i.load(e,t)},d(ht.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),ht.prototype.load=function(e,t){t=u(t,{}),G.setLoading(this,!0);var i=this._name;this._name=void 0,this._clampToGround=u(t.clampToGround,!1);var r=this;return dt(this,this._entityCollection,e,t).then(function(){var e,t=r._entityCollection.computeAvailability(),n=t.start,s=t.stop,l=C.equals(n,v.MINIMUM_VALUE),u=C.equals(s,v.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=C.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),s=C.fromDate(c)),e=new H,e.startTime=n,e.stopTime=s,e.currentTime=C.clone(n),e.clockRange=o.LOOP_STOP,e.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(C.secondsDifference(s,n)/60,1),31556900))}var d=!1;return e!==r._clock&&(r._clock=e,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),G.setLoading(r,!1),r}).otherwise(function(e){return G.setLoading(r,!1),r._error.raiseEvent(r,e),console.log(e),F.reject(e)})};var Ft=new e;return ht.prototype.update=function(t){function i(e){for(var t=e._children,r=t.length,n=0;n<r;++n){var o=t[n];Ft.set(o.id,o),i(o)}}var n=this._networkLinks;if(0===n.length)return!0;var o=C.now(),a=this;Ft.removeAll();var s=!1,l=this._lastCameraView,u=this._camera;!c(u)||u.positionWC.equalsEpsilon(l.position,E.EPSILON7)&&u.directionWC.equalsEpsilon(l.direction,E.EPSILON7)&&u.upWC.equalsEpsilon(l.up,E.EPSILON7)||(l.position=r.clone(u.positionWC),l.direction=r.clone(u.directionWC),l.up=r.clone(u.upWC),l.bbox=u.computeViewRectangle(),s=!0);var d=new e,h=!1;return n.values.forEach(function(e){var t=e.entity;if(!Ft.contains(t.id)){if(!e.updating){var r=!1;if(e.refreshMode===It.INTERVAL?C.secondsDifference(o,e.lastUpdated)>e.time&&(r=!0):e.refreshMode===It.EXPIRE?C.greaterThan(o,e.time)&&(r=!0):e.refreshMode===It.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&C.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new j,u=y(e.href,ot(e.cookie,e.queryString),!1);u=at(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),dt(a,n,u,{context:t.id}).then(ft(a,e,n,d,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),h=!0}}d.set(e.id,e)}}),h&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0},ht}),define("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,i){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(i,n.WGS84);var r=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){r._definitionChanged.raiseEvent(r)})}r(d.prototype,{isConstant:{get:function(){return u.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var h=new e,p=new e,f=new a;return d.prototype.getValue=function(e,t){var r=this._velocityVectorProperty._getValue(e,p,h);if(i(r))return l.rotationMatrixFromPositionVelocity(h,r,this._ellipsoid,f),s.fromRotationMatrix(f,t)},d.prototype.equals=function(e){return this===e||e instanceof d&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),define("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),define("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.vertexArray=i.vertexArray,this.fragmentShaderSource=i.fragmentShaderSource,this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.outputTexture=i.outputTexture,this.preExecute=i.preExecute,this.postExecute=i.postExecute,this.persists=e(i.persists,!1),this.pass=t.COMPUTE,this.owner=i.owner}return i.prototype.execute=function(e){e.execute(this)},i}),define("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"}),define("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function f(e,t){return d.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function m(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=c.fromCache({viewport:new e(0,0,t,r)})),_}var _,g=new l({primitiveType:o.TRIANGLES}),v=new s({color:new t(0,0,0,0)});return h.prototype.execute=function(e){i(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,r=t.width,n=t.height,o=this._context,a=i(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=i(e.shaderProgram)?e.shaderProgram:f(o,e.fragmentShaderSource),l=p(o,t),u=m(r,n),c=e.uniformMap,d=v;d.framebuffer=l,d.renderState=u,d.execute(o);var h=g;h.vertexArray=a,h.renderState=u,h.shaderProgram=s,h.uniformMap=c,h.framebuffer=l,h.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return r(this)},h}),define("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),define("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),define("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),define("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var d=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),h=Math.floor(.5*o),p=0,f=0,m=0,_=-1,g=0;g<u;++g){if(-c<=p&&p<=c&&-h<=f&&f<=h){var v=4*((h-f)*n+p+c);d.red=t.byteToFloat(s[v]),d.green=t.byteToFloat(s[v+1]),d.blue=t.byteToFloat(s[v+2]),d.alpha=t.byteToFloat(s[v+3]);var y=a.getObjectByPickColor(d);if(r(y))return y}if(p===f||p<0&&-p===f||p>0&&p===1-f){var C=m;m=-_,_=C}p+=m,f+=_}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),define("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function a(e,t){for(var i=t.derivedKeywords,r=i.length,n=0;n<r;++n){var o=i[n]+t.keyword,s=e._shaders[o];a(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(t){var i=t.vertexShaderSource,o=t.fragmentShaderSource,a=t.attributeLocations;"string"==typeof i&&(i=new n({sources:[i]})),"string"==typeof o&&(o=new n({sources:[o]}));var s,l=i.createCombinedVertexShader(),u=o.createCombinedFragmentShader(),c=l+u+JSON.stringify(a);if(e(this._shaders[c]))s=this._shaders[c],delete this._shadersToRelease[c];else{var d=this._context,h=new r({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:i,vertexShaderText:l,fragmentShaderSource:o,fragmentShaderText:u,attributeLocations:a});s={cache:this,shaderProgram:h,keyword:c,derivedKeywords:[],count:0},h._cachedShader=s,this._shaders[c]=s,++this._numberOfShaders}return++s.count,s.shaderProgram},o.prototype.getDerivedShaderProgram=function(t,i){var r=t._cachedShader,n=i+r.keyword,o=this._shaders[n];if(e(o))return o.shaderProgram},o.prototype.createDerivedShaderProgram=function(e,t,i){var o=e._cachedShader,a=t+o.keyword,s=i.vertexShaderSource,l=i.fragmentShaderSource,u=i.attributeLocations;"string"==typeof s&&(s=new n({sources:[s]})),"string"==typeof l&&(l=new n({sources:[l]}));var c=s.createCombinedVertexShader(),d=l.createCombinedFragmentShader(),h=this._context,p=new r({gl:h._gl,logShaderCompilation:h.logShaderCompilation,debugShaders:h.debugShaders,vertexShaderSource:s,vertexShaderText:c,fragmentShaderSource:l,fragmentShaderText:d,attributeLocations:u}),f={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0};return o.derivedKeywords.push(t),p._cachedShader=f,this._shaders[a]=f,p},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];a(this,i),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),define("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/OrthographicFrustum","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=d.clone(d.IDENTITY),this._viewportTransformation=d.clone(d.IDENTITY),this._model=d.clone(d.IDENTITY),this._view=d.clone(d.IDENTITY),this._inverseView=d.clone(d.IDENTITY),this._projection=d.clone(d.IDENTITY),this._infiniteProjection=d.clone(d.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=c.clone(d.IDENTITY),this._view3DDirty=!0,this._view3D=new d,this._inverseView3DDirty=!0,this._inverseView3D=new d,this._inverseModelDirty=!0,this._inverseModel=new d,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new c,this._viewRotation=new c,this._inverseViewRotation=new c,this._viewRotation3D=new c,this._inverseViewRotation3D=new c,this._inverseProjectionDirty=!0,this._inverseProjection=new d,this._modelViewDirty=!0,this._modelView=new d,this._modelView3DDirty=!0,this._modelView3D=new d,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new d,this._inverseModelViewDirty=!0,this._inverseModelView=new d,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new d,this._viewProjectionDirty=!0,this._viewProjection=new d,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new d,this._modelViewProjectionDirty=!0,this._modelViewProjection=new d,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new d,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new d,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new d,this._normalDirty=!0,this._normal=new c,this._normal3DDirty=!0,this._normal3D=new c,this._inverseNormalDirty=!0,this._inverseNormal=new c,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new c,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new l,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._orthographicIn3D=!1,this._backgroundColor=new o,this._fogDensity=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0}function g(e,t){d.clone(t,e._view),d.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function v(e,t){d.clone(t,e._inverseView),d.getRotation(t,e._inverseViewRotation)}function y(e,t){d.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function C(e,t){d.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function w(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function S(e,t){a(p.computeIcrfToFixedMatrix(t.time,W))||(W=p.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);c.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=c.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),c.multiplyByVector(W,r,r),c.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);
var n=t.mapProjection,o=n.ellipsoid,s=o.cartesianToCartographic(e._sunPositionWC,q);n.project(s,e._sunPositionColumbusView)}function E(e){if(e._viewportDirty){var t=e._viewport;d.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),d.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function b(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===m.SCENE2D||e._mode===m.MORPHING||e._orthographicIn3D?d.clone(d.ZERO,e._inverseProjection):d.inverse(e._projection,e._inverseProjection))}function T(e){e._modelViewDirty&&(e._modelViewDirty=!1,d.multiplyTransformation(e._view,e._model,e._modelView))}function x(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,d.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function A(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,d.inverse(e.modelView,e._inverseModelView))}function P(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,d.inverse(e.modelView3D,e._inverseModelView3D))}function D(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,d.multiply(e._projection,e._view,e._viewProjection))}function M(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,d.inverse(e.viewProjection,e._inverseViewProjection))}function I(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,d.multiply(e._projection,e.modelView,e._modelViewProjection))}function R(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function O(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,d.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function N(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,d.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function L(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,d.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function B(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;d.getRotation(e.inverseModelView,t),c.transpose(t,t)}}function F(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;d.getRotation(e.inverseModelView3D,t),c.transpose(t,t)}}function k(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,d.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,d.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function z(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,d.multiplyByPoint(e.inverseModel,e._cameraPosition,j),l.fromCartesian(j,e._encodedCameraPositionMC))}function U(e,t,r,n,o,s,l,c){var h=Y;h.x=e.y,h.y=e.z,h.z=e.x;var f=X;f.x=r.y,f.y=r.z,f.z=r.x;var _=Z;_.x=n.y,_.y=n.z,_.z=n.x;var g=K;g.x=t.y,g.y=t.z,g.z=t.x,s===m.SCENE2D&&(h.z=.5*o);var v=l.unproject(h,Q);v.longitude=u.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=u.clamp(v.latitude,-u.PI_OVER_TWO,u.PI_OVER_TWO);var y=l.ellipsoid,C=y.cartographicToCartesian(v,J),w=p.eastNorthUpToFixedFrame(C,y,$);return d.multiplyByPointAsVector(w,f,f),d.multiplyByPointAsVector(w,_,_),d.multiplyByPointAsVector(w,g,g),a(c)||(c=new d),c[0]=f.x,c[1]=_.x,c[2]=-g.x,c[3]=0,c[4]=f.y,c[5]=_.y,c[6]=-g.y,c[7]=0,c[8]=f.z,c[9]=_.z,c[10]=-g.z,c[11]=0,c[12]=-i.dot(f,C),c[13]=-i.dot(_,C),c[14]=i.dot(g,C),c[15]=1,c}function G(e){e._view3DDirty&&(e._mode===m.SCENE3D?d.clone(e._view,e._view3D):U(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),d.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function H(e){e._inverseView3DDirty&&(d.inverseTransformation(e.view3D,e._inverseView3D),d.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}s(_.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return E(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return E(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){d.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,d.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,d.getRotation(this.inverseModel,e),c.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return G(this),this._view3D}},viewRotation:{get:function(){return G(this),this._viewRotation}},viewRotation3D:{get:function(){return G(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return H(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return H(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return b(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return T(this),this._modelView}},modelView3D:{get:function(){return x(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return R(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return A(this),this._inverseModelView}},inverseModelView3D:{get:function(){return P(this),this._inverseModelView3D}},viewProjection:{get:function(){return D(this),this._viewProjection}},inverseViewProjection:{get:function(){return M(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return I(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return O(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return N(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return L(this),this._modelViewInfiniteProjection}},normal:{get:function(){return B(this),this._normal}},normal3D:{get:function(){return F(this),this._normal3D}},inverseNormal:{get:function(){return k(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return 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}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}}});var W=new c,q=new n;_.prototype.updateCamera=function(e){g(this,e.viewMatrix),v(this,e.inverseViewMatrix),w(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==m.SCENE2D&&e.frustum instanceof f},_.prototype.updateFrustum=function(e){y(this,e.projectionMatrix),a(e.infiniteProjectionMatrix)&&C(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,a(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},_.prototype.updatePass=function(e){this._pass=e},_.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;this.updateCamera(i),e.mode===m.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),S(this,e),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=p.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*t.clientWidth;var r,n=i.frustum.fov,a=this._viewport;r=a.height>a.width?2*Math.tan(.5*n)/a.height:2*Math.tan(.5*n)/a.width,this._geometricToleranceOverMeter=r*e.maximumScreenSpaceError,o.clone(e.backgroundColor,this._backgroundColor)};var j=new i,Y=new i,X=new i,Z=new i,K=new i,Q=new n,J=new i,$=new d;return _}),define("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e,t){var i="WebGL Error:  ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function M(e,t,i,r){for(var n=D(e,r)+": "+t.name+"(",o=0;o<i.length;++o)0!==o&&(n+=", "),n+=i[o];return n+=");"}function I(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new p(M(e,t,i,r))}function R(e,t,i){return{get:function(){var r=e[t];return i(e,"get: "+t,r),e[t]},set:function(r){e[t]=r,i(e,"set: "+t,r)}}}function O(e,t){function i(i){return function(){var r=i.apply(e,arguments);return t(e,i,arguments),r}}if(!o(t))return e;var r={};for(var n in e){var a=e[n];a instanceof Function?r[n]=i(a):Object.defineProperty(r,n,R(e,n,t))}return r}function N(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function L(i,a){if("undefined"==typeof WebGLRenderingContext)throw new p("The browser does not support WebGL.  Visit http://get.webgl.org.");this._canvas=i,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});s.alpha=n(s.alpha,!1),s.stencil=n(s.stencil,!0);var l,u=!1,c=u&&"undefined"!=typeof WebGL2RenderingContext,d=!1,h=a.getWebGLStub;if(o(h))l=h(i,s);else if(c&&(l=i.getContext("webgl2",s)||i.getContext("experimental-webgl2",s)||void 0,o(l)&&(d=!0)),o(l)||(l=i.getContext("webgl",s)||i.getContext("experimental-webgl",s)||void 0),!o(l))throw new p("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._gl=l,this._webgl2=d,this._id=r(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new b(this);var m=l;this._stencilBits=m.getParameter(m.STENCIL_BITS),v._maximumCombinedTextureImageUnits=m.getParameter(m.MAX_COMBINED_TEXTURE_IMAGE_UNITS),v._maximumCubeMapSize=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),v._maximumFragmentUniformVectors=m.getParameter(m.MAX_FRAGMENT_UNIFORM_VECTORS),v._maximumTextureImageUnits=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),v._maximumRenderbufferSize=m.getParameter(m.MAX_RENDERBUFFER_SIZE),v._maximumTextureSize=m.getParameter(m.MAX_TEXTURE_SIZE),v._maximumVaryingVectors=m.getParameter(m.MAX_VARYING_VECTORS),v._maximumVertexAttributes=m.getParameter(m.MAX_VERTEX_ATTRIBS),v._maximumVertexTextureImageUnits=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v._maximumVertexUniformVectors=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS);var _=m.getParameter(m.ALIASED_LINE_WIDTH_RANGE);v._minimumAliasedLineWidth=_[0],v._maximumAliasedLineWidth=_[1];var g=m.getParameter(m.ALIASED_POINT_SIZE_RANGE);v._minimumAliasedPointSize=g[0],v._maximumAliasedPointSize=g[1];var y=m.getParameter(m.MAX_VIEWPORT_DIMS);v._maximumViewportWidth=y[0],v._maximumViewportHeight=y[1];var C=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT);v._highpFloatSupported=0!==C.precision;var S=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_INT);v._highpIntSupported=0!==S.rangeMax,this._antialias=m.getContextAttributes().antialias,this._standardDerivatives=!!N(m,["OES_standard_derivatives"]),this._elementIndexUint=!!N(m,["OES_element_index_uint"]),this._depthTexture=!!N(m,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!N(m,["OES_texture_float"]),this._fragDepth=!!N(m,["EXT_frag_depth"]),this._debugShaders=N(m,["WEBGL_debug_shaders"]),this._s3tc=!!N(m,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!N(m,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!N(m,["WEBGL_compressed_texture_etc1"]);var T=a.allowTextureFilterAnisotropic?N(m,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=T,v._maximumTextureFilterAnisotropy=o(T)?m.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var x,P,D,M,I,R,O,L,B,F;if(d){var k=this;x=function(){return k._gl.createVertexArray()},P=function(e){k._gl.bindVertexArray(e)},D=function(e){k._gl.deleteVertexArray(e)},M=function(e,t,i,r,n){m.drawElementsInstanced(e,t,i,r,n)},I=function(e,t,i,r){m.drawArraysInstanced(e,t,i,r)},R=function(e,t){m.vertexAttribDivisor(e,t)},O=function(e){m.drawBuffers(e)}}else L=N(m,["OES_vertex_array_object"]),o(L)&&(x=function(){return L.createVertexArrayOES()},P=function(e){L.bindVertexArrayOES(e)},D=function(e){L.deleteVertexArrayOES(e)}),B=N(m,["ANGLE_instanced_arrays"]),o(B)&&(M=function(e,t,i,r,n){B.drawElementsInstancedANGLE(e,t,i,r,n)},I=function(e,t,i,r){B.drawArraysInstancedANGLE(e,t,i,r)},R=function(e,t){B.vertexAttribDivisorANGLE(e,t)}),F=N(m,["WEBGL_draw_buffers"]),o(F)&&(O=function(e){F.drawBuffersWEBGL(e)});this.glCreateVertexArray=x,this.glBindVertexArray=P,this.glDeleteVertexArray=D,this.glDrawElementsInstanced=M,this.glDrawArraysInstanced=I,this.glVertexAttribDivisor=R,this.glDrawBuffers=O,this._vertexArrayObject=!!L,this._instancedArrays=!!B,this._drawBuffers=!!F,v._maximumDrawBuffers=this.drawBuffers?m.getParameter(f.MAX_DRAW_BUFFERS):1,v._maximumColorAttachments=this.drawBuffers?m.getParameter(f.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new t(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var V=new A,z=new w(this),U=E.fromCache();this._defaultPassState=z,this._defaultRenderState=U,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=V,this._currentRenderState=U,this._currentPassState=z,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;G<v._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},E.apply(m,U,z)}function B(e){}function F(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,E.partialApply(e._gl,n,t,o,i,r)}function k(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=H;if(o(t))t._bind(),B(e),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}function V(e,t,i,r){var o=n(i._renderState,e._defaultRenderState);k(e,t),F(e,o,r,!1);var a=i._shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex)}function z(e,t){var i=t._primitiveType,r=t._vertexArray,a=t._offset,s=t._count,l=t.instanceCount;e._us.model=n(t._modelMatrix,d.IDENTITY),t._shaderProgram._setUniforms(t._uniformMap,e._us,e.validateShaderProgram),r._bind();var u=r.indexBuffer;o(u)?(a*=u.bytesPerIndex,s=n(s,u.numberOfIndices),0===l?e._gl.drawElements(i,s,u.indexDatatype,a):e.glDrawElementsInstanced(i,s,u.indexDatatype,a,l)):(s=n(s,r.numberOfVertices),0===l?e._gl.drawArrays(i,a,s):e.glDrawArraysInstanced(i,a,s,l)),r._unBind()}function U(e,t,i){this._pickObjects=e,this.key=t,this.color=i}var G={};a(L.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},etc1:{get:function(){return this._etc1}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=O(this._originalGLContext,e?I:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var H;"undefined"!=typeof WebGLRenderingContext&&(H=[f.BACK]);var W=new g;L.prototype.clear=function(e,i){e=n(e,W),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,i,!0);var d=n(e.framebuffer,i.framebuffer);k(this,d),r.clear(a)},L.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var i=n(e._framebuffer,t.framebuffer);V(this,i,e,t),z(this,e)},L.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=H;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r<i;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},L.prototype.readPixels=function(e){var t=this._gl;e=e||{};var i=Math.max(e.x||0,0),r=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return k(this,a),t.readPixels(i,r,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var q={position:0,textureCoordinates:1};return L.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new u({attributes:{position:new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:h.TRIANGLES});e=P.fromGeometry({context:this,geometry:t,attributeLocations:q,bufferUsage:_.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},L.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT),new C({vertexArray:this.getViewportQuadVertexArray(),primitiveType:h.TRIANGLES,renderState:t.renderState,shaderProgram:T.fromCache({context:this,vertexShaderSource:m,fragmentShaderSource:e,attributeLocations:q}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},L.prototype.createPickFramebuffer=function(){return new S(this)},L.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(U.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),U.prototype.destroy=function(){delete this._pickObjects[this.key]},L.prototype.createPickId=function(e){++this._nextPickColor[0];var i=this._nextPickColor[0];if(0===i)throw new p("Out of unique Pick IDs.");return this._pickObjects[i]=e,new U(this._pickObjects,i,t.fromRgba(i))},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];o(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},L}),define("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,i,r,n){"use strict";function o(e,t,o){var a=[i(t.positiveX,o),i(t.negativeX,o),i(t.positiveY,o),i(t.negativeY,o),i(t.positiveZ,o),i(t.negativeZ,o)];return r.all(a,function(t){return new n({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return o}),define("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(i){function a(e){t(e.blob)&&(l._missingImageByteLength=e.blob.size);var n=r(e);if(i.disableCheckIfAllPixelsAreTransparent){for(var o=!0,a=e.width,s=i.pixelsToCheck,u=0,c=s.length;o&&u<c;++u){var d=s[u],h=4*d.x+d.y*a,p=n[h+3];p>0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}i=e(i,e.EMPTY_OBJECT),this._pixelsToCheck=i.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(i.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var i=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=r(e),a=e.width,s=0,l=i.length;s<l;++s)for(var u=i[s],c=4*u.x+u.y*a,d=0;d<4;++d){var h=c+d;if(o[h]!==n[h])return!1}return!0},a}),define("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var i,r=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();r>1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4,i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"<tr><td>"+n+"</td><td>"+i(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return r+="</table>"}this.description=i(t)},t}),define("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadCRN","../Core/loadImage","../Core/loadImageViaBlob","../Core/loadKTX","../Core/throttleRequestByServer"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}t(l.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),l.prototype.getTileCredits=i.throwInstantiationError,l.prototype.requestImage=i.throwInstantiationError,l.prototype.pickFeatures=i.throwInstantiationError;var u=/\.ktx$/i,c=/\.crn$/i;return l.loadImage=function(t,i){return u.test(i)?s(i,a):c.test(i)?s(i,r):e(t.tileDiscardPolicy)?s(i,o):s(i,n)},l}),define("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(C._tileWidth=a.rows,C._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)C._tilingScheme=new g({ellipsoid:i.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,C,C._errorEvent,s,void 0,void 0,void 0,c))}C._tilingScheme=new u({ellipsoid:i.ellipsoid})}if(C._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new _,d=n.fullExtent,f=l.unproject(new t(Math.max(d.xmin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(d.ymin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),v=l.unproject(new t(Math.min(d.xmax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(d.ymax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));C._rectangle=new p(f.longitude,f.latitude,v.longitude,v.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var w="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,C,C._errorEvent,w,void 0,void 0,void 0,c))}C._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else C._rectangle=C._tilingScheme.rectangle;o(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new y({missingImageUrl:E(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(C._credit=new r(n.copyrightText)),C._ready=!0,C._readyPromise.resolve(!0),m.handleSuccess(h)}function s(e){var t="An error occurred while accessing "+C._url+".";h=m.handleError(h,C,C._errorEvent,t,void 0,void 0,void 0,c),C._readyPromise.reject(new f(t))}function c(){var e={f:"json"};o(C._token)&&(e.token=C._token);var t=d(C._url,{parameters:e,proxy:C._proxy});v(t,a,s)}i=n(i,{}),this._url=i.url,this._token=i.token,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new u({ellipsoid:i.ellipsoid})),this._credit=void 0,this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var h,C=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function E(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(S.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),S.prototype.getTileCredits=function(e,t,i){},
S.prototype.requestImage=function(e,t,i){var r=E(this,e,t,i);return w.loadImage(this,r)},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,d,p,f=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof u)l=h.toDegrees(a),d=h.toDegrees(s),p="4326";else{var m=this._tilingScheme.projection.project(new i(a,s,0));l=m.x,d=m.y,p="3857"}var g=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return g+="&geometry="+l+","+d,g+="&mapExtent="+f.west+","+f.south+","+f.east+","+f.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+p,g+="&layers=visible",o(this._layers)&&(g+=":"+this._layers),o(this._token)&&(g+="&token="+this._token),o(this._proxy)&&(g=this._proxy.getURL(g)),c(g).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a<n.length;++a){var s=n[a],l=new C;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=i.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new _;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}r.push(l)}return r})}},S}),define("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)}),define("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(o){function a(e){var r=e.resourceSets[0].resources[0];E._tileWidth=r.imageWidth,E._tileHeight=r.imageHeight,E._maximumLevel=r.zoomMax-1,E._imageUrlSubdomains=r.imageUrlSubdomains,E._imageUrlTemplate=r.imageUrl.replace("{culture}",E._culture);var o=E._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}E._imageUrlTemplate=E._imageUrlTemplate.replace(/^http:/,o),n(E._tileDiscardPolicy)||(E._tileDiscardPolicy=new _({missingImageUrl:y(E,0,0,E._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=E._attributionList=r.imageryProviders;s||(s=E._attributionList=[]);for(var l=0,d=s.length;l<d;++l){var p=s[l];p.credit=new i(p.attribution);for(var f=p.coverageAreas,m=0,g=p.coverageAreas.length;m<g;++m){var v=f[m],C=v.bbox;v.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}E._ready=!0,E._readyPromise.resolve(!0),h.handleSuccess(w)}function g(e){var t="An error occurred while accessing "+S+".";w=h.handleError(w,E,E._errorEvent,t,void 0,void 0,void 0,C),E._readyPromise.reject(new d(t))}function C(){var e=l(S,{callbackParameterName:"jsonp",proxy:E._proxy});f(e,a,g)}o=r(o,{}),this._key=e.getKey(o.key),this._keyErrorCredit=e.getErrorCredit(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=r(o.mapStyle,m.AERIAL),this._culture=r(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new i("Bing Imagery",v._logoData,"http://www.bing.com"),this.defaultGamma=1,this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=f.defer();var w,S=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,E=this;C()}function y(e,t,i,r){var o=e._imageUrlTemplate,a=v.tileXYToQuadKey(t,i,r);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+i+r)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function C(e,t,i){++t;for(var r=[],o=0,a=e.length;o<a;++o){for(var s=e[o],l=s.coverageAreas,u=!1,d=0,h=s.coverageAreas.length;!u&&d<h;++d){var p=l[d];if(t>=p.zoomMin&&t<=p.zoomMax){var f=c.intersection(i,p.bbox,S);n(f)&&(u=!0)}}u&&r.push(s.credit)}return r}o(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var w=new c;v.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,w),o=C(this._attributionList,i,r);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},v.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},v.prototype.pickFeatures=function(e,t,i,r,n){},v._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;0!==(e&o)&&(a|=1),0!==(t&o)&&(a|=2),r+=a}return r},v.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;n>=0;--n){var o=1<<n,a=+e[r-n];0!==(1&a)&&(t|=o),0!==(2&a)&&(i|=o)}return{x:t,y:i,level:r}};var S=new c;return v}),define("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._perspectiveMatrix=new o,this._infinitePerspective=new o}function l(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,a=e.near,s=e.far;t===e._top&&i===e._bottom&&n===e._left&&r===e._right&&a===e._near&&s===e._far||(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=a,e._far=s,e._perspectiveMatrix=o.computePerspectiveOffCenter(n,r,i,t,a,s,e._perspectiveMatrix),e._infinitePerspective=o.computeInfinitePerspectiveOffCenter(n,r,i,t,a,e._infinitePerspective))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return l(this),this._infinitePerspective}}});var u=new e,c=new e,d=new e,h=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,f=this.left,m=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,m,v),e.add(r,v,v);var y=d;e.multiplyByScalar(n,_,y),e.add(r,y,y);var C=h;e.multiplyByScalar(g,f,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(C,o,C);var w=a[0];return i(w)||(w=a[0]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(g,p,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(o,C,C),w=a[1],i(w)||(w=a[1]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(o,l,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(g,C,C),w=a[2],i(w)||(w=a[2]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(o,s,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(C,g,C),w=a[3],i(w)||(w=a[3]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),w=a[4],i(w)||(w=a[4]=new t),w.x=n.x,w.y=n.y,w.z=n.z,w.w=-e.dot(n,v),e.negate(n,C),w=a[5],i(w)||(w=a[5]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=1/this.near,o=this.top*n,a=2*i*o/t;o=this.right*n;var s=2*i*o/e;return r.x=s,r.y=a,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),define("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,i,r){"use strict";function n(){this._offCenterFrustum=new r,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this.xOffset=0,this._xOffset=this.xOffset,this.yOffset=0,this._yOffset=this.yOffset}function o(e){var t=e._offCenterFrustum;e.fov===e._fov&&e.aspectRatio===e._aspectRatio&&e.near===e._near&&e.far===e._far&&e.xOffset===e._xOffset&&e.yOffset===e._yOffset||(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o(this),this._fovy}},sseDenominator:{get:function(){return o(this),this._sseDenominator}}}),n.prototype.computeCullingVolume=function(e,t,i){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},n.prototype.getPixelDimensions=function(e,t,i,r){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return!!e(t)&&(o(this),o(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))},n}),define("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t,i){var r,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return r=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*r/o,i*r/n)}return e instanceof u?(r=e.near,n=e.top,o=e.right,Math.max(t*r/o,i*r/n)):Math.max(t,i)}function h(e,t,i,r){if(n(r)&&i(.5)>r){var o=i(0),a=i(1),l=i(.5),u=l-o,c=l-a;return function(r){var n=i(r);if(r<=.5){var l=(n-o)/u;return s.lerp(e,-s.PI_OVER_TWO,l)}var d=(n-a)/c;return s.lerp(-s.PI_OVER_TWO,t,1-d)}}return function(i){return s.lerp(e,t,i)}}function p(e,i,r,o,a){var l=a,u=Math.max(r,o);if(!n(l)){var c=e.position,h=i,p=e.up,f=e.right,m=e.frustum,_=t.subtract(c,h,E),g=t.magnitude(t.multiplyByScalar(p,t.dot(_,p),b)),v=t.magnitude(t.multiplyByScalar(f,t.dot(_,f),b));l=Math.min(.2*d(m,g,v),1e9)}if(u<l){var y=8,C=1e6,w=-Math.pow((l-r)*C,1/y),S=Math.pow((l-o)*C,1/y);return function(e){var t=e*(S-w)+w;return-Math.pow(t,y)/C+l}}return function(e){return s.lerp(r,o,e)}}function f(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:t<e-Math.PI&&(e-=s.TWO_PI),e}function m(i,r,n,o,a,l,u){function c(t){var i=t.time/r;d.setView({orientation:{heading:s.lerp(_,o,i),pitch:s.lerp(m,a,i),roll:s.lerp(g,l,i)}}),e.lerp(h,n,i,d.position),d.position.z=v(i)}var d=i.camera,h=t.clone(d.position,T),m=d.pitch,_=f(d.heading,o),g=f(d.roll,l),v=p(d,n,h.z,n.z,u);return c}function _(e,t){e.longitude<t.longitude?e.longitude+=s.TWO_PI:t.longitude+=s.TWO_PI}function g(e,t){var i=e.longitude-t.longitude;i<-s.PI?e.longitude+=s.TWO_PI:i>s.PI&&(t.longitude+=s.TWO_PI)}function v(e,r,o,a,l,u,c,d,m,v){function y(){var e=E.longitude,i=D.longitude,n=E.latitude,o=D.latitude;return function(l){var c=l.time/r,d=t.fromRadians(s.lerp(e,i,c),s.lerp(n,o,c),V(c));C.setView({destination:d,orientation:{heading:s.lerp(T,a,c),pitch:z(c),roll:s.lerp(P,u,c)}})}}var C=e.camera,w=e.mapProjection,S=w.ellipsoid,E=i.clone(C.positionCartographic,x),b=C.pitch,T=f(C.heading,a),P=f(C.roll,u),D=S.cartesianToCartographic(o,A);E.longitude=s.zeroToTwoPi(E.longitude),D.longitude=s.zeroToTwoPi(D.longitude);var M=!1;if(n(d)){var I=s.zeroToTwoPi(d),R=Math.min(E.longitude,D.longitude),O=Math.max(E.longitude,D.longitude),N=I>=R&&I<=O;if(n(m)){var L=Math.abs(E.longitude-D.longitude),B=s.TWO_PI-L,F=N?L:B,k=N?B:L;F<k*m&&!N&&(M=!0)}else N||(M=!0)}M?_(E,D):g(E,D);var V=p(C,o,E.height,D.height,c),z=h(b,l,V,v);return y()}function y(i,r,n,o,a,l,u){function c(t){var i=t.time/r;d.setView({orientation:{heading:s.lerp(m,o,i)}}),e.lerp(h,n,i,d.position);var a=g(i),l=d.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var d=i.camera,h=t.clone(d.position,T),m=f(d.heading,o),_=d.frustum.right-d.frustum.left,g=p(d,n,_,n.z,u);return c}function C(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function w(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var S={},E=new t,b=new t,T=new t,x=new i,A=new i,P=new i,D=new t;return S.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return C();var d=r(o.convert,!0),h=i.mapProjection,p=h.ellipsoid,f=o.maximumHeight,_=o.flyOverLongitude,g=o.flyOverLongitudeWeight,S=o.pitchAdjustHeight,E=o.easingFunction;d&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,P),l=h.project(P,D));var b=i.camera,T=o.endTransform;n(T)&&b._setTransform(T);var x=o.duration;n(x)||(x=Math.ceil(t.distance(b.position,l)/1e6)+2,x=Math.min(x,3));var A=r(o.heading,0),M=r(o.pitch,-s.PI_OVER_TWO),I=r(o.roll,0),R=i.screenSpaceCameraController;R.enableInputs=!1;var O=w(R,o.complete),N=w(R,o.cancel),L=b.frustum,B=i.mode===c.SCENE2D;if(B=B&&e.equalsEpsilon(b.position,l,s.EPSILON6),B=B&&s.equalsEpsilon(Math.max(L.right-L.left,L.top-L.bottom),l.z,s.EPSILON6),B=B||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,b.position,s.EPSILON10),B=B&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(b.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(M),s.negativePiToPi(b.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(I),s.negativePiToPi(b.roll),s.EPSILON10))return C(O,N);var F=new Array(4);if(F[c.SCENE2D]=y,F[c.SCENE3D]=v,F[c.COLUMBUS_VIEW]=m,x<=0){var k=function(){var e=F[u](i,1,l,A,M,I,f,_,g,S);e({time:1}),"function"==typeof O&&O()};return C(k,N)}var V=F[u](i,x,l,A,M,I,f,_,g,S);if(!n(E)){var z=b.positionCartographic.height,U=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;E=z>U&&z>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:x,easingFunction:E,startObject:{time:0},stopObject:{time:x},update:V,complete:O,cancel:N}},S}),define("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),define("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/HeadingPitchRoll","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./OrthographicFrustum","./OrthographicOffCenterFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){this._scene=e,this._transform=y.clone(y.IDENTITY),this._invTransform=y.clone(y.IDENTITY),this._actualTransform=y.clone(y.IDENTITY),this._actualInvTransform=y.clone(y.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new P,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=g.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new h,this._moveEnd=new h,this._changed=new h,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new y,this._invViewMatrix=new y,I(this),this._mode=D.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,g.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,Z(this,M.DEFAULT_VIEW_RECTANGLE,this.position,!0);var r=i.magnitude(this.position);r+=r*M.DEFAULT_VIEW_FACTOR,i.normalize(this.position,this.position),i.multiplyByScalar(this.position,r,this.position)}function I(e){y.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),y.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),y.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function R(e){E.basisTo2D(e._projection,e._transform,e._actualTransform)}function O(e){var t=e._projection,n=t.ellipsoid,o=y.getColumn(e._transform,3,me),a=n.cartesianToCartographic(o,he),s=t.project(a,pe),l=_e;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,ye),c=r.add(y.getColumn(e._transform,0,fe),o,fe);n.cartesianToCartographic(c,a),t.project(a,s);var d=ge;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,i.subtract(d,l,d),d.x=0;var h=ve;if(i.magnitudeSquared(d)>g.EPSILON10)i.cross(u,d,h);else{var p=r.add(y.getColumn(e._transform,1,fe),o,fe);n.cartesianToCartographic(p,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,i.subtract(h,l,h),h.x=0,i.magnitudeSquared(h)<g.EPSILON10&&(r.clone(r.UNIT_Y,d),r.clone(r.UNIT_Z,h))}i.cross(h,u,d),i.normalize(d,d),i.cross(u,d,h),i.normalize(h,h),y.setColumn(e._actualTransform,0,d,e._actualTransform),y.setColumn(e._actualTransform,1,h,e._actualTransform),y.setColumn(e._actualTransform,2,u,e._actualTransform),y.setColumn(e._actualTransform,3,l,e._actualTransform)}function N(e){var t=e._mode,r=!1,n=0;t===D.SCENE2D&&(n=e.frustum.right-e.frustum.left,r=n!==e._positionCartographic.height);var o=e._position,a=!i.equals(o,e.position)||r;a&&(o=i.clone(e.position,e._position));var s=e._direction,l=!i.equals(s,e.direction);l&&(i.normalize(e.direction,e.direction),s=i.clone(e.direction,e._direction));var u=e._up,c=!i.equals(u,e.up);c&&(i.normalize(e.up,e.up),u=i.clone(e.up,e._up));var d=e._right,h=!i.equals(d,e.right);h&&(i.normalize(e.right,e.right),d=i.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(y.inverseTransformation(e._transform,e._invTransform),e._mode===D.COLUMBUS_VIEW||e._mode===D.SCENE2D?y.equals(y.IDENTITY,e._transform)?y.clone(M.TRANSFORM_2D,e._actualTransform):e._mode===D.COLUMBUS_VIEW?R(e):O(e):y.clone(e._transform,e._actualTransform),y.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var f=e._actualTransform;if(a||p)if(e._positionWC=y.multiplyByPoint(f,o,e._positionWC),t===D.SCENE3D||t===D.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var m=Ce;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===D.SCENE2D&&(m.z=n),e._projection.unproject(m,e._positionCartographic)}if(l||c||h){var _=i.dot(s,i.cross(u,d,Ce));if(Math.abs(1-_)>g.EPSILON2){var v=1/i.magnitudeSquared(u),C=i.dot(u,s)*v,w=i.multiplyByScalar(s,C,Ce);u=i.normalize(i.subtract(u,w,e._up),e._up),i.clone(u,e.up),d=i.cross(s,u,e._right),i.clone(d,e.right)}}(l||p)&&(e._directionWC=y.multiplyByPointAsVector(f,s,e._directionWC)),(c||p)&&(e._upWC=y.multiplyByPointAsVector(f,u,e._upWC)),(h||p)&&(e._rightWC=y.multiplyByPointAsVector(f,d,e._rightWC)),(a||l||c||h||p)&&I(e)}function L(e,t){var i;return i=g.equalsEpsilon(Math.abs(e.z),1,g.EPSILON3)?Math.atan2(t.y,t.x)-g.PI_OVER_TWO:Math.atan2(e.y,e.x)-g.PI_OVER_TWO,g.TWO_PI-g.zeroToTwoPi(i)}function B(e){return g.PI_OVER_TWO-g.acosClamped(e.z)}function F(e,t,i){var r=0;return g.equalsEpsilon(Math.abs(e.z),1,g.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=g.zeroToTwoPi(r+g.TWO_PI)),r}function k(e,t,r){var n=y.clone(e.transform,Ie),o=E.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Re);e._setTransform(o),i.clone(i.ZERO,e.position),r.heading=r.heading-g.PI_OVER_TWO;var a=C.fromHeadingPitchRoll(r,Oe),s=v.fromQuaternion(a,Ne);v.getColumn(s,0,e.direction),v.getColumn(s,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function V(e,t,r,n){var o=y.clone(e.transform,Ie);if(e._setTransform(y.IDENTITY),!i.equals(t,e.positionWC)){if(n){var a=e._projection,s=a.ellipsoid.cartesianToCartographic(t,Le);t=a.project(s,Me)}i.clone(t,e.position)}r.heading=r.heading-g.PI_OVER_TWO;var l=C.fromHeadingPitchRoll(r,Oe),u=v.fromQuaternion(l,Ne);v.getColumn(u,0,e.direction),v.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function z(e,r,n,o){var a=y.clone(e.transform,Ie);if(e._setTransform(y.IDENTITY),!i.equals(r,e.positionWC)){if(o){var s=e._projection,l=s.ellipsoid.cartesianToCartographic(r,Le);r=s.project(l,Me)}t.clone(r,e.position);var u=.5*-r.z,c=-u,d=e.frustum;if(c>u){var h=d.top/d.right;d.right=c,d.left=u,d.top=d.right*h,d.bottom=-d.top}}if(e._scene.mapMode2D===T.ROTATE){n.heading=n.heading-g.PI_OVER_TWO,n.pitch=-g.PI_OVER_TWO,n.roll=0;var p=C.fromHeadingPitchRoll(n,Oe),f=v.fromQuaternion(p,Ne);v.getColumn(f,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(a)}function U(e,t,r,n){var o=i.clone(r.direction,Be),a=i.clone(r.up,Fe);if(e._scene.mode===D.SCENE3D){var s=e._projection.ellipsoid,l=E.eastNorthUpToFixedFrame(t,s,we),u=y.inverseTransformation(l,Se);y.multiplyByPointAsVector(u,o,o),y.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,ke);return n.heading=L(o,a),n.pitch=B(o),n.roll=F(o,a,c),n}function G(e,t){var i,r,n=e._scene.mapMode2D===T.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(r=o,i=-r):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function H(e,t){var r=e.position,n=i.normalize(r,Ye);if(a(e.constrainedAxis)){var o=i.equalsEpsilon(n,e.constrainedAxis,g.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,Ke),g.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,Xe),u=i.dot(n,l),c=g.acosClamped(u);t>0&&t>c&&(t=c-g.EPSILON4),u=i.dot(n,i.negate(l,Ke)),c=g.acosClamped(u),t<0&&-t>c&&(t=-c+g.EPSILON4);var d=i.cross(l,n,Ze);e.rotate(d,t)}}else e.rotate(e.right,t)}function W(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function q(e,t){var i=e.frustum;t*=.5;var r=i.right-t,n=i.left+t,o=e._maxCoord.x;e._scene.mapMode2D===T.ROTATE&&(o*=e.maximumZoomFactor),r>o&&(r=o,n=-o),r<=n&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function j(e,t){e.move(e.direction,t)}function Y(e,t,r){t=g.clamp(t,-g.PI_OVER_TWO,g.PI_OVER_TWO),e=g.zeroToTwoPi(e)-g.PI_OVER_TWO;var n=C.fromAxisAngle(i.UNIT_Y,-t,$e),o=C.fromAxisAngle(i.UNIT_Z,-e,et),a=C.multiply(o,n,o),s=v.fromQuaternion(a,tt),l=i.clone(i.UNIT_X,Je);return v.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function X(e,t,r,n){var o=Math.abs(i.dot(t,r));return o/n-i.dot(e,r)}function Z(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:pt,l=t.north,u=t.south,c=t.east,h=t.west;h>c&&(c+=g.TWO_PI);var p,f=.5*(h+c);if(u<-g.PI_OVER_TWO+g.RADIANS_PER_DEGREE&&l>g.PI_OVER_TWO-g.RADIANS_PER_DEGREE)p=0;else{var m=rt;m.longitude=f,m.latitude=l,m.height=0;var _=nt;_.longitude=f,_.latitude=u,_.height=0;var v=it;a(v)&&v.ellipsoid===o||(it=v=new d(void 0,void 0,o)),v.setEndPoints(m,_),p=v.interpolateUsingFraction(.5,rt).latitude}var y=rt;y.longitude=f,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,dt),w=rt;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,ot);w.longitude=h;var E=o.cartographicToCartesian(w,st);w.longitude=f;var b=o.cartographicToCartesian(w,ut);w.latitude=u;var T=o.cartographicToCartesian(w,ct);w.longitude=c;var A=o.cartographicToCartesian(w,lt);w.longitude=h;var P=o.cartographicToCartesian(w,at);i.subtract(E,C,E),i.subtract(A,C,A),i.subtract(S,C,S),i.subtract(P,C,P),i.subtract(b,C,b),i.subtract(T,C,T);var D=o.geodeticSurfaceNormal(C,s.direction);i.negate(D,D);var M=i.cross(D,i.UNIT_Z,s.right);i.normalize(M,M);var I,R=i.cross(M,D,s.up);if(e.frustum instanceof x){var O,N,L=Math.max(i.distance(S,E),i.distance(A,P)),B=Math.max(i.distance(S,A),i.distance(E,P)),F=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,k=B*F;L>k?(O=L,N=O/F):(N=B,O=k),I=Math.max(O,N)}else{var V=Math.tan(.5*e.frustum.fovy),z=e.frustum.aspectRatio*V;if(I=Math.max(X(D,R,E,V),X(D,R,A,V),X(D,R,S,V),X(D,R,P,V),X(D,R,b,V),X(D,R,T,V),X(D,M,E,z),X(D,M,A,z),X(D,M,S,z),X(D,M,P,z),X(D,M,b,z),X(D,M,T,z)),u<0&&l>0){var U=rt;U.longitude=h,U.latitude=0,U.height=0;var G=o.cartographicToCartesian(U,ht);i.subtract(G,C,G),I=Math.max(I,X(D,R,G,V),X(D,M,G,z)),U.longitude=c,G=o.cartographicToCartesian(U,ht),i.subtract(G,C,G),I=Math.max(I,X(D,R,G,V),X(D,M,G,z))}}return i.add(C,i.multiplyByScalar(D,-I,ht),r)}function K(e,t,i){var r=e._projection;t.west>t.east&&(t=S.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,s=ft;s.longitude=t.east,s.latitude=t.north;var l=r.project(s,mt);y.multiplyByPoint(n,l,l),y.multiplyByPoint(o,l,l),s.longitude=t.west,s.latitude=t.south;var u=r.project(s,_t);if(y.multiplyByPoint(n,u,u),y.multiplyByPoint(o,u,u),i.x=.5*(l.x-u.x)+u.x,i.y=.5*(l.y-u.y)+u.y,a(e.frustum.fovy)){var c=Math.tan(.5*e.frustum.fovy),d=e.frustum.aspectRatio*c;i.z=.5*Math.max((l.x-u.x)/d,(l.y-u.y)/c)}else{var h=l.x-u.x,p=l.y-u.y;i.z=Math.max(h,p)}return i}function Q(e,t,i){var r=e._projection;t.west>t.east&&(t=S.MAX_VALUE);var n=gt;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,vt);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,yt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),d=e.frustum.right/e.frustum.top,h=c*d;return u>h?(a=u,s=a/d):(s=c,a=h),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function J(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,Ct),a=_.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return w.getPoint(n,s,r)}}function $(e,t,i,r){var n=e.getPickRay(t,wt),o=n.origin;o.z=0;var a=i.unproject(o);if(!(a.latitude<-g.PI_OVER_TWO||a.latitude>g.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}function ee(e,t,r,n){var o=e.getPickRay(t,St),a=-o.origin.x/o.direction.x;w.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-g.PI_OVER_TWO||s.latitude>g.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function te(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,d=2/a*(a-t.y)-1,h=e.positionWC;i.clone(h,r.origin);var p=i.multiplyByScalar(e.directionWC,u,Et);
i.add(h,p,p);var f=i.multiplyByScalar(e.rightWC,c*u*l,bt),m=i.multiplyByScalar(e.upWC,d*u*s,Tt),_=i.add(p,f,r.direction);return i.add(_,m,_),i.subtract(_,h,_),i.normalize(_,_),r}function ie(e,t,r){var n=e._scene.canvas,o=n.clientWidth,s=n.clientHeight,l=e.frustum;a(l._offCenterFrustum)&&(l=l._offCenterFrustum);var u=2/o*t.x-1;u*=.5*(l.right-l.left);var c=2/s*(s-t.y)-1;c*=.5*(l.top-l.bottom);var d=r.origin;return i.clone(e.position,d),i.multiplyByScalar(e.right,u,xt),i.add(xt,d,d),i.multiplyByScalar(e.up,c,xt),i.add(xt,d,d),i.clone(e.directionWC,r.direction),e._mode===D.COLUMBUS_VIEW&&i.fromElements(r.origin.z,r.origin.x,r.origin.y,r.origin),r}function re(e,t,r,n,o,a){function s(r){var n=i.lerp(t,l,r.time,new i);e.worldToCameraCoordinatesPoint(n,e.position)}var l=i.clone(t);return r.y>n?l.y-=r.y-n:r.y<-n&&(l.y+=-n-r.y),r.z>o?l.z-=r.z-o:r.z<-o&&(l.z+=-o-r.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function ne(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,Mt),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,It),It);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,Rt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,Ot)),d=u*c,h=l*c,p=e._maxCoord.x,f=e._maxCoord.y,m=Math.max(d-p,p),_=Math.max(h-f,f);if(r.z<-m||r.z>m||r.y<-_||r.y>_){var g=s.y<-m||s.y>m,v=s.z<-_||s.z>_;if(g||v)return re(e,r,s,m,_,t)}}function oe(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function ae(e,t){var i=e.frustum;a(i._offCenterFrustum)&&(i=i._offCenterFrustum);var r,n,o=i.right/i.top,s=t*o;return t>s?(r=t,n=r/o):(n=t,r=s),1.5*Math.max(r,n)}function se(e,t,i){a(i)||(i=p.clone(M.DEFAULT_OFFSET));var r=i.range;if(!a(r)||0===r){var n=t.radius;0===n?i.range=Bt:e.frustum instanceof x||e._mode===D.SCENE2D?i.range=ae(e,n):i.range=oe(e,n)}return i}function le(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,qt),l=i.magnitude(s),u=i.normalize(s,jt);i.equalsEpsilon(u,i.UNIT_Z,g.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,Yt),Yt),n=i.normalize(i.cross(u,r,Xt),Xt));var c=Math.sqrt(i.magnitudeSquared(s)-1),d=i.multiplyByScalar(u,1/l,qt),h=c/l,p=i.multiplyByScalar(r,h,jt),f=i.multiplyByScalar(n,h,Yt),m=i.add(d,f,Zt[0]);i.subtract(m,p,m),i.multiplyComponents(o,m,m);var _=i.subtract(d,f,Zt[1]);i.subtract(_,p,_),i.multiplyComponents(o,_,_);var v=i.subtract(d,f,Zt[2]);i.add(v,p,v),i.multiplyComponents(o,v,v);var y=i.add(d,f,Zt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Zt}function ue(e,t,i,r,n,o){Kt.x=e,Kt.y=t;var s=r.pickEllipsoid(Kt,n,Qt);return a(s)?(Jt[i]=n.cartesianToCartographic(s,Jt[i]),1):(Jt[i]=n.cartesianToCartographic(o[i],Jt[i]),0)}M.TRANSFORM_2D=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),M.TRANSFORM_2D_INVERSE=y.inverseTransformation(M.TRANSFORM_2D,new y),M.DEFAULT_VIEW_RECTANGLE=S.fromDegrees(-95,-20,-70,90),M.DEFAULT_VIEW_FACTOR=.5,M.DEFAULT_OFFSET=new p(0,-g.PI_OVER_FOUR,0),M.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===D.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=i.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,d=o.x+l.left,h=o.x+l.right,p=n.y+s.bottom,f=n.y+s.top,m=o.y+l.bottom,_=o.y+l.top,v=Math.max(u,d),y=Math.min(c,h),C=Math.max(p,m),w=Math.min(f,_);if(v>=y||C>=f)r=1;else{var S=l;u<d&&c>h&&p<m&&f>_&&(S=s),r=1-(y-v)*(w-C)/((S.right-S.left)*(S.top-S.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=i.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=i.clone(e.positionWC,e._changedPosition),void(e._changedDirection=i.clone(e.directionWC,e._changedDirection));var E,b=g.acosClamped(i.dot(e.directionWC,e._changedDirection));E=a(e.frustum.fovy)?b/(.5*e.frustum.fovy):b;var T=i.distance(e.positionWC,e._changedPosition),x=T/e.positionCartographic.height;(E>t||x>t)&&(e._changed.raiseEvent(Math.max(E,x)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var ce=new y,de=new n;M.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,r=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&r){var s=this._mode,l=e.globe;if(a(l)&&s!==D.SCENE2D&&s!==D.MORPHING){var u,c,d=l.ellipsoid,h=e.mapProjection;y.equals(this.transform,y.IDENTITY)||(u=y.clone(this.transform,ce),c=i.magnitude(this.position),this._setTransform(y.IDENTITY));var p=de;s===D.SCENE3D?d.cartesianToCartographic(this.position,p):h.unproject(this.position,p);var f=!1;if(p.height<n){var m=l.getHeight(p);a(m)&&(m+=o,p.height<m&&(p.height=m,s===D.SCENE3D?d.cartographicToCartesian(p,this.position):h.project(p,this.position),f=!0))}a(u)&&(this._setTransform(u),f&&(i.normalize(this.position,this.position),i.negate(this.position,this.direction),i.multiplyByScalar(this.position,Math.max(c,o),this.position),i.normalize(this.direction,this.direction),i.cross(this.direction,this.up,this.right),i.cross(this.right,this.direction,this.up)))}}};var he=new n,pe=new i,fe=new i,me=new r,_e=new r,ge=new r,ve=new r,ye=new r,Ce=new i,we=new y,Se=new y;s(M.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return N(this),this._invTransform}},viewMatrix:{get:function(){return N(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return N(this),this._invViewMatrix}},positionCartographic:{get:function(){return N(this),this._positionCartographic}},positionWC:{get:function(){return N(this),this._positionWC}},directionWC:{get:function(){return N(this),this._directionWC}},upWC:{get:function(){return N(this),this._upWC}},rightWC:{get:function(){return N(this),this._rightWC}},heading:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,we),i=E.eastNorthUpToFixedFrame(this.positionWC,e,Se);this._setTransform(i);var r=L(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,we),i=E.eastNorthUpToFixedFrame(this.positionWC,e,Se);this._setTransform(i);var r=B(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,we),i=E.eastNorthUpToFixedFrame(this.positionWC,e,Se);this._setTransform(i);var r=F(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),M.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==D.MORPHING,t=this._mode===D.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=2,n=i.top/i.right;i.right=this._maxCoord.x*r,i.left=-i.right,i.top=n*i.right,i.bottom=-i.top}this._mode===D.SCENE2D&&G(this,this.position);var o=this._scene.globe,s=!a(o)||o._surface.tileProvider.ready&&0===o._surface._tileLoadQueueHigh.length&&0===o._surface._tileLoadQueueMedium.length&&0===o._surface._tileLoadQueueLow.length&&0===o._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!s),this._adjustHeightForTerrain()};var Ee=new i,be=new i,Te=new i;M.prototype._setTransform=function(e){var t=i.clone(this.positionWC,Ee),r=i.clone(this.upWC,be),n=i.clone(this.directionWC,Te);y.clone(e,this._transform),this._transformChanged=!0,N(this);var o=this._actualInvTransform;y.multiplyByPoint(o,t,this.position),y.multiplyByPointAsVector(o,n,this.direction),y.multiplyByPointAsVector(o,r,this.up),i.cross(this.direction,this.up,this.right),N(this)};var xe=new t,Ae=new w,Pe=new i,De=new i;M.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof x&&(e||!(this._positionCartographic.height<15e4))){if(!y.equals(y.IDENTITY,this.transform))return void(this.frustum.width=i.magnitude(this.position));var t,r,n=this._scene,o=n._globe;if(a(o)){var s=xe;s.x=n.drawingBufferWidth/2,s.y=n.drawingBufferHeight/2;var l=this.getPickRay(s,Ae);if(t=o.pick(l,n,Pe),n.pickPositionSupported&&(r=n.pickPositionWorldCoordinates(s,De)),a(t)&&a(r)){var u=a(r)?i.distance(r,this.positionWC):Number.POSITIVE_INFINITY,c=a(t)?i.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(u,c)}else a(r)?this.frustum.width=i.distance(r,this.positionWC):a(t)&&(this.frustum.width=i.distance(t,this.positionWC))}if(!a(o)||!a(t)&&!a(r)){var d=Math.max(this.positionCartographic.height,0);this.frustum.width=d}}};var Me=new i,Ie=new y,Re=new y,Oe=new C,Ne=new v,Le=new n,Be=new i,Fe=new i,ke=new i,Ve={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},ze=new f;M.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),r=this._mode;if(r!==D.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,i.clone(this.positionWC,Me));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,Me),n=!1),a(t.direction)&&(t=U(this,s,t,Ve.orientation)),ze.heading=o(t.heading,0),ze.pitch=o(t.pitch,-g.PI_OVER_TWO),ze.roll=o(t.roll,0),this._suspendTerrainAdjustment=!0,r===D.SCENE3D?k(this,s,ze):r===D.SCENE2D?z(this,s,ze,n):V(this,s,ze,n)}};var Ue=new i;M.prototype.flyHome=function(e){var t=this._mode;if(t===D.MORPHING&&this._scene.completeMorph(),t===D.SCENE2D)this.flyTo({destination:S.MAX_VALUE,duration:e,endTransform:y.IDENTITY});else if(t===D.SCENE3D){var r=this.getRectangleCameraCoordinates(M.DEFAULT_VIEW_RECTANGLE),n=i.magnitude(r);n+=n*M.DEFAULT_VIEW_FACTOR,i.normalize(r,r),i.multiplyByScalar(r,n,r),this.flyTo({destination:r,duration:e,endTransform:y.IDENTITY})}else if(t===D.COLUMBUS_VIEW){var o=this._projection.ellipsoid.maximumRadius,a=new i(0,-1,1);a=i.multiplyByScalar(i.normalize(a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(i.normalize(a,Ue).z),roll:0},endTransform:y.IDENTITY,convert:!1})}},M.prototype.worldToCameraCoordinates=function(e,t){return a(t)||(t=new r),N(this),y.multiplyByVector(this._actualInvTransform,e,t)},M.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new i),N(this),y.multiplyByPoint(this._actualInvTransform,e,t)},M.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new i),N(this),y.multiplyByPointAsVector(this._actualInvTransform,e,t)},M.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new r),N(this),y.multiplyByVector(this._actualTransform,e,t)},M.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new i),N(this),y.multiplyByPoint(this._actualTransform,e,t)},M.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new i),N(this),y.multiplyByPointAsVector(this._actualTransform,e,t)};var Ge=new i;M.prototype.move=function(e,t){var r=this.position;i.multiplyByScalar(e,t,Ge),i.add(r,Ge,r),this._mode===D.SCENE2D&&G(this,r),this._adjustOrthographicFrustum(!0)},M.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,e)},M.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,-e)},M.prototype.moveUp=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,e)},M.prototype.moveDown=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,-e)},M.prototype.moveRight=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,e)},M.prototype.moveLeft=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,-e)},M.prototype.lookLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,-e)},M.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,e)},M.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,-e)},M.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,e)};var He=new C,We=new v;M.prototype.look=function(e,t){var i=o(t,this.defaultLookAmount),r=C.fromAxisAngle(e,-i,He),n=v.fromQuaternion(r,We),a=this.direction,s=this.up,l=this.right;v.multiplyByVector(n,a,a),v.multiplyByVector(n,s,s),v.multiplyByVector(n,l,l)},M.prototype.twistLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,e)},M.prototype.twistRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,-e)};var qe=new C,je=new v;M.prototype.rotate=function(e,t){var r=o(t,this.defaultRotateAmount),n=C.fromAxisAngle(e,-r,qe),a=v.fromQuaternion(n,je);v.multiplyByVector(a,this.position,this.position),v.multiplyByVector(a,this.direction,this.direction),v.multiplyByVector(a,this.up,this.up),i.cross(this.direction,this.up,this.right),i.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},M.prototype.rotateDown=function(e){e=o(e,this.defaultRotateAmount),H(this,e)},M.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),H(this,-e)};var Ye=new i,Xe=new i,Ze=new i,Ke=new i;M.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),W(this,-e)},M.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),W(this,e)},M.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===D.SCENE2D?q(this,e):j(this,e)},M.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===D.SCENE2D?q(this,-e):j(this,-e)},M.prototype.getMagnitude=function(){return this._mode===D.SCENE3D?i.magnitude(this.position):this._mode===D.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===D.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Qe=new y;M.prototype.lookAt=function(e,t){var i=E.eastNorthUpToFixedFrame(e,c.WGS84,Qe);this.lookAtTransform(i,t)};var Je=new i,$e=new C,et=new C,tt=new v;M.prototype.lookAtTransform=function(e,r){if(this._setTransform(e),a(r)){var n;if(n=a(r.heading)?Y(r.heading,r.pitch,r.range):r,this._mode===D.SCENE2D){t.clone(t.ZERO,this.position),i.negate(n,this.up),this.up.z=0,i.magnitudeSquared(this.up)<g.EPSILON10&&i.clone(i.UNIT_Y,this.up),i.normalize(this.up,this.up),this._setTransform(y.IDENTITY),i.negate(i.UNIT_Z,this.direction),i.cross(this.direction,this.up,this.right),i.normalize(this.right,this.right);var o=this.frustum,s=o.top/o.right;return o.right=.5*i.magnitude(n),o.left=-o.right,o.top=s*o.right,o.bottom=-o.top,void this._setTransform(e)}i.clone(n,this.position),i.negate(this.position,this.direction),i.normalize(this.direction,this.direction),i.cross(this.direction,i.UNIT_Z,this.right),i.magnitudeSquared(this.right)<g.EPSILON10&&i.clone(i.UNIT_X,this.right),i.normalize(this.right,this.right),i.cross(this.right,this.direction,this.up),i.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var it,rt=new n,nt=new n,ot=new i,at=new i,st=new i,lt=new i,ut=new i,ct=new i,dt=new i,ht=new i,pt={direction:new i,right:new i,up:new i},ft=new n,mt=new i,_t=new i,gt=new n,vt=new i,yt=new i;M.prototype.getRectangleCameraCoordinates=function(e,t){var r=this._mode;return a(t)||(t=new i),r===D.SCENE3D?Z(this,e,t):r===D.COLUMBUS_VIEW?K(this,e,t):r===D.SCENE2D?Q(this,e,t):void 0};var Ct=new w,wt=new w,St=new w;M.prototype.pickEllipsoid=function(e,t,r){if(a(r)||(r=new i),t=o(t,c.WGS84),this._mode===D.SCENE3D)r=J(this,e,t,r);else if(this._mode===D.SCENE2D)r=$(this,e,this._projection,r);else{if(this._mode!==D.COLUMBUS_VIEW)return;r=ee(this,e,this._projection,r)}return r};var Et=new i,bt=new i,Tt=new i,xt=new i;M.prototype.getPickRay=function(e,t){a(t)||(t=new w);var i=this.frustum;return a(i.aspectRatio)&&a(i.fov)&&a(i.near)?te(this,e,t):ie(this,e,t)};var At=new i,Pt=new i;M.prototype.distanceToBoundingSphere=function(e){var t=i.subtract(this.positionWC,e.center,At),r=i.multiplyByScalar(this.directionWC,i.dot(t,this.directionWC),Pt);return Math.max(0,i.magnitude(r)-e.radius)};var Dt=new t;M.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,Dt);return Math.max(n.x,n.y)};var Mt=new i,It=new i,Rt=new i,Ot=new i;M.prototype.createCorrectPositionTween=function(e){if(this._mode===D.COLUMBUS_VIEW)return ne(this,e)};var Nt=new i,Lt={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};M.prototype.cancelFlight=function(){a(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},M.prototype.flyTo=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.destination,i=this._mode;if(i!==D.MORPHING){this.cancelFlight();var r=o(e.orientation,o.EMPTY_OBJECT);if(a(r.direction)&&(r=U(this,t,r,Ve.orientation)),a(e.duration)&&e.duration<=0){var n=Ve;return n.destination=e.destination,n.orientation.heading=r.heading,n.orientation.pitch=r.pitch,n.orientation.roll=r.roll,n.convert=e.convert,n.endTransform=e.endTransform,this.setView(n),void("function"==typeof e.complete&&e.complete())}var s=a(t.west);s&&(t=this.getRectangleCameraCoordinates(t,Nt));var l,u=this;Lt.destination=t,Lt.heading=r.heading,Lt.pitch=r.pitch,Lt.roll=r.roll,Lt.duration=e.duration,Lt.complete=function(){l===u._currentFlight&&(u._currentFlight=void 0),a(e.complete)&&e.complete()},Lt.cancel=e.cancel,Lt.endTransform=e.endTransform,Lt.convert=!s&&e.convert,Lt.maximumHeight=e.maximumHeight,Lt.pitchAdjustHeight=e.pitchAdjustHeight,Lt.flyOverLongitude=e.flyOverLongitude,Lt.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Lt.easingFunction=e.easingFunction;var c=this._scene;l=c.tweens.add(b.createTween(c,Lt)),this._currentFlight=l}};var Bt=100;M.prototype.viewBoundingSphere=function(e,t){t=se(this,e,t),this.lookAt(e.center,t)};var Ft=new y,kt=new i,Vt=new i,zt=new i,Ut=new i,Gt=new r,Ht=new C,Wt=new v;M.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var r=this._mode===D.SCENE2D||this._mode===D.COLUMBUS_VIEW;this._setTransform(y.IDENTITY);var n,a=se(this,e,t.offset);n=r?i.multiplyByScalar(i.UNIT_Z,a.range,kt):Y(a.heading,a.pitch,a.range);var s=E.eastNorthUpToFixedFrame(e.center,c.WGS84,Ft);y.multiplyByPoint(s,n,n);var l,u;if(!r){if(l=i.subtract(e.center,n,Vt),i.normalize(l,l),u=y.multiplyByPointAsVector(s,i.UNIT_Z,zt),1-Math.abs(i.dot(l,u))<g.EPSILON6){var d=C.fromAxisAngle(l,a.heading,Ht),h=v.fromQuaternion(d,Wt);i.fromCartesian4(y.getColumn(s,1,Gt),u),v.multiplyByVector(h,u,u)}var p=i.cross(l,u,Ut);i.cross(p,l,u),i.normalize(u,u)}this.flyTo({destination:n,orientation:{direction:l,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var qt=new i,jt=new i,Yt=new i,Xt=new i,Zt=[new i,new i,new i,new i],Kt=new t,Qt=new i,Jt=[new n,new n,new n,new n];return M.prototype.computeViewRectangle=function(t,r){t=o(t,c.WGS84);var n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),a=new e(i.ZERO,t.maximumRadius),s=n.computeVisibility(a);if(s!==m.OUTSIDE){var l=this._scene.canvas,u=l.clientWidth,d=l.clientHeight,h=0,p=le(this,t);if(h+=ue(0,0,0,this,t,p),h+=ue(0,d,1,this,t,p),h+=ue(u,d,2,this,t,p),h+=ue(u,0,3,this,t,p),h<2)return S.MAX_VALUE;r=S.fromCartographicArray(Jt,r);for(var f=0,_=Jt[3].longitude,v=0;v<4;++v){var y=Jt[v].longitude,C=Math.abs(y-_);f+=C>g.PI?g.TWO_PI-C:C,_=y}return g.equalsEpsilon(Math.abs(f),g.TWO_PI,g.EPSILON9)&&(r.west=-g.PI,r.east=g.PI,Jt[0].latitude>=0?r.north=g.PI_OVER_TWO:r.south=-g.PI_OVER_TWO),r}},M.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===D.SCENE2D||this.frustum instanceof P)){var e=this._scene;this.frustum=new P,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=g.toRadians(60)}},M.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===D.SCENE2D||this.frustum instanceof x)){var e=this._scene;this.frustum=new x,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=i.magnitude(this.position);var t=this.frustum.projectionMatrix;a(t)&&this._adjustOrthographicFrustum(!0)}},M.clone=function(e,t){return a(t)||(t=new M(e._scene)),i.clone(e.position,t.position),i.clone(e.direction,t.direction),i.clone(e.up,t.up),i.clone(e.right,t.right),y.clone(e._transform,t.transform),t._transformChanged=!0,t},M}),define("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)}),define("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function d(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function h(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,h=i._eventStartPosition,p=i._pressTime,f=i._releaseTime;a[o]=!0,s[o]=!1,h[o]=new e;var m=i._movement[o];t(m)||(m=i._movement[o]={}),m.distance={startPosition:new e,endPosition:new e},m.angleAndHeight={startPosition:new e,endPosition:new e},m.prevAngle=0,i._eventHandler.setInputAction(function(t){i._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,h[o])},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,f[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(d(t,m),a[o]=!1,m.prevAngle=m.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,m.distance.endPosition),e.clone(t.angleAndHeight.endPosition,m.angleAndHeight.endPosition));for(var i=m.angleAndHeight.endPosition.x,r=m.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i<r-Math.PI;)i+=l;m.angleAndHeight.endPosition.x=-i*n.clientWidth/12,m.angleAndHeight.startPosition.x=-r*n.clientWidth/12}},l.PINCH_MOVE,r)}function p(i,r){var n=c(u.WHEEL,r),o=i._update;o[n]=!0;var s=i._movement[n];t(s)||(s=i._movement[n]={}),s.startPosition=new e,s.endPosition=new e,i._eventHandler.setInputAction(function(t){var i=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=i,o[n]=!1):s.endPosition.y=s.endPosition.y+i},l.WHEEL,r)}function f(i,r,n){var o=c(n,r),a=i._isDown,s=i._eventStartPosition,d=i._pressTime,h=i._releaseTime;a[o]=!1,s[o]=new e;var p=i._lastMovement[o];t(p)||(p=i._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var f,m;n===u.LEFT_DRAG?(f=l.LEFT_DOWN,m=l.LEFT_UP):n===u.RIGHT_DRAG?(f=l.RIGHT_DOWN,m=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(f=l.MIDDLE_DOWN,m=l.MIDDLE_UP),i._eventHandler.setInputAction(function(t){i._buttonsDown++,p.valid=!1,a[o]=!0,d[o]=new Date,e.clone(t.position,s[o])},f,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),a[o]=!1,h[o]=new Date},m,r)}function m(t,i){e.clone(t.startPosition,i.startPosition),e.clone(t.endPosition,i.endPosition)}function _(i,r){var n=i._update,o=i._movement,a=i._lastMovement,s=i._isDown;for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,r);n[p]=!0,t(i._lastMovement[p])||(i._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(i._movement[p])||(i._movement[p]={startPosition:new e,endPosition:new e})}}i._eventHandler.setInputAction(function(l){for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,r);s[p]&&(n[p]?(m(o[p],a[p]),a[p].valid=!0,m(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,i._currentMousePosition)},l.MOUSE_MOVE,r)}function g(i){this._eventHandler=new s(i,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,p(this,void 0),h(this,void 0,i),f(this,void 0,u.LEFT_DRAG),f(this,void 0,u.RIGHT_DRAG),f(this,void 0,u.MIDDLE_DRAG),_(this,void 0);for(var r in o)if(o.hasOwnProperty(r)){var n=o[r];t(n)&&(p(this,n),h(this,n,i),f(this,n,u.LEFT_DRAG),f(this,n,u.RIGHT_DRAG),f(this,n,u.MIDDLE_DRAG),_(this,n))}}return i(g.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];if(r.valid)return r},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),define("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function w(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function S(e,t,i,r){return re=!1,oe=!1,b(e,e._urlParts,function(n){return n(e,t,i,r)})}function E(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,b(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function b(e,t,i){for(var r="",n=0;n<t.length;++n){var o=t[n];r+="string"==typeof o?o:encodeURIComponent(i(o))}var s=e._proxy;return a(s)&&(r=s.getURL(r)),r}function T(e,t){if(a(e)){for(var i,r,n=[],o=0,s=Object.keys(t);o<e.length;){i=Number.MAX_VALUE,r=void 0;for(var l=0;l<s.length;++l){var u=e.indexOf(s[l],o);u>=0&&u<i&&(i=u,r=s[l])}a(r)?(o<i&&n.push(e.substring(o,i)),n.push(t[r]),o=i+r.length):(n.push(e.substring(o)),o=e.length)}return n}}function x(e,t,i){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var r=e.urlSchemeZeroPadding[t];if("string"==typeof r){var n=r.length;n>1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function A(e,t,i,r){return x(e,"{x}",t)}function P(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return x(e,"{reverseX}",n)}function D(e,t,i,r){return x(e,"{y}",i)}function M(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return x(e,"{reverseY}",n)}function I(e,t,i,r){var n=e.maximumLevel,o=a(n)&&r<n?n-r-1:r;return x(e,"{reverseZ}",o)}function R(e,t,i,r){return x(e,"{z}",r)}function O(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function N(e,t,i,r){re||(e.tilingScheme.tileXYToRectangle(t,i,r,ne),ne.west=_.toDegrees(ne.west),ne.south=_.toDegrees(ne.south),ne.east=_.toDegrees(ne.east),ne.north=_.toDegrees(ne.north),re=!0)}function L(e,t,i,r){return N(e,t,i,r),ne.west}function B(e,t,i,r){return N(e,t,i,r),ne.south}function F(e,t,i,r){return N(e,t,i,r),ne.east}function k(e,t,i,r){return N(e,t,i,r),ne.north}function V(e,t,i,r){oe||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,ae),oe=!0)}function z(e,t,i,r){return V(e,t,i,r),ae.west}function U(e,t,i,r){return V(e,t,i,r),ae.south}function G(e,t,i,r){return V(e,t,i,r),ae.east}function H(e,t,i,r){return V(e,t,i,r),ae.north}function W(e,t,i,r){return e.tileWidth}function q(e,t,i,r){return e.tileHeight}function j(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.x}function Y(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.y}function X(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileWidth-le.x-1}function Z(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileHeight-le.y-1}function K(e,t,i,r,n,o,a){if(!se){te(e,t,i,r,n,o);var s=de,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,ue);le.x=e.tileWidth*(s.x-l.west)/l.width|0,le.y=e.tileHeight*(l.north-s.y)/l.height|0,se=!0}}function Q(e,t,i,r,n,o,a){return _.toDegrees(n)}function J(e,t,i,r,n,o,a){return _.toDegrees(o)}function $(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),de.x}function ee(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),de.y}function te(e,t,i,r,n,o,a){if(!ce){var s;if(e.tilingScheme instanceof c)de.x=_.toDegrees(n),de.y=_.toDegrees(o);else{var l=he;l.longitude=n,l.latitude=o,s=e.tilingScheme.projection.project(l,de)}ce=!0}}function ie(e,t,i,r,n,o,a){return a}s(w.prototype,{url:{get:function(){return this._url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),w.prototype.reinitialize=function(e){var t=this;t._readyPromise=y(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._urlSchemeZeroPadding=o(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,d(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new v({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,fe),!0})},w.prototype.getTileCredits=function(e,t,i){},
w.prototype.requestImage=function(e,t,i){var r=S(this,e,t,i);return C.loadImage(this,r)},w.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=E(u,e,t,i,r,n,a.format);return++l,"json"===a.type?h(c).then(a.callback).otherwise(s):"xml"===a.type?m(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):f({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,de=new t,he=new i,pe={"{x}":A,"{y}":D,"{z}":R,"{s}":O,"{reverseX}":P,"{reverseY}":M,"{reverseZ}":I,"{westDegrees}":L,"{southDegrees}":B,"{eastDegrees}":F,"{northDegrees}":k,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":H,"{width}":W,"{height}":q},fe=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return w}),define("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,{});var a=t(i.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(i.fileExtension,"png"),c=new n({ellipsoid:i.ellipsoid}),d=256,h=256,p=t(i.minimumLevel,0),f=i.maximumLevel,m=t(i.rectangle,c.rectangle),_=c.positionToTileXY(r.southwest(m),p),g=c.positionToTileXY(r.northeast(m),p),v=((Math.abs(g.x-_.x)+1)*(Math.abs(g.y-_.y)+1),t(i.credit,l));"string"==typeof v&&(v=new e(v));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:i.proxy,credit:v,tilingScheme:c,tileWidth:d,tileHeight:h,minimumLevel:p,maximumLevel:f,rectangle:m})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),define("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var d=c.attributes,h=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);if(i(d.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:h})),i(d.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,1,0,1)},modelMatrix:h})),i(d.bitangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"bitangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:h})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),define("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(n){function f(s){for(var h,p,f,m,w=/tileformat/i,S=/tileset/i,E=/tilesets/i,b=/boundingbox/i,T=/srs/i,x=[],A=s.childNodes[0].childNodes,P=0;P<A.length;P++)if(w.test(A.item(P).nodeName))h=A.item(P);else if(E.test(A.item(P).nodeName)){f=A.item(P);for(var D=A.item(P).childNodes,M=0;M<D.length;M++)S.test(D.item(M).nodeName)&&x.push(D.item(M))}else b.test(A.item(P).nodeName)?p=A.item(P):T.test(A.item(P).nodeName)&&(m=A.item(P).textContent);var I=i(n.fileExtension,h.getAttribute("extension")),R=i(n.tileWidth,parseInt(h.getAttribute("width"),10)),O=i(n.tileHeight,parseInt(h.getAttribute("height"),10)),N=i(n.minimumLevel,parseInt(x[0].getAttribute("order"),10)),L=i(n.maximumLevel,parseInt(x[x.length-1].getAttribute("order"),10)),B=f.getAttribute("profile"),F=n.tilingScheme;if(!r(F))if("geodetic"===B||"global-geodetic"===B)F=new o({ellipsoid:n.ellipsoid});else{if("mercator"!==B&&"global-mercator"!==B){var k=a(v,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+B+".";return g=c.handleError(g,C,C.errorEvent,k,void 0,void 0,void 0,_),void(g.retry||y.reject(new u(k)))}F=new d({ellipsoid:n.ellipsoid})}var V=l.clone(n.rectangle);if(!r(V)){var z,U,G,H,W=i(n.flipXY,!1);W?(G=new e(parseFloat(p.getAttribute("miny")),parseFloat(p.getAttribute("minx"))),H=new e(parseFloat(p.getAttribute("maxy")),parseFloat(p.getAttribute("maxx")))):(G=new e(parseFloat(p.getAttribute("minx")),parseFloat(p.getAttribute("miny"))),H=new e(parseFloat(p.getAttribute("maxx")),parseFloat(p.getAttribute("maxy"))));var q="geodetic"===B||"mercator"===B;if(F instanceof o||q)z=t.fromDegrees(G.x,G.y),U=t.fromDegrees(H.x,H.y);else{var j=F.projection;z=j.unproject(G),U=j.unproject(H)}V=new l(z.longitude,z.latitude,U.longitude,U.latitude)}V.west<F.rectangle.west&&(V.west=F.rectangle.west),V.east>F.rectangle.east&&(V.east=F.rectangle.east),V.south<F.rectangle.south&&(V.south=F.rectangle.south),V.north>F.rectangle.north&&(V.north=F.rectangle.north);var Y=F.positionToTileXY(l.southwest(V),N),X=F.positionToTileXY(l.northeast(V),N),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(N=0);var K=a(v,"{z}/{x}/{reverseY}."+I);y.resolve({url:K,tilingScheme:F,rectangle:V,tileWidth:R,tileHeight:O,minimumLevel:N,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function m(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),s=i(n.tileHeight,256),l=i(n.minimumLevel,0),u=n.maximumLevel,c=r(n.tilingScheme)?n.tilingScheme:new d({ellipsoid:n.ellipsoid}),h=i(n.rectangle,c.rectangle),p=a(v,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:h,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){var e=a(v,"tilemapresource.xml"),t=n.proxy;r(t)&&(e=t.getURL(e)),s(e).then(f).otherwise(m)}n=i(n,{});var g,v=n.url,y=h.defer(),C=new p(y.promise);return _(),C}return f}),define("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n];if(e.equals(o,i))return!0}return!1}function l(e){var t=e.element;if(i(t)){var r=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&r.removeChild(n)}r.removeChild(t)}}function u(e,t){var r,n,a,s=e._displayedCredits.textCredits;for(r=0;r<t.length;r++)a=t[r],i(a)&&(n=s.indexOf(a),n===-1?o(a,e._textContainer,e._delimiter):s.splice(n,1));for(r=0;r<s.length;r++)a=s[r],i(a)&&l(a)}function c(e,t){var r,n,o,s=e._displayedCredits.imageCredits;for(r=0;r<t.length;r++)o=t[r],i(o)&&(n=s.indexOf(o),n===-1?a(o,e._imageContainer):s.splice(n,1));for(r=0;r<s.length;r++)o=s[r],i(o)&&l(o)}function d(e,i){var r=document.createElement("span");r.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(r),e.appendChild(n),this._delimiter=t(i," • "),this._textContainer=n,this._imageContainer=r,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]},this.container=e}return d.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;s(this._defaultImageCredits,e)||(t[e.id]=e)}else{var i=this._currentFrameCredits.textCredits;s(this._defaultTextCredits,e)||(i[e.id]=e)}},d.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;s(t,e)||t.push(e)}else{var i=this._defaultTextCredits;s(i,e)||i.push(e)}},d.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?(t=this._defaultImageCredits.indexOf(e),t!==-1&&this._defaultImageCredits.splice(t,1)):(t=this._defaultTextCredits.indexOf(e),t!==-1&&this._defaultTextCredits.splice(t,1))},d.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},d.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);u(this,e),c(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},d.prototype.destroy=function(){return this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),r(this)},d.prototype.isDestroyed=function(){return!1},d}),define("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,i,r,n){"use strict";function o(i){i=e(i,e.EMPTY_OBJECT);var r=i.attributeName,o=i.perInstanceAttribute;t(o)||(o=!1);var a,s=e(i.glslDatatype,"vec3"),l="v_"+r;if("normal"===r||"tangent"===r||"bitangent"===r)a="vec4 getColor() { return vec4(("+l+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===r&&(s="vec2"),s){case"float":a="vec4 getColor() { return vec4(vec3("+l+"), 1.0); }\n";break;case"vec2":a="vec4 getColor() { return vec4("+l+", 0.0, 1.0); }\n";break;case"vec3":a="vec4 getColor() { return vec4("+l+", 1.0); }\n";break;case"vec4":a="vec4 getColor() { return "+l+"; }\n"}var u="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(o?"":"attribute "+s+" "+r+";\n")+"varying "+s+" "+l+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(o?l+" = czm_batchTable_"+r+"(batchId);\n":l+" = "+r+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",c="varying "+s+" "+l+";\n"+a+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(i.translucent,!1),this._vertexShaderSource=e(i.vertexShaderSource,u),this._fragmentShaderSource=e(i.fragmentShaderSource,c),this._renderState=n.getDefaultRenderState(!1,!1,i.renderState),this._closed=e(i.closed,!1),this._attributeName=r,this._glslDatatype=s}return i(o.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),define("Scene/DebugCameraPrimitive",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/Matrix4","../Core/PrimitiveType","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){e=a(e,a.EMPTY_OBJECT),this._camera=e.camera,this._color=a(e.color,r.CYAN),this._updateOnChange=a(e.updateOnChange,!0),this.show=a(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitive=void 0,this._planesPrimitive=void 0}var v=new Array(4);v[0]=new i(-1,-1,1,1),v[1]=new i(1,-1,1,1),v[2]=new i(1,1,1,1),v[3]=new i(-1,1,1,1);for(var y=new p,C=new Array(4),w=0;w<4;++w)C[w]=new i;var S=new r,E=[1,1e5];return g.prototype.update=function(a){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy()),!s(this._outlinePrimitive)){var l=this._camera,u=l.frustum,g=a.frustumSplits,w=g.length-1;w<=0&&(g=E,g[0]=this._camera.frustum.near,g[1]=this._camera.frustum.far,w=1);var b,T,x=this._camera.viewMatrix;if(s(l.frustum.fovy)){var A=this._camera.frustum.projectionMatrix,P=p.multiply(A,x,y);T=p.inverse(P,y)}else b=p.inverseTransformation(x,y);var D,M=new Float64Array(12*(w+1));for(D=0;D<w+1;++D)for(var I=0;I<4;++I){var R,O=i.clone(v[I],C[I]);if(s(T)){O=p.multiplyByVector(T,O,O);var N=1/O.w;t.multiplyByScalar(O,N,O),t.subtract(O,this._camera.positionWC,O),t.normalize(O,O);var L=t.dot(this._camera.directionWC,O);t.multiplyByScalar(O,g[D]/L,O),t.add(O,this._camera.positionWC,O)}else{s(u._offCenterFrustum)&&(u=u._offCenterFrustum);var B,F;D===w?(B=g[D-1],F=g[D]):(B=g[D],F=g[D+1]),O.x=.5*(O.x*(u.right-u.left)+u.left+u.right),O.y=.5*(O.y*(u.top-u.bottom)+u.bottom+u.top),O.z=.5*(O.z*(B-F)-B-F),O.w=1,R=p.multiplyByVector(b,O,O)}M[12*D+3*I]=O.x,M[12*D+3*I+1]=O.y,M[12*D+3*I+2]=O.z}var k=new e.fromVertices(M),V=new d;V.position=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:M});var z,U,G=new Uint16Array(8*(2*w+1));for(D=0;D<w+1;++D)z=8*D,U=4*D,G[z]=U,G[z+1]=U+1,G[z+2]=U+1,G[z+3]=U+2,G[z+4]=U+2,G[z+5]=U+3,G[z+6]=U+3,G[z+7]=U;for(D=0;D<w;++D)z=8*(w+1+D),U=4*D,G[z]=U,G[z+1]=U+4,G[z+2]=U+1,G[z+3]=U+5,G[z+4]=U+2,G[z+5]=U+6,G[z+6]=U+3,G[z+7]=U+7;this._outlinePrimitive=new _({geometryInstances:new h({geometry:{attributes:V,indices:G,primitiveType:f.LINES,boundingSphere:k},attributes:{color:n.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new m({translucent:!1,flat:!0}),asynchronous:!1});var H=new Uint16Array(6*(5*w+1));for(D=0;D<w+1;++D)z=6*D,U=4*D,H[z]=U,H[z+1]=U+1,H[z+2]=U+2,H[z+3]=U,H[z+4]=U+2,H[z+5]=U+3;for(D=0;D<w;++D)z=6*(w+1+4*D),U=4*D,H[z]=U+4,H[z+1]=U,H[z+2]=U+3,H[z+3]=U+4,H[z+4]=U+3,H[z+5]=U+7,H[z+6]=U+4,H[z+7]=U,H[z+8]=U+1,H[z+9]=U+4,H[z+10]=U+1,H[z+11]=U+5,H[z+12]=U+7,H[z+13]=U+3,H[z+14]=U+2,H[z+15]=U+7,H[z+16]=U+2,H[z+17]=U+6,H[z+18]=U+6,H[z+19]=U+2,H[z+20]=U+1,H[z+21]=U+6,H[z+22]=U+1,H[z+23]=U+5;this._planesPrimitive=new _({geometryInstances:new h({geometry:{attributes:V,indices:H,primitiveType:f.TRIANGLES,boundingSphere:k},attributes:{color:n.fromColor(r.fromAlpha(this._color,.1,S))},id:this.id,pickPrimitive:this}),appearance:new m({translucent:!0,flat:!0}),asynchronous:!1})}this._outlinePrimitive.update(a),this._planesPrimitive.update(a)}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy(),l(this)},g}),define("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=i(e,i.EMPTY_OBJECT),this.length=i(e.length,1e7),this._length=void 0,this.width=i(e.width,2),this._width=void 0,this.show=i(e.show,!0),this.modelMatrix=a.clone(i(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0}return c.prototype.update=function(i){if(this.show){if(!r(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,r(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var n=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),c=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),d=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[n,c,d],appearance:new l,asynchronous:!1})}this._primitive.update(i)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),define("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),define("Shaders/DepthPlaneVS",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),define("Scene/DepthPlane",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./DepthFunction","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function y(e,i){var r=e.radii,n=i.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,w),a=t.magnitude(o),s=t.normalize(o,S),l=t.normalize(t.cross(t.UNIT_Z,o,E),E),u=t.normalize(t.cross(s,l,b),b),c=Math.sqrt(t.magnitudeSquared(o)-1),d=t.multiplyByScalar(s,1/a,w),h=c/a,p=t.multiplyByScalar(l,h,S),f=t.multiplyByScalar(u,h,E),m=t.add(d,f,b);t.subtract(m,p,m),t.multiplyComponents(r,m,m),t.pack(m,C,0);var _=t.subtract(d,f,b);t.subtract(_,p,_),t.multiplyComponents(r,_,_),t.pack(_,C,3);var g=t.add(d,f,b);t.add(g,p,g),t.multiplyComponents(r,g,g),t.pack(g,C,6);var v=t.subtract(d,f,b);return t.add(v,p,v),t.multiplyComponents(r,v,v),t.pack(v,C,9),C}var C=n.supportsTypedArrays()?new Float32Array(12):[],w=new t,S=new t,E=new t,b=new t;return v.prototype.update=function(n){if(this._mode=n.mode,n.mode===g.SCENE3D){var v=n.context,C=n.mapProjection.ellipsoid;r(this._command)||(this._rs=d.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:_.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=h.fromCache({context:v,vertexShaderSource:m,fragmentShaderSource:f,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,C.maximumRadius),pass:c.OPAQUE,owner:this}));var w=y(C,n);if(r(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(w);else{var S=new o({attributes:{position:new a({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:w})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=p.fromGeometry({context:v,geometry:S,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},v.prototype.execute=function(e,t){this._mode===g.SCENE3D&&this._command.execute(e,t)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},v}),define("Scene/DeviceOrientationCameraController",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,i,r,n,o){"use strict";function a(t){function i(t){var i=t.alpha;return e(i)?(n._alpha=r.toRadians(i),n._beta=r.toRadians(t.beta),void(n._gamma=r.toRadians(t.gamma))):(n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0))}this._scene=t,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var n=this;window.addEventListener("deviceorientation",i,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",i,!1)}}function s(e,t,i,r){var a=e.direction,s=e.right,d=e.up,h=o.fromAxisAngle(a,i,u),p=o.fromAxisAngle(s,r,l),f=o.multiply(p,h,p),m=o.fromAxisAngle(d,t,u);o.multiply(m,f,f);var _=n.fromQuaternion(f,c);n.multiplyByVector(_,s,s),n.multiplyByVector(_,d,d),n.multiplyByVector(_,a,a)}var l=new o,u=new o,c=new n;return a.prototype.update=function(){if(e(this._alpha)){e(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var t=this._lastAlpha-this._alpha,i=this._lastBeta-this._beta,r=this._lastGamma-this._gamma;s(this._scene.camera,-t,i,r),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._removeListener(),t(this)},a}),define("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"}),define("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"}),define("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,w.fromType(w.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new d({owner:n(t._owner,this)}),this._pickCommand=new d({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function b(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=_.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var T={position:0};return E.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:C.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=b(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var d=this._oneOverEllipsoidRadiiSquared;d.x=1/(c.x*c.x),d.y=1/(c.y*c.y),d.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var _=this._material!==this.material;this._material=this.material,this._material.update(n);var w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E,x=this._colorCommand;(_||w||s)&&(E=new m({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._sp=f.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=r(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?h.TRANSLUCENT:h.OPAQUE,A.push(x)),P.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(_||w||!o(this._pickSP))&&(E=new m({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._pickSP=f.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?h.TRANSLUCENT:h.OPAQUE,A.push(D)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},E}),define("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"}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";
}),define("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),define("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(e<t[0])return h=0;if(e>t[i-1])return h=i-2;if(e>=t[h]){if(h+1<i&&e<t[h+1])return h;if(h+2<i&&e<t[h+2])return++h,h}else if(h-1>=0&&e>=t[h-1])return--h,h;var r;for(r=0;r<i-2&&!(e>=t[r]&&e<t[r+1]);++r);return h=r}for(var a=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],s=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],l=0;l<s.length;++l)s[l]*=1e6;for(var u=s[1],c=s[s.length-1],d=0;d<s.length;++d)s[d]=(s[d]-c)/(u-c);var h=0,p=new e;return n.prototype.update=function(n){var l=n.fog.enabled=this.enabled;if(l){var d=n.camera,h=d.positionCartographic;if(!t(h)||h.height>8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var f=h.height,m=o(f),_=i.clamp((f-a[m])/(a[m+1]-a[m]),0,1),g=i.lerp(s[m],s[m+1],_),v=1e6*this.density,y=v/u*c;g=g*(v-y)*1e-6;var C=e.normalize(d.positionWC,p),w=i.clamp(e.dot(d.directionWC,C),0,1);g*=1-w,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),define("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),define("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.passes={render:!1,pick:!1,depth:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0}return t}),define("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s<n;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return i}),define("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"}),define("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function m(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return f.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,f=this._texture,m=!r(f)||f.width!==n||f.height!==a;if(m&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new h({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthStencilTexture=new h({context:i,width:n,height:a,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_STENCIL})),r(this._fbo)&&!m||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=d.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,m){var _=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return _._texture},u_step:function(){return g}}}},f.prototype.execute=function(e,t){this._command.execute(e,t)},f.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},f.prototype.getColorFramebuffer=function(){return this._fbo},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return m(this),n(this)},f}),define("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n){"use strict";function o(e,i,r){this.type=e,t(i)||("json"===e?i="application/json":"xml"===e?i="text/xml":"html"===e?i="text/html":"text"===e&&(i="text/plain")),this.format=i,t(r)||("json"===e?r=a:"xml"===e?r=s:"html"===e?r=m:"text"===e&&(r=m)),this.callback=r}function a(i){for(var r=[],o=i.features,a=0;a<o.length;++a){var s=o[a],l=new n;if(l.data=s,l.properties=s.properties,l.configureNameFromProperties(s.properties),l.configureDescriptionFromProperties(s.properties),t(s.geometry)&&"Point"===s.geometry.type){var u=s.geometry.coordinates[0],c=s.geometry.coordinates[1];l.position=e.fromDegrees(u,c)}r.push(l)}return r}function s(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===_)return l(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===g)return u(e);if("FeatureCollection"===t.localName&&t.namespaceURI===v)return c(e);if("ServiceExceptionReport"===t.localName)throw new r((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?d(e):f(e)}function l(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(_,"Feature"),o=0;o<r.length;++o){for(var a=r[o],s={},l=a.getElementsByTagNameNS(_,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var d=c.getAttribute("ref"),h=c.textContent.trim();s[d]=h}}var p=new n;p.data=a,p.properties=s,p.configureNameFromProperties(s),p.configureDescriptionFromProperties(s),t.push(p)}return t}function u(e){var t,i=e.documentElement,r=[],n=i.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}r.push(p(a,t))}else for(var c=i.getElementsByTagNameNS("*","FeatureInfo"),d=0;d<c.length;++d){var h=c[d];t={};for(var f=h.childNodes,m=0;m<f.length;++m){var _=f[m];_.nodeType===Node.ELEMENT_NODE&&(t[_.localName]=_.textContent)}r.push(p(h,t))}return r}function c(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(y,"featureMember"),n=0;n<r.length;++n){var o=r[n],a={};h(o,a),t.push(p(o,a))}return t}function d(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}for(var o=t.childNodes,a=0;a<o.length;++a){var s=o[a];if(s.nodeType===Node.ELEMENT_NODE){var l={};h(s,l),i.push(p(s,l))}}return i}function h(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&h(n,t)&&(t[n.localName]=n.textContent)}return i}function p(e,t){var i=new n;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function f(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);var o=new n;return o.data=e,o.description=i.innerHTML,[o]}function m(e){if(!C.test(e)&&!w.test(e)){var t,i=S.exec(e);i&&i.length>1&&(t=i[1]);var r=new n;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",g="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",C=/<body>\s*<\/body>/im,w=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,S=/<title>([\s\S]*)<\/title>/im;return o}),define("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),define("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n";
}),define("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),define("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=r;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,d,h,p,f,m,_,g,v,y,C,w){var S=0,E="",b=n.pickTerrain.mesh.encoding,T=b.quantization;T===i.BITS12&&(S=1,E="QUANTIZATION_BITS12");var x=t.mode,A=x|u<<2|c<<3|d<<4|h<<5|p<<6|f<<7|_<<8|g<<9|v<<10|y<<11|C<<12|w<<13|S<<14|m<<15,P=n.surfaceShader;if(e(P)&&P.numberOfDayTextures===a&&P.flags===A)return P.shaderProgram;var D=this._shadersByTexturesFlags[a];if(e(D)||(D=this._shadersByTexturesFlags[a]=[]),P=D[A],!e(P)){var M=this.baseVertexShaderSource.clone(),I=this.baseFragmentShaderSource.clone();M.defines.push(E),I.defines.push("TEXTURE_UNITS "+a),u&&I.defines.push("APPLY_BRIGHTNESS"),c&&I.defines.push("APPLY_CONTRAST"),d&&I.defines.push("APPLY_HUE"),h&&I.defines.push("APPLY_SATURATION"),p&&I.defines.push("APPLY_GAMMA"),f&&I.defines.push("APPLY_ALPHA"),_&&(I.defines.push("SHOW_REFLECTIVE_OCEAN"),M.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&I.defines.push("SHOW_OCEAN_WAVES"),v&&(y?(M.defines.push("ENABLE_VERTEX_LIGHTING"),I.defines.push("ENABLE_VERTEX_LIGHTING")):(M.defines.push("ENABLE_DAYNIGHT_SHADING"),I.defines.push("ENABLE_DAYNIGHT_SHADING"))),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),I.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(M.defines.push("FOG"),I.defines.push("FOG")),m&&I.defines.push("APPLY_SPLIT");for(var R="    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n    {\n        vec4 color = initialColor;\n",O=0;O<a;++O)R+="    color = sampleAndBlend(\n        color,\n        u_dayTextures["+O+"],\n        u_dayTextureUseWebMercatorT["+O+"] ? textureCoordinates.xz : textureCoordinates.xy,\n        u_dayTextureTexCoordsRectangle["+O+"],\n        u_dayTextureTranslationAndScale["+O+"],\n        "+(f?"u_dayTextureAlpha["+O+"]":"1.0")+",\n        "+(u?"u_dayTextureBrightness["+O+"]":"0.0")+",\n        "+(c?"u_dayTextureContrast["+O+"]":"0.0")+",\n        "+(d?"u_dayTextureHue["+O+"]":"0.0")+",\n        "+(h?"u_dayTextureSaturation["+O+"]":"0.0")+",\n        "+(p?"u_dayTextureOneOverGamma["+O+"]":"0.0")+",\n        "+(m?"u_dayTextureSplit["+O+"]":"0.0")+"\n    );\n";R+="        return color;\n    }",I.sources.push(R),M.sources.push(s(x)),M.sources.push(l(C));var N=r.fromCache({context:t.context,vertexShaderSource:M,fragmentShaderSource:I,attributeLocations:b.getAttributeLocations()});P=D[A]=new o(a,A,N)}return n.surfaceShader=P,P.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,d=c.quantization;d===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var h=t.mode,p=h|o<<2|a<<3,f=this._pickShaderPrograms[p];if(!e(f)){var m=this.baseVertexShaderSource.clone();m.defines.push(u),m.sources.push(s(h)),m.sources.push(l(o));var _="void main()\n{\n    gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";f=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:c.getAttributeLocations()})}return f},a.prototype.destroy=function(){var i,r,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(i in a)a.hasOwnProperty(i)&&(r=a[i],e(r)&&r.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(i in s)s.hasOwnProperty(i)&&(r=s[i],r.destroy());return t(this)},a}),define("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)}),define("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),define("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)}),define("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/Plane","../Core/Ray","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(t,i,r){r.cartographicToCartesian(u.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(u.northeast(i),t.northeastCornerCartesian),y.longitude=i.west,y.latitude=.5*(i.south+i.north),y.height=0;var n=r.cartographicToCartesian(y,g),o=e.cross(n,e.UNIT_Z,p);e.normalize(o,t.westNormal),y.longitude=i.east;var l=r.cartographicToCartesian(y,v),c=e.cross(e.UNIT_Z,l,p);e.normalize(c,t.eastNormal);var d,h=e.subtract(n,l,p),S=e.normalize(h,_),E=i.south;if(E>0){y.longitude=.5*(i.west+i.east),y.latitude=E;var b=r.cartographicToCartesian(y,w.origin);e.clone(S,w.direction);var T=s.fromPointNormal(t.southwestCornerCartesian,t.westNormal,C);a.rayPlane(w,T,t.southwestCornerCartesian),d=r.geodeticSurfaceNormal(b,f)}else d=r.geodeticSurfaceNormalCartographic(u.southeast(i),f);var x=e.cross(d,h,m);e.normalize(x,t.southNormal);var A,P=i.north;if(P<0){y.longitude=.5*(i.west+i.east),y.latitude=P;var D=r.cartographicToCartesian(y,w.origin);e.negate(S,w.direction);var M=s.fromPointNormal(t.northeastCornerCartesian,t.eastNormal,C);a.rayPlane(w,M,t.northeastCornerCartesian),A=r.geodeticSurfaceNormal(D,f)}else A=r.geodeticSurfaceNormalCartographic(u.northwest(i),f);var I=e.cross(h,A,m);e.normalize(I,t.northNormal)}var h=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=u.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);d(this,t.rectangle,r)},p=new e,f=new e,m=new e,_=new e,g=new e,v=new e,y=new t,C=new s(e.ZERO,0),w=new l,S=new e,E=new e,b=new e(0,-1,0),T=new e(0,0,-1),x=new e;return h.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!u.contains(this.rectangle,n)){var a=this.southwestCornerCartesian,s=this.northeastCornerCartesian,l=this.westNormal,d=this.southNormal,h=this.eastNormal,p=this.northNormal;t.mode!==c.SCENE3D&&(a=t.mapProjection.project(u.southwest(this.rectangle),S),a.z=a.y,a.y=a.x,a.x=0,s=t.mapProjection.project(u.northeast(this.rectangle),E),s.z=s.y,s.y=s.x,s.x=0,l=b,h=e.UNIT_Y,d=T,p=e.UNIT_Z);var f=e.subtract(r,a,x),m=e.dot(f,l),_=e.dot(f,d),g=e.subtract(r,s,x),v=e.dot(g,h),y=e.dot(g,p);m>0?o+=m*m:v>0&&(o+=v*v),_>0?o+=_*_:y>0&&(o+=y*y)}var C;C=t.mode===c.SCENE3D?n.height:r.x;var w=t.mode===c.SCENE3D?this.maximumHeight:0,A=C-w;return A>0&&(o+=A*A),Math.sqrt(o)},h}),define("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function f(e,t,r,n,o){function s(t){e.data=t,e.state=d.RECEIVED}function l(){e.state=d.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,i,r,n,o,u)}function u(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=d.RECEIVING,c(e.data,s,l)):e.state=d.UNLOADED}u()}function m(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);i(u)&&(e.state=d.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=d.TRANSFORMED},function(){e.state=d.FAILED}))}function _(e,t,r,o,a,c){var h=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:h,usage:l.STATIC_DRAW}),f=e.mesh.encoding.getAttributes(p),m=e.mesh.indices.indexBuffers||{},_=m[t.id];if(!i(_)||_.isDestroyed()){var g=e.mesh.indices,v=2===g.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;_=s.createIndexBuffer({context:t,typedArray:g,usage:l.STATIC_DRAW,indexDatatype:v}),_.vertexArrayDestroyable=!1,_.referenceCount=1,m[t.id]=_,e.mesh.indices.indexBuffers=m}else++_.referenceCount;e.vertexArray=new u({context:t,attributes:f,indexBuffer:_}),e.state=d.READY}return p.prototype.freeResources=function(){if(this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=o.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new h({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===d.UNLOADED&&f(this,t,i,r,n),this.state===d.RECEIVED&&m(this,e,t,i,r,n),this.state===d.TRANSFORMED&&_(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===d.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,h=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,h,r,n,o),!i(this.data))return;this.state=d.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=d.RECEIVED},function(){p.state=d.FAILED})}this.state===d.RECEIVED&&m(this,e,t,r,n,o),this.state===d.TRANSFORMED&&_(this,e.context,t,r,n,o)},p}),define("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,i,r,o,a,s){if(e.decodePosition(o,a,s),n(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,i){var r=e.data,o=E(e);n(o)&&(r.upsampledTerrain=new v(o)),P(e,t)&&(r.loadedTerrain=new v);for(var a=0,s=i.length;a<s;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,i,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,i,e.x,e.y,e.level),s.state>=g.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,M(t.context,a),x(e)),u=!0),s.state===g.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=r(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===g.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,i,e.x,e.y,e.level),l.state>=g.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,i.hasWaterMask&&I(e),b(e)),l.state===g.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===g.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function b(e){T(e,e._southwestChild),T(e,e._southeastChild),T(e,e._northwestChild),T(e,e._northeastChild)}function T(e,t){if(n(t)&&t.state!==m.START){var i=t.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new v({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=m.LOADING}}function x(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,i){if(i.state!==m.START){var r=i.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new v)),i.state=m.LOADING}}function P(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(n(i))return i;var r=e.parent;return!n(r)||!(!n(r.data)||!n(r.data.terrainData))&&r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)}function D(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var i=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:h.LINEAR,magnificationFilter:d.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function M(e,t){var r=t.waterMaskTexture;n(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=D(e),d=o.length;if(1===d){if(0===o[0])return;a=u.allWaterTexture}else{var h=Math.sqrt(d);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function I(e){for(var t=e.data,i=e.parent;n(i)&&!n(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(n(i)&&n(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(o.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(y.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),i=this.upsampledTerrain,r=n(i)&&(i.state===g.RECEIVING||i.state===g.TRANSFORMING),o=!t&&!r,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==f.TRANSITIONING}return o}}});var R=new t,O=new t,N=new t,L=new t;return y.prototype.pick=function(e,i,r,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,d=u.indices,h=u.encoding,p=d.length,f=0;f<p;f+=3){var m=d[f],_=d[f+1],g=d[f+2],v=C(h,i,r,c,m,R),y=C(h,i,r,c,_,O),w=C(h,i,r,c,g,N),S=a.rayTriangle(e,v,y,w,o,L);if(n(S))return t.clone(S,s)}}},y.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;e<t;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},y.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},y.processStateMachine=function(e,t,i,r,o){var a=e.data;n(a)||(a=e.data=new y),e.state===m.START&&(w(e,i,r),e.state=m.LOADING),e.state===m.LOADING&&S(e,t,i,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,d=0,h=c.length;d<h;++d){var p=c[d];if(n(p.loadingImagery)){if(p.loadingImagery.state===f.PLACEHOLDER){var _=p.loadingImagery.imageryLayer;if(_.imageryProvider.ready){p.freeResources(),c.splice(d,1),_._createTileImagerySkeletons(e,i,d),--d,h=c.length;continue}u=!1}var g=p.processStateMachine(e,t);l=l&&g,s=s&&(g||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===f.FAILED||p.loadingImagery.state===f.INVALID)}else u=!1}e.upsampledFromParent=u,d===h&&(s&&(e.renderable=!0),l&&(e.state=m.DONE))},y}),define("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"}),define("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"}),define("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e,t){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||r)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),define("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";var t={LEFT:-1,NONE:0,RIGHT:1};return e(t)}),define("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&(s.state!==t.READY||!this.useWebMercatorT&&!e(s.texture));)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(r,!this.useWebMercatorT),!1))},i}),define("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImagerySplitDirection","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L){"use strict";function B(e,t){this._imageryProvider=e,t=i(t,{}),this.alpha=i(t.alpha,i(e.defaultAlpha,1)),this.brightness=i(t.brightness,i(e.defaultBrightness,B.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,B.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,B.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,B.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,B.DEFAULT_GAMMA)),this.splitDirection=i(t.splitDirection,i(e.defaultSplit,B.DEFAULT_SPLIT)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,d.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new L(R.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function F(e,t,n,o){if(!c.isCompressedFormat(o.pixelFormat)&&u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!r(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,i(e._maximumAnisotropy,s))})}o.generateMipmap(C.NICEST),o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;r(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=N.READY}function k(e,t,i){return JSON.stringify([e,t,i])}function V(e,t,i,n){var o=t.cache.imageryLayer_reproject;if(!r(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){r(this.framebuffer)&&this.framebuffer.destroy(),r(this.vertexArray)&&this.vertexArray.destroy(),r(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var d=c/63;a[s++]=0,a[s++]=d,a[s++]=1,a[s++]=d}var p={position:0,webMercatorT:1},f=h.getRegularGridIndices(2,64),m=_.createIndexBuffer({context:t,typedArray:f,usage:g.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new P({context:t,attributes:[{index:p.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:a,usage:g.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:g.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:m});var v=new E({sources:[M]});o.shaderProgram=S.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:D,attributeLocations:p}),o.sampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}i.sampler=o.sampler;var y=i.width,I=i.height;q.textureDimensions.x=y,q.textureDimensions.y=I,q.texture=i;var R=Math.sin(n.south),O=.5*Math.log((1+R)/(1-R));R=Math.sin(n.north);var N=.5*Math.log((1+R)/(1-R)),L=1/(N-O),B=new b({context:t,width:y,height:I,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(I)&&B.generateMipmap(C.NICEST);for(var F=n.south,k=n.north,V=j,z=0,U=0;U<64;++U){var G=U/63,H=u.lerp(F,k,G);R=Math.sin(H);var W=.5*Math.log((1+R)/(1-R)),Y=(W-O)*L;V[z++]=Y,V[z++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(V),e.shaderProgram=o.shaderProgram,e.outputTexture=B,e.uniformMap=q,e.vertexArray=o.vertexArray}function z(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(i),l=n.rectangle,u=o.maximumRadius*l.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,d=Math.log(c)/Math.log(2),h=Math.round(d);return 0|h}n(B.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),B.DEFAULT_BRIGHTNESS=1,B.DEFAULT_CONTRAST=1,B.DEFAULT_HUE=0,B.DEFAULT_SATURATION=1,B.DEFAULT_GAMMA=1,B.DEFAULT_SPLIT=O.NONE,B.prototype.isBaseLayer=function(){return this._isBaseLayer},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return o(this)};var U=new d,G=new d,H=new d,W=new d;B.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return d.intersection(e.rectangle,t)})},B.prototype._createTileImagerySkeletons=function(e,i,n){var o=e.data;if(r(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(r(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(r(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof m&&e.rectangle.north<f.MaximumLatitude&&e.rectangle.south>-f.MaximumLatitude,l=d.intersection(a.rectangle,this._rectangle,U),u=d.intersection(e.rectangle,l,G);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,h=e.rectangle;u=G,h.south>=c.north?u.north=u.south=c.north:h.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(h.south,c.south),u.north=Math.min(h.north,c.north)),h.west>=c.east?u.west=u.east=c.east:h.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(h.west,c.west),u.east=Math.min(h.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var _=1,g=_*i.getLevelMaximumGeometricError(e.level),v=z(this,g,p);v=Math.max(0,v);var y=a.maximumLevel;if(v>y&&(v=y),r(a.minimumLevel)){var C=a.minimumLevel;v<C&&(v=C)}var w=a.tilingScheme,S=w.positionToTileXY(d.northwest(u),v),E=w.positionToTileXY(d.southeast(u),v),b=e.rectangle.width/512,T=e.rectangle.height/512,x=w.tileXYToRectangle(S.x,S.y,v);Math.abs(x.south-e.rectangle.north)<T&&S.y<E.y&&++S.y,Math.abs(x.east-e.rectangle.west)<b&&S.x<E.x&&++S.x;var A=w.tileXYToRectangle(E.x,E.y,v);Math.abs(A.north-e.rectangle.south)<T&&E.y>S.y&&--E.y,Math.abs(A.west-e.rectangle.east)<b&&E.x>S.x&&--E.x;var P,D=d.clone(e.rectangle,W),M=w.tileXYToRectangle(S.x,S.y,v),I=d.intersection(M,l,H);s?(w.rectangleToNativeRectangle(D,D),w.rectangleToNativeRectangle(M,M),w.rectangleToNativeRectangle(I,I),w.rectangleToNativeRectangle(l,l),P=w.tileXYToNativeRectangle.bind(w),b=D.width/512,T=D.height/512):P=w.tileXYToRectangle.bind(w);
var R,O,N=0,B=1;!this.isBaseLayer()&&Math.abs(I.west-D.west)>=b&&(N=Math.min(1,(I.west-D.west)/D.width)),!this.isBaseLayer()&&Math.abs(I.north-D.north)>=T&&(B=Math.max(0,(I.north-D.south)/D.height));for(var F=B,k=S.x;k<=E.x;k++)if(R=N,M=P(k,S.y,v),I=d.simpleIntersection(M,l,H),r(I)){N=Math.min(1,(I.east-D.west)/D.width),k===E.x&&(this.isBaseLayer()||Math.abs(I.east-D.east)<b)&&(N=1),B=F;for(var V=S.y;V<=E.y;V++)if(O=B,M=P(k,V,v),I=d.simpleIntersection(M,l,H),r(I)){B=Math.max(0,(I.south-D.south)/D.height),V===E.y&&(this.isBaseLayer()||Math.abs(I.south-D.south)<T)&&(B=0);var q=new t(R,B,N,O),j=this.getImageryFromCache(k,V,v);o.imagery.splice(n,0,new L(j,q,s)),++n}}return!0},B.prototype._calculateTextureTranslationAndScale=function(e,i){var r=i.readyImagery.rectangle,n=e.rectangle;if(i.useWebMercatorT){var o=i.readyImagery.imageryLayer.imageryProvider.tilingScheme;r=o.rectangleToNativeRectangle(r,U),n=o.rectangleToNativeRectangle(n,W)}var a=n.width,s=n.height,l=a/r.width,u=s/r.height;return new t(l*(n.west-r.west)/a,u*(n.south-r.south)/s,l,u)},B.prototype._requestImagery=function(e){function t(t){return r(t)?(e.image=t,e.state=N.RECEIVED,void p.handleSuccess(a._requestImageError)):i()}function i(t){e.state=N.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){e.state=N.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return r(n)?(r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void I(n,t,i)):void(e.state=N.UNLOADED)}var o=this._imageryProvider,a=this;n()},B.prototype._createTexture=function(e,t){var i=this._imageryProvider,n=t.image;if(r(i.tileDiscardPolicy)){var o=i.tileDiscardPolicy;if(r(o)){if(!o.isReady())return void(t.state=N.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=N.INVALID)}}var a;a=new b(r(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView}}:{context:e,source:n,pixelFormat:i.hasAlphaChannel?c.RGBA:c.RGB}),i.tilingScheme instanceof m?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=N.TEXTURE_LOADED},B.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(r=i(r,!0),r&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new v({persists:!0,owner:this,preExecute:function(e){V(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,F(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),F(this,a,t,n)},B.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},B.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},B.prototype.getImageryFromCache=function(e,t,i,n){var o=k(e,t,i),a=this._imageryCache[o];return r(a)||(a=new R(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},B.prototype.removeImageryFromCache=function(e){var t=k(e.x,e.y,e.level);delete this._imageryCache[t]};var q={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},j=a.supportsTypedArrays()?new Float32Array(128):void 0;return B}),define("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./OrthographicFrustum","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G){"use strict";function H(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=G.RECEIVE_ONLY,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new h,this._imageryLayers.layerAdded.addEventListener(H.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(H.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(H.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(H.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function q(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function j(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=v.multiplyByPoint(t,this.properties.rtc,ie);return v.setTranslation(t,i,J),J},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=v.multiplyByPoint(t,this.properties.rtc,ie);return v.setTranslation(t,r,$),v.multiply(i,$,$),$},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,rtc:new r,modifiedModelView:new v,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new v}};return t}function Y(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=X(e,r.vertexArray,r.terrainData._mesh))}function X(e,t,i){var r={indices:i.indices,primitiveType:C.TRIANGLES};f.toWireframe(r);var n=r.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:m.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function Z(t,i,a){var s=i.data,u=P.maximumTextureImageUnits,c=s.waterMaskTexture,d=t.hasWaterMask&&l(c),h=t.oceanNormalMap,p=d&&l(h),f=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,m=a.fog.enabled,_=G.castShadows(t.shadows),S=G.receiveShadows(t.shadows);d&&--u,p&&--u;var b=s.center,x=s.pickTerrain.mesh.encoding,A=ee,I=0,R=0,O=0,N=0,L=!1;if(a.mode!==U.SCENE3D){var B=a.mapProjection,F=B.project(w.southwest(i.rectangle),re),V=B.project(w.northeast(i.rectangle),ne);if(A.x=F.x,A.y=F.y,A.z=V.x,A.w=V.y,a.mode!==U.MORPHING&&(b=te,b.x=0,b.y=.5*(A.z+A.x),b.z=.5*(A.w+A.y),A.x-=b.y,A.y-=b.z,A.z-=b.y,A.w-=b.z),a.mode===U.SCENE2D&&x.quantization===E.BITS12){var z=1/(Math.pow(2,12)-1)*.5,H=(A.z-A.x)*z,W=(A.w-A.y)*z;A.x-=H,A.y-=W,A.z+=H,A.w+=W}B instanceof T&&(I=i.rectangle.south,R=i.rectangle.north,O=T.geodeticLatitudeToMercatorAngle(I),N=1/(T.geodeticLatitudeToMercatorAngle(R)-O),L=!0)}var q=s.imagery,X=0,Z=q.length,K=t._renderState,Q=t._blendRenderState,J=K,$=t._firstPassInitialColor,ie=a.context;l(t._debug.boundingSphereTile)||se();do{var ue,ce,de=0;t._drawCommands.length<=t._usedDrawCommands?(ue=new D,ue.owner=i,ue.cull=!1,ue.boundingVolume=new e,ue.orientedBoundingBox=void 0,ce=j(a),t._drawCommands.push(ue),t._uniformMaps.push(ce)):(ue=t._drawCommands[t._usedDrawCommands],ce=t._uniformMaps[t._usedDrawCommands]),ue.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?oe(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&ae(s.boundingSphere3D,o.RED).update(a));var he=ce.properties;n.clone($,he.initialColor),he.oceanNormalMap=h,he.lightingFadeDistance.x=t.lightingFadeOutDistance,he.lightingFadeDistance.y=t.lightingFadeInDistance,he.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,he.center3D=s.center,r.clone(b,he.rtc),n.clone(A,he.tileRectangle),he.southAndNorthLatitude.x=I,he.southAndNorthLatitude.y=R,he.southMercatorYAndOneOverHeight.x=O,he.southMercatorYAndOneOverHeight.y=N;for(var pe=m&&g.fog(i._distance,a.fog.density)>g.EPSILON3,fe=!1,me=!1,_e=!1,ge=!1,ve=!1,ye=!1,Ce=!1;de<u&&X<Z;){var we=q[X],Se=we.readyImagery;if(++X,l(Se)&&0!==Se.imageryLayer.alpha){var Ee=we.useWebMercatorT?Se.textureWebMercator:Se.texture,be=Se.imageryLayer;if(l(we.textureTranslationAndScale)||(we.textureTranslationAndScale=be._calculateTextureTranslationAndScale(i,we)),he.dayTextures[de]=Ee,he.dayTextureTranslationAndScale[de]=we.textureTranslationAndScale,he.dayTextureTexCoordsRectangle[de]=we.textureCoordinateRectangle,he.dayTextureUseWebMercatorT[de]=we.useWebMercatorT,he.dayTextureAlpha[de]=be.alpha,ye=ye||1!==he.dayTextureAlpha[de],he.dayTextureBrightness[de]=be.brightness,fe=fe||he.dayTextureBrightness[de]!==k.DEFAULT_BRIGHTNESS,he.dayTextureContrast[de]=be.contrast,me=me||he.dayTextureContrast[de]!==k.DEFAULT_CONTRAST,he.dayTextureHue[de]=be.hue,_e=_e||he.dayTextureHue[de]!==k.DEFAULT_HUE,he.dayTextureSaturation[de]=be.saturation,ge=ge||he.dayTextureSaturation[de]!==k.DEFAULT_SATURATION,he.dayTextureOneOverGamma[de]=1/be.gamma,ve=ve||he.dayTextureOneOverGamma[de]!==1/k.DEFAULT_GAMMA,he.dayTextureSplit[de]=be.splitDirection,Ce=Ce||0!==he.dayTextureSplit[de],l(Se.credits))for(var Te=a.creditDisplay,xe=Se.credits,Ae=0,Pe=xe.length;Ae<Pe;++Ae)Te.addCredit(xe[Ae]);++de}}he.dayTextures.length=de,he.waterMask=c,n.clone(s.waterMaskTranslationAndScale,he.waterMaskTranslationAndScale),he.minMaxHeight.x=x.minimumHeight,he.minMaxHeight.y=x.maximumHeight,v.clone(x.matrix,he.scaleAndBias),ue.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,de,fe,me,_e,ge,ve,ye,Ce,d,p,t.enableLighting,f,L,pe),ue.castShadows=_,ue.receiveShadows=S,ue.renderState=J,ue.primitiveType=C.TRIANGLES,ue.vertexArray=s.vertexArray,ue.uniformMap=ce,ue.pass=M.GLOBE,t._debug.wireframe&&(Y(ie,t,i),l(s.wireframeVertexArray)&&(ue.vertexArray=s.wireframeVertexArray,ue.primitiveType=C.LINES));var De=ue.boundingVolume,Me=ue.orientedBoundingBox;a.mode!==U.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,De),r.fromElements(De.center.z,De.center.x,De.center.y,De.center),a.mode===U.MORPHING&&(De=e.union(s.boundingSphere3D,De,De))):(ue.boundingVolume=e.clone(s.boundingSphere3D,De),ue.orientedBoundingBox=y.clone(s.orientedBoundingBox,Me)),a.commandList.push(ue),J=Q,$=le}while(X<Z)}function K(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new D,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof T;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=t.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(H.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),H.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var i=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&i.addCredit(this._terrainProvider.credit);for(var r=0,n=t.length;r<n;++r){var o=t.get(r).imageryProvider;o.ready&&l(o.credit)&&i.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)q(a[u]);a.length=0},H.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];l(n)&&(n.length=0)}this._usedDrawCommands=0},H.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;o<a;++o)Z(this,n[o],e)}},H.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=I.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)K(this,t[i],e)},H.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},H.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},H.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var Q=new e;H.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&g.fog(o,i.fog.density)>=1)return b.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==U.SCENE3D&&(c=Q,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===U.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var d=u.computeVisibility(c);if(d===_.OUTSIDE)return b.NONE;var h=i.mode===U.SCENE3D&&i.camera.frustum instanceof V;if(i.mode===U.SCENE3D&&!h){var p=a.occludeePointInScaledSpace;return l(p)?n.ellipsoid.isScaledSpacePointVisible(p)?d:b.NONE:d}return d};var J=new v,$=new v,ee=new n,te=new r,ie=new r,re=new r,ne=new r;H.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},H.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},H.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=z.LOADING)}),this._layerOrderChanged=!0}},H.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)r===-1&&(r=o),s.freeResources(),++n;else if(r!==-1)break}r!==-1&&i.splice(r,n)})},H.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},H.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var oe,ae,se;!function(){function e(e){return new B({geometryInstances:e,appearance:new L({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new v;oe=function(t,r){return t===i?n:(se(),i=t,u=v.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},ae=function(t,r){return t===i?n:(se(),i=t,u=v.fromTranslation(t.center,u),u=v.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},se=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var le=new n(0,0,0,0);return H}),define("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function d(e,t){var i=e.indexOf(t);return i}function h(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return r!==-1&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;r<n;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=d(this._layers,e);h(this,t,t+1)},c.prototype.lower=function(e){var t=d(this._layers,e);h(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=d(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=d(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var d=u[c];s.contains(d.rectangle,o)&&(n=d)}if(t(n)){for(var h=n.data.imagery,f=[],m=[],_=h.length-1;_>=0;--_){var g=h[_],v=g.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var C=p,w=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-w),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+w),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-w),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+w),s.contains(C,o)){var S=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(S)&&(f.push(S),m.push(v.imageryLayer))}}}}if(0!==f.length)return l.all(f,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=m[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;o<a;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;o<a;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),define("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),define("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var s=0;s<t;++s)r[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return r},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),define("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),define("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Ray","../Core/Rectangle","../Core/Visibility","./OrthographicFrustum","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new p({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=c.center(e.rectangle,B),r=i.longitude-L.longitude,n=i.latitude-L.latitude;i=c.center(t.rectangle,B);var o=i.longitude-L.longitude,a=i.latitude-L.latitude;return r*r+n*n-(o*o+a*a)}function C(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=f.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;L=t.camera.positionCartographic,h.sort(y);var p=e._addHeightCallbacks,m=e._removeHeightCallbacks,_=t.frameNumber;if(p.length>0||m.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(_,p,m);p.length=0,m.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?S(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++i.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++i.tilesWaitingForChildren);t.afterRender.push(w(e))}}function w(e){return function(){A(e)}}function S(e,t,i){var r=e._debug;if(++r.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>r.maxDepth&&(r.maxDepth=i.level),P(e,t,i)<e.maximumScreenSpaceError)return i.needsLoading&&e._tileLoadQueueMedium.push(i),void M(e,i);var n=i.southwestChild,o=i.southeastChild,a=i.northwestChild,s=i.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(M(e,i),E(e,t.camera.positionCartographic,n,o,a,s),i.needsLoading&&e._tileLoadQueueMedium.push(i)):(T(e,n,o,a,s,t),i.needsLoading&&e._tileLoadQueueLow.push(i)):(E(e,t.camera.positionCartographic,n,o,a,s),M(e,i),i.needsLoading&&e._tileLoadQueueLow.push(i))}function E(e,t,i,r,n,o){t.longitude<i.east?t.latitude<i.north?(b(e,i),b(e,r),b(e,n),b(e,o)):(b(e,n),b(e,i),b(e,o),b(e,r)):t.latitude<i.north?(b(e,r),b(e,i),b(e,o),b(e,n)):(b(e,o),b(e,n),b(e,r),b(e,i))}function b(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function T(e,t,i,r,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(x(e,t,s,o,l),x(e,i,s,o,l),x(e,r,s,o,l),x(e,n,s,o,l)):(x(e,r,s,o,l),x(e,t,s,o,l),x(e,n,s,o,l),x(e,i,s,o,l)):a.latitude<t.rectangle.north?(x(e,i,s,o,l),x(e,t,s,o,l),x(e,n,s,o,l),x(e,r,s,o,l)):(x(e,n,s,o,l),x(e,r,s,o,l),x(e,i,s,o,l),x(e,t,s,o,l))}function x(e,t,i,r,n){
i.computeTileVisibility(t,r,n)!==d.NONE?S(e,r,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function A(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function P(e,t,i){if(t.mode===_.SCENE2D||t.camera.frustum instanceof h)return D(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function D(e,t,i){var n=t.camera,o=n.frustum;r(o._offCenterFrustum)&&(o=o._offCenterFrustum);var a=t.context,s=a.drawingBufferWidth,u=a.drawingBufferHeight,c=e._tileProvider.getLevelMaximumGeometricError(i.level),d=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,u),h=c/d;return t.fog.enabled&&t.mode!==_.SCENE2D&&(h-=l.fog(i._distance,t.fog.density)*t.fog.sse),h}function M(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function I(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;R(e,t,o,a,i),R(e,t,o,a,r),R(e,t,o,a,n)}}function R(e,t,i,r,n){for(var o=0,a=n.length;o<a&&s()<r;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l)}}function O(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),d=n._updateHeightsTimeSlice,h=u+d,p=o.mode,f=o.mapProjection,m=f.ellipsoid;a.length>0;){for(var g=a[0],v=g.customData,y=v.length,C=!1,w=n._lastTileIndex;w<y;++w){var S=v[w];if(g.level>S.level){if(r(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,m)),p===_.SCENE3D){var E=m.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,F.direction),b=m.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,F.origin);if(!r(b)){var T=Math.min(i(g.data.minimumHeight,0),-11500),x=e.multiplyByScalar(E,Math.abs(T)+1,V);e.subtract(S.positionOnEllipsoidSurface,x,F.origin)}}else t.clone(S.positionCartographic,k),k.height=-11500,f.project(k,V),e.fromElements(V.z,V.x,V.y,V),e.clone(V,F.origin),e.clone(e.UNIT_X,F.direction);var A=g.data.pick(F,p,f,!1,V);r(A)&&S.callback(A),S.level=g.level}else if(g.level===S.level){for(var P,D=g.children,M=D.length,I=0;I<M&&(P=D[I],!c.contains(P.rectangle,S.positionCartographic));++I);var R=l.getTileDataAvailable(P.x,P.y,P.level),O=g.parent;(r(R)&&!R||r(O)&&r(O.data)&&r(O.data.terrainData)&&!O.data.terrainData.isChildAvailable(O.x,O.y,P.x,P.y))&&S.removeFunc()}if(s()>=h){C=!0;break}}if(C){n._lastTileIndex=w;break}n._lastTileIndex=0,a.shift()}}function N(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=r.length;o<a;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(v.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),v.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},v.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==m.START&&e(t),t=t.replacementNext},v.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},v.prototype.updateHeight=function(e,t){var i=this,r={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){for(var e=i._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===r){e.splice(n,1);break}i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},v.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var i=this._debug;i.suspendLodUpdate||(i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},v.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),C(this,e),N(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},v.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==_.MORPHING){I(this,e),O(this,e);var i=this._debug;i.suspendLodUpdate||i.enableDebugOutput&&(i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren))}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var L,B=new t,F=new u,k=new t,V=new e;return v}),define("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new b;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new S,this._surfaceShaderSet.baseVertexShaderSource=new _({sources:[C,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new _({sources:[v]}),this._surface=new T({tileProvider:new E({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new d,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=A.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function D(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}function M(e,t){return m.contains(e.rectangle,t)?e:void 0}a(P.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var I=[],R={start:0,stop:0};P.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=I;l.length=0;var u,c,d=this._surface._tilesToRender,p=d.length;for(c=0;c<p;++c){u=d[c];var f=u.data;if(o(f)){var m=f.pickBoundingSphere;a!==x.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,f.minimumHeight,f.maximumHeight,m),i.fromElements(m.center.z,m.center.x,m.center.y,m.center)):e.clone(f.boundingSphere3D,m);var _=h.raySphere(t,m,R);o(_)&&l.push(f)}}l.sort(D(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var O=new i,N=new i,L=new r,B=new f;return P.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!m.contains(r.rectangle,e));++a);if(o(r)&&m.contains(r.rectangle,e)){for(;r.renderable;)r=M(r.southwestChild,e)||M(r.southeastChild,e)||M(r.northwestChild,e)||r.northeastChild;for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,O),c=B,d=l.geodeticSurfaceNormal(u,c.direction),h=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(h)){var p=Math.min(n(r.data.minimumHeight,0),-11500),f=i.multiplyByScalar(d,Math.abs(p)+1,N);i.subtract(u,f,c.origin)}var _=r.data.pick(c,void 0,void 0,!1,N);if(o(_))return l.cartesianToCartographic(_,L).height}}}},P.prototype.beginFrame=function(e){if(this.show){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;w(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new g({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===x.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.shadows=this.shadows,t.beginFrame(e))}},P.prototype.update=function(e){if(this.show){var t=this._surface,i=e.passes;i.render&&t.update(e),i.pick&&t.update(e)}},P.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},P}),define("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"}),define("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function h(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n    float n_range = czm_depthRange.near;\n    float f_range = czm_depthRange.far;\n    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n    gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function m(e,t,i,r){e._colorTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function _(e,t,i,r){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function g(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;i(e.framebuffer)&&!a||(p(e),f(e),m(e,t,r,n),_(e,t,r,n))}function v(r,n,a,s){if(r._viewport.width=a,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=l.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var u="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(u,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){h(this,e,t)},d.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;g(this,e,t,i),v(this,e,t,i),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){p(this),f(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),r(this)},d}),define("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(r){function n(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===v._channel){n=t.layers[o];break}var s;if(!i(n))throw s="Could not find layer with channel (id) of "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(!i(n.version))throw s="Could not find a version in channel (id) "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(v._version=n.version,i(t.projection)&&"flat"===t.projection)v._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,m),new u(s);v._tilingScheme=new d({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}v._imageUrlTemplate=v._imageUrlTemplate.replace("{request}",v._requestType).replace("{channel}",v._channel).replace("{version}",v._version),v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(_)}function p(e){var t="An error occurred while accessing "+g+".";_=c.handleError(_,v,v._errorEvent,t,void 0,void 0,void 0,m),v._readyPromise.reject(new u(t))}function m(){var e=i(v._proxy)?v._proxy.getURL(g):g,t=s(e);h(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",f._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var _,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",v=this;m()}function m(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(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}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),f.prototype.getTileCredits=function(e,t,i){},f.prototype.requestImage=function(e,t,i){var r=m(this,e,t,i);return p.loadImage(this,r)},f.prototype.pickFeatures=function(e,t,i,r,n){},f._logoData="data:image/png;base64,[encoded data, 10272 characters]",f}),define("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,
r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),define("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(r.key);var d=t(r.format,"png");/\./.test(d)||(d="."+d),this._format=d;var h=s;if(l.test(s)||(h+="/"),h+=n+"/{z}/{x}/{y}"+this._format,i(this._accessToken)&&(h+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:h,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,r){var n=c.slice();return i(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s});define("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new h({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var m=new l,_=new l,g=new t,v=[];return f.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(d.computeIcrfToFixedMatrix(i,m))||d.computeTemeToPseudoFixedMatrix(i,m);var n=this._axes.evaluate(i,_);l.transpose(n,n),l.multiply(m,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(m,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=v,v.length=0,t.update(e),e.commandList=a,1===v.length?v[0]:void 0}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},f});define("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),define("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"}),define("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"}),define("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function v(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function C(e){v(e),y(e)}function w(e,t,i,r){v(e);var o=new Float32Array(i*r*4);e._accumulationTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}}),e._revealageTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}})}function S(e,t){y(e);var i=o.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,u=e._adjustAlphaFBO.status===i;n&&a&&s&&u||(C(e),e._translucentMultipassSupport=!1,r=!1)}return r}function E(e,t,r,n){var o=r[n.id];if(!i(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),r[n.id]=o}return o}function b(e,t,i){return E(t,O,e._translucentRenderStateCache,i)}function T(e,t,i){return E(t,N,e._translucentRenderStateCache,i)}function x(e,t,i){return E(t,L,e._alphaRenderStateCache,i)}function A(e,t,r,n){var o=e.shaderCache.getDerivedShaderProgram(t,r);if(!i(o)){var a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),s.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),s.sources.push("void main()\n{\n    czm_translucent_main();\n    if (czm_discard)\n    {\n        discard;\n    }\n"+n+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return o}function P(e,t){return A(e,t,"translucentMRT",B)}function D(e,t){return A(e,t,"translucentMultipass",F)}function M(e,t){return A(e,t,"alphaMultipass",k)}function I(e,t,i,r,n){var o,a,s,l=t.context,u=r.framebuffer,c=n.length,d=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var h=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=d&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,i(a,t,l,r,h);for(r.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=d&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,i(a,t,l,r,h);r.framebuffer=u}function R(e,t,i,r,n){var o=t.context,a=r.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var u=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var d=n[c],h=l&&d.receiveShadows?d.derivedCommands.oit.shadows.translucentCommand:d.derivedCommands.oit.translucentCommand;i(h,t,o,r,u)}r.framebuffer=a}g.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&w(this,t,n,o),i(this._translucentFBO)&&!s||S(this,t)){var l,u,h=this;i(this._compositeCommand)||(l=new d({sources:[f]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new d({defines:["MRT"],sources:[p]}),u={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new d({sources:[p]}),u={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return h._alphaClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=c.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var O={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ONE,functionDestinationRgb:_.ONE,functionSourceAlpha:_.ZERO,functionDestinationAlpha:_.ONE_MINUS_SOURCE_ALPHA},N={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ONE,functionDestinationRgb:_.ONE,functionSourceAlpha:_.ONE,functionDestinationAlpha:_.ONE},L={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ZERO,functionDestinationRgb:_.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:_.ZERO,functionDestinationAlpha:_.ONE_MINUS_SOURCE_ALPHA},B="    vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n    float ai = czm_gl_FragColor.a;\n    float wzi = czm_alphaWeight(ai);\n    gl_FragData[0] = vec4(Ci * wzi, ai);\n    gl_FragData[1] = vec4(ai * wzi);\n",F="    vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n    float ai = czm_gl_FragColor.a;\n    float wzi = czm_alphaWeight(ai);\n    gl_FragColor = vec4(Ci, ai) * wzi;\n",k="    float ai = czm_gl_FragColor.a;\n    gl_FragColor = vec4(ai);\n";return g.prototype.createDerivedCommands=function(e,t,r){if(i(r)||(r={}),this._translucentMRTSupport){var n,o;i(r.translucentCommand)&&(n=r.translucentCommand.shaderProgram,o=r.translucentCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),i(n)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=n,r.translucentCommand.renderState=o):(r.translucentCommand.shaderProgram=P(t,e.shaderProgram),r.translucentCommand.renderState=b(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;i(r.translucentCommand)&&(a=r.translucentCommand.shaderProgram,l=r.translucentCommand.renderState,u=r.alphaCommand.shaderProgram,c=r.alphaCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),r.alphaCommand=s.shallowClone(e,r.alphaCommand),i(a)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=a,r.translucentCommand.renderState=l,r.alphaCommand.shaderProgram=u,r.alphaCommand.renderState=c):(r.translucentCommand.shaderProgram=D(t,e.shaderProgram),r.translucentCommand.renderState=T(this,t,e.renderState),r.alphaCommand.shaderProgram=M(t,e.shaderProgram),r.alphaCommand.renderState=x(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},g.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void R(this,e,t,i,r):void I(this,e,t,i,r)},g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},g.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return C(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),r(this)},g}),define("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),define("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var i=o(t.container);this._container=i;var r=document.createElement("div");r.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),a.appendChild(this._msText),r.appendChild(a),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return a.prototype.update=function(){if(!t(this._time))return this._lastFpsSampleTime=n(),void(this._time=n());var e=this._time,i=n();this._time=i;var r=i-e;this._frameCount++;var o=this._fps,a=i-this._lastFpsSampleTime;a>1e3&&(o=1e3*this._frameCount/a|0,this._lastFpsSampleTime=i,this._frameCount=0),o!==this._fps&&(this._fpsText.nodeValue=o+" FPS",this._fps=o),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},a.prototype.destroy=function(){return i(this)},a}),define("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n    float n_range = czm_depthRange.near;\n    float f_range = czm_depthRange.far;\n    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n    gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function d(e,t,r,o){e._depthTexture=new a({context:t,width:r,height:o,pixelFormat:i.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function h(e,t,i,n){u(e),c(e),d(e,t,i,n),e.framebuffer=new r({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||h(t,i,n,o)}function f(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),f(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),define("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),define("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nattribute float batchId;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),define("Scene/PointAppearance",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT),this._vertexShaderSource=i(n.vertexShaderSource,s),this._fragmentShaderSource=i(n.fragmentShaderSource,a),this._renderState=l.getDefaultRenderState(!1,!1,n.renderState),this._pointSize=i(n.pointSize,2),this._highlightColor=r(n.highlightColor)?n.highlightColor:new e,this.material=void 0,this.translucent=i(n.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=n.uniforms;this.uniforms=t(this.uniforms,o,!0)}return n(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return u.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),u.VERTEX_FORMAT=o.POSITION_AND_COLOR,u.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,u.prototype.isTranslucent=l.prototype.isTranslucent,u.prototype.getRenderState=l.prototype.getRenderState,u}),define("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;i<t;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),define("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),define("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./OrthographicOffCenterFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}function v(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function y(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function C(e,t){var i=e._scene,r=i.camera,n=Z,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,j);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,Y),h=d.eastNorthUpToFixedFrame(c,t,X);return s.multiplyByPointAsVector(h,r.direction,a),s.multiplyByPointAsVector(h,r.up,l),n}function w(t,i,r,n){function a(t){E(c,f,t.time,u.position),E(d,m,t.time,u.direction),E(p,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,K),d=e.clone(u.direction,Q),p=e.clone(u.up,J),f=s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,r.position,$),m=s.multiplyByPointAsVector(h.TRANSFORM_2D_INVERSE,r.direction,ee),_=s.multiplyByPointAsVector(h.TRANSFORM_2D_INVERSE,r.up,te),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){M(t,l,0,1,i,n)}});t._currentTweens.push(g)}function S(t,i,r){function n(t){E(p,g,t.time,u.position),E(f,y,t.time,u.direction),E(m,S,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var i=u.frustum;i.right=a.lerp(b,T,t.time),i.left=-i.right,i.top=i.right*(l.drawingBufferHeight/l.drawingBufferWidth),i.bottom=-i.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}i/=3;var s,l=t._scene,u=l.camera;i>0?(s=Z,e.fromDegrees(0,0,5*r.maximumRadius,r,s.position),e.negate(s.position,s.direction),e.normalize(s.direction,s.direction),e.clone(e.UNIT_Z,s.up)):(u.position.z=u.frustum.right-u.frustum.left,s=C(t,r));var c=I(s);v(t,c);var d,h,p=e.clone(u.position,we),f=e.clone(u.direction,Se),m=e.clone(u.up,Ee),g=e.fromElements(0,0,5*r.maximumRadius,be),y=e.negate(e.UNIT_Z,Te),S=e.clone(e.UNIT_Y,xe),b=u.frustum.right,T=.5*g.z;if(d=t._morphToOrthographic?function(){h=re,h.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,h.width=u.frustum.right-u.frustum.left,u.frustum=h,w(t,i,s,c)}:function(){h=ie,h.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,h.fov=a.toRadians(60),s.frustum=h,A(t,i,s,function(){w(t,i,s,c)})},i>0){var x=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l._mode=_.MORPHING,d()}});t._currentTweens.push(x)}else d()}function E(t,i,r,n){return e.lerp(t,i,r,n)}function b(e,t,i,r,n){function s(e){u.frustum.fov=a.lerp(c,d,e.time);var t=h/Math.tan(.5*u.frustum.fov);r(u,t)}var l=e._scene,u=l.camera;if(!(u.frustum instanceof p)){var c=u.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=i.position.z*Math.tan(.5*c);u.frustum.far=h/Math.tan(.5*d)+1e7;var f=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(f)}}function T(t,r){function n(t){E(c,_,t.time,u.position),E(d,f,t.time,u.direction),E(p,m,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right),u._adjustOrthographicFrustum(!0)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ne),d=e.clone(u.direction,oe),p=e.clone(u.up,ae),f=e.negate(e.UNIT_Z,le),m=e.clone(e.UNIT_Y,ue),_=se;if(r>0)e.clone(e.ZERO,se),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,se);var g=de;s.multiplyByPoint(h.TRANSFORM_2D,c,g.origin),s.multiplyByPointAsVector(h.TRANSFORM_2D,d,g.direction);var y=l.globe;if(i(y)){var C=y.pick(g,l,he);i(C)&&(s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var w=ce;w.right=.5*_.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=pe;S.position=_,S.direction=f,S.up=m,S.frustum=w;var T=R(S);v(t,T);var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){b(t,r,S,a,T)}});t._currentTweens.push(x)}function x(t,r,n){function o(e,t){e.position.x=t}function a(){b(t,r,c,o,E)}r*=.5;var l=t._scene,u=l.camera,c=me;if(r>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,fe),l.mapProjection.project(fe,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=ve;e.clone(c.position2D,p.origin);var f=e.clone(u.directionWC,p.direction),m=n.scaleToGeodeticSurface(u.positionWC,Ce),_=d.eastNorthUpToFixedFrame(m,n,ye);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,f,f),s.multiplyByPointAsVector(h.TRANSFORM_2D,f,f);var g=l.globe;if(i(g)){var y=g.pick(p,l,ge);if(i(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(h.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(h.TRANSFORM_2D,c.direction,c.direction2D),
s.multiplyByPointAsVector(h.TRANSFORM_2D,c.up,c.up2D);var w=c.frustum;w.right=.5*c.position.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=_e;s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=w;var E=R(S);v(t,E),D(t,r,c,a)}function A(e,t,i,r){function n(e){l.frustum.fov=a.lerp(d,c,e.time),l.position.z=h/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=i.frustum.clone();var c=l.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=u*Math.tan(.5*c);l.frustum.far=h/Math.tan(.5*d)+1e7,l.frustum.fov=d;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){r(e)}});e._currentTweens.push(p)}function P(t,i,r,n){function a(){function a(t){E(h,u,t.time,l.position),E(p,c,t.time,l.direction),E(f,d,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}l.frustum=r.frustum.clone();var h=e.clone(l.position,we),p=e.clone(l.direction,Se),f=e.clone(l.up,Ee);h.z=u.z;var m=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){n(t)}});t._currentTweens.push(m)}i*=.5;var s=t._scene,l=s.camera,u=e.clone(r.position,be),c=e.clone(r.direction,Te),d=e.clone(r.up,xe);s._mode=_.MORPHING,t._morphToOrthographic?a():A(t,0,r,a)}function D(t,i,r,n){function a(t){E(u,h,t.time,l.position),E(c,p,t.time,l.direction),E(d,f,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right),l._adjustOrthographicFrustum(!0)}var s=t._scene,l=s.camera,u=e.clone(l.position,we),c=e.clone(l.direction,Se),d=e.clone(l.up,Ee),h=e.clone(r.position2D,be),p=e.clone(r.direction2D,Te),f=e.clone(r.up2D,xe),m=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){M(t,s,1,0,i,n)}});t._currentTweens.push(m)}function M(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function I(t){return function(r){var n=r._scene;if(n._mode=_.SCENE3D,n.morphTime=_.getMorphTime(_.SCENE3D),y(r),r._previousMode!==_.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,_.SCENE3D,a)}}function R(t){return function(r){var n=r._scene;n._mode=_.SCENE2D,n.morphTime=_.getMorphTime(_.SCENE2D),y(r);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,_.SCENE2D,a)}}function O(t){return function(r){var n=r._scene;if(n._mode=_.COLUMBUS_VIEW,n.morphTime=_.getMorphTime(_.COLUMBUS_VIEW),y(r),r._previousModeMode!==_.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,_.COLUMBUS_VIEW,a)}}g.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},g.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._morphToOrthographic=r.camera.frustum instanceof p,this._previousMode!==_.SCENE2D&&this._previousMode!==_.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,_.SCENE2D,!0),r._mode=_.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===_.COLUMBUS_VIEW?T(this,e):x(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var N=new e,L=new e,B=new e,F=new e,k=new e,V=new e,z=new e,U=new t,G=new s,H=new m,W=new p,q={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};g.prototype.morphToColumbusView=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==_.COLUMBUS_VIEW&&this._previousMode!==_.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,_.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=N,l=L,u=B;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*r.maximumRadius,o),e.negate(e.normalize(o,l),l),e.cross(e.UNIT_X,l,u);else{var c=n.camera;if(this._previousMode===_.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=r.scaleToGeodeticSurface(o,z),f=d.eastNorthUpToFixedFrame(p,r,G);s.inverseTransformation(f,f),n.mapProjection.project(r.cartesianToCartographic(o,U),o),s.multiplyByPointAsVector(f,l,l),s.multiplyByPointAsVector(f,u,u)}}var m;this._morphToOrthographic?(m=W,m.width=n.camera.frustum.right-n.camera.frustum.left,m.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(m=H,m.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,m.fov=a.toRadians(60));var g=q;g.position=o,g.direction=l,g.up=u,g.frustum=m;var y=O(g);v(this,y),this._previousMode===_.SCENE2D?P(this,t,g,y):(g.position2D=s.multiplyByPoint(h.TRANSFORM_2D,o,F),g.direction2D=s.multiplyByPointAsVector(h.TRANSFORM_2D,l,k),g.up2D=s.multiplyByPointAsVector(h.TRANSFORM_2D,u,V),n._mode=_.MORPHING,D(this,t,g,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}},g.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==_.SCENE3D&&this._previousMode!==_.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,_.SCENE3D,!0),n._mode=_.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===_.SCENE2D)S(this,t,r);else{var o;t>0?(o=Z,e.fromDegrees(0,0,5*r.maximumRadius,r,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=C(this,r);var a=I(o);v(this,a),w(this,t,o,a)}0===t&&i(this._completeMorph)&&this._completeMorph()}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return y(this),r(this)};var j=new t,Y=new e,X=new s,Z={position:new e,direction:new e,up:new e,frustum:void 0},K=new e,Q=new e,J=new e,$=new e,ee=new e,te=new e,ie=new m,re=new p,ne=new e,oe=new e,ae=new e,se=new e,le=new e,ue=new e,ce=new f,de=new l,he=new e,pe={position:void 0,direction:void 0,up:void 0,frustum:void 0},fe=new t,me={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new f},_e={position:new e,direction:new e,up:new e,frustum:void 0},ge=new e,ve=new l,ye=new s,Ce=new e,we=new e,Se=new e,Ee=new e,be=new e,Te=new e,xe=new e;return g}),define("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,d=t(r.easingFunction,o.LINEAR_NONE),h=r.startObject,p=new l.Tween(h);p.to(e(r.stopObject),n),p.delay(c),p.easing(d),i(r.update)&&p.onUpdate(function(){r.update(h)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var f=new u(this,p,r.startObject,r.stopObject,r.duration,a,d,r.update,r.complete,r.cancel);return this._tweens.push(f),f},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;i<t;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),t.splice(r,1))}},c}),define("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./OrthographicFrustum","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:d.CTRL},{eventType:C.RIGHT_DRAG,modifier:d.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:d.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new T,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,h.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function A(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function P(t){return e.equalsEpsilon(t.startPosition,t.endPosition,h.EPSILON14)}function D(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),d=t.getButtonReleaseTime(i,r),h=c&&d&&(d.getTime()-c.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(c&&d&&h<ee){var m=A(f,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var _=t.getLastMovement(i,r);if(!o(_)||P(_))return;u.motion.x=.5*(_.endPosition.x-_.startPosition.x),u.motion.y=.5*(_.endPosition.y-_.startPosition.y),u.startPosition=e.clone(_.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function M(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(te[0]=i,i=te);for(var l=i.length,u=0;u<l;++u){var d=i[u],h=o(d.eventType)?d.eventType:d,p=d.modifier,f=s.isMoving(h,p)&&s.getMovement(h,p),m=s.getStartMousePosition(h,p);e.enableInputs&&t&&(f?r(e,m,f):n<1&&D(s,h,p,n,r,e,a))}}}function I(i,r,n,a,s,l){var u=1;o(l)&&(u=h.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,d=i.maximumZoomDistance,p=s-c,f=a*p;f=h.clamp(f,i._minimumZoomRate,i._maximumZoomRate);var m=n.endPosition.y-n.startPosition.y,_=m/i._scene.canvas.clientHeight;_=Math.min(_,i.maximumMovementRatio);var g=f*_;if(!(g>0&&Math.abs(s-c)<1||g<0&&Math.abs(s-d)<1)){s-g<c?g=s-c-1:s-g>d&&(g=s-d);var v=i._scene,y=v.camera,C=v.mode;if(y.frustum instanceof S)return void(Math.abs(g)>0&&(y.zoomIn(g),y._adjustOrthographicFrustum()));var w,T=e.equals(r,i._zoomMouseStart),x=i._zoomingOnVector,A=i._rotatingZoom;if(T||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(w=C!==E.SCENE2D?F(i,r,re):y.getPickRay(r,ie).origin),o(w)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(w,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,x=i._zoomingOnVector=!1,A=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void y.zoomIn(g);var P=C===E.COLUMBUS_VIEW;if(y.positionCartographic.height<2e6&&(A=!0),!T||A){if(C===E.SCENE2D){var D=i._zoomWorldPosition,M=y.position;if(!t.equals(D,M)&&y.positionCartographic.height<2*i._maxCoord.x){var I=y.position.x,R=t.subtract(D,M,oe);t.normalize(R,R);var O=t.distance(D,M)*g/(.5*y.getMagnitude());y.move(R,.5*O),(y.position.x<0&&I>0||y.position.x>0&&I<0)&&(w=y.getPickRay(r,ie).origin,i._zoomWorldPosition=t.clone(w,i._zoomWorldPosition))}}else if(C===E.SCENE3D){var N=t.normalize(y.position,de);if(y.positionCartographic.height<3e3&&Math.abs(t.dot(y.direction,N))<.6)P=!0;else{var L=v.canvas,B=ae;B.x=L.clientWidth/2,B.y=L.clientHeight/2;var k=F(i,B,se);if(o(k)&&y.positionCartographic.height<1e6){var V=pe;t.clone(y.position,V);var z=i._zoomWorldPosition,U=he;if(U=t.normalize(z,U),t.dot(U,N)<0)return;var G=we,H=_e;t.clone(y.direction,H),t.add(V,t.multiplyByScalar(H,1e3,Se),G);var W=ge,q=ve;t.subtract(z,V,W),t.normalize(W,q);var j=t.dot(N,q);if(j>=0)return void(i._zoomMouseStart.x=-1);var Y=Math.acos(-j),X=t.magnitude(V),Z=t.magnitude(z),K=X-g,Q=t.magnitude(W),J=Math.asin(h.clamp(Q/Z*Math.sin(Y),-1,1)),$=Math.asin(h.clamp(K/Z*Math.sin(Y),-1,1)),ee=J-$+Y,te=fe;t.normalize(V,te);var Te=me;Te=t.cross(q,te,Te),Te=t.normalize(Te,Te),t.normalize(t.cross(te,Te,Se),H),t.multiplyByScalar(t.normalize(G,Se),t.magnitude(G)-g,G),t.normalize(V,V),t.multiplyByScalar(V,K,V);var xe=ye;t.multiplyByScalar(t.add(t.multiplyByScalar(te,Math.cos(ee)-1,Ee),t.multiplyByScalar(H,Math.sin(ee),be),Se),K,xe),t.add(V,xe,V),t.normalize(G,te),t.normalize(t.cross(te,Te,Se),H);var Ae=Ce;return t.multiplyByScalar(t.add(t.multiplyByScalar(te,Math.cos(ee)-1,Ee),t.multiplyByScalar(H,Math.sin(ee),be),Se),t.magnitude(G),Ae),t.add(G,Ae,G),t.clone(V,y.position),t.normalize(t.subtract(G,V,Se),y.direction),t.clone(y.direction,y.direction),t.cross(y.direction,y.up,y.right),void t.cross(y.right,y.direction,y.up)}if(o(k)){var Pe=t.normalize(k,le),De=t.normalize(i._zoomWorldPosition,ue),Me=t.dot(De,Pe);if(Me>0&&Me<1){var Ie=h.acosClamped(Me),Re=t.cross(De,Pe,ce),Oe=Math.abs(Ie)>h.toRadians(20)?.75*y.positionCartographic.height:y.positionCartographic.height-g,Ne=g/Oe;y.rotate(Re,Ie*Ne)}}else P=!0}}i._rotatingZoom=!P}if(!T&&P||x){var Le,Be=b.wgs84ToWindowCoordinates(v,i._zoomWorldPosition,ne);Le=C!==E.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(Be)?y.getPickRay(Be,ie):y.getPickRay(r,ie);var Fe=Le.direction;C===E.COLUMBUS_VIEW&&t.fromElements(Fe.y,Fe.z,Fe.x,Fe),y.move(Fe,g),i._zoomingOnVector=!0}else y.zoomIn(g)}}function R(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,Te).origin,s=o.getPickRay(r.endPosition,xe).origin,l=t.subtract(a,s,Ae),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function O(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;I(e,t,i,e._zoomFactor,n.getMagnitude())}function N(t,i,r){if(o(r.angleAndHeight))return void L(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Pe;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var d=De;d.x=2/l*r.endPosition.x-1,d.y=2/u*(u-r.endPosition.y)-1,d=e.normalize(d,d);var p=h.acosClamped(c.x);c.y<0&&(p=h.TWO_PI-p);var f=h.acosClamped(d.x);d.y<0&&(f=h.TWO_PI-f);var m=f-p;a.twistRight(m)}function L(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function B(e){var t=e._scene.mapMode2D===w.ROTATE;f.equals(f.IDENTITY,e._scene.camera.transform)?(M(e,e.enableTranslate,e.translateEventTypes,R,e.inertiaTranslate,"_lastInertiaTranslateMovement"),M(e,e.enableZoom,e.zoomEventTypes,O,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&M(e,e.enableRotate,e.tiltEventTypes,N,e.inertiaSpin,"_lastInertiaTiltMovement")):(M(e,e.enableZoom,e.zoomEventTypes,O,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&M(e,e.enableRotate,e.translateEventTypes,N,e.inertiaSpin,"_lastInertiaSpinMovement"))}function F(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPositionWorldCoordinates(i,Ie));var u=s.getPickRay(i,Me),c=a.pick(u,n,Re),d=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,h=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return d<h?t.clone(l,r):t.clone(c,r)}}function k(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void J(i,r,n);if(i._strafing)return void W(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,ze),d=e.clone(n.endPosition,Ue),p=l.getPickRay(c,Oe),f=t.clone(t.ZERO,ke),_=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=F(i,c,Le),o(a)&&(f.x=a.x)),f.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,W(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=m.fromPointNormal(f,_,Ve);p=l.getPickRay(c,Oe);var v=u.rayPlane(p,g,Le),y=l.getPickRay(d,Ne),C=u.rayPlane(y,g,Be);if(!o(v)||!o(C))return i._looking=!0,J(i,r,n),void e.clone(r,i._translateMousePosition);var w=t.subtract(v,C,Fe),S=w.x;w.x=w.y,w.y=w.z,w.z=S;var E=t.magnitude(w);E>h.EPSILON6&&(t.normalize(w,w),l.move(w,E))}function V(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void J(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,z(t,i,r)):U(t,i,r)}function z(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Ge;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var d,p=s.getPickRay(c,He),m=t.UNIT_X,_=p.origin,g=p.direction,y=t.dot(m,g);if(Math.abs(y)>h.EPSILON6&&(d=-t.dot(m,_)/y),!o(d)||d<=0)return i._looking=!0,J(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,d,We);t.add(_,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,Qe);S.cartographicToCartesian(E,C);var b=v.eastNorthUpToFixedFrame(C,S,je),T=i._globe,x=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=f.clone(s.transform,Je);s._setTransform(b),j(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=T,i._ellipsoid=x;var P=x.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function U(i,r,n){var a,s,c=i._scene,d=c.camera,g=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,We);else{if(d.position.z<i._minimumPickingTerrainHeight&&(a=F(i,r,We)),!o(a)){s=d.getPickRay(r,He);var y,C=s.origin,w=s.direction,S=t.dot(g,w);if(Math.abs(S)>h.EPSILON6&&(y=-t.dot(g,C)/S),!o(y)||y<=0)return i._looking=!0,J(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(w,y,We),t.add(C,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var E=c.canvas,b=Ge;b.x=E.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=d.getPickRay(b,He);var T=t.clone(t.ZERO,Xe);T.x=a.x;var x=m.fromPointNormal(T,g,Ze),A=u.rayPlane(s,x,qe),P=d._projection,D=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var M=P.unproject(a,Qe);D.cartographicToCartesian(M,a);var I,R=v.eastNorthUpToFixedFrame(a,D,je);o(A)?(t.fromElements(A.y,A.z,A.x,A),M=P.unproject(A,Qe),D.cartographicToCartesian(M,A),I=v.eastNorthUpToFixedFrame(A,D,Ye)):I=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var L=t.UNIT_Z,B=f.clone(d.transform,Je);d._setTransform(R);var k=t.cross(t.UNIT_Z,t.normalize(d.position,Ke),Ke),V=t.dot(d.right,k);if(j(i,r,n,L,!1,!0),d._setTransform(I),V<0){n.startPosition.y>n.endPosition.y&&(L=void 0);var z=d.constrainedAxis;d.constrainedAxis=void 0,j(i,r,n,L,!0,!1),d.constrainedAxis=z}else j(i,r,n,L,!0,!1);if(o(d.constrainedAxis)){var U=t.cross(d.direction,d.constrainedAxis,Mt);t.equalsEpsilon(U,t.ZERO,h.EPSILON6)||(t.dot(U,d.right)<0&&t.negate(U,U),t.cross(U,d.direction,d.up),t.cross(d.direction,d.up,d.right),t.normalize(d.up,d.up),t.normalize(d.right,d.right))}d._setTransform(B),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var H=t.clone(d.positionWC,Ke);if(d._adjustHeightForTerrain(),!t.equals(d.positionWC,H)){d._setTransform(I),d.worldToCameraCoordinatesPoint(H,H);var W=t.magnitudeSquared(H);t.magnitudeSquared(d.position)>W&&(t.normalize(d.position,d.position),t.multiplyByScalar(d.position,Math.sqrt(W),d.position));var q=t.angleBetween(H,d.position),Y=t.cross(H,d.position,H);t.normalize(Y,Y);var X=_.fromAxisAngle(Y,q,$e),Z=p.fromQuaternion(X,et);p.multiplyByVector(Z,d.direction,d.direction),p.multiplyByVector(Z,d.up,d.up),t.cross(d.direction,d.up,d.right),t.cross(d.right,d.direction,d.up),d._setTransform(B)}}function G(e,i,r){o(r.distance)&&(r=r.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,it);a.position.z<e._minimumPickingTerrainHeight&&(u=F(e,l,rt));var d;if(o(u))d=t.distance(c.origin,u);else{var h=t.UNIT_X,p=c.origin,f=c.direction;d=-t.dot(h,p)/t.dot(h,f)}I(e,i,r,e._zoomFactor,d)}function H(e){var t=e._scene,i=t.camera;if(f.equals(f.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),M(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),M(e,e.enableTranslate,e.translateEventTypes,k,e.inertiaTranslate,"_lastInertiaTranslateMovement"),M(e,e.enableZoom,e.zoomEventTypes,G,e.inertiaZoom,"_lastInertiaZoomMovement"),M(e,e.enableLook,e.lookEventTypes,J),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else M(e,e.enableRotate,e.rotateEventTypes,j,e.inertiaSpin,"_lastInertiaSpinMovement"),M(e,e.enableZoom,e.zoomEventTypes,X,e.inertiaZoom,"_lastInertiaZoomMovement")}function W(e,i,r){var n=e._scene,a=n.camera,s=F(e,r.startPosition,ct);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,nt),d=t.clone(a.direction,st);n.mode===E.COLUMBUS_VIEW&&t.fromElements(d.z,d.x,d.y,d);var h=m.fromPointNormal(s,d,ot),p=u.rayPlane(c,h,at);o(p)&&(d=t.subtract(s,p,d),n.mode===E.COLUMBUS_VIEW&&t.fromElements(d.y,d.z,d.x,d),t.add(a.position,d,a.position))}}function q(i,r,n){var a=i._scene,s=a.camera;if(!f.equals(s.transform,f.IDENTITY))return void j(i,r,n);var u,c,d,h,p=i._ellipsoid.geodeticSurfaceNormal(s.position,pt),m=i._ellipsoid.cartesianToCartographic(s.positionWC,ut).height,_=i._globe,g=!1;if(o(_)&&m<i._minimumPickingTerrainHeight&&(h=F(i,n.startPosition,ct),o(h))){var v=s.getPickRay(n.startPosition,Me),y=i._ellipsoid.geodeticSurfaceNormal(h);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?J(i,r,n,p):i._rotating?j(i,r,n):i._strafing?(t.clone(h,i._strafeStartPosition),W(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=dt,c.x=c.y=c.z=u,d=l.fromCartesian3(c,ht),Y(i,r,n,d))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&m<i._minimumPickingTerrainHeight?o(h)?t.magnitude(s.position)<t.magnitude(h)?(t.clone(h,i._strafeStartPosition),i._strafing=!0,W(i,r,n)):(u=t.magnitude(h),c=dt,c.x=c.y=c.z=u,d=l.fromCartesian3(c,ht),Y(i,r,n,d),t.clone(h,i._rotateStartPosition)):(i._looking=!0,J(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,lt))?(Y(i,r,n,i._ellipsoid),t.clone(lt,i._rotateStartPosition)):m>i._minimumTrackBallHeight?(i._rotating=!0,j(i,r,n)):(i._looking=!0,J(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function j(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,d=u.canvas,h=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),f=e._rotateFactor*(p-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);var m=(r.startPosition.x-r.endPosition.x)/d.clientWidth,_=(r.startPosition.y-r.endPosition.y)/d.clientHeight;m=Math.min(m,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);var g=f*m*Math.PI*2,v=f*_*Math.PI;s||c.rotateRight(g),l||c.rotateUp(v),c.constrainedAxis=h}function Y(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,Ct),c=e.clone(n.endPosition,wt),d=l.pickEllipsoid(u,a,ft),p=l.pickEllipsoid(c,a,mt);if(!o(d)||!o(p))return i._rotating=!0,void j(i,r,n);if(d=l.worldToCameraCoordinates(d,d),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var f=l.constrainedAxis,m=t.mostOrthogonalAxis(f,_t);t.cross(m,f,m),t.normalize(m,m);var _=t.cross(f,m,gt),g=t.magnitude(d),v=t.dot(f,d),y=Math.acos(v/g),C=t.multiplyByScalar(f,v,vt);t.subtract(d,C,C),t.normalize(C,C);var w=t.magnitude(p),S=t.dot(f,p),E=Math.acos(S/w),b=t.multiplyByScalar(f,S,yt);t.subtract(p,b,b),t.normalize(b,b);var T=Math.acos(t.dot(C,m));t.dot(C,_)<0&&(T=h.TWO_PI-T);var x=Math.acos(t.dot(b,m));t.dot(b,_)<0&&(x=h.TWO_PI-x);var A,P=T-x;A=t.equalsEpsilon(f,l.position,h.EPSILON2)?l.right:t.cross(f,l.position,_t);var D,M=t.cross(f,A,_t),I=t.dot(M,t.subtract(d,f,gt)),R=t.dot(M,t.subtract(p,f,gt));D=I>0&&R>0?E-y:I>0&&R<=0?t.dot(l.position,f)>0?-y-E:y+E:y-E,l.rotateRight(P),l.rotateUp(D)}else{t.normalize(d,d),t.normalize(p,p);var O=t.dot(d,p),N=t.cross(d,p,_t);if(O<1&&!t.equalsEpsilon(N,t.ZERO,h.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function X(e,i,r){o(r.distance)&&(r=r.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,d=s.getPickRay(u,it),h=n.cartesianToCartographic(s.position,Et).height;h<e._minimumPickingTerrainHeight&&(c=F(e,u,rt));var p;p=o(c)?t.distance(d.origin,c):h;var f=t.normalize(s.position,St);I(e,i,r,e._zoomFactor,p,t.dot(f,s.direction))}function Z(t,i,r){var n=t._scene,a=n.camera;if(f.equals(a.transform,f.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Lt);return void J(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Nt);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,K(t,i,r)):Q(t,i,r)}}function K(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,d=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Bt).height;if(!(p-d-1<h.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var m=s.canvas,_=bt;_.x=m.clientWidth/2,_.y=m.clientHeight/2;var y,C=c.getPickRay(_,Tt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,xt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Lt);return J(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,Nt);b.height=0,y=a.cartographicToCartesian(b,xt)}var T=v.eastNorthUpToFixedFrame(y,a,Pt),x=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=f.clone(c.transform,It);c._setTransform(T),j(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=x,i._ellipsoid=A;var D=A.maximumRadius;i._rotateFactor=1/D,i._rotateRateRangeAdjustment=D}}function Q(i,r,n){var a,s,c,d=i._ellipsoid,m=i._scene,y=m.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,xt);else{if(a=F(i,r,xt),!o(a)){if(s=y.getPickRay(r,Tt),c=u.rayEllipsoid(s,d),!o(c)){var C=d.cartesianToCartographic(y.position,Nt);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var w=i._ellipsoid.geodeticSurfaceNormal(y.position,Lt);J(i,r,n,w),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,xt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=m.canvas,E=bt;E.x=S.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=y.getPickRay(E,Tt);var b=t.magnitude(a),T=t.fromElements(b,b,b,dt),x=l.fromCartesian3(T,ht);if(c=u.rayEllipsoid(s,x),o(c)){var A=t.magnitude(s.origin)>b?c.start:c.stop,P=g.getPoint(s,A,At),D=v.eastNorthUpToFixedFrame(a,d,Pt),M=v.eastNorthUpToFixedFrame(P,x,Dt),I=i._globe,R=i._ellipsoid;
i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=f.clone(y.transform,It);y._setTransform(D);var L=t.cross(P,y.positionWC,Mt),B=t.dot(y.rightWC,L);if(j(i,r,n,O,!1,!0),y._setTransform(M),B<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var k=y.constrainedAxis;y.constrainedAxis=void 0,j(i,r,n,O,!0,!1),y.constrainedAxis=k}else j(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var V=t.cross(y.direction,y.constrainedAxis,Mt);t.equalsEpsilon(V,t.ZERO,h.EPSILON6)||(t.dot(V,y.right)<0&&t.negate(V,V),t.cross(V,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=I,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,Mt);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var H=t.angleBetween(U,y.position),W=t.cross(U,y.position,U);t.normalize(W,W);var q=_.fromAxisAngle(W,H,Rt),Y=p.fromQuaternion(q,Ot);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function J(e,i,r,a){var s=e._scene,l=s.camera,u=Ft;u.x=r.startPosition.x,u.y=0;var c=kt;c.x=r.endPosition.x,c.y=0;var d,p,f=l.getPickRay(u,Vt),m=l.getPickRay(c,zt),_=0;l.frustum instanceof S?(d=f.origin,p=m.origin,t.add(l.direction,d,d),t.add(l.direction,p,p),t.subtract(d,l.position,d),t.subtract(p,l.position,p),t.normalize(d,d),t.normalize(p,p)):(d=f.direction,p=m.direction);var g=t.dot(d,p);g<1&&(_=Math.acos(g)),_=r.startPosition.x>r.endPosition.x?-_:_;var v=e._horizontalRotationAxis;if(o(a)?l.look(a,-_):o(v)?l.look(v,-_):l.lookLeft(_),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,f=l.getPickRay(u,Vt),m=l.getPickRay(c,zt),_=0,l.frustum instanceof S?(d=f.origin,p=m.origin,t.add(l.direction,d,d),t.add(l.direction,p,p),t.subtract(d,l.position,d),t.subtract(p,l.position,p),t.normalize(d,d),t.normalize(p,p)):(d=f.direction,p=m.direction),g=t.dot(d,p),g<1&&(_=Math.acos(g)),_=r.startPosition.y>r.endPosition.y?-_:_,a=n(a,v),o(a)){var y=l.direction,C=t.negate(a,Ut),w=t.equalsEpsilon(y,a,h.EPSILON2),E=t.equalsEpsilon(y,C,h.EPSILON2);if(w||E)(w&&_<0||E&&_>0)&&l.look(l.right,-_);else{g=t.dot(y,a);var b=h.acosClamped(g);_>0&&_>b&&(_=b-h.EPSILON4),g=t.dot(y,C),b=h.acosClamped(g),_<0&&-_>b&&(_=-b+h.EPSILON4);var T=t.cross(a,y,Gt);l.look(T,_)}}else l.lookUp(_)}function $(e){M(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),M(e,e.enableZoom,e.zoomEventTypes,X,e.inertiaZoom,"_lastInertiaZoomMovement"),M(e,e.enableTilt,e.tiltEventTypes,Z,e.inertiaSpin,"_lastInertiaTiltMovement"),M(e,e.enableLook,e.lookEventTypes,J)}var ee=.4,te=[],ie=new g,re=new t,ne=new e,oe=new t,ae=new e,se=new t,le=new t,ue=new t,ce=new t,de=new t,he=new t,pe=new t,fe=new t,me=new t,_e=new t,ge=new t,ve=new t,ye=new t,Ce=new t,we=new t,Se=new t,Ee=new t,be=new t,Te=new g,xe=new g,Ae=new t,Pe=new e,De=new e,Me=new g,Ie=new t,Re=new t,Oe=new g,Ne=new g,Le=new t,Be=new t,Fe=new t,ke=new t,Ve=new m(t.ZERO,0),ze=new e,Ue=new e,Ge=new e,He=new g,We=new t,qe=new t,je=new f,Ye=new f,Xe=new t,Ze=new m(t.ZERO,0),Ke=new t,Qe=new r,Je=new f,$e=new _,et=new p,tt=new e,it=new g,rt=new t,nt=new g,ot=new m(t.ZERO,0),at=new t,st=new t,lt=new t,ut=new r,ct=new t,dt=new t,ht=new l,pt=new t,ft=i.clone(i.UNIT_W),mt=i.clone(i.UNIT_W),_t=new t,gt=new t,vt=new t,yt=new t,Ct=new e,wt=new e,St=new t,Et=new r,bt=new e,Tt=new g,xt=new t,At=new t,Pt=new f,Dt=new f,Mt=new t,It=new f,Rt=new _,Ot=new p,Nt=new r,Lt=new t,Bt=new r,Ft=new e,kt=new e,Vt=new g,zt=new g,Ut=new t,Gt=new t;return x.prototype.update=function(){f.equals(this._scene.camera.transform,f.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===E.SCENE2D?B(this):r===E.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,H(this)):r===E.SCENE3D&&(this._horizontalRotationAxis=void 0,$(this)),this._aggregator.reset()},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},x}),define("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function i(){}return i.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},i.createShadowCastVertexShader=function(i,r,n){var o=i.defines.slice(0),a=i.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(i),l=e(s);if(r&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var d="varying vec3 v_positionEC; \nvoid main() \n{ \n    czm_shadow_cast_main(); \n    v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(d)}return new t({defines:o,sources:a})},i.createShadowCastFragmentShader=function(i,r,n,o){var a=i.defines.slice(0),s=i.sources.slice(0),l=t.findPositionVarying(i),u=e(l);u||(l="v_positionEC");for(var c=s.length,d=0;d<c;++d)s[d]=t.replaceMain(s[d],"czm_shadow_cast_main");var h="";return r&&(u||(h+="varying vec3 v_positionEC; \n"),h+="uniform vec4 shadowMap_lightPositionEC; \n"),h+=o?"void main() \n{ \n":"void main() \n{ \n    czm_shadow_cast_main(); \n    if (gl_FragColor.a == 0.0) \n    { \n       discard; \n    } \n",h+=r?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",h+="} \n",s.push(h),new t({defines:a,sources:s})},i.getShadowReceiveShaderKeyword=function(e,t,i,r){var n=e._usesDepthTexture,o=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,c=e.softShadows;return"receiveShadow "+n+o+a+s+l+u+c+t+i+r},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return i&&(r?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},i.createShadowReceiveFragmentShader=function(i,r,n,o,a){for(var s=t.findNormalVarying(i),l=!o&&e(s)||o&&a,u=t.findPositionVarying(i),c=e(u),d=r._usesDepthTexture,h=r._polygonOffsetSupported,p=r._isPointLight,f=r._isSpotLight,m=r._numberOfCascades>1,_=r.debugCascadeColors,g=r.softShadows,v=p?r._pointBias:o?r._terrainBias:r._primitiveBias,y=i.defines.slice(0),C=i.sources.slice(0),w=C.length,S=0;S<w;++S)C[S]=t.replaceMain(C[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):d&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!p&&y.push("USE_SOFT_SHADOWS"),m&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&v.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),v.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var E="";return E+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",E+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?"    return vec4("+u+", 1.0); \n":"    return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?"    return normalize("+s+"); \n":"    return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(v.normalOffset&&l?"    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n    float normalOffsetScale = 1.0 - nDotL; \n    vec3 offset = normalOffset * normalOffsetScale * normalEC; \n    positionEC.xyz += offset; \n":"")+"} \n",E+="void main() \n{ \n    czm_shadow_receive_main(); \n    vec4 positionEC = getPositionEC(); \n    vec3 normalEC = getNormalEC(); \n    float depth = -positionEC.z; \n",E+="    czm_shadowParameters shadowParameters; \n    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",o?E+="    shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(E+="    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),E+=p?"    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n    float distance = length(directionEC); \n    directionEC = normalize(directionEC); \n    float radius = shadowMap_lightPositionEC.w; \n    // Stop early if the fragment is beyond the point light radius \n    if (distance > radius) \n    { \n        return; \n    } \n    vec3 directionWC  = czm_inverseViewRotation * directionEC; \n    shadowParameters.depth = distance / radius; \n    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n    shadowParameters.texCoords = directionWC; \n    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":f?"    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    vec4 shadowPosition = shadowMap_matrix * positionEC; \n    // Spot light uses a perspective projection, so perform the perspective divide \n    shadowPosition /= shadowPosition.w; \n    // Stop early if the fragment is not in the shadow bounds \n    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n    { \n        return; \n    } \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":m?"    float maxDepth = shadowMap_cascadeSplits[1].w; \n    // Stop early if the eye depth exceeds the last cascade \n    if (depth > maxDepth) \n    { \n        return; \n    } \n    // Get the cascade based on the eye-space depth \n    vec4 weights = czm_cascadeWeights(depth); \n    // Apply normal offset \n    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    // Transform position into the cascade \n    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n    // Get visibility \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n    // Fade out shadows that are far away \n    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n    visibility = mix(visibility, 1.0, fade); \n"+(_?"    // Draw cascade colors for debugging \n    gl_FragColor *= czm_cascadeColor(weights); \n":""):"    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    vec4 shadowPosition = shadowMap_matrix * positionEC; \n    // Stop early if the fragment is not in the shadow bounds \n    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n    { \n        return; \n    } \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",E+="    gl_FragColor.rgb *= visibility; \n} \n",C.push(E),new t({defines:y,sources:C})},i}),define("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicOffCenterFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z){"use strict";function K(e){e=d(e,d.EMPTY_OBJECT);var i=e.context;this._enabled=d(e.enabled,!0),this._softShadows=d(e.softShadows,!1),this._normalOffset=d(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=d(e.fromLightSource,!0),this.darkness=d(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=d(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(_.isInternetExplorer()||_.isEdge()||(_.isChrome()||_.isFirefox())&&_.isWindows()&&!i.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new C,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=d(e.isPointLight,!1),this._pointLightRadius=d(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&d(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?d(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new q:h(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new C,new C,new C,new C],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new Q(i);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,$(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new I(i),this._size=d(e.size,2048),this.size=this._size}function Q(e){this.camera=new fe,this.passState=new I(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function J(e,t){return L.fromCache({cull:{enabled:!0,face:G.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function $(e){var t=!e._usesDepthTexture;e._primitiveRenderState=J(t,e._primitiveBias),e._terrainRenderState=J(t,e._terrainBias),e._pointRenderState=J(t,e._pointBias)}function ee(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;h(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function te(){return new B({wrapS:z.CLAMP_TO_EDGE,wrapT:z.CLAMP_TO_EDGE,minificationFilter:V.NEAREST,magnificationFilter:k.NEAREST})}function ie(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:te()}),n=new D({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function re(e,t){for(var i=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:R.UNSIGNED_INT_24_8,sampler:te()}),r=new D({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function ne(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new A({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:te()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new D({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function oe(e,t){e._isPointLight?ne(e,t):e._usesDepthTexture?re(e,t):ie(e,t)}function ae(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==b.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,$(e),ee(e),oe(e,t))}function se(e,t){h(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(ee(e),oe(e,t),ae(e,t),le(e,t))}function le(e,t,i){i=d(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ue(t,i){t._size=i;var r=t._passes,n=r.length,o=t._textureSize;if(t._isPointLight){i=x.maximumCubeMapSize>=i?i:x.maximumCubeMapSize,o.x=i,o.y=i;var a=new e(0,0,i,i);r[0].passState.viewport=a,r[1].passState.viewport=a,r[2].passState.viewport=a,r[3].passState.viewport=a,r[4].passState.viewport=a,r[5].passState.viewport=a}else 1===n?(i=x.maximumTextureSize>=i?i:x.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=x.maximumTextureSize>=2*i?i:x.maximumTextureSize/2,o.x=2*i,o.y=2*i,r[0].passState.viewport=new e(0,0,i,i),r[1].passState.viewport=new e(i,0,i,i),r[2].passState.viewport=new e(0,i,i,i),r[3].passState.viewport=new e(i,i,i,i));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=r[s],u=l.passState.viewport,c=u.x/o.x,d=u.y/o.y,h=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(h,0,0,c,0,p,0,d,0,0,1,0,0,0,0,1)}}function ce(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n    vec2 uv = v_textureCoordinates; \n    vec3 dir; \n \n    if (uv.y < 0.5) \n    { \n        if (uv.x < 0.333) \n        { \n            dir.x = -1.0; \n            dir.y = uv.x * 6.0 - 1.0; \n            dir.z = uv.y * 4.0 - 1.0; \n        } \n        else if (uv.x < 0.666) \n        { \n            dir.y = -1.0; \n            dir.x = uv.x * 6.0 - 3.0; \n            dir.z = uv.y * 4.0 - 1.0; \n        } \n        else \n        { \n            dir.z = -1.0; \n            dir.x = uv.x * 6.0 - 5.0; \n            dir.y = uv.y * 4.0 - 1.0; \n        } \n    } \n    else \n    { \n        if (uv.x < 0.333) \n        { \n            dir.x = 1.0; \n            dir.y = uv.x * 6.0 - 1.0; \n            dir.z = uv.y * 4.0 - 3.0; \n        } \n        else if (uv.x < 0.666) \n        { \n            dir.y = 1.0; \n            dir.x = uv.x * 6.0 - 3.0; \n            dir.z = uv.y * 4.0 - 3.0; \n        } \n        else \n        { \n            dir.z = 1.0; \n            dir.x = uv.x * 6.0 - 5.0; \n            dir.y = uv.y * 4.0 - 3.0; \n        } \n    } \n \n    float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n    gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?"    float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":"    float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+"    gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=M.OVERLAY,r}function de(t,i){var r=i.context,n=i.context.drawingBufferWidth,o=i.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Se;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;h(l)||(l=ce(t,r),t._debugShadowViewCommand=l),h(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=L.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function he(e,t){var r=new g({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new g({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new X({geometryInstances:[r,o],appearance:new j({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function pe(e,t){de(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new W({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new W({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new W({camera:e._passes[r].camera,color:Ae[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!h(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=S.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,Pe),c=C.fromTranslationQuaternionRotationScale(o,a,u,be);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=he(c,l.YELLOW)}e._debugLightFrustum.update(t)}else h(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new W({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new C,this.inverseViewMatrix=new C,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new C}function me(e,t){var i,r=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,d=l/s,h=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,h=.9);var f=Re,m=Me;for(m[0]=s,m[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(d,_),v=s+c*_,w=y.lerp(v,g,h);m[i+1]=w,f[i]=w-m[i]}if(p){for(i=0;i<u;++i)f[i]=Math.min(f[i],e._maximumCascadeDistances[i]);var S=m[0];for(i=0;i<u-1;++i)S+=f[i],m[i+1]=S}o.unpack(m,0,e._cascadeSplits[0]),o.unpack(m,1,e._cascadeSplits[1]),o.unpack(f,0,e._cascadeDistances);var E=r.frustum,b=E.left,T=E.right,x=E.bottom,A=E.top,P=E.near,D=E.far,M=r.positionWC,I=r.directionWC,R=r.upWC,O=a.frustum.clone(Ie),N=r.getViewProjection();for(i=0;i<u;++i){O.near=m[i],O.far=m[i+1];for(var L=C.multiply(O.projectionMatrix,a.viewMatrix,be),B=C.inverse(L,be),F=C.multiply(N,B,be),k=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Be),V=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe),z=0;z<8;++z){var U=o.clone(Ee[z],Te[z]);C.multiplyByVector(F,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,k,k),n.maximumByComponent(U,V,V)}k.x=Math.max(k.x,0),k.y=Math.max(k.y,0),k.z=0,V.x=Math.min(V.x,1),V.y=Math.min(V.y,1),V.z=Math.min(V.z,1);var G=e._passes[i],H=G.camera;H.clone(r);var W=H.frustum;W.left=b+k.x*(T-b),W.right=b+V.x*(T-b),W.bottom=x+k.y*(A-x),W.top=x+V.y*(A-x),W.near=P+k.z*(D-P),W.far=P+V.z*(D-P),G.cullingVolume=H.frustum.computeCullingVolume(M,I,R);var q=e._cascadeMatrices[i];C.multiply(H.getViewProjection(),a.inverseViewMatrix,q),C.multiply(G.textureOffsets,q,q)}}function _e(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=C.multiply(r.frustum.projectionMatrix,r.viewMatrix,be),s=C.inverse(a,be),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Ne);u=n.cross(c,l,Le),n.normalize(u,u),n.normalize(c,c);for(var d=n.fromElements(0,0,0,ke),h=C.computeView(d,l,u,c,Oe),p=C.multiply(h,s,be),f=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Be),m=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe),_=0;_<8;++_){var g=o.clone(Ee[_],Te[_]);C.multiplyByVector(p,g,g),n.divideByScalar(g,g.w,g),n.minimumByComponent(g,f,f),n.maximumByComponent(g,m,m)}m.z+=1e3,f.z-=10;var v=ke;v.x=-(.5*(f.x+m.x)),v.y=-(.5*(f.y+m.y)),v.z=-m.z;var y=C.fromTranslation(v,be);h=C.multiply(y,h,h);var w=.5*(m.x-f.x),S=.5*(m.y-f.y),E=m.z-f.z,b=i.frustum;b.left=-w,b.right=w,b.bottom=-S,b.top=S,b.near=.01,b.far=E,C.clone(h,i.viewMatrix),C.inverse(h,i.inverseViewMatrix),C.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),n.clone(l,i.directionWC),n.clone(u,i.upWC),n.clone(c,i.rightWC)}function ge(e,t){var i=new Y;i.fov=y.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=Ve[r],n.upWC=ze[r],n.rightWC=Ue[r],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}function ve(e,i){var r=e._sceneCamera,o=e._shadowMapCamera,a=We;if(e._cascadesEnabled){if(r.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=i.mapProjection.ellipsoid.geodeticSurfaceNormal(r.positionWC,Ge),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var d=o.frustum.far/2,h=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,d,qe),qe);a.center=h,a.radius=d,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function ye(e,t){var i=t.camera,r=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(r.directionWC,a.directionWC):e._isPointLight?n.clone(r.positionWC,a.positionWC):a.clone(r);var s=e._lightDirectionEC;C.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=U.clone(i,o),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ve(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function Ce(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=je;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function we(e,t,i,r,n,o){var a,l,u;if(h(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=P.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!h(a)||n!==i.shaderProgram.id||t){var c=i.shaderProgram,d=i.pass===M.GLOBE,p=i.pass!==M.TRANSLUCENT,f=e._isPointLight,m=e._usesDepthTexture,_=Z.getShadowCastShaderKeyword(f,d,m,p);if(a=r.shaderCache.getDerivedShaderProgram(c,_),!h(a)){var g=c.vertexShaderSource,v=c.fragmentShaderSource,y=Z.createShadowCastVertexShader(g,f,d),C=Z.createShadowCastFragmentShader(v,f,m,p);a=r.shaderCache.createDerivedShaderProgram(c,_,{vertexShaderSource:y,fragmentShaderSource:C,attributeLocations:c._attributeLocations})}l=e._primitiveRenderState,f?l=e._pointRenderState:d&&(l=e._terrainRenderState);var w=i.renderState.cull.enabled;w||(l=s(l,!1),l.cull.enabled=!1,l=L.fromCache(l)),u=Ce(e,i.uniformMap,d)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}K.MAXIMUM_DISTANCE=2e4,K.prototype.debugCreateRenderStates=function(){$(this)},p(K.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e;
}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ue(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var Se=new e,Ee=new Array(8);Ee[0]=new o(-1,-1,-1,1),Ee[1]=new o(1,-1,-1,1),Ee[2]=new o(1,1,-1,1),Ee[3]=new o(-1,1,-1,1),Ee[4]=new o(-1,-1,1,1),Ee[5]=new o(1,-1,1,1),Ee[6]=new o(1,1,1,1),Ee[7]=new o(-1,1,1,1);for(var be=new C,Te=new Array(8),xe=0;xe<8;++xe)Te[xe]=new o;var Ae=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],Pe=new n;fe.prototype.clone=function(e){C.clone(e.viewMatrix,this.viewMatrix),C.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var De=new C(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return C.multiply(t,e,this.viewProjectionMatrix),C.multiply(De,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Me=new Array(5),Ie=new Y,Re=new Array(4),Oe=new C,Ne=new n,Le=new n,Be=new n,Fe=new n,ke=new n,Ve=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],ze=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],Ue=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],Ge=new n,He=new n,We=new t,qe=We.center;K.prototype.update=function(e){if(ye(this,e),this._needsUpdate)if(se(this,e.context),this._isPointLight&&ge(this,e),this._cascadesEnabled&&(_e(this,e),this._numberOfCascades>1&&me(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&pe(this,e)},K.prototype.updatePass=function(e,t){le(this,e,t)};var je=new r;return K.createDerivedCommands=function(e,t,i,r,n,o){h(o)||(o={});var a=t.length>0,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===M.GLOBE,d=!1;if(c&&(d=i.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),i.castShadows){var p=o.castCommands;h(p)||(p=o.castCommands=[]);var f=o.castShaderProgramId,m=e.length;p.length=m;for(var _=0;_<m;++_)p[_]=we(e[_],r,i,n,f,p[_]);o.castShaderProgramId=i.shaderProgram.id}if(i.receiveShadows&&a){var g,v;h(o.receiveCommand)&&(g=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=P.shallowClone(i,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!h(g)||C||r||y){var w=Z.getShadowReceiveShaderKeyword(t[0],i.castShadows,c,d);if(g=n.shaderCache.getDerivedShaderProgram(s,w),!h(g)){var S=Z.createShadowReceiveVertexShader(l,c,d),E=Z.createShadowReceiveFragmentShader(u,t[0],i.castShadows,c,d);g=n.shaderCache.createDerivedShaderProgram(s,w,{vertexShaderSource:S,fragmentShaderSource:E,attributeLocations:s._attributeLocations})}v=Ce(t[0],i.uniformMap,c)}o.receiveCommand.shaderProgram=g,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows}return o},K.prototype.isDestroyed=function(){return!1},K.prototype.destroy=function(){ee(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return f(this)},K}),define("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"}),define("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"}),define("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"}),define("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}E.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},E.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var b=new e,T=new e,x=new i,A=new t,P=new t,D=new l;return E.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,E=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new d({color:new r}),this._clearFBO2Command=new d({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var I=1,R=2;M={delta:function(){return I},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={delta:function(){return I},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={u_center:function(){return E._uCenter},u_radius:function(){return E._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(1,O,N),B=T;B.width=L,B.height=L;var F=this._fbo,k=o(F)&&F.getColorTexture(0)||void 0;if(!o(k)||k.width!==a||k.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var V=[new v({context:i,width:a,height:p})];F=i.depthTexture?this._fbo=new h({context:i,colorTextures:V,depthTexture:new v({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:f.UNSIGNED_SHORT})}):this._fbo=new h({context:i,colorTextures:V,depthRenderbuffer:new m({context:i,format:_.DEPTH_COMPONENT16})}),this._downSampleFBO1=new h({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._downSampleFBO2=new h({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:B});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return E._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return E._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return E._blurStep},this._blurYCommand.renderState=z;var U=b;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return E._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var H=i.uniformState,W=H.sunPositionWC,q=H.view,j=H.viewProjection,Y=H.projection,X=l.computeViewportTransformation(n,0,1,D),Z=l.multiplyByPoint(q,W,x),K=c.pointToGLWindowCoordinates(j,X,W,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(B,0,1,D),K=c.pointToGLWindowCoordinates(j,X,W,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},E}),define("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/PixelFormat","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","./Camera","./CreditDisplay","./CullingVolume","./DebugCameraPrimitive","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./MapMode2D","./OIT","./OrthographicFrustum","./OrthographicOffCenterFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve){"use strict";function ye(t){t=c(t,c.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new O(i,r);d(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=u(),this._frameState=new Q(o,new q(n)),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new k(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=i,this._context=o,this._computeEngine=new R(o),this._globe=void 0,this._primitives=new de,this._groundPrimitives=new de,this._tweens=new ve,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new ee);var h;this._useOIT&&d(l)&&(h=new ie(o)),this._globeDepth=l,this._depthPlane=new X,this._oit=h,this._fxaa=new $,this._clearColorCommand=new I({color:new s,stencil:0,owner:this}),this._depthClearCommand=new I({depth:1,owner:this}),this._stencilClearCommand=new I({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._pickDepthPassState=void 0,this._pickDepthFramebuffer=void 0,this._pickDepthFramebufferWidth=void 0,this._pickDepthFramebufferHeight=void 0,this._depthOnlyRenderStateCache={},this._transitioner=new fe(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _,this.morphComplete=new _,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=s.clone(s.BLACK),this._mode=he.SCENE3D,this._mapProjection=d(t.mapProjection)?t.mapProjection:new g,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.fxaa=!0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new K,this._sunCamera=new W(this),this.shadowMap=new _e({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new W(this);this._camera=p,this._cameraClone=W.clone(p),this._screenSpaceCameraController=new me(this),this._mapMode2D=c(t.mapMode2D,te.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var f=p.frustum.near,m=p.frustum.far,v=Math.ceil(Math.log(m/f)/Math.log(this.farToNearRatio));xe(f,m,this.farToNearRatio,v,this._frustumCommandsList,!1,void 0),Te(this,0,E.now()),this.initializeFrame()}function Ce(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function we(e,t,i){var r=1/Math.max(1,Ce(e.position,t.position));return n.multiplyByScalar(e.position,r,ut),n.multiplyByScalar(t.position,r,ct),n.equalsEpsilon(ut,ct,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function Se(e,t){var i=e.frameState,r=e._context,n=i.shadowHints.shadowsEnabled,o=i.shadowHints.shadowMaps,a=i.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=i.shadowHints.lastDirtyTime;t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0);var c=t.derivedCommands;if(t.dirty&&d(c)){t.dirty=!1,n&&(t.receiveShadows||t.castShadows)&&(c.shadows=_e.createDerivedCommands(o,a,t,l,r,c.shadows));var h=e._oit;t.pass===F.TRANSLUCENT&&d(h)&&h.isSupported()&&(s&&t.receiveShadows?(c.oit=d(c.oit)?c.oit:{},c.oit.shadows=h.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,r,c.oit.shadows)):c.oit=h.createDerivedCommands(t,r,c.oit)),c.depth=ot(e,t,r,c.depth)}}function Ee(e){var t=e.globe;if(e._mode===he.SCENE3D&&d(t)){var i=t.ellipsoid;return dt.radius=i.minimumRadius,lt=A.fromBoundingSphere(dt,e._camera.positionWC,lt)}}function be(e){e.render=!1,e.pick=!1,e.depth=!1}function Te(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=Ee(e),n.terrainExaggeration=e._terrainExaggeration,d(e.globe)?n.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:n.maximumScreenSpaceError=2,be(n.passes)}function xe(e,t,i,r,n,o,a){n.length=r;for(var s=0;s<r;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(i,s)*e),u=Math.min(t,i*l));var c=n[s];d(c)?(c.near=l,c.far=u):c=n[s]=new J(l,u)}}function Ae(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||Se(e,t);for(var r=e._frustumCommandsList,n=r.length,o=0;o<n;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof I?F.OPAQUE:t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var h=e._debugFrustumStatistics.commandsInFrustums;h[t.debugOverlappingFrustums]=d(h[t.debugOverlappingFrustums])?h[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function Pe(e,t,i){return d(e)&&(!d(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==w.OUTSIDE&&(!d(i)||!e.boundingVolume.isOccluded(i)))}function De(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=F.NUMBER_OF_PASSES,h=0;h<u;++h)for(var p=0;p<c;++p)l[h].indices[p]=0;o.length=0,a.length=0;for(var f=Number.MAX_VALUE,m=-Number.MAX_VALUE,_=!1,g=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,C=Number.MAX_VALUE,w=t.mode===he.SCENE3D?t.occluder:void 0,S=t.cullingVolume,E=ht.planes,T=0;T<5;++T)E[T]=S.planes[T];S=ht;var x=e._environmentState;x.isSkyAtmosphereVisible=d(x.skyAtmosphereCommand)&&x.isReadyForAtmosphere,x.isSunVisible=Pe(x.sunDrawCommand,S,w),x.isMoonVisible=Pe(x.moonCommand,S,w);for(var A=s.length,P=0;P<A;++P){var D=s[P],M=D.pass;if(M===F.COMPUTE)o.push(D);else if(M===F.OVERLAY)a.push(D);else{var R=D.boundingVolume;if(d(R)){if(!Pe(D,S,w))continue;if(pt=R.computePlaneDistances(n,r,pt),f=Math.min(f,pt.start),m=Math.max(m,pt.stop),g&&D.receiveShadows&&pt.start<_e.MAXIMUM_DISTANCE&&!(M===F.GLOBE&&pt.start<-100&&pt.stop>100)){var O=pt.stop-pt.start;M!==F.GLOBE&&pt.start<100&&(C=Math.min(C,O)),v=Math.min(v,pt.start),y=Math.max(y,pt.stop)}}else pt.start=i.frustum.near,pt.stop=i.frustum.far,_=!(D instanceof I);Ae(e,D,pt)}}_?(f=i.frustum.near,m=i.frustum.far):(f=Math.min(Math.max(f,i.frustum.near),i.frustum.far),m=Math.max(Math.min(m,i.frustum.far),f),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v))),g&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=C);var N,L=e.mode===he.SCENE2D,B=e.farToNearRatio;L?(m=Math.min(m,i.position.z+e.nearToFarDistance2D),f=Math.min(f,m),N=Math.ceil(Math.max(1,m-f)/e.nearToFarDistance2D)):N=Math.ceil(Math.log(m/f)/Math.log(B)),f!==Number.MAX_VALUE&&(N!==u||0!==l.length&&(f<l[0].near||m>l[u-1].far&&!b.equalsEpsilon(m,l[u-1].far,b.EPSILON8)))&&(xe(f,m,B,N,l,L,e.nearToFarDistance2D),De(e));var k=t.frustumSplits;k.length=N+1;for(var V=0;V<N;++V)k[V]=l[V].near,V===N-1&&(k[V+1]=l[V].far)}function Me(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function Ie(e,t,i){var r=t.context,n=c(i,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=G.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)a.indexOf(t[1])===-1&&a.push(t[1]);return e});var l,u=a.length,h="void main() \n{ \n    czm_Debug_main(); \n";if(t.debugShowCommands){d(e._debugColor)||(e._debugColor=s.fromRandom());var p=e._debugColor;if(u>0)for(l=0;l<u;++l)h+="    gl_FragData["+a[l]+"].rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n";else h+="    gl_FragColor.rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n"}if(t.debugShowFrustums){var f=1&e.debugOverlappingFrustums?"1.0":"0.0",m=2&e.debugOverlappingFrustums?"1.0":"0.0",_=4&e.debugOverlappingFrustums?"1.0":"0.0";if(u>0)for(l=0;l<u;++l)h+="    gl_FragData["+a[l]+"].rgb *= vec3("+f+", "+m+", "+_+"); \n";else h+="    gl_FragColor.rgb *= vec3("+f+", "+m+", "+_+"); \n"}h+="}",o.sources.push(h);var g=Me(n);return U.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:g})}function Re(e,t,i){var r=L.shallowClone(e);r.shaderProgram=Ie(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function Oe(e,t,r,o,a){if(!d(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Re(e,t,o):u&&e.receiveShadows&&d(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,o):t.frameState.passes.depth&&d(e.derivedCommands.depth)?e.derivedCommands.depth.depthOnlyCommand.execute(r,o):e.execute(r,o),e.debugShowBoundingVolume&&d(e.boundingVolume)){var c=t._frameState,h=e.boundingVolume;d(t._debugVolume)&&t._debugVolume.destroy();var p,f=n.clone(h.center);if(c.mode!==he.SCENE3D){f=T.multiplyByPoint(ft,f,f);var _=c.mapProjection,g=_.unproject(f);f=_.ellipsoid.cartographicToCartesian(g)}if(d(h.radius)){var C=h.radius;p=y.toWireframe(m.createGeometry(new m({radii:new n(C,C,C),vertexFormat:ae.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ce({geometryInstances:new v({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,f,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new ae({flat:!0,translucent:!1}),asynchronous:!1})}else{var w=h.halfAxes;p=y.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:ae.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ce({geometryInstances:new v({geometry:p,modelMatrix:T.fromRotationTranslation(w,f,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new ae({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,E=c.commandList=[];t._debugVolume.update(c);var b;d(a)&&(b=o.framebuffer,o.framebuffer=a),E[0].execute(r,o),d(b)&&(o.framebuffer=b),c.commandList=S}}}function Ne(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Le(e,t,i,r){var n=e.context;x(r,Ne,e._camera.positionWC);for(var o=r.length,a=0;a<o;++a)t(r[a],e,n,i)}function Be(e,t){var i=e._debugGlobeDepths[t];return!d(i)&&e.context.depthTexture&&(i=new ee,e._debugGlobeDepths[t]=i),i}function Fe(e,t){var i=e._pickDepths[t];return d(i)||(i=new ue,e._pickDepths[t]=i),i}function ke(e,t){var i=e._camera,r=e.context,n=r.uniformState;n.updateCamera(i);var o;o=d(i.frustum.fov)?i.frustum.clone(mt):d(i.frustum.infiniteProjectionMatrix)?i.frustum.clone(_t):d(i.frustum.width)?i.frustum.clone(gt):i.frustum.clone(vt),o.near=i.frustum.near,o.far=i.frustum.far,n.updateFrustum(o),n.updatePass(F.ENVIRONMENT);var a=e._useWebVR&&e.mode!==he.SCENE2D,s=e._frameState.passes,l=s.pick,u=s.depth,c=e._environmentState;if(!l){var h=c.skyBoxCommand;if(d(h)&&Oe(h,e,r,t),c.isSkyAtmosphereVisible&&Oe(c.skyAtmosphereCommand,e,r,t),c.isSunVisible&&(c.sunDrawCommand.execute(r,t),e.sunBloom&&!a)){var p;p=c.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:c.useFXAA?e._fxaa.getColorFramebuffer():c.originalFramebuffer,e._sunPostProcess.execute(r,p),t.framebuffer=p}c.isMoonVisible&&c.moonCommand.execute(r,t)}var f;c.useOIT?(d(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),f=e._executeOITFunction):f=Le;for(var m,_=c.clearGlobeDepth,g=c.useDepthPlane,v=e._depthClearCommand,y=e._depthPlane,C=i.position.z,w=e._frustumCommandsList,S=w.length,E=0;E<S;++E){var b=S-E-1,T=w[b];e.mode===he.SCENE2D?(i.position.z=C-T.near+1,o.far=Math.max(1,T.far-T.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==b?T.near*st:T.near,o.far=T.far,n.updateFrustum(o));var x,A=e.debugShowGlobeDepth?Be(e,b):e._globeDepth;e.debugShowGlobeDepth&&d(A)&&c.useGlobeDepthFramebuffer&&(x=t.framebuffer,t.framebuffer=A.framebuffer),v.execute(r,t),n.updatePass(F.GLOBE);var P=T.commands[F.GLOBE],D=T.indices[F.GLOBE];for(m=0;m<D;++m)Oe(P[m],e,r,t);for(d(A)&&c.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(A.update(r),A.executeCopyDepth(r,t)),e.debugShowGlobeDepth&&d(A)&&c.useGlobeDepthFramebuffer&&(t.framebuffer=x),n.updatePass(F.GROUND),P=T.commands[F.GROUND],D=T.indices[F.GROUND],m=0;m<D;++m)Oe(P[m],e,r,t);D>0&&r.stencilBuffer&&e._stencilClearCommand.execute(r,t),_&&(v.execute(r,t),g&&y.execute(r,t));for(var M=F.GROUND+1,I=F.TRANSLUCENT,R=M;R<I;++R)for(n.updatePass(R),P=T.commands[R],D=T.indices[R],m=0;m<D;++m)Oe(P[m],e,r,t);if(0!==b&&e.mode!==he.SCENE2D&&(o.near=T.near,n.updateFrustum(o)),n.updatePass(F.TRANSLUCENT),P=T.commands[F.TRANSLUCENT],P.length=T.indices[F.TRANSLUCENT],f(e,Oe,t,P),d(A)&&(c.useGlobeDepthFramebuffer||u)&&e.useDepthPicking){var O=u?t.framebuffer.depthStencilTexture:A.framebuffer.depthStencilTexture,N=Fe(e,b);N.update(r,O),N.executeCopyDepth(r,t)}}}function Ve(e){var t=e.context.uniformState;t.updatePass(F.COMPUTE);var i=e._environmentState.sunComputeCommand;d(i)&&i.execute(e._computeEngine);for(var r=e._computeCommandList,n=r.length,o=0;o<n;++o)r[o].execute(e._computeEngine)}function ze(e,t){var i=e.context.uniformState;i.updatePass(F.OVERLAY);for(var r=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(r,t)}function Ue(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(Se(e,u),u.castShadows&&(u.pass===F.GLOBE||u.pass===F.OPAQUE||u.pass===F.TRANSLUCENT)&&Pe(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var d=!1,h=a-1;h>=0;--h){var p=o[h].cullingVolume;if(Pe(u,p))o[h].commandList.push(u),d=!0;else if(d)break}}}function Ge(e){var t=e.frameState,i=t.shadowHints.shadowMaps,r=i.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var d=e.frameState.commandList;for(Ue(e,d,s),l=0;l<c;++l){var h=s.passes[l];o.updateCamera(h.camera),s.updatePass(n,l);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];o.updatePass(m.pass),Oe(m.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}function He(e,t,i){var r=e._context,o=t.viewport,a=e._frameState,s=a.camera,l=a.mode,u=a.passes.depth;if(e._useWebVR&&l!==he.SCENE2D){u||Ze(e),De(e),Ke(e,t,i),u||(Ve(e),Ge(e)),o.x=0,o.y=0,o.width=.5*r.drawingBufferWidth,o.height=r.drawingBufferHeight;var c=W.clone(s,e._cameraVR),d=s.frustum.near,h=5*d,p=h/30,f=n.multiplyByScalar(c.right,.5*p,xt);s.frustum.aspectRatio=o.width/o.height;var m=.5*p*d/h;n.add(c.position,f,s.position),s.frustum.xOffset=m,ke(e,t),o.x=t.viewport.width,n.subtract(c.position,f,s.position),s.frustum.xOffset=-m,ke(e,t),W.clone(c,s)}else o.x=0,o.y=0,o.width=r.drawingBufferWidth,o.height=r.drawingBufferHeight,l!==he.SCENE2D||e._mapMode2D===te.ROTATE?qe(!0,e,t,i):We(e,t,i);
}function We(e,t,i){var r=e.context,o=e.frameState,a=e.camera,s=t.viewport,l=yt,u=Ct,c=e.mapProjection;c.project(l,u);var d=n.clone(a.position,wt),h=T.clone(a.transform,Et),p=a.frustum.clone();a._setTransform(T.IDENTITY);var f=T.computeViewportTransformation(s,0,1,St),m=a.frustum.projectionMatrix,_=a.positionWC.y,g=n.fromElements(b.sign(_)*u.x-_,0,-a.positionWC.x,bt),v=M.pointToGLWindowCoordinates(m,f,g,Tt);v.x=Math.floor(v.x);var y=s.x,C=s.width;if(0===_||v.x<=0||v.x>=r.drawingBufferWidth)qe(!0,e,t,i);else if(Math.abs(.5*r.drawingBufferWidth-v.x)<1)s.width=v.x,a.position.x*=b.sign(a.position.x),a.frustum.right=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),qe(!0,e,t,i),s.x=s.width,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),qe(!1,e,t,i);else if(v.x>.5*r.drawingBufferWidth){s.width=v.x;var w=a.frustum.right;a.frustum.right=u.x-_,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),qe(!0,e,t,i),s.x+=v.x,s.width=r.drawingBufferWidth-v.x,a.position.x=-a.position.x,a.frustum.left=-a.frustum.right,a.frustum.right=w-2*a.frustum.right,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),qe(!1,e,t,i)}else{s.x=v.x,s.width=r.drawingBufferWidth-v.x;var S=a.frustum.left;a.frustum.left=-u.x-_,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),qe(!0,e,t,i),s.x=0,s.width=v.x,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=S-2*a.frustum.left,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),qe(!1,e,t,i)}a._setTransform(h),n.clone(d,a.position),a.frustum=p.clone(),s.x=y,s.width=C}function qe(e,t,i,r){var n=t.frameState.passes.depth;e||n||(t.frameState.commandList.length=0),n||Ze(t),De(t),e&&(Ke(t,i,r),n||(Ve(t),Ge(t))),ke(t,i)}function je(e){var t=e._frameState,i=e._environmentState,r=t.passes.render,n=e.skyAtmosphere,o=e.globe;if(!r||e._mode!==he.SCENE2D&&t.camera.frustum instanceof re)i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0;else{d(n)&&d(o)&&(n.setDynamicAtmosphereColor(o.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||o._surface._tilesToRender.length>0),i.skyAtmosphereCommand=d(n)?n.update(t):void 0,i.skyBoxCommand=d(e.skyBox)?e.skyBox.update(t):void 0;var a=d(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=d(a)?a.drawCommand:void 0,i.sunComputeCommand=d(a)?a.computeCommand:void 0,i.moonCommand=d(e.moon)?e.moon.update(t):void 0}var s=i.clearGlobeDepth=d(o)&&(!o.depthTestAgainstTerrain||e.mode===he.SCENE2D),l=i.useDepthPlane=s&&e.mode===he.SCENE3D;l&&e._depthPlane.update(t)}function Ye(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Y({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),d(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Xe(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===he.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<r;++o)if(i[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Ze(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Ye(e),Xe(e),e._globe&&e._globe.update(t)}function Ke(e,t,i){var r=e._context,n=e._environmentState,o=e._frameState.passes,a=o.pick,l=e._useWebVR&&e.mode!==he.SCENE2D;n.originalFramebuffer=t.framebuffer,d(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new ge:d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!d(e.sun)&&d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var u=e._clearColorCommand;s.clone(i,u.color),u.execute(r,t);var c=n.useGlobeDepthFramebuffer=!a&&d(e._globeDepth);c&&(e._globeDepth.update(r),e._globeDepth.clear(r,t,i));for(var h=!1,p=e._frustumCommandsList,f=p.length,m=0;m<f;++m)if(p[m].indices[F.TRANSLUCENT]>0){h=!0;break}var _=n.useOIT=!a&&h&&d(e._oit)&&e._oit.isSupported();_&&(e._oit.update(r,e._globeDepth.framebuffer),e._oit.clear(r,t,i),n.useOIT=e._oit.isSupported());var g=n.useFXAA=!a&&e.fxaa;g&&(e._fxaa.update(r),e._fxaa.clear(r,t,i)),n.isSunVisible&&e.sunBloom&&!l?t.framebuffer=e._sunPostProcess.update(t):c?t.framebuffer=e._globeDepth.framebuffer:g&&(t.framebuffer=e._fxaa.getColorFramebuffer()),d(t.framebuffer)&&u.execute(r,t)}function Qe(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=Be(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Fe(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function Je(e){for(var t=e.afterRender,i=0,r=t.length;i<r;++i)t[i]();t.length=0}function $e(e,t){d(t)||(t=E.now());var i=e._camera;we(i,e._cameraClone,b.EPSILON6)?e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),W.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,o=r.uniformState,a=e._frameState,l=b.incrementWrap(a.frameNumber,15e6,1);Te(e,l,t),a.passes.render=!0;var u=c(e.backgroundColor,s.BLACK);a.backgroundColor=u,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var h=e.shadowMap;d(h)&&h.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(h)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var p=e._passState;if(p.framebuffer=void 0,p.blendingEnabled=void 0,p.scissorTest=void 0,d(e.globe)&&e.globe.beginFrame(a),je(e),He(e,p,u),Qe(e,p),ze(e,p),d(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!d(e._performanceDisplay)){var f=document.createElement("div");f.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(f);var _=new oe({container:f});e._performanceDisplay=_,e._performanceContainer=f}e._performanceDisplay.update()}else d(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),Je(a),e._postRender.raiseEvent(e,t)}function et(e,t,i,r){var o=e._camera,a=o.frustum;d(a._offCenterFrustum)&&(a=a._offCenterFrustum);var s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,It);o._setTransform(T.IDENTITY);var h=n.clone(o.position,Pt);n.multiplyByScalar(o.right,l,Dt),n.add(Dt,h,h),n.multiplyByScalar(o.up,u,Dt),n.add(Dt,h,h),o._setTransform(c),e.mode===he.SCENE2D&&n.fromElements(h.z,h.x,h.y,h);var p=a.getPixelDimensions(s.width,s.height,1,Mt),f=At;return f.right=.5*p.x,f.left=-f.right,f.top=.5*p.y,f.bottom=-f.top,f.near=a.near,f.far=a.far,f.computeCullingVolume(h,o.directionWC,o.upWC)}function tt(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,d=2*(u.height-t.y-u.y)/u.height-1,h=c*a*l,p=d*a*s,f=o.getPixelDimensions(u.width,u.height,1,Mt),m=f.x*i*.5,_=f.y*r*.5,g=Rt;return g.top=p+_,g.bottom=p-_,g.right=h+m,g.left=h-m,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function it(e,t,i,r){var n=e.camera.frustum;return n instanceof re||n instanceof ne?et(e,t,i,r):tt(e,t,i,r)}function rt(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!d(i)){for(var r=t._attributeLocations,n=t.fragmentShaderSource,o=!1,a=n.sources,s=a.length,l=0;l<s;++l)if(kt.test(a[l])||Vt.test(a[l])){o=!0;break}o||(n=new G({sources:["void main() { gl_FragColor = vec4(1.0); }"]})),i=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:r})}return i}function nt(e,t){var i=e._depthOnlyRenderStateCache,r=i[t.id];if(!d(r)){var n=z.getState(t);n.depthMask=!0,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r=z.fromCache(n),i[t.id]=r}return r}function ot(e,t,i,r){d(r)||(r={});var n,o;return d(r.depthOnlyCommand)&&(n=r.depthOnlyCommand.shaderProgram,o=r.depthOnlyCommand.renderState),r.depthOnlyCommand=L.shallowClone(t,r.depthOnlyCommand),d(n)&&r.shaderProgramId===t.shaderProgram.id?(r.depthOnlyCommand.shaderProgram=n,r.depthOnlyCommand.renderState=o):(r.depthOnlyCommand.shaderProgram=rt(i,t.shaderProgram),r.depthOnlyCommand.renderState=nt(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),r}function at(t,i){var r=t._context,n=t._frameState;be(n.passes),n.passes.pick=!0,n.passes.depth=!0,n.cullingVolume=it(t,i,1,1);var o=t._pickDepthPassState;d(o)||(o=t._pickDepthPassState=new k(r),o.scissorTest={enabled:!0,rectangle:new e},o.viewport=new e);var a=r.drawingBufferWidth,s=r.drawingBufferHeight,l=t._pickDepthFramebuffer,u=t._pickDepthFramebufferWidth,c=t._pickDepthFramebufferHeight;d(l)&&u===a&&c===s||(t._pickDepthFramebuffer=t._pickDepthFramebuffer&&t._pickDepthFramebuffer.destroy(),l=t._pickDepthFramebuffer=new B({context:r,depthStencilTexture:new H({context:r,width:a,height:s,pixelFormat:P.DEPTH_STENCIL,pixelDatatype:V.UNSIGNED_INT_24_8})}),t._pickDepthFramebufferWidth=a,t._pickDepthFramebufferHeight=s),o.framebuffer=l,o.viewport.width=a,o.viewport.height=s,o.scissorTest.rectangle.x=i.x,o.scissorTest.rectangle.y=s-i.y,o.scissorTest.rectangle.width=1,o.scissorTest.rectangle.height=1,He(t,o,Bt),Qe(t,o),r.endFrame()}var st=.9999;h(ye.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 N.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return N.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return d(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===he.SCENE2D?this.morphTo2D(0):e===he.SCENE3D?this.morphTo3D(0):e===he.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new W(this),d(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Z(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=e}}}),ye.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1};var lt,ut=new n,ct=new n,dt=new t,ht=new j,pt=new S,ft=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ft=T.inverseTransformation(ft,ft);var mt=new se,_t=new le,gt=new re,vt=new ne,yt=new a(Math.PI,b.PI_OVER_TWO),Ct=new n,wt=new n,St=new T,Et=new T,bt=new n,Tt=new n;ye.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),d(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var xt=new n;ye.prototype.render=function(e){try{$e(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},ye.prototype.clampLineWidth=function(e){return Math.max(N.minimumAliasedLineWidth,Math.min(e,N.maximumAliasedLineWidth))};var At=new ne,Pt=new n,Dt=new n,Mt=new r,It=new T,Rt=new le,Ot=3,Nt=3,Lt=new e(0,0,Ot,Nt),Bt=new s(0,0,0,0),Ft=new r;ye.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=pe.transformWindowToDrawingBuffer(this,e,Ft);d(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),Te(this,r.frameNumber,r.time),r.cullingVolume=it(this,n,Ot,Nt),r.passes.pick=!0,i.update(r),Lt.x=n.x-.5*(Ot-1),Lt.y=this.drawingBufferHeight-n.y-.5*(Nt-1);var o=this._pickFramebuffer.begin(Lt);He(this,o,Bt),Qe(this,o);var a=this._pickFramebuffer.end(Lt);return t.endFrame(),Je(r),a};var kt=/\bgl_FragDepthEXT\b/,Vt=/\bdiscard\b/,zt=new o,Ut=new o(1,1/255,1/65025,1/16581375);ye.prototype.pickPositionWorldCoordinates=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=pe.transformWindowToDrawingBuffer(this,e,Ft);this.pickTranslucentDepth&&at(this,n),n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;a=d(s.frustum.fov)?s.frustum.clone(mt):d(s.frustum.infiniteProjectionMatrix)?s.frustum.clone(_t):d(s.frustum.width)?s.frustum.clone(gt):s.frustum.clone(vt);for(var l=this.numberOfFrustums,u=0;u<l;++u){var c=Fe(this,u),h=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:c.framebuffer}),p=o.unpack(h,0,zt);o.divideByScalar(p,255,p);var f=o.dot(p,Ut);if(f>0&&f<1){var m,_=this._frustumCommandsList[u];return this.mode===he.SCENE2D?(m=s.position.z,s.position.z=m-_.near+1,a.far=Math.max(1,_.far-_.near),a.near=1,r.update(this.frameState),r.updateFrustum(a)):(a.near=_.near*(0!==u?st:1),a.far=_.far,r.updateFrustum(a)),t=pe.drawingBufferToWgs84Coordinates(this,n,f,t),this.mode===he.SCENE2D&&(s.position.z=m,r.update(this.frameState)),t}}}};var Gt=new a;return ye.prototype.pickPosition=function(e,t){if(t=this.pickPositionWorldCoordinates(e,t),d(t)&&this.mode!==he.SCENE3D){n.fromElements(t.y,t.z,t.x,t);var i=this.mapProjection,r=i.ellipsoid,o=i.unproject(t,Gt);r.cartographicToCartesian(o,t)}return t},ye.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];d(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);d(s)&&d(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&d(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),d(r)&&d(r.show)&&(u=!0,r.show=D.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=D.toValue(!0,r.show);return n},ye.prototype.completeMorph=function(){this._transitioner.completeMorph()},ye.prototype.morphTo2D=function(e){var t,i=this.globe;t=d(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},ye.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=d(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},ye.prototype.morphTo3D=function(e){var t,i=this.globe;t=d(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},ye.prototype.isDestroyed=function(){return!1},ye.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._pickDepthFramebuffer=this._pickDepthFramebuffer&&this._pickDepthFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),d(this._globeDepth)&&this._globeDepth.destroy(),d(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),d(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},ye}),define("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(r){function n(e){w._image=e,w._tileWidth=e.width,w._tileHeight=e.height,w._ready=!0,w._readyPromise.resolve(!0),c.handleSuccess(w._errorEvent)}function h(e){var t="Failed to load image "+v+".";C=c.handleError(C,w,w._errorEvent,t,0,0,0,p,e),w._readyPromise.reject(new u(t))}function p(){d(s(v),n,h)}r=t(r,{});var f=r.url;this._url=f;var m=r.proxy;this._proxy=m;var _=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:_,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var v=f;i(m)&&(v=m.getURL(v));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,w=this;p()}return r(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(e,t,i){},h.prototype.requestImage=function(e,t,i){return this._image},h.prototype.pickFeatures=function(e,t,i,r,n){},h}),define("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\n#ifdef COLOR_CORRECT\nvec3 rgb2hsb(vec3 rgbColor)\n{\nvec4 p = mix(vec4(rgbColor.bg, K_RGB2HSB.wz), vec4(rgbColor.gb, K_RGB2HSB.xy), step(rgbColor.b, rgbColor.g));\nvec4 q = mix(vec4(p.xyw, rgbColor.r), vec4(rgbColor.r, p.yzx), step(p.x, rgbColor.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\nvec3 hsb2rgb(vec3 hsbColor)\n{\nvec3 p = abs(fract(hsbColor.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsbColor.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsbColor.y);\n}\n#endif\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = rgb2hsb(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = hsb2rgb(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),define("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth  * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),define("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w){"use strict";function S(r){r=i(r,a.WGS84),this.show=!0,this._ellipsoid=r,this._command=new h({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(r.radii,1.025,new e)),n.z=r.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function E(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(S.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),S.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},S.prototype.update=function(t){if(this.show){var i=t.mode;if((i===w.SCENE3D||i===w.MORPHING)&&t.passes.render){var n=this._command;if(!r(n.vertexArray)){var o=t.context,a=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));n.vertexArray=_.fromGeometry({context:o,geometry:a,attributeLocations:l.createAttributeLocations(a),bufferUsage:d.STATIC_DRAW}),n.renderState=p.fromCache({cull:{enabled:!0,face:C.FRONT},blending:y.ALPHA_BLEND});var u=new m({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:g}),u=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:g})}var h=E(this);if(h&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var S=t.context,b=new m({defines:["SKY_FROM_SPACE"],sources:[v]}),T=new m({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=f.fromCache({context:S,vertexShaderSource:b,fragmentShaderSource:T}),b=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=f.fromCache({context:S,vertexShaderSource:b,fragmentShaderSource:T})}var x=t.camera.positionWC,A=e.magnitude(x);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=A,A>this._cameraAndRadiiAndDynamicAtmosphereColor.y?n.shaderProgram=h?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:n.shaderProgram=h?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,n}}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),o(this)},S}),define("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"}),define("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"}),define("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new d({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?h(n,this._sources).then(function(e){d._cubeMap=d._cubeMap&&d._cubeMap.destroy(),d._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var d=this;s.uniformMap={u_cubeMap:function(){return d._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),w=a.createAttributeLocations(C);
s.vertexArray=m.fromGeometry({context:n,geometry:C,attributeLocations:w,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=f.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:w}),s.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),define("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"}),define("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"}),define("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"}),define("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(){this.show=!0,this._drawCommand=new _({primitiveType:h.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P=new t,D=new t,M=new r,I=new r;return A.prototype.update=function(r){var a=r._passState,s=r.frameState,h=r.context;if(this.show){var _=s.mode;if(_!==T.SCENE2D&&_!==T.MORPHING&&s.passes.render){var A=a.viewport.width,R=a.viewport.height;if(!o(this._texture)||A!==this._drawingBufferWidth||R!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=A,this._drawingBufferHeight=R,this._glowFactorDirty=!1;var O=Math.max(A,R);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:h,width:O,height:O,pixelFormat:d.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var N=this,L={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}};this._commands.computeCommand=new m({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){N._commands.computeCommand=void 0}})}var B=this._drawCommand;if(!o(B.vertexArray)){var F={direction:0},k=new Uint8Array(8);k[0]=0,k[1]=0,k[2]=255,k[3]=0,k[4]=255,k[5]=255,k[6]=0,k[7]=255;var V=p.createVertexBuffer({context:h,typedArray:k,usage:f.STATIC_DRAW}),z=[{index:F.direction,vertexBuffer:V,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],U=p.createIndexBuffer({context:h,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:f.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});B.vertexArray=new C({context:h,attributes:z,indexBuffer:U}),B.shaderProgram=v.fromCache({context:h,vertexShaderSource:E,fragmentShaderSource:w,attributeLocations:F}),B.renderState=g.fromCache({blending:b.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var G=h.uniformState.sunPositionWC,H=h.uniformState.sunPositionColumbusView,W=this._boundingVolume,q=this._boundingVolume2D;i.clone(G,W.center),q.center.x=H.z,q.center.y=H.x,q.center.z=H.y,W.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,q.radius=W.radius,_===T.SCENE3D?e.clone(W,B.boundingVolume):_===T.COLUMBUS_VIEW&&e.clone(q,B.boundingVolume);var j=x.computeActualWgs84Position(s,G,I),Y=i.magnitude(i.subtract(j,r.camera.position,I)),X=h.uniformState.projection,Z=M;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=c.multiplyByVector(X,Z,I),Q=x.clipToGLWindowCoordinates(a.viewport,K,P);Z.x=u.SOLAR_RADIUS;var J=c.multiplyByVector(X,Z,I),$=x.clipToGLWindowCoordinates(a.viewport,J,D);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,I))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),define("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),define("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),define("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),define("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"}),define("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return d.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var d=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(d,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},d}),define("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(r){function n(e,t){i(m[e])||(m[e]=t),i(v)&&!i(v[e])&&(v[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),d=new c(r.url),m=l(t(d.query,"")),_=e(f(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);m=e(_,m);var g,v;g=new c(r.url),v=l(t(g.query,""));var y=e(f(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);v=e(y,v),n("layers",r.layers),parseFloat(_.version)>=1.3?n("crs",r.tilingScheme instanceof u?"EPSG:3857":"CRS:84"):n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),d.query=s(m);var C,w=d.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(v)&&(i(v.query_layers)||(v.query_layers=r.layers),i(v.x)||(v.x="{i}"),i(v.y)||(v.y="{j}"),i(v.info_format)||(v.info_format="{format}"),g.query=s(v),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new h({url:w,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures})}function f(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new d("json","application/json")),o(new d("xml","text/xml")),o(new d("text","text/html"))]),p}),define("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new h({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=f.resolve(!0);var n=this._tilingScheme.positionToTileXY(d.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(d.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function g(t,n,o,a){var s,l=t._tileMatrixLabels,d=r(l)?l[a]:a.toString(),h=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",d).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",h[(n+o+a)%h.length]);else{var f=new p(t._url),m=c(i(f.query,""));m=e(v,m),m.tilematrix=d,m.layer=t._layer,m.style=t._style,m.tilerow=o,m.tilecol=n,m.tilematrixset=t._tileMatrixSetID,m.format=t._format,f.query=u(m),s=f.toString()}var _=t._proxy;return r(_)&&(s=_.getURL(s)),s}var v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=g(this,e,t,i);return m.loadImage(this,r)},_.prototype.pickFeatures=function(e,t,i,r,n){},_}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,i,r){switch(i=i||"i8","*"===i.charAt(i.length-1)&&(i="i32"),i){case"i1":HEAP8[e>>0]=t;break;case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+i)}}function getValue(e,t,i){switch(t=t||"i8","*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":return HEAP8[e>>0];case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}function allocate(e,t,i,r){var n,o;"number"==typeof e?(n=!0,o=e):(n=!1,o=e.length);var a,s="string"==typeof t?t:null;if(a=i==ALLOC_NONE?r:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===i?ALLOC_STATIC:i](Math.max(o,s?1:t.length)),n){var l,r=a;for(assert(0==(3&a)),l=a+(o&-4);r<l;r+=4)HEAP32[r>>2]=0;for(l=a+o;r<l;)HEAP8[r++>>0]=0;return a}if("i8"===s)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var u,c,d,h=0;h<o;){var p=e[h];"function"==typeof p&&(p=Runtime.getFunctionIndex(p)),u=s||t[h],0!==u?("i64"==u&&(u="i32"),setValue(a+h,p,u),d!==u&&(c=Runtime.getNativeTypeSize(u),d=u),h+=c):h++}return a}function getMemory(e){return staticSealed?"undefined"!=typeof _sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,t){if(0===t||!e)return"";for(var i,r=0,n=0;;){if(i=HEAPU8[e+n>>0],r|=i,0==i&&!t)break;if(n++,t&&n==t)break}t||(t=n);var o="";if(r<128){for(var a,s=1024;t>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,s))),o=o?o+a:a,e+=s,t-=s;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var i=HEAP8[e++>>0];if(!i)return t;t+=String.fromCharCode(i)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}function UTF8ArrayToString(e,t){for(var i,r,n,o,a,s,l="";;){if(i=e[t++],!i)return l;if(128&i)if(r=63&e[t++],192!=(224&i))if(n=63&e[t++],224==(240&i)?i=(15&i)<<12|r<<6|n:(o=63&e[t++],240==(248&i)?i=(7&i)<<18|r<<12|n<<6|o:(a=63&e[t++],248==(252&i)?i=(3&i)<<24|r<<18|n<<12|o<<6|a:(s=63&e[t++],i=(1&i)<<30|r<<24|n<<18|o<<12|a<<6|s))),i<65536)l+=String.fromCharCode(i);else{var u=i-65536;l+=String.fromCharCode(55296|u>>10,56320|1023&u)}else l+=String.fromCharCode((31&i)<<6|r);else l+=String.fromCharCode(i)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,i,r){if(!(r>0))return 0;for(var n=i,o=i+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(i>=o)break;t[i++]=s}else if(s<=2047){if(i+1>=o)break;t[i++]=192|s>>6,t[i++]=128|63&s}else if(s<=65535){if(i+2>=o)break;t[i++]=224|s>>12,t[i++]=128|s>>6&63,t[i++]=128|63&s}else if(s<=2097151){if(i+3>=o)break;t[i++]=240|s>>18,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}else if(s<=67108863){if(i+4>=o)break;t[i++]=248|s>>24,t[i++]=128|s>>18&63,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}else{if(i+5>=o)break;t[i++]=252|s>>30,t[i++]=128|s>>24&63,t[i++]=128|s>>18&63,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}}return t[i]=0,i-n}function stringToUTF8(e,t,i){return stringToUTF8Array(e,HEAPU8,t,i)}function lengthBytesUTF8(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++i)),r<=127?++t:t+=r<=2047?2:r<=65535?3:r<=2097151?4:r<=67108863?5:6}return t}function UTF16ToString(e){for(var t=0,i="";;){var r=HEAP16[e+2*t>>1];if(0==r)return i;++t,i+=String.fromCharCode(r)}}function stringToUTF16(e,t,i){if(void 0===i&&(i=2147483647),i<2)return 0;i-=2;for(var r=t,n=i<2*e.length?i/2:e.length,o=0;o<n;++o){var a=e.charCodeAt(o);HEAP16[t>>1]=a,t+=2}return HEAP16[t>>1]=0,t-r}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var t=0,i="";;){var r=HEAP32[e+4*t>>2];if(0==r)return i;if(++t,r>=65536){var n=r-65536;i+=String.fromCharCode(55296|n>>10,56320|1023&n)}else i+=String.fromCharCode(r)}}function stringToUTF32(e,t,i){if(void 0===i&&(i=2147483647),i<4)return 0;for(var r=t,n=r+i-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343){var s=e.charCodeAt(++o);a=65536+((1023&a)<<10)|1023&s}if(HEAP32[t>>2]=a,t+=4,t+4>n)break}return HEAP32[t>>2]=0,t-r}function lengthBytesUTF32(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&++i,t+=4}return t}function demangle(e){function t(){s++,"K"===e[s]&&s++;for(var t=[];"E"!==e[s];)if("S"!==e[s])if("C"!==e[s]){var i=parseInt(e.substr(s)),r=i.toString().length;if(!i||!r){s--;break}var n=e.substr(s+r,i);t.push(n),u.push(n),s+=r+i}else t.push(t[t.length-1]),s+=2;else{s++;var o=e.indexOf("_",s),a=e.substring(s,o)||0;t.push(u[a]||"?"),s=o+1}return s++,t}function i(r,n,o){function a(){return"("+h.join(", ")+")"}n=n||1/0;var u,d="",h=[];if("N"===e[s]){if(u=t().join("::"),n--,0===n)return r?[u]:u}else{("K"===e[s]||c&&"L"===e[s])&&s++;var p=parseInt(e.substr(s));if(p){var f=p.toString().length;u=e.substr(s+f,p),s+=f+p}}if(c=!1,"I"===e[s]){s++;var m=i(!0),_=i(!0,1,!0);d+=_[0]+" "+u+"<"+m.join(", ")+">"}else d=u;e:for(;s<e.length&&n-- >0;){var g=e[s++];if(g in l)h.push(l[g]);else switch(g){case"P":h.push(i(!0,1,!0)[0]+"*");break;case"R":h.push(i(!0,1,!0)[0]+"&");break;case"L":s++;var v=e.indexOf("E",s),p=v-s;h.push(e.substr(s,p)),s+=p+2;break;case"A":var p=parseInt(e.substr(s));if(s+=p.toString().length,"_"!==e[s])throw"?";s++,h.push(i(!0,1,!0)[0]+" ["+p+"]");break;case"E":break e;default:d+="?"+g;break e}}return o||1!==h.length||"void"!==h[0]||(h=[]),r?(d&&h.push(d+"?"),h):d+a()}var r=!!Module.___cxa_demangle;if(r)try{var n=_malloc(e.length);writeStringToMemory(e.substr(1),n);var o=_malloc(4),a=Module.___cxa_demangle(n,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{n&&_free(n),o&&_free(o),a&&_free(a)}var s=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},u=[],c=!0,d=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}d=i()}catch(e){d+="?"}return d.indexOf("?")>=0&&!r&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling"),d}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}function enlargeMemory(){var e=Math.pow(2,31);if(DYNAMICTOP>=e)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY<e/2)TOTAL_MEMORY=alignMemoryPage(2*TOTAL_MEMORY);else{var t=TOTAL_MEMORY;if(TOTAL_MEMORY=alignMemoryPage((3*TOTAL_MEMORY+e)/4),TOTAL_MEMORY<=t)return!1}if(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,16777216),TOTAL_MEMORY>=e)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var i=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return!1}var r=_emscripten_replace_memory(buffer);return!!r&&(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(i),!0)}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?Runtime.dynCall("v",i):Runtime.dynCall("vi",i,[t.arg]):i(void 0===t.arg?null:t.arg)}else t()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,i){var r=i>0?i:lengthBytesUTF8(e)+1,n=new Array(r),o=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=o),n}function intArrayToString(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}function writeStringToMemory(e,t,i){for(var r=intArrayFromString(e,i),n=0;n<r.length;){var o=r[n];HEAP8[t+n>>0]=o,n+=1}}function writeArrayToMemory(e,t){for(var i=0;i<e.length;i++)HEAP8[t++>>0]=e[i]}function writeAsciiToMemory(e,t,i){for(var r=0;r<e.length;++r)HEAP8[t++>>0]=e.charCodeAt(r);i||(HEAP8[t>>0]=0)}function unSign(e,t,i){return e>=0?e:t<=32?2*Math.abs(1<<t-1)+e:Math.pow(2,t)+e}function reSign(e,t,i){if(e<=0)return e;var r=t<=32?Math.abs(1<<t-1):Math.pow(2,t-1);return e>=r&&(t<=32||e>r)&&(e=-2*r+e),e}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _pthread_cleanup_push(e,t){__ATEXIT__.push(function(){Runtime.dynCall("vi",e,[t])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,t){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Runtime.dynCall("v",t),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,t,i){return HEAPU8.set(HEAPU8.subarray(t,t+i),e),e}function ___syscall6(e,t){SYSCALLS.varargs=t;try{var i=SYSCALLS.getStreamFromFD();return FS.close(i),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator?navigator.hardwareConcurrency||1:1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _sbrk(e){var t=_sbrk;t.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),t.called=!0,assert(Runtime.dynamicAlloc),
t.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var i=DYNAMICTOP;if(0!=e){var r=t.alloc(e);if(!r)return-1>>>0}return i}function _pthread_key_create(e,t){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(e,t){function i(e){e.source===window&&e.data===n&&(e.stopPropagation(),r.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,t)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var r=[],n="__emcc";window.addEventListener("message",i,!0),window.setImmediate=function(e){r.push(e),window.postMessage(n,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(e,t,i,r,n){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=r;var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var t=Date.now(),i=Browser.mainLoop.queue.shift();if(i.func(i.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,a=n%1==0?n-1:Math.floor(n);i.counted?Browser.mainLoop.remainingBlockers=a:(a+=.5,Browser.mainLoop.remainingBlockers=(8*n+a)/9)}return console.log('main loop blocker "'+i.name+'" took '+(Date.now()-t)+" ms"),Browser.mainLoop.updateStatus(),void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){"undefined"!=typeof r?Runtime.dynCall("vi",e,[r]):Runtime.dynCall("v",e)}),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},n||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),i)throw"SimulateInfiniteLoop"}function _pthread_setspecific(e,t){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=t,0):ERRNO_CODES.EINVAL}function _time(e){var t=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=t),t}function _pthread_self(){return 0}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var i=SYSCALLS.getStreamFromFD(),r=SYSCALLS.get(),n=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),s=n;return assert(0===r),FS.llseek(i,s,a),HEAP32[o>>2]=i.position,i.getdents&&0===s&&0===a&&(i.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var i=(SYSCALLS.get(),SYSCALLS.get()),r=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var o=___syscall146.buffer,a=0;a<r;a++){for(var s=HEAP32[i+8*a>>2],l=HEAP32[i+(8*a+4)>>2],u=0;u<l;u++){var c=HEAPU8[s+u];0===c||10===c?(Module.print(UTF8ArrayToString(o,0)),o.length=0):o.push(c)}n+=l}return n}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,t,i,r){try{return Module.dynCall_iiii(e,t,i,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiii(e,t,i,r,n,o){try{Module.dynCall_viiiii(e,t,i,r,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,t){try{Module.dynCall_vi(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,t){try{return Module.dynCall_ii(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viii(e,t,i,r){try{Module.dynCall_viii(e,t,i,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiiii(e,t,i,r,n,o,a){try{Module.dynCall_viiiiii(e,t,i,r,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiii(e,t,i,r,n){try{Module.dynCall_viiii(e,t,i,r,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}function exit(e,t){if(!t||!Module.noExitRuntime)throw Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(e)}),console.log(" "),setTimeout(function(){process.exit(e)},500)):ENVIRONMENT_IS_SHELL&&"function"==typeof quit&&quit(e),new ExitStatus(e)}function abort(e){void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var t="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.",i="abort("+e+") at "+stackTrace()+t;throw abortDecorators&&abortDecorators.forEach(function(t){i=t(i,e)}),i}var Module;Module||(Module=("undefined"!=typeof Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=require("fs"),nodePath=require("path");Module.read=function(e,t){e=nodePath.normalize(e);var i=nodeFS.readFileSync(e);return i||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),i=nodeFS.readFileSync(e)),i&&!t&&(i=i.toString()),i},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),"undefined"==typeof Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8===0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4===(7&e)),e+=4):assert(0===(3&e)),e},getAlignSize:function(e,t,i){return i||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,t),Module["dynCall_"+e].apply(null,i)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t<Runtime.functionPointers.length;t++)if(!Runtime.functionPointers[t])return Runtime.functionPointers[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var i=Runtime.funcWrappers[t];return i[e]||(i[e]=function(){return Runtime.dynCall(t,e,arguments)}),i[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var t=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,t},dynamicAlloc:function(e){var t=DYNAMICTOP;if(DYNAMICTOP=DYNAMICTOP+e|0,DYNAMICTOP=DYNAMICTOP+15&-16,DYNAMICTOP>=TOTAL_MEMORY){var i=enlargeMemory();if(!i)return DYNAMICTOP=t,0}return t},alignMemory:function(e,t){var i=e=Math.ceil(e/(t?t:16))*(t?t:16);return i},makeBigInt:function(e,t,i){var r=i?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t);return r},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9,globalScope=this,cwrap,ccall;!function(){function parseJSFunc(e){var t=e.toString().match(sourceRegex).slice(1);return{arguments:t[0],body:t[1],returnValue:t[2]}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;return null!==e&&void 0!==e&&0!==e&&(t=Runtime.stackAlloc((e.length<<2)+1),writeStringToMemory(e,t)),t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,i,r,n){var o=getCFunc(e),a=[],s=0;if(r)for(var l=0;l<r.length;l++){var u=toC[i[l]];u?(0===s&&(s=Runtime.stackSave()),a[l]=u(r[l])):a[l]=r[l]}var c=o.apply(null,a);if("string"===t&&(c=Pointer_stringify(c)),0!==s){if(n&&n.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(s)});Runtime.stackRestore(s)}return c};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,t){return"$"+t}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0,byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=65536;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;totalMemory=Math.max(totalMemory,16777216),totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&Math.imul(4294967295,5)===-5||(Math.imul=function(e,t){var i=e>>>16,r=65535&e,n=t>>>16,o=65535&t;return r*o+(i*o+r*n<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5888,__ATINIT__.push(),allocate([116,0,0,0,86,7,0,0,116,0,0,0,99,7,0,0,156,0,0,0,112,7,0,0,16,0,0,0,0,0,0,0,156,0,0,0,145,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,215,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,179,7,0,0,56,0,0,0,0,0,0,0,156,0,0,0,249,7,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,1,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,227,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,219,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);
var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var _BDtoIHigh=!0;Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._memset=_memset;var _BDtoILow=!0;Module._bitshift64Lshr=_bitshift64Lshr,Module._bitshift64Shl=_bitshift64Shl;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var t in EXCEPTIONS.infos){var i=EXCEPTIONS.infos[t];if(i.adjusted===e)return t}return e},addRef:function(e){if(e){var t=EXCEPTIONS.infos[e];t.refcount++}},decRef:function(e){if(e){var t=EXCEPTIONS.infos[e];assert(t.refcount>0),t.refcount--,0===t.refcount&&(t.destructor&&Runtime.dynCall("vi",t.destructor,[e]),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){var t=EXCEPTIONS.infos[e];t.refcount=0}}};Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){SYSCALLS.varargs+=4;var t=HEAP32[SYSCALLS.varargs-4>>2];return t},getStr:function(){var e=Pointer_stringify(SYSCALLS.get());return e},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:t===-1),e},getZero:function(){assert(0===SYSCALLS.get())}},PTHREAD_SPECIFIC={},ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},PTHREAD_SPECIFIC_NEXT_KEY=1,_BItoD=!0,PATH=void 0,Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,i=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(i,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,i=Browser.mainLoop.expectedBlockers;t?t<i?Module.setStatus(e+" ("+(i-t)+"/"+i+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){var t=Module.preMainLoop();if(t===!1)return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r||document.msPointerLockElement===r}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||"undefined"!=typeof Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var t={};t.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},t.handle=function(e,t,i,r){var n=null;if(Browser.hasBlobConstructor)try{n=new Blob([e],{type:Browser.getMimetype(t)}),n.size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(t)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!n){var o=new Browser.BlobBuilder;o.append(new Uint8Array(e).buffer),n=o.getBlob()}var a=Browser.URLObject.createObjectURL(n),s=new Image;s.onload=function(){assert(s.complete,"Image "+t+" could not be decoded");var r=document.createElement("canvas");r.width=s.width,r.height=s.height;var n=r.getContext("2d");n.drawImage(s,0,0),Module.preloadedImages[t]=r,Browser.URLObject.revokeObjectURL(a),i&&i(e)},s.onerror=function(e){console.log("Image "+a+" could not be decoded"),r&&r()},s.src=a},Module.preloadPlugins.push(t);var i={};i.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},i.handle=function(e,t,i,r){function n(r){a||(a=!0,Module.preloadedAudios[t]=r,i&&i(e))}function o(){a||(a=!0,Module.preloadedAudios[t]=new Audio,r&&r())}var a=!1;if(!Browser.hasBlobConstructor)return o();try{var s=new Blob([e],{type:Browser.getMimetype(t)})}catch(e){return o()}var l=Browser.URLObject.createObjectURL(s),u=new Audio;u.addEventListener("canplaythrough",function(){n(u)},!1),u.onerror=function(i){function r(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="=",r="",n=0,o=0,a=0;a<e.length;a++)for(n=n<<8|e[a],o+=8;o>=6;){var s=n>>o-6&63;o-=6,r+=t[s]}return 2==o?(r+=t[(3&n)<<4],r+=i+i):4==o&&(r+=t[(15&n)<<2],r+=i),r}a||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+r(e),n(u))},u.src=l,Browser.safeSetTimeout(function(){n(u)},1e4)},Module.preloadPlugins.push(i);var r=Module.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&r.addEventListener("click",function(e){!Browser.pointerLock&&r.requestPointerLock&&(r.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,t,i,r){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var n,o;if(t){var a={antialias:!1,alpha:!1};if(r)for(var s in r)a[s]=r[s];o=GL.createContext(e,a),o&&(n=GL.getContext(o).GLctx),e.style.backgroundColor="black"}else n=e.getContext("2d");return n?(i&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=n,t&&GL.makeContextCurrent(o),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),n):null},destroyContext:function(e,t,i){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,t,i){function r(){Browser.isFullScreen=!1;var e=n.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},n.cancelFullScreen=n.cancelFullScreen.bind(document),Browser.lockPointer&&n.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(n)}Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=i,"undefined"==typeof Browser.lockPointer&&(Browser.lockPointer=!0),"undefined"==typeof Browser.resizeCanvas&&(Browser.resizeCanvas=!1),"undefined"==typeof Browser.vrDevice&&(Browser.vrDevice=null);var n=Module.canvas;Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",r,!1),document.addEventListener("mozfullscreenchange",r,!1),document.addEventListener("webkitfullscreenchange",r,!1),document.addEventListener("MSFullscreenChange",r,!1));var o=document.createElement("div");n.parentNode.insertBefore(o,n),o.appendChild(n),o.requestFullScreen=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?o.requestFullScreen({vrDisplay:i}):o.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var i=Math.max(Browser.nextRAF-t,0);setTimeout(e,i)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),i=Module.canvas.width,r=Module.canvas.height,n="undefined"!=typeof window.scrollX?window.scrollX:window.pageXOffset,o="undefined"!=typeof window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var s=a.pageX-(n+t.left),l=a.pageY-(o+t.top);s*=i/t.width,l*=r/t.height;var u={x:s,y:l};if("touchstart"===e.type)Browser.lastTouches[a.identifier]=u,Browser.touches[a.identifier]=u;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[a.identifier];c||(c=u),Browser.lastTouches[a.identifier]=c,Browser.touches[a.identifier]=u}return}var d=e.pageX-(n+t.left),h=e.pageY-(o+t.top);d*=i/t.width,h*=r/t.height,Browser.mouseMovementX=d-Browser.mouseX,Browser.mouseMovementY=h-Browser.mouseY,Browser.mouseX=d,Browser.mouseY=h}},xhrLoad:function(e,t,i){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)},asyncLoad:function(e,t,i,r){Browser.xhrLoad(e,function(i){assert(i,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(i)),r||removeRunDependency("al "+e)},function(t){if(!i)throw'Loading data file "'+e+'" failed.';i()}),r||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,i){var r=Module.canvas;Browser.updateCanvasDimensions(r,e,t),i||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,i){t&&i?(e.widthNative=t,e.heightNative=i):(t=e.widthNative,i=e.heightNative);var r=t,n=i;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(r/n<Module.forcedAspectRatio?r=Math.round(n*Module.forcedAspectRatio):n=Math.round(r/Module.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/r,screen.height/n);r=Math.round(r*o),n=Math.round(n*o)}Browser.resizeCanvas?(e.width!=r&&(e.width=r),e.height!=n&&(e.height=n),"undefined"!=typeof e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=i&&(e.height=i),"undefined"!=typeof e.style&&(r!=t||n!=i?(e.style.setProperty("width",r+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}};Module.requestFullScreen=function(e,t,i){Browser.requestFullScreen(e,t,i)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,t,i){Browser.setCanvasSize(e,t,i)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,t,i,r){return Browser.createContext(e,t,i,r)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_cleanup_pop:_pthread_cleanup_pop,_pthread_getspecific:_pthread_getspecific,_pthread_setspecific:_pthread_setspecific,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,_emscripten_set_main_loop:_emscripten_set_main_loop,_pthread_self:_pthread_self,_abort:_abort,_pthread_cleanup_push:_pthread_cleanup_push,___syscall6:___syscall6,_sbrk:_sbrk,_time:_time,_pthread_key_create:_pthread_key_create,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___syscall140:___syscall140,_pthread_once:_pthread_once,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,_sysconf:_sysconf,___syscall146:___syscall146,___cxa_begin_catch:___cxa_begin_catch,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,cttz_i8:cttz_i8};var asm=function(e,t,i){"use asm";var r=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var l=e.Uint32Array;var u=e.Float32Array;var c=e.Float64Array;var d=new r(i);var h=new n(i);var p=new o(i);var f=new a(i);var m=new s(i);var _=new l(i);var g=new u(i);var v=new c(i);var y=e.byteLength;var C=t.STACKTOP|0;var w=t.STACK_MAX|0;var S=t.tempDoublePtr|0;var E=t.ABORT|0;var b=t.cttz_i8|0;var T=0;var x=0;var A=0;var P=0;var D=e.NaN,M=e.Infinity;var I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0;var z=0;var U=0;var G=0;var H=0;var W=0;var q=0;var j=0;var Y=0;var X=0;var Z=0;var K=e.Math.floor;var Q=e.Math.abs;var J=e.Math.sqrt;var $=e.Math.pow;var ee=e.Math.cos;var te=e.Math.sin;var ie=e.Math.tan;var re=e.Math.acos;var ne=e.Math.asin;var oe=e.Math.atan;var ae=e.Math.atan2;var se=e.Math.exp;var le=e.Math.log;var ue=e.Math.ceil;var ce=e.Math.imul;var de=e.Math.min;var he=e.Math.clz32;var pe=t.abort;var fe=t.assert;var me=t.invoke_iiii;var _e=t.invoke_viiiii;var ge=t.invoke_vi;var ve=t.invoke_ii;var ye=t.invoke_viii;var Ce=t.invoke_v;var we=t.invoke_viiiiii;var Se=t.invoke_viiii;var Ee=t._pthread_cleanup_pop;var be=t._pthread_getspecific;var Te=t._pthread_setspecific;var xe=t.__ZSt18uncaught_exceptionv;var Ae=t._emscripten_set_main_loop;var Pe=t._pthread_self;var De=t._abort;var Me=t._pthread_cleanup_push;var Ie=t.___syscall6;var Re=t._sbrk;var Oe=t._time;var Ne=t._pthread_key_create;var Le=t.___setErrNo;var Be=t._emscripten_memcpy_big;var Fe=t.___syscall54;var ke=t.___syscall140;var Ve=t._pthread_once;var ze=t._emscripten_set_main_loop_timing;var Ue=t._sysconf;var Ge=t.___syscall146;var He=t.___cxa_begin_catch;var We=0;function qe(e){if(y(e)&16777215||y(e)<=16777215||y(e)>2147483648)return false;d=new r(e);h=new n(e);p=new o(e);f=new a(e);m=new s(e);_=new l(e);g=new u(e);v=new c(e);i=e;return true}function je(e){e=e|0;var t=0;t=C;C=C+e|0;C=C+15&-16;return t|0}function Ye(){return C|0}function Xe(e){e=e|0;C=e}function Ze(e,t){e=e|0;t=t|0;C=e;w=t}function Ke(e,t){e=e|0;t=t|0;if(!T){T=e;x=t}}function Qe(e){e=e|0;d[S>>0]=d[e>>0];d[S+1>>0]=d[e+1>>0];d[S+2>>0]=d[e+2>>0];d[S+3>>0]=d[e+3>>0]}function Je(e){e=e|0;d[S>>0]=d[e>>0];d[S+1>>0]=d[e+1>>0];d[S+2>>0]=d[e+2>>0];d[S+3>>0]=d[e+3>>0];d[S+4>>0]=d[e+4>>0];d[S+5>>0]=d[e+5>>0];d[S+6>>0]=d[e+6>>0];d[S+7>>0]=d[e+7>>0]}function $e(e){e=e|0;z=e}function et(){return z|0}function tt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0;f=C;C=C+576|0;c=f+48|0;s=f+32|0;a=f+16|0;o=f;u=f+64|0;d=f+60|0;l=e+4|0;h=e+8|0;if((p[l>>2]|0)>>>0>(p[h>>2]|0)>>>0){p[o>>2]=1138;p[o+4>>2]=2119;p[o+8>>2]=1117;yi(u,1084,o)|0;vi(u)|0}if((2147418112/(r>>>0)|0)>>>0<=t>>>0){p[a>>2]=1138;p[a+4>>2]=2120;p[a+8>>2]=1157;yi(u,1084,a)|0;vi(u)|0}a=p[h>>2]|0;if(a>>>0>=t>>>0){h=1;C=f;return h|0}do if(i){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10;while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){p[s>>2]=1138;p[s+4>>2]=2129;p[s+8>>2]=1205;yi(u,1084,s)|0;vi(u)|0}i=ce(t,r)|0;do if(!n){o=it(p[e>>2]|0,i,d,1)|0;if(!o){h=0;C=f;return h|0}else{p[e>>2]=o;break}}else{a=rt(i,d)|0;if(!a){h=0;C=f;return h|0}Ar[n&0](a,p[e>>2]|0,p[l>>2]|0);o=p[e>>2]|0;do if(o)if(!(o&7)){ot(o,0,0,1,0)|0;break}else{p[c>>2]=1138;p[c+4>>2]=2502;p[c+8>>2]=1504;yi(u,1084,c)|0;vi(u)|0;break}while(0);p[e>>2]=a}while(0);o=p[d>>2]|0;if(o>>>0>i>>>0)t=(o>>>0)/(r>>>0)|0;p[h>>2]=t;h=1;C=f;return h|0}function it(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=C;C=C+560|0;l=u+32|0;o=u+16|0;n=u;s=u+48|0;a=u+44|0;if(e&7){p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1482;yi(s,1084,n)|0;vi(s)|0;l=0;C=u;return l|0}if(t>>>0>2147418112){p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1375;yi(s,1084,o)|0;vi(s)|0;l=0;C=u;return l|0}p[a>>2]=t;r=ot(e,t,a,r,0)|0;if(i)p[i>>2]=p[a>>2];if(!(r&7)){l=r;C=u;return l|0}p[l>>2]=1138;p[l+4>>2]=2554;p[l+8>>2]=1428;yi(s,1084,l)|0;vi(s)|0;l=r;C=u;return l|0}function rt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+560|0;s=l+32|0;a=l+16|0;i=l;o=l+48|0;n=l+44|0;r=e+3&-4;r=(r|0)!=0?r:4;if(r>>>0>2147418112){p[i>>2]=1138;p[i+4>>2]=2502;p[i+8>>2]=1375;yi(o,1084,i)|0;vi(o)|0;s=0;C=l;return s|0}p[n>>2]=r;i=ot(0,r,n,1,0)|0;e=p[n>>2]|0;if(t)p[t>>2]=e;if((i|0)==0|e>>>0<r>>>0){p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1401;yi(o,1084,a)|0;vi(o)|0;s=0;C=l;return s|0}if(!(i&7)){s=i;C=l;return s|0}p[s>>2]=1138;p[s+4>>2]=2529;p[s+8>>2]=1428;yi(o,1084,s)|0;vi(o)|0;s=i;C=l;return s|0}function nt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0;F=C;C=C+880|0;N=F+144|0;O=F+128|0;R=F+112|0;I=F+96|0;P=F+80|0;S=F+64|0;y=F+48|0;w=F+32|0;_=F+16|0;c=F;M=F+360|0;L=F+296|0;B=F+224|0;v=F+156|0;if((t|0)==0|r>>>0>11){e=0;C=F;return e|0}p[e>>2]=t;n=B;o=n+68|0;do{p[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=d[i+o>>0]|0;if(n<<24>>24){D=B+((n&255)<<2)|0;p[D>>2]=(p[D>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;u=1;a=0;s=-1;l=0;while(1){n=p[B+(u<<2)>>2]|0;if(!n)p[e+28+(u+-1<<2)>>2]=0;else{D=u+-1|0;p[L+(D<<2)>>2]=o;o=n+o|0;A=16-u|0;p[e+28+(D<<2)>>2]=(o+-1<<A|(1<<A)+-1)+1;p[e+96+(D<<2)>>2]=l;p[v+(u<<2)>>2]=l;a=a>>>0>u>>>0?a:u;s=s>>>0<u>>>0?s:u;l=n+l|0}u=u+1|0;if((u|0)==17){D=a;break}else o=o<<1}p[e+4>>2]=l;o=e+172|0;do if(l>>>0>(p[o>>2]|0)>>>0){p[o>>2]=l;if(l){n=l+-1|0;if(n&l)g=14}else{n=-1;g=14}if((g|0)==14){A=n>>>16|n;A=A>>>8|A;A=A>>>4|A;A=A>>>2|A;A=(A>>>1|A)+1|0;p[o>>2]=A>>>0>t>>>0?t:A}a=e+176|0;n=p[a>>2]|0;do if(n){A=p[n+-4>>2]|0;n=n+-8|0;if(!((A|0)!=0?(A|0)==(~p[n>>2]|0):0)){p[c>>2]=1138;p[c+4>>2]=647;p[c+8>>2]=1851;yi(M,1084,c)|0;vi(M)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[_>>2]=1138;p[_+4>>2]=2502;p[_+8>>2]=1504;yi(M,1084,_)|0;vi(M)|0;break}}while(0);o=p[o>>2]|0;o=(o|0)!=0?o:1;n=rt((o<<1)+8|0,0)|0;if(!n){p[a>>2]=0;n=0;break}else{p[n+4>>2]=o;p[n>>2]=~o;p[a>>2]=n+8;g=25;break}}else g=25;while(0);e:do if((g|0)==25){A=e+24|0;d[A>>0]=s;d[e+25>>0]=D;o=e+176|0;a=0;do{x=d[i+a>>0]|0;n=x&255;if(x<<24>>24){if(!(p[B+(n<<2)>>2]|0)){p[w>>2]=1138;p[w+4>>2]=2272;p[w+8>>2]=1249;yi(M,1084,w)|0;vi(M)|0}x=v+(n<<2)|0;n=p[x>>2]|0;p[x>>2]=n+1;if(n>>>0>=l>>>0){p[y>>2]=1138;p[y+4>>2]=2276;p[y+8>>2]=1262;yi(M,1084,y)|0;vi(M)|0}h[(p[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=d[A>>0]|0;T=(n&255)>>>0<r>>>0?r:0;x=e+8|0;p[x>>2]=T;b=(T|0)!=0;if(b){E=1<<T;n=e+164|0;do if(E>>>0>(p[n>>2]|0)>>>0){p[n>>2]=E;a=e+168|0;n=p[a>>2]|0;do if(n){w=p[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~p[n>>2]|0):0)){p[S>>2]=1138;p[S+4>>2]=647;p[S+8>>2]=1851;yi(M,1084,S)|0;vi(M)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[P>>2]=1138;p[P+4>>2]=2502;p[P+8>>2]=1504;yi(M,1084,P)|0;vi(M)|0;break}}while(0);n=E<<2;o=rt(n+8|0,0)|0;if(!o){p[a>>2]=0;n=0;break e}else{P=o+8|0;p[o+4>>2]=E;p[o>>2]=~E;p[a>>2]=P;o=P;break}}else{o=e+168|0;n=E<<2;a=o;o=p[o>>2]|0}while(0);Xi(o|0,-1,n|0)|0;v=e+176|0;S=1;do{if(p[B+(S<<2)>>2]|0){y=T-S|0;w=1<<y;o=S+-1|0;s=p[L+(o<<2)>>2]|0;if(o>>>0>=16){p[I>>2]=1138;p[I+4>>2]=1956;p[I+8>>2]=1725;yi(M,1084,I)|0;vi(M)|0}n=p[e+28+(o<<2)>>2]|0;if(!n)t=-1;else t=(n+-1|0)>>>(16-S|0);if(s>>>0<=t>>>0){_=(p[e+96+(o<<2)>>2]|0)-s|0;g=S<<16;do{n=m[(p[v>>2]|0)+(_+s<<1)>>1]|0;if((f[i+n>>0]|0|0)!=(S|0)){p[R>>2]=1138;p[R+4>>2]=2318;p[R+8>>2]=1291;yi(M,1084,R)|0;vi(M)|0}c=s<<y;o=n|g;u=0;do{l=u+c|0;if(l>>>0>=E>>>0){p[O>>2]=1138;p[O+4>>2]=2324;p[O+8>>2]=1325;yi(M,1084,O)|0;vi(M)|0}n=p[a>>2]|0;if((p[n+(l<<2)>>2]|0)!=-1){p[N>>2]=1138;p[N+4>>2]=2326;p[N+8>>2]=1348;yi(M,1084,N)|0;vi(M)|0;n=p[a>>2]|0}p[n+(l<<2)>>2]=o;u=u+1|0}while(u>>>0<w>>>0);s=s+1|0}while(s>>>0<=t>>>0)}}S=S+1|0}while(T>>>0>=S>>>0);n=d[A>>0]|0}o=e+96|0;p[o>>2]=(p[o>>2]|0)-(p[L>>2]|0);o=e+100|0;p[o>>2]=(p[o>>2]|0)-(p[L+4>>2]|0);o=e+104|0;p[o>>2]=(p[o>>2]|0)-(p[L+8>>2]|0);o=e+108|0;p[o>>2]=(p[o>>2]|0)-(p[L+12>>2]|0);o=e+112|0;p[o>>2]=(p[o>>2]|0)-(p[L+16>>2]|0);o=e+116|0;p[o>>2]=(p[o>>2]|0)-(p[L+20>>2]|0);o=e+120|0;p[o>>2]=(p[o>>2]|0)-(p[L+24>>2]|0);o=e+124|0;p[o>>2]=(p[o>>2]|0)-(p[L+28>>2]|0);o=e+128|0;p[o>>2]=(p[o>>2]|0)-(p[L+32>>2]|0);o=e+132|0;p[o>>2]=(p[o>>2]|0)-(p[L+36>>2]|0);o=e+136|0;p[o>>2]=(p[o>>2]|0)-(p[L+40>>2]|0);o=e+140|0;p[o>>2]=(p[o>>2]|0)-(p[L+44>>2]|0);o=e+144|0;p[o>>2]=(p[o>>2]|0)-(p[L+48>>2]|0);o=e+148|0;p[o>>2]=(p[o>>2]|0)-(p[L+52>>2]|0);o=e+152|0;p[o>>2]=(p[o>>2]|0)-(p[L+56>>2]|0);o=e+156|0;p[o>>2]=(p[o>>2]|0)-(p[L+60>>2]|0);o=e+16|0;p[o>>2]=0;a=e+20|0;p[a>>2]=n&255;t:do if(b){while(1){if(!r)break t;n=r+-1|0;if(!(p[B+(r<<2)>>2]|0))r=n;else break}p[o>>2]=p[e+28+(n<<2)>>2];n=T+1|0;p[a>>2]=n;if(n>>>0<=D>>>0){while(1){if(p[B+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>D>>>0)break t}p[a>>2]=n}}while(0);p[e+92>>2]=-1;p[e+160>>2]=1048575;p[e+12>>2]=32-(p[x>>2]|0);n=1}while(0);e=n;C=F;return e|0}function ot(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;do if(!e){r=Vi(t)|0;if(i){if(!r)e=0;else e=Gi(r)|0;p[i>>2]=e}}else{if(!t){zi(e);if(!i){r=0;break}p[i>>2]=0;r=0;break}if(r){r=Ui(e,t)|0;e=(r|0)==0?e:r}else r=0;if(i){t=Gi(e)|0;p[i>>2]=t}}while(0);return r|0}function at(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if(!((e|0)!=0&t>>>0>73&(i|0)!=0)){i=0;return i|0}if((p[i>>2]|0)!=40|t>>>0<74){i=0;return i|0}if(((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)!=18552){i=0;return i|0}if(((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0<74){i=0;return i|0}if(((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0>t>>>0){i=0;return i|0}p[i+4>>2]=(f[e+12>>0]|0)<<8|(f[e+13>>0]|0);p[i+8>>2]=(f[e+14>>0]|0)<<8|(f[e+15>>0]|0);p[i+12>>2]=f[e+16>>0];p[i+16>>2]=f[e+17>>0];t=e+18|0;r=i+32|0;p[r>>2]=f[t>>0];p[r+4>>2]=0;t=d[t>>0]|0;p[i+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;p[i+24>>2]=(f[e+26>>0]|0)<<16|(f[e+25>>0]|0)<<24|(f[e+27>>0]|0)<<8|(f[e+28>>0]|0);p[i+28>>2]=(f[e+30>>0]|0)<<16|(f[e+29>>0]|0)<<24|(f[e+31>>0]|0)<<8|(f[e+32>>0]|0);i=1;return i|0}function st(e){e=e|0;He(e|0)|0;Vt()}function lt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0;o=C;C=C+528|0;n=o;r=o+16|0;t=p[e+20>>2]|0;if(t)ut(t);t=e+4|0;i=p[t>>2]|0;if(!i){n=e+16|0;d[n>>0]=0;C=o;return}if(!(i&7))ot(i,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yi(r,1084,n)|0;vi(r)|0}p[t>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;n=e+16|0;d[n>>0]=0;C=o;return}function ut(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0;l=C;C=C+592|0;a=l+64|0;o=l+48|0;s=l+32|0;r=l+16|0;i=l;n=l+80|0;if(!e){C=l;return}t=p[e+168>>2]|0;do if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[i>>2]=1138;p[i+4>>2]=647;p[i+8>>2]=1851;yi(n,1084,i)|0;vi(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[r>>2]=1138;p[r+4>>2]=2502;p[r+8>>2]=1504;yi(n,1084,r)|0;vi(n)|0;break}}while(0);t=p[e+176>>2]|0;do if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[s>>2]=1138;p[s+4>>2]=647;p[s+8>>2]=1851;yi(n,1084,s)|0;vi(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yi(n,1084,o)|0;vi(n)|0;break}}while(0);if(!(e&7)){ot(e,0,0,1,0)|0;C=l;return}else{p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1504;yi(n,1084,a)|0;vi(n)|0;C=l;return}}function ct(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+544|0;a=l+16|0;t=l;o=l+32|0;n=e+8|0;i=p[n>>2]|0;if((i+-1|0)>>>0>=8192){p[t>>2]=1138;p[t+4>>2]=3002;p[t+8>>2]=1529;yi(o,1084,t)|0;vi(o)|0}p[e>>2]=i;r=e+20|0;t=p[r>>2]|0;if(!t){t=rt(180,0)|0;if(!t)t=0;else{s=t+164|0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0}p[r>>2]=t;s=p[e>>2]|0}else s=i;if(!(p[n>>2]|0)){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yi(o,1084,a)|0;vi(o)|0;a=p[e>>2]|0}else a=s;o=p[e+4>>2]|0;if(a>>>0>16){r=a;i=0}else{e=0;e=nt(t,s,o,e)|0;C=l;return e|0}while(1){n=i+1|0;if(r>>>0>3){r=r>>>1;i=n}else{r=n;break}}e=i+2+((r|0)!=32&1<<r>>>0<a>>>0&1)|0;e=e>>>0<11?e&255:11;e=nt(t,s,o,e)|0;C=l;return e|0}function dt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0;M=C;C=C+720|0;T=M+160|0;b=M+144|0;E=M+128|0;S=M+112|0;w=M+96|0;y=M+80|0;v=M+64|0;g=M+48|0;c=M+32|0;s=M+16|0;n=M;P=M+200|0;D=M+176|0;x=ht(e,14)|0;if(!x){p[t>>2]=0;i=t+4|0;r=p[i>>2]|0;if(r){if(!(r&7))ot(r,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yi(P,1084,n)|0;vi(P)|0}p[i>>2]=0;p[t+8>>2]=0;p[t+12>>2]=0}d[t+16>>0]=0;i=t+20|0;r=p[i>>2]|0;if(!r){t=1;C=M;return t|0}ut(r);p[i>>2]=0;t=1;C=M;return t|0}m=t+4|0;_=t+8|0;i=p[_>>2]|0;if((i|0)!=(x|0)){if(i>>>0<=x>>>0){do if((p[t+12>>2]|0)>>>0<x>>>0){if(tt(m,x,(i+1|0)==(x|0),1,0)|0){i=p[_>>2]|0;break}d[t+16>>0]=1;t=0;C=M;return t|0}while(0);Xi((p[m>>2]|0)+i|0,0,x-i|0)|0}p[_>>2]=x}Xi(p[m>>2]|0,0,x|0)|0;h=e+20|0;i=p[h>>2]|0;if((i|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{r=p[o>>2]|0;if((r|0)==(p[a>>2]|0))r=0;else{p[o>>2]=r+1;r=f[r>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yi(P,1084,s)|0;vi(P)|0;i=p[h>>2]|0}r=r<<32-i|p[n>>2];p[n>>2]=r}while((i|0)<5)}else{r=e+16|0;n=r;r=p[r>>2]|0}u=r>>>27;p[n>>2]=r<<5;p[h>>2]=i+-5;if((u+-1|0)>>>0>20){t=0;C=M;return t|0}p[D+20>>2]=0;p[D>>2]=0;p[D+4>>2]=0;p[D+8>>2]=0;p[D+12>>2]=0;d[D+16>>0]=0;i=D+4|0;r=D+8|0;e:do if(tt(i,21,0,1,0)|0){s=p[r>>2]|0;l=p[i>>2]|0;Xi(l+s|0,0,21-s|0)|0;p[r>>2]=21;if(u){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{i=p[h>>2]|0;if((i|0)<3){do{r=p[n>>2]|0;if((r|0)==(p[o>>2]|0))r=0;else{p[n>>2]=r+1;r=f[r>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[c>>2]=1138;p[c+4>>2]=3204;p[c+8>>2]=1638;yi(P,1084,c)|0;vi(P)|0;i=p[h>>2]|0}r=r<<32-i|p[a>>2];p[a>>2]=r}while((i|0)<3)}else r=p[a>>2]|0;p[a>>2]=r<<3;p[h>>2]=i+-3;d[l+(f[1599+s>>0]|0)>>0]=r>>>29;s=s+1|0}while((s|0)!=(u|0))}if(ct(D)|0){u=e+4|0;s=e+8|0;l=e+16|0;r=0;t:while(1){a=x-r|0;i=pt(e,D)|0;i:do if(i>>>0<17){if((p[_>>2]|0)>>>0<=r>>>0){p[g>>2]=1138;p[g+4>>2]=906;p[g+8>>2]=1769;
yi(P,1084,g)|0;vi(P)|0}d[(p[m>>2]|0)+r>>0]=i;i=r+1|0}else switch(i|0){case 17:{i=p[h>>2]|0;if((i|0)<3){do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[v>>2]=1138;p[v+4>>2]=3204;p[v+8>>2]=1638;yi(P,1084,v)|0;vi(P)|0;i=p[h>>2]|0}n=n<<32-i|p[l>>2];p[l>>2]=n}while((i|0)<3)}else n=p[l>>2]|0;p[l>>2]=n<<3;p[h>>2]=i+-3;i=(n>>>29)+3|0;if(i>>>0>a>>>0){i=0;break e}i=i+r|0;break i}case 18:{i=p[h>>2]|0;if((i|0)<7){do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[y>>2]=1138;p[y+4>>2]=3204;p[y+8>>2]=1638;yi(P,1084,y)|0;vi(P)|0;i=p[h>>2]|0}n=n<<32-i|p[l>>2];p[l>>2]=n}while((i|0)<7)}else n=p[l>>2]|0;p[l>>2]=n<<7;p[h>>2]=i+-7;i=(n>>>25)+11|0;if(i>>>0>a>>>0){i=0;break e}i=i+r|0;break i}default:{if((i+-19|0)>>>0>=2){A=90;break t}o=p[h>>2]|0;if((i|0)==19){if((o|0)<2){n=o;while(1){i=p[u>>2]|0;if((i|0)==(p[s>>2]|0))o=0;else{p[u>>2]=i+1;o=f[i>>0]|0}i=n+8|0;p[h>>2]=i;if((i|0)>=33){p[w>>2]=1138;p[w+4>>2]=3204;p[w+8>>2]=1638;yi(P,1084,w)|0;vi(P)|0;i=p[h>>2]|0}n=o<<32-i|p[l>>2];p[l>>2]=n;if((i|0)<2)n=i;else break}}else{n=p[l>>2]|0;i=o}p[l>>2]=n<<2;p[h>>2]=i+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){i=p[u>>2]|0;if((i|0)==(p[s>>2]|0))o=0;else{p[u>>2]=i+1;o=f[i>>0]|0}i=n+8|0;p[h>>2]=i;if((i|0)>=33){p[S>>2]=1138;p[S+4>>2]=3204;p[S+8>>2]=1638;yi(P,1084,S)|0;vi(P)|0;i=p[h>>2]|0}n=o<<32-i|p[l>>2];p[l>>2]=n;if((i|0)<6)n=i;else break}}else{n=p[l>>2]|0;i=o}p[l>>2]=n<<6;p[h>>2]=i+-6;o=(n>>>26)+7|0}if((r|0)==0|o>>>0>a>>>0){i=0;break e}i=r+-1|0;if((p[_>>2]|0)>>>0<=i>>>0){p[E>>2]=1138;p[E+4>>2]=906;p[E+8>>2]=1769;yi(P,1084,E)|0;vi(P)|0}n=d[(p[m>>2]|0)+i>>0]|0;if(!(n<<24>>24)){i=0;break e}i=o+r|0;if(r>>>0>=i>>>0){i=r;break i}do{if((p[_>>2]|0)>>>0<=r>>>0){p[b>>2]=1138;p[b+4>>2]=906;p[b+8>>2]=1769;yi(P,1084,b)|0;vi(P)|0}d[(p[m>>2]|0)+r>>0]=n;r=r+1|0}while((r|0)!=(i|0))}}while(0);if(x>>>0>i>>>0)r=i;else break}if((A|0)==90){p[T>>2]=1138;p[T+4>>2]=3145;p[T+8>>2]=1620;yi(P,1084,T)|0;vi(P)|0;i=0;break}if((x|0)==(i|0))i=ct(t)|0;else i=0}else i=0}else{d[D+16>>0]=1;i=0}while(0);lt(D);t=i;C=M;return t|0}function ht(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0;u=C;C=C+528|0;a=u;o=u+16|0;if(!t){l=0;C=u;return l|0}if(t>>>0<=16){l=ft(e,t)|0;C=u;return l|0}s=ft(e,t+-16|0)|0;l=e+20|0;t=p[l>>2]|0;if((t|0)<16){r=e+4|0;n=e+8|0;i=e+16|0;do{e=p[r>>2]|0;if((e|0)==(p[n>>2]|0))e=0;else{p[r>>2]=e+1;e=f[e>>0]|0}t=t+8|0;p[l>>2]=t;if((t|0)>=33){p[a>>2]=1138;p[a+4>>2]=3204;p[a+8>>2]=1638;yi(o,1084,a)|0;vi(o)|0;t=p[l>>2]|0}e=e<<32-t|p[i>>2];p[i>>2]=e}while((t|0)<16)}else{e=e+16|0;i=e;e=p[e>>2]|0}p[i>>2]=e<<16;p[l>>2]=t+-16;l=e>>>16|s<<16;C=u;return l|0}function pt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,_=0,g=0,v=0;v=C;C=C+576|0;d=v+48|0;c=v+32|0;u=v+16|0;l=v;_=v+64|0;h=p[t+20>>2]|0;g=e+20|0;s=p[g>>2]|0;do if((s|0)<24){a=e+4|0;r=p[a>>2]|0;n=p[e+8>>2]|0;i=r>>>0<n>>>0;if((s|0)>=16){if(i){p[a>>2]=r+1;i=f[r>>0]|0}else i=0;p[g>>2]=s+8;a=e+16|0;o=i<<24-s|p[a>>2];p[a>>2]=o;break}if(i){o=(f[r>>0]|0)<<8;i=r+1|0}else{o=0;i=r}if(i>>>0<n>>>0){r=f[i>>0]|0;i=i+1|0}else r=0;p[a>>2]=i;p[g>>2]=s+16;a=e+16|0;o=(r|o)<<16-s|p[a>>2];p[a>>2]=o}else{o=e+16|0;a=o;o=p[o>>2]|0}while(0);n=(o>>>16)+1|0;do if(n>>>0<=(p[h+16>>2]|0)>>>0){r=p[(p[h+168>>2]|0)+(o>>>(32-(p[h+8>>2]|0)|0)<<2)>>2]|0;if((r|0)==-1){p[l>>2]=1138;p[l+4>>2]=3249;p[l+8>>2]=1665;yi(_,1084,l)|0;vi(_)|0}i=r&65535;r=r>>>16;if((p[t+8>>2]|0)>>>0<=i>>>0){p[u>>2]=1138;p[u+4>>2]=905;p[u+8>>2]=1769;yi(_,1084,u)|0;vi(_)|0}if((f[(p[t+4>>2]|0)+i>>0]|0|0)!=(r|0)){p[c>>2]=1138;p[c+4>>2]=3253;p[c+8>>2]=1682;yi(_,1084,c)|0;vi(_)|0}}else{r=p[h+20>>2]|0;while(1){i=r+-1|0;if(n>>>0>(p[h+28+(i<<2)>>2]|0)>>>0)r=r+1|0;else break}i=(o>>>(32-r|0))+(p[h+96+(i<<2)>>2]|0)|0;if(i>>>0<(p[t>>2]|0)>>>0){i=m[(p[h+176>>2]|0)+(i<<1)>>1]|0;break}p[d>>2]=1138;p[d+4>>2]=3271;p[d+8>>2]=1620;yi(_,1084,d)|0;vi(_)|0;g=0;C=v;return g|0}while(0);p[a>>2]=p[a>>2]<<r;p[g>>2]=(p[g>>2]|0)-r;g=i;C=v;return g|0}function ft(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0;u=C;C=C+544|0;s=u+16|0;i=u;a=u+32|0;if(t>>>0>=33){p[i>>2]=1138;p[i+4>>2]=3195;p[i+8>>2]=1622;yi(a,1084,i)|0;vi(a)|0}l=e+20|0;i=p[l>>2]|0;if((i|0)>=(t|0)){n=e+16|0;o=n;n=p[n>>2]|0;a=i;s=32-t|0;s=n>>>s;n=n<<t;p[o>>2]=n;t=a-t|0;p[l>>2]=t;C=u;return s|0}n=e+4|0;o=e+8|0;r=e+16|0;do{e=p[n>>2]|0;if((e|0)==(p[o>>2]|0))e=0;else{p[n>>2]=e+1;e=f[e>>0]|0}i=i+8|0;p[l>>2]=i;if((i|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yi(a,1084,s)|0;vi(a)|0;i=p[l>>2]|0}e=e<<32-i|p[r>>2];p[r>>2]=e}while((i|0)<(t|0));s=32-t|0;s=e>>>s;a=e<<t;p[r>>2]=a;t=i-t|0;p[l>>2]=t;C=u;return s|0}function mt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0;_=C;C=C+528|0;h=_;c=_+16|0;if((e|0)==0|t>>>0<62){m=0;C=_;return m|0}u=rt(300,0)|0;if(!u){m=0;C=_;return m|0}p[u>>2]=519686845;i=u+4|0;p[i>>2]=0;r=u+8|0;p[r>>2]=0;l=u+88|0;n=u+136|0;o=u+160|0;a=l;s=a+44|0;do{p[a>>2]=0;a=a+4|0}while((a|0)<(s|0));d[l+44>>0]=0;g=u+184|0;a=u+208|0;s=u+232|0;v=u+252|0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;d[v+12>>0]=0;v=u+268|0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;d[v+12>>0]=0;v=u+284|0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;d[v+12>>0]=0;p[n>>2]=0;p[n+4>>2]=0;p[n+8>>2]=0;p[n+12>>2]=0;p[n+16>>2]=0;d[n+20>>0]=0;p[o>>2]=0;p[o+4>>2]=0;p[o+8>>2]=0;p[o+12>>2]=0;p[o+16>>2]=0;d[o+20>>0]=0;p[g>>2]=0;p[g+4>>2]=0;p[g+8>>2]=0;p[g+12>>2]=0;p[g+16>>2]=0;d[g+20>>0]=0;p[a>>2]=0;p[a+4>>2]=0;p[a+8>>2]=0;p[a+12>>2]=0;p[a+16>>2]=0;d[a+20>>0]=0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0;d[s+16>>0]=0;do if(((t>>>0>=74?((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)==18552:0)?((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0>=74:0)?((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0<=t>>>0:0){p[l>>2]=e;p[i>>2]=e;p[r>>2]=t;if(Tt(u)|0){i=p[l>>2]|0;if((f[i+39>>0]|0)<<8|(f[i+40>>0]|0)){if(!(xt(u)|0))break;if(!(At(u)|0))break;i=p[l>>2]|0}if(!((f[i+55>>0]|0)<<8|(f[i+56>>0]|0))){v=u;C=_;return v|0}if(Pt(u)|0?Dt(u)|0:0){v=u;C=_;return v|0}}}else m=7;while(0);if((m|0)==7)p[l>>2]=0;Nt(u);if(!(u&7)){ot(u,0,0,1,0)|0;v=0;C=_;return v|0}else{p[h>>2]=1138;p[h+4>>2]=2502;p[h+8>>2]=1504;yi(c,1084,h)|0;vi(c)|0;v=0;C=_;return v|0}return 0}function _t(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0;c=C;C=C+528|0;u=c;l=c+16|0;o=p[e+88>>2]|0;s=(f[o+70+(n<<2)+1>>0]|0)<<16|(f[o+70+(n<<2)>>0]|0)<<24|(f[o+70+(n<<2)+2>>0]|0)<<8|(f[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(f[o+16>>0]|0)>>>0)o=(f[o+70+(a<<2)+1>>0]|0)<<16|(f[o+70+(a<<2)>>0]|0)<<24|(f[o+70+(a<<2)+2>>0]|0)<<8|(f[o+70+(a<<2)+3>>0]|0);else o=p[e+8>>2]|0;if(o>>>0>s>>>0){l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=gt(e,l,u,t,i,r,n)|0;C=c;return u|0}p[u>>2]=1138;p[u+4>>2]=3690;p[u+8>>2]=1780;yi(l,1084,u)|0;vi(l)|0;l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=gt(e,l,u,t,i,r,n)|0;C=c;return u|0}function gt(e,t,i,r,n,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;var s=0,l=0,u=0,c=0;c=p[e+88>>2]|0;l=((f[c+12>>0]|0)<<8|(f[c+13>>0]|0))>>>a;u=((f[c+14>>0]|0)<<8|(f[c+15>>0]|0))>>>a;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;c=c+18|0;a=d[c>>0]|0;a=ce(a<<24>>24==0|a<<24>>24==9?8:16,l)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ce(a,u)|0)>>>0>n>>>0){e=0;return e|0}o=(l+1|0)>>>1;s=(u+1|0)>>>1;if(!i){e=0;return e|0}p[e+92>>2]=t;p[e+96>>2]=t;p[e+104>>2]=i;p[e+100>>2]=t+i;p[e+108>>2]=0;p[e+112>>2]=0;switch(f[c>>0]|0|0){case 0:{Mt(e,r,n,a,l,u,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{It(e,r,n,a,l,u,o,s)|0;e=1;return e|0}case 9:{Rt(e,r,n,a,l,u,o,s)|0;e=1;return e|0}case 8:case 7:{Ot(e,r,n,a,l,u,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function vt(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+4>>2]|0}function yt(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+8>>2]|0}function Ct(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+12>>2]|0}function wt(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+32>>2]|0}function St(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0;n=C;C=C+576|0;r=n+40|0;i=n+56|0;o=n;p[o>>2]=40;at(e,t,o)|0;t=o+32|0;e=p[t+4>>2]|0;do switch(p[t>>2]|0){case 0:{if(!e){o=8;C=n;return o|0}else e=14;break}case 1:{if(!e)e=13;else e=14;break}case 2:{if(!e)e=13;else e=14;break}case 3:{if(!e)e=13;else e=14;break}case 4:{if(!e)e=13;else e=14;break}case 5:{if(!e)e=13;else e=14;break}case 6:{if(!e)e=13;else e=14;break}case 7:{if(!e)e=13;else e=14;break}case 8:{if(!e)e=13;else e=14;break}case 9:{if(!e){o=8;C=n;return o|0}else e=14;break}case 10:{if(!e){o=8;C=n;return o|0}else e=14;break}default:e=14}while(0);if((e|0)==13){o=16;C=n;return o|0}else if((e|0)==14){p[r>>2]=1138;p[r+4>>2]=2668;p[r+8>>2]=1523;yi(i,1084,r)|0;vi(i)|0;o=0;C=n;return o|0}return 0}function Et(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0,s=0,l=0;s=C;C=C+576|0;o=s+40|0;n=s+56|0;l=s;p[l>>2]=40;at(e,t,l)|0;r=(((p[l+4>>2]|0)>>>i)+3|0)>>>2;t=(((p[l+8>>2]|0)>>>i)+3|0)>>>2;i=l+32|0;e=p[i+4>>2]|0;do switch(p[i>>2]|0){case 0:{if(!e)e=8;else a=14;break}case 1:{if(!e)a=13;else a=14;break}case 2:{if(!e)a=13;else a=14;break}case 3:{if(!e)a=13;else a=14;break}case 4:{if(!e)a=13;else a=14;break}case 5:{if(!e)a=13;else a=14;break}case 6:{if(!e)a=13;else a=14;break}case 7:{if(!e)a=13;else a=14;break}case 8:{if(!e)a=13;else a=14;break}case 9:{if(!e)e=8;else a=14;break}case 10:{if(!e)e=8;else a=14;break}default:a=14}while(0);if((a|0)==13)e=16;else if((a|0)==14){p[o>>2]=1138;p[o+4>>2]=2668;p[o+8>>2]=1523;yi(n,1084,o)|0;vi(n)|0;e=0}l=ce(ce(t,r)|0,e)|0;C=s;return l|0}function bt(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0;_=C;C=C+592|0;m=_+56|0;a=_+40|0;h=_+72|0;d=_;f=_+68|0;p[d>>2]=40;at(e,t,d)|0;s=(p[d+4>>2]|0)>>>n;l=(p[d+8>>2]|0)>>>n;d=d+32|0;r=p[d+4>>2]|0;do switch(p[d>>2]|0){case 0:{if(!r)d=8;else u=14;break}case 1:{if(!r)u=13;else u=14;break}case 2:{if(!r)u=13;else u=14;break}case 3:{if(!r)u=13;else u=14;break}case 4:{if(!r)u=13;else u=14;break}case 5:{if(!r)u=13;else u=14;break}case 6:{if(!r)u=13;else u=14;break}case 7:{if(!r)u=13;else u=14;break}case 8:{if(!r)u=13;else u=14;break}case 9:{if(!r)d=8;else u=14;break}case 10:{if(!r)d=8;else u=14;break}default:u=14}while(0);if((u|0)==13)d=16;else if((u|0)==14){p[a>>2]=1138;p[a+4>>2]=2668;p[a+8>>2]=1523;yi(h,1084,a)|0;vi(h)|0;d=0}p[f>>2]=i;c=mt(e,t)|0;t=o+n|0;if(t>>>0>n>>>0){u=(c|0)==0;e=i;while(1){r=ce((s+3|0)>>>2,d)|0;a=ce(r,(l+3|0)>>>2)|0;if(!(n>>>0>15|(u|a>>>0<8))?(p[c>>2]|0)==519686845:0)_t(c,f,a,r,n)|0;e=e+a|0;p[f>>2]=e;n=n+1|0;if((n|0)==(t|0))break;else{l=l>>>1;s=s>>>1}}}if(!c){C=_;return}if((p[c>>2]|0)!=519686845){C=_;return}Nt(c);if(!(c&7)){ot(c,0,0,1,0)|0;C=_;return}else{p[m>>2]=1138;p[m+4>>2]=2502;p[m+8>>2]=1504;yi(h,1084,m)|0;vi(h)|0;C=_;return}}function Tt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0;a=e+92|0;r=p[e+4>>2]|0;o=e+88|0;n=p[o>>2]|0;t=(f[n+68>>0]|0)<<8|(f[n+67>>0]|0)<<16|(f[n+69>>0]|0);i=r+t|0;n=(f[n+65>>0]|0)<<8|(f[n+66>>0]|0);if(!n){e=0;return e|0}p[a>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=r+(n+t);p[e+108>>2]=0;p[e+112>>2]=0;if(!(dt(a,e+116|0)|0)){e=0;return e|0}t=p[o>>2]|0;do if(!((f[t+39>>0]|0)<<8|(f[t+40>>0]|0))){if(!((f[t+55>>0]|0)<<8|(f[t+56>>0]|0))){e=0;return e|0}}else{if(!(dt(a,e+140|0)|0)){e=0;return e|0}if(dt(a,e+188|0)|0){t=p[o>>2]|0;break}else{e=0;return e|0}}while(0);if((f[t+55>>0]|0)<<8|(f[t+56>>0]|0)){if(!(dt(a,e+164|0)|0)){e=0;return e|0}if(!(dt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function xt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0;_=C;C=C+576|0;s=_;a=_+64|0;m=_+16|0;r=e+88|0;t=p[r>>2]|0;h=(f[t+39>>0]|0)<<8|(f[t+40>>0]|0);u=e+236|0;o=e+240|0;i=p[o>>2]|0;if((i|0)!=(h|0)){if(i>>>0<=h>>>0){do if((p[e+244>>2]|0)>>>0<h>>>0){if(tt(u,h,(i+1|0)==(h|0),4,0)|0){t=p[o>>2]|0;break}d[e+248>>0]=1;m=0;C=_;return m|0}else t=i;while(0);Xi((p[u>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=p[r>>2]|0}p[o>>2]=h}l=e+92|0;i=p[e+4>>2]|0;r=(f[t+34>>0]|0)<<8|(f[t+33>>0]|0)<<16|(f[t+35>>0]|0);n=i+r|0;t=(f[t+37>>0]|0)<<8|(f[t+36>>0]|0)<<16|(f[t+38>>0]|0);if(!t){m=0;C=_;return m|0}p[l>>2]=n;p[e+96>>2]=n;p[e+104>>2]=t;p[e+100>>2]=i+(t+r);p[e+108>>2]=0;p[e+112>>2]=0;p[m+20>>2]=0;p[m>>2]=0;p[m+4>>2]=0;p[m+8>>2]=0;p[m+12>>2]=0;d[m+16>>0]=0;e=m+24|0;p[m+44>>2]=0;p[e>>2]=0;p[e+4>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;d[e+16>>0]=0;if(dt(l,m)|0?(c=m+24|0,dt(l,c)|0):0){if(!(p[o>>2]|0)){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yi(a,1084,s)|0;vi(a)|0}if(!h)t=1;else{r=0;n=0;o=0;t=0;a=0;e=0;s=0;i=p[u>>2]|0;while(1){r=(pt(l,m)|0)+r&31;n=(pt(l,c)|0)+n&63;o=(pt(l,m)|0)+o&31;t=(pt(l,m)|0)+t|0;a=(pt(l,c)|0)+a&63;e=(pt(l,m)|0)+e&31;p[i>>2]=n<<5|r<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;i=i+4|0}}}}else t=0;lt(m+24|0);lt(m);m=t;C=_;return m|0}function At(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0;D=C;C=C+1008|0;a=D;o=D+496|0;P=D+472|0;x=D+276|0;A=D+80|0;T=D+16|0;n=p[e+88>>2]|0;b=(f[n+47>>0]|0)<<8|(f[n+48>>0]|0);E=e+92|0;t=p[e+4>>2]|0;i=(f[n+42>>0]|0)<<8|(f[n+41>>0]|0)<<16|(f[n+43>>0]|0);r=t+i|0;n=(f[n+45>>0]|0)<<8|(f[n+44>>0]|0)<<16|(f[n+46>>0]|0);if(!n){P=0;C=D;return P|0}p[E>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=t+(n+i);p[e+108>>2]=0;p[e+112>>2]=0;p[P+20>>2]=0;p[P>>2]=0;p[P+4>>2]=0;p[P+8>>2]=0;p[P+12>>2]=0;d[P+16>>0]=0;if(dt(E,P)|0){i=0;r=-3;n=-3;while(1){p[x+(i<<2)>>2]=r;p[A+(i<<2)>>2]=n;t=(r|0)>2;i=i+1|0;if((i|0)==49)break;else{r=t?-3:r+1|0;n=(t&1)+n|0}}t=T;i=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(i|0));S=e+252|0;i=e+256|0;t=p[i>>2]|0;e:do if((t|0)==(b|0))s=13;else{if(t>>>0<=b>>>0){do if((p[e+260>>2]|0)>>>0<b>>>0)if(tt(S,b,(t+1|0)==(b|0),4,0)|0){t=p[i>>2]|0;break}else{d[e+264>>0]=1;t=0;break e}while(0);Xi((p[S>>2]|0)+(t<<2)|0,0,b-t<<2|0)|0}p[i>>2]=b;s=13}while(0);do if((s|0)==13){if(!b){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yi(o,1084,a)|0;vi(o)|0;t=1;break}r=T+4|0;n=T+8|0;e=T+12|0;o=T+16|0;a=T+20|0;s=T+24|0;l=T+28|0;u=T+32|0;c=T+36|0;h=T+40|0;m=T+44|0;_=T+48|0;g=T+52|0;v=T+56|0;y=T+60|0;w=0;i=p[S>>2]|0;while(1){t=0;do{M=pt(E,P)|0;S=t<<1;I=T+(S<<2)|0;p[I>>2]=(p[I>>2]|0)+(p[x+(M<<2)>>2]|0)&3;S=T+((S|1)<<2)|0;p[S>>2]=(p[S>>2]|0)+(p[A+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);p[i>>2]=(f[1713+(p[r>>2]|0)>>0]|0)<<2|(f[1713+(p[T>>2]|0)>>0]|0)|(f[1713+(p[n>>2]|0)>>0]|0)<<4|(f[1713+(p[e>>2]|0)>>0]|0)<<6|(f[1713+(p[o>>2]|0)>>0]|0)<<8|(f[1713+(p[a>>2]|0)>>0]|0)<<10|(f[1713+(p[s>>2]|0)>>0]|0)<<12|(f[1713+(p[l>>2]|0)>>0]|0)<<14|(f[1713+(p[u>>2]|0)>>0]|0)<<16|(f[1713+(p[c>>2]|0)>>0]|0)<<18|(f[1713+(p[h>>2]|0)>>0]|0)<<20|(f[1713+(p[m>>2]|0)>>0]|0)<<22|(f[1713+(p[_>>2]|0)>>0]|0)<<24|(f[1713+(p[g>>2]|0)>>0]|0)<<26|(f[1713+(p[v>>2]|0)>>0]|0)<<28|(f[1713+(p[y>>2]|0)>>0]|0)<<30;w=w+1|0;if((w|0)==(b|0)){t=1;break}else i=i+4|0}}while(0)}else t=0;lt(P);I=t;C=D;return I|0}function Pt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0;m=C;C=C+560|0;s=m;a=m+40|0;c=m+16|0;n=p[e+88>>2]|0;u=(f[n+55>>0]|0)<<8|(f[n+56>>0]|0);l=e+92|0;t=p[e+4>>2]|0;i=(f[n+50>>0]|0)<<8|(f[n+49>>0]|0)<<16|(f[n+51>>0]|0);r=t+i|0;n=(f[n+53>>0]|0)<<8|(f[n+52>>0]|0)<<16|(f[n+54>>0]|0);if(!n){c=0;C=m;return c|0}p[l>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=t+(n+i);p[e+108>>2]=0;p[e+112>>2]=0;p[c+20>>2]=0;p[c>>2]=0;p[c+4>>2]=0;p[c+8>>2]=0;p[c+12>>2]=0;d[c+16>>0]=0;e:do if(dt(l,c)|0){o=e+268|0;i=e+272|0;t=p[i>>2]|0;if((t|0)!=(u|0)){if(t>>>0<=u>>>0){do if((p[e+276>>2]|0)>>>0<u>>>0)if(tt(o,u,(t+1|0)==(u|0),2,0)|0){t=p[i>>2]|0;break}else{d[e+280>>0]=1;t=0;break e}while(0);Xi((p[o>>2]|0)+(t<<1)|0,0,u-t<<1|0)|0}p[i>>2]=u}if(!u){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yi(a,1084,s)|0;vi(a)|0;t=1;break}i=0;r=0;n=0;t=p[o>>2]|0;while(1){s=pt(l,c)|0;i=s+i&255;r=(pt(l,c)|0)+r&255;h[t>>1]=r<<8|i;n=n+1|0;if((n|0)==(u|0)){t=1;break}else t=t+2|0}}else t=0;while(0);lt(c);c=t;C=m;return c|0}function Dt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0;M=C;C=C+2416|0;a=M;o=M+1904|0;D=M+1880|0;A=M+980|0;P=M+80|0;x=M+16|0;n=p[e+88>>2]|0;T=(f[n+63>>0]|0)<<8|(f[n+64>>0]|0);b=e+92|0;t=p[e+4>>2]|0;i=(f[n+58>>0]|0)<<8|(f[n+57>>0]|0)<<16|(f[n+59>>0]|0);r=t+i|0;n=(f[n+61>>0]|0)<<8|(f[n+60>>0]|0)<<16|(f[n+62>>0]|0);if(!n){D=0;C=M;return D|0}p[b>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=t+(n+i);p[e+108>>2]=0;p[e+112>>2]=0;p[D+20>>2]=0;p[D>>2]=0;p[D+4>>2]=0;p[D+8>>2]=0;p[D+12>>2]=0;d[D+16>>0]=0;if(dt(b,D)|0){i=0;r=-7;n=-7;while(1){p[A+(i<<2)>>2]=r;p[P+(i<<2)>>2]=n;t=(r|0)>6;i=i+1|0;if((i|0)==225)break;else{r=t?-7:r+1|0;n=(t&1)+n|0}}t=x;i=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(i|0));E=e+284|0;i=T*3|0;r=e+288|0;t=p[r>>2]|0;e:do if((t|0)==(i|0))s=13;else{if(t>>>0<=i>>>0){do if((p[e+292>>2]|0)>>>0<i>>>0)if(tt(E,i,(t+1|0)==(i|0),2,0)|0){t=p[r>>2]|0;break}else{d[e+296>>0]=1;t=0;break e}while(0);Xi((p[E>>2]|0)+(t<<1)|0,0,i-t<<1|0)|0}p[r>>2]=i;s=13}while(0);do if((s|0)==13){if(!T){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yi(o,1084,a)|0;vi(o)|0;t=1;break}r=x+4|0;n=x+8|0;e=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;c=x+36|0;m=x+40|0;_=x+44|0;g=x+48|0;v=x+52|0;y=x+56|0;w=x+60|0;S=0;i=p[E>>2]|0;while(1){t=0;do{I=pt(b,D)|0;E=t<<1;R=x+(E<<2)|0;p[R>>2]=(p[R>>2]|0)+(p[A+(I<<2)>>2]|0)&7;E=x+((E|1)<<2)|0;p[E>>2]=(p[E>>2]|0)+(p[P+(I<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);I=f[1717+(p[a>>2]|0)>>0]|0;h[i>>1]=(f[1717+(p[r>>2]|0)>>0]|0)<<3|(f[1717+(p[x>>2]|0)>>0]|0)|(f[1717+(p[n>>2]|0)>>0]|0)<<6|(f[1717+(p[e>>2]|0)>>0]|0)<<9|(f[1717+(p[o>>2]|0)>>0]|0)<<12|I<<15;R=f[1717+(p[m>>2]|0)>>0]|0;h[i+2>>1]=(f[1717+(p[s>>2]|0)>>0]|0)<<2|I>>>1|(f[1717+(p[l>>2]|0)>>0]|0)<<5|(f[1717+(p[u>>2]|0)>>0]|0)<<8|(f[1717+(p[c>>2]|0)>>0]|0)<<11|R<<14;h[i+4>>1]=(f[1717+(p[_>>2]|0)>>0]|0)<<1|R>>>2|(f[1717+(p[g>>2]|0)>>0]|0)<<4|(f[1717+(p[v>>2]|0)>>0]|0)<<7|(f[1717+(p[y>>2]|0)>>0]|0)<<10|(f[1717+(p[w>>2]|0)>>0]|0)<<13;S=S+1|0;if((S|0)==(T|0)){t=1;break}else i=i+6|0}}while(0)}else t=0;lt(D);R=t;C=M;return R|0}function Mt(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0;ae=C;C=C+656|0;ne=ae+112|0;ie=ae+96|0;te=ae+80|0;ee=ae+64|0;$=ae+48|0;oe=ae+32|0;re=ae+16|0;J=ae;K=ae+144|0;Q=ae+128|0;H=e+240|0;W=p[H>>2]|0;Y=e+256|0;X=p[Y>>2]|0;i=d[(p[e+88>>2]|0)+17>>0]|0;Z=r>>>2;if(!(i<<24>>24)){C=ae;return 1}q=(s|0)==0;j=s+-1|0;B=(o&1|0)!=0;F=r<<1;k=e+92|0;V=e+116|0;z=e+140|0;U=e+236|0;G=a+-1|0;L=(n&1|0)!=0;N=e+188|0;D=e+252|0;M=Z+1|0;I=Z+2|0;R=Z+3|0;O=G<<4;A=i&255;i=0;o=0;n=1;P=0;do{if(!q){T=p[t+(P<<2)>>2]|0;x=0;while(1){S=x&1;l=(S|0)==0;w=(S<<5^32)+-16|0;S=(S<<1^2)+-1|0;b=l?a:-1;u=l?0:G;e=(x|0)==(j|0);E=B&e;if((u|0)!=(b|0)){y=B&e^1;v=l?T:T+O|0;while(1){if((n|0)==1)n=pt(k,V)|0|512;g=n&7;n=n>>>3;l=f[1811+g>>0]|0;e=0;do{m=(pt(k,z)|0)+o|0;_=m-W|0;o=_>>31;o=o&m|_&~o;if((p[H>>2]|0)>>>0<=o>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yi(K,1084,J)|0;vi(K)|0}p[Q+(e<<2)>>2]=p[(p[U>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<l>>>0);_=L&(u|0)==(G|0);if(E|_){m=0;do{c=ce(m,r)|0;e=v+c|0;l=(m|0)==0|y;h=m<<1;le=(pt(k,N)|0)+i|0;se=le-X|0;i=se>>31;i=i&le|se&~i;do if(_){if(!l){se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;break}p[e>>2]=p[Q+((f[1819+(g<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=i>>>0){p[ie>>2]=1138;p[ie+4>>2]=906;p[ie+8>>2]=1769;yi(K,1084,ie)|0;vi(K)|0}p[v+(c+4)>>2]=p[(p[D>>2]|0)+(i<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i}else{if(!l){se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;break}p[e>>2]=p[Q+((f[1819+(g<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=i>>>0){p[te>>2]=1138;p[te+4>>2]=906;p[te+8>>2]=1769;yi(K,1084,te)|0;vi(K)|0}p[v+(c+4)>>2]=p[(p[D>>2]|0)+(i<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;p[v+(c+8)>>2]=p[Q+((f[(h|1)+(1819+(g<<2))>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=i>>>0){p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yi(K,1084,ne)|0;vi(K)|0}p[v+(c+12)>>2]=p[(p[D>>2]|0)+(i<<2)>>2]}while(0);m=m+1|0}while((m|0)!=2)}else{p[v>>2]=p[Q+((f[1819+(g<<2)>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[re>>2]=1138;p[re+4>>2]=906;p[re+8>>2]=1769;yi(K,1084,re)|0;vi(K)|0}p[v+4>>2]=p[(p[D>>2]|0)+(i<<2)>>2];p[v+8>>2]=p[Q+((f[1819+(g<<2)+1>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yi(K,1084,oe)|0;vi(K)|0}p[v+12>>2]=p[(p[D>>2]|0)+(i<<2)>>2];p[v+(Z<<2)>>2]=p[Q+((f[1819+(g<<2)+2>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[$>>2]=1138;p[$+4>>2]=906;p[$+8>>2]=1769;yi(K,1084,$)|0;vi(K)|0}p[v+(M<<2)>>2]=p[(p[D>>2]|0)+(i<<2)>>2];p[v+(I<<2)>>2]=p[Q+((f[1819+(g<<2)+3>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[ee>>2]=1138;p[ee+4>>2]=906;p[ee+8>>2]=1769;yi(K,1084,ee)|0;vi(K)|0}p[v+(R<<2)>>2]=p[(p[D>>2]|0)+(i<<2)>>2]}u=u+S|0;if((u|0)==(b|0))break;else v=v+w|0}}x=x+1|0;if((x|0)==(s|0))break;else T=T+F|0}}P=P+1|0}while((P|0)!=(A|0));C=ae;return 1}function It(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,de=0,he=0,pe=0;he=C;C=C+608|0;ue=he+48|0;de=he+32|0;ce=he+16|0;le=he;ae=he+96|0;se=he+80|0;oe=he+64|0;W=e+240|0;q=p[W>>2]|0;X=e+256|0;ie=p[X>>2]|0;re=e+272|0;ne=p[re>>2]|0;i=p[e+88>>2]|0;j=(f[i+63>>0]|0)<<8|(f[i+64>>0]|0);i=d[i+17>>0]|0;if(!(i<<24>>24)){C=he;return 1}Y=(s|0)==0;Z=s+-1|0;K=r<<1;Q=e+92|0;J=e+116|0;$=a+-1|0;ee=e+212|0;te=e+188|0;H=(n&1|0)==0;G=(o&1|0)==0;B=e+288|0;F=e+284|0;k=e+252|0;V=e+140|0;z=e+236|0;U=e+164|0;N=e+268|0;L=$<<5;R=i&255;i=0;n=0;o=0;e=0;l=1;O=0;do{if(!Y){M=p[t+(O<<2)>>2]|0;I=0;while(1){P=I&1;u=(P|0)==0;A=(P<<6^64)+-32|0;P=(P<<1^2)+-1|0;D=u?a:-1;c=u?0:$;if((c|0)!=(D|0)){x=G|(I|0)!=(Z|0);T=u?M:M+L|0;while(1){if((l|0)==1)l=pt(Q,J)|0|512;b=l&7;l=l>>>3;h=f[1811+b>>0]|0;u=0;do{S=(pt(Q,U)|0)+n|0;E=S-ne|0;n=E>>31;n=n&S|E&~n;if((p[re>>2]|0)>>>0<=n>>>0){p[le>>2]=1138;p[le+4>>2]=906;p[le+8>>2]=1769;yi(ae,1084,le)|0;vi(ae)|0}p[oe+(u<<2)>>2]=m[(p[N>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{S=(pt(Q,V)|0)+e|0;E=S-q|0;e=E>>31;e=e&S|E&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[ce>>2]=1138;p[ce+4>>2]=906;p[ce+8>>2]=1769;yi(ae,1084,ce)|0;vi(ae)|0}p[se+(u<<2)>>2]=p[(p[z>>2]|0)+(e<<2)>>2];u=u+1|0}while(u>>>0<h>>>0);E=H|(c|0)!=($|0);w=0;S=T;while(1){y=x|(w|0)==0;v=w<<1;_=0;g=S;while(1){h=(pt(Q,ee)|0)+i|0;u=h-j|0;i=u>>31;i=i&h|u&~i;u=(pt(Q,te)|0)+o|0;h=u-ie|0;o=h>>31;o=o&u|h&~o;if((E|(_|0)==0)&y){u=f[_+v+(1819+(b<<2))>>0]|0;h=i*3|0;if((p[B>>2]|0)>>>0<=h>>>0){p[de>>2]=1138;p[de+4>>2]=906;p[de+8>>2]=1769;yi(ae,1084,de)|0;vi(ae)|0}pe=p[F>>2]|0;p[g>>2]=(m[pe+(h<<1)>>1]|0)<<16|p[oe+(u<<2)>>2];p[g+4>>2]=(m[pe+(h+2<<1)>>1]|0)<<16|(m[pe+(h+1<<1)>>1]|0);p[g+8>>2]=p[se+(u<<2)>>2];if((p[X>>2]|0)>>>0<=o>>>0){p[ue>>2]=1138;p[ue+4>>2]=906;p[ue+8>>2]=1769;yi(ae,1084,ue)|0;vi(ae)|0}p[g+12>>2]=p[(p[k>>2]|0)+(o<<2)>>2]}_=_+1|0;if((_|0)==2)break;else g=g+16|0}w=w+1|0;if((w|0)==2)break;else S=S+r|0}c=c+P|0;if((c|0)==(D|0))break;else T=T+A|0}}I=I+1|0;if((I|0)==(s|0))break;else M=M+K|0}}O=O+1|0}while((O|0)!=(R|0));C=he;return 1}function Rt(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0;$=C;C=C+576|0;J=$+32|0;Q=$+16|0;K=$;Z=$+64|0;X=$+48|0;k=e+272|0;V=p[k>>2]|0;i=p[e+88>>2]|0;z=(f[i+63>>0]|0)<<8|(f[i+64>>0]|0);i=d[i+17>>0]|0;if(!(i<<24>>24)){C=$;return 1}U=(s|0)==0;G=s+-1|0;H=r<<1;W=e+92|0;q=e+116|0;j=a+-1|0;Y=e+212|0;F=(o&1|0)==0;N=e+288|0;L=e+284|0;B=e+164|0;R=e+268|0;O=j<<4;I=i&255;M=(n&1|0)!=0;i=0;o=0;e=1;D=0;do{if(!U){A=p[t+(D<<2)>>2]|0;P=0;while(1){T=P&1;n=(T|0)==0;b=(T<<5^32)+-16|0;T=(T<<1^2)+-1|0;x=n?a:-1;l=n?0:j;if((l|0)!=(x|0)){E=F|(P|0)!=(G|0);S=n?A:A+O|0;while(1){if((e|0)==1)e=pt(W,q)|0|512;w=e&7;e=e>>>3;u=f[1811+w>>0]|0;n=0;do{v=(pt(W,B)|0)+o|0;y=v-V|0;o=y>>31;o=o&v|y&~o;if((p[k>>2]|0)>>>0<=o>>>0){p[K>>2]=1138;p[K+4>>2]=906;p[K+8>>2]=1769;yi(Z,1084,K)|0;vi(Z)|0}p[X+(n<<2)>>2]=m[(p[R>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0<u>>>0);y=(l|0)==(j|0)&M;g=0;v=S;while(1){_=E|(g|0)==0;h=g<<1;n=(pt(W,Y)|0)+i|0;c=n-z|0;u=c>>31;u=u&n|c&~u;if(_){i=f[1819+(w<<2)+h>>0]|0;n=u*3|0;if((p[N>>2]|0)>>>0<=n>>>0){p[Q>>2]=1138;p[Q+4>>2]=906;p[Q+8>>2]=1769;yi(Z,1084,Q)|0;vi(Z)|0}c=p[L>>2]|0;p[v>>2]=(m[c+(n<<1)>>1]|0)<<16|p[X+(i<<2)>>2];p[v+4>>2]=(m[c+(n+2<<1)>>1]|0)<<16|(m[c+(n+1<<1)>>1]|0)}c=v+8|0;n=(pt(W,Y)|0)+u|0;u=n-z|0;i=u>>31;i=i&n|u&~i;if(!(y|_^1)){n=f[(h|1)+(1819+(w<<2))>>0]|0;u=i*3|0;if((p[N>>2]|0)>>>0<=u>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yi(Z,1084,J)|0;vi(Z)|0}_=p[L>>2]|0;p[c>>2]=(m[_+(u<<1)>>1]|0)<<16|p[X+(n<<2)>>2];p[v+12>>2]=(m[_+(u+2<<1)>>1]|0)<<16|(m[_+(u+1<<1)>>1]|0)}g=g+1|0;if((g|0)==2)break;else v=v+r|0}l=l+T|0;if((l|0)==(x|0))break;else S=S+b|0}}P=P+1|0;if((P|0)==(s|0))break;else A=A+H|0}}D=D+1|0}while((D|0)!=(I|0));C=$;return 1}function Ot(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0;se=C;C=C+608|0;ne=se+48|0;ae=se+32|0;oe=se+16|0;re=se;ie=se+96|0;ee=se+80|0;te=se+64|0;W=e+272|0;q=p[W>>2]|0;i=p[e+88>>2]|0;j=(f[i+63>>0]|0)<<8|(f[i+64>>0]|0);i=d[i+17>>0]|0;if(!(i<<24>>24)){C=se;return 1}Y=(s|0)==0;X=s+-1|0;Z=r<<1;K=e+92|0;Q=e+116|0;J=a+-1|0;$=e+212|0;H=(n&1|0)==0;G=(o&1|0)==0;V=e+288|0;z=e+284|0;U=e+164|0;F=e+268|0;k=J<<5;L=i&255;i=0;n=0;o=0;e=0;l=1;B=0;do{if(!Y){O=p[t+(B<<2)>>2]|0;N=0;while(1){I=N&1;u=(I|0)==0;M=(I<<6^64)+-32|0;I=(I<<1^2)+-1|0;R=u?a:-1;c=u?0:J;if((c|0)!=(R|0)){D=G|(N|0)!=(X|0);P=u?O:O+k|0;while(1){if((l|0)==1)l=pt(K,Q)|0|512;A=l&7;l=l>>>3;h=f[1811+A>>0]|0;u=0;do{T=(pt(K,U)|0)+e|0;x=T-q|0;e=x>>31;e=e&T|x&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[re>>2]=1138;p[re+4>>2]=906;p[re+8>>2]=1769;yi(ie,1084,re)|0;vi(ie)|0}p[ee+(u<<2)>>2]=m[(p[F>>2]|0)+(e<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{T=(pt(K,U)|0)+n|0;x=T-q|0;n=x>>31;n=n&T|x&~n;if((p[W>>2]|0)>>>0<=n>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yi(ie,1084,oe)|0;vi(ie)|0}p[te+(u<<2)>>2]=m[(p[F>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);x=H|(c|0)!=(J|0);b=0;T=P;while(1){E=D|(b|0)==0;S=b<<1;y=0;w=T;while(1){v=(pt(K,$)|0)+o|0;g=v-j|0;o=g>>31;o=o&v|g&~o;g=(pt(K,$)|0)+i|0;v=g-j|0;i=v>>31;i=i&g|v&~i;if((x|(y|0)==0)&E){g=f[y+S+(1819+(A<<2))>>0]|0;v=o*3|0;u=p[V>>2]|0;if(u>>>0<=v>>>0){p[ae>>2]=1138;p[ae+4>>2]=906;p[ae+8>>2]=1769;yi(ie,1084,ae)|0;vi(ie)|0;u=p[V>>2]|0}h=p[z>>2]|0;_=i*3|0;if(u>>>0>_>>>0)u=h;else{p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yi(ie,1084,ne)|0;vi(ie)|0;u=p[z>>2]|0}p[w>>2]=(m[h+(v<<1)>>1]|0)<<16|p[ee+(g<<2)>>2];p[w+4>>2]=(m[h+(v+2<<1)>>1]|0)<<16|(m[h+(v+1<<1)>>1]|0);p[w+8>>2]=(m[u+(_<<1)>>1]|0)<<16|p[te+(g<<2)>>2];p[w+12>>2]=(m[u+(_+2<<1)>>1]|0)<<16|(m[u+(_+1<<1)>>1]|0)}y=y+1|0;if((y|0)==2)break;else w=w+16|0}b=b+1|0;if((b|0)==2)break;else T=T+r|0}c=c+I|0;if((c|0)==(R|0))break;else P=P+M|0}}N=N+1|0;if((N|0)==(s|0))break;else O=O+Z|0}}B=B+1|0}while((B|0)!=(L|0));C=se;return 1}function Nt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+576|0;s=l+48|0;o=l+32|0;n=l+16|0;r=l;a=l+64|0;p[e>>2]=0;t=e+284|0;i=p[t>>2]|0;if(i){if(!(i&7))ot(i,0,0,1,0)|0;else{p[r>>2]=1138;p[r+4>>2]=2502;p[r+8>>2]=1504;yi(a,1084,r)|0;vi(a)|0}p[t>>2]=0;p[e+288>>2]=0;p[e+292>>2]=0}d[e+296>>0]=0;i=e+268|0;t=p[i>>2]|0;if(t){if(!(t&7))ot(t,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yi(a,1084,n)|0;vi(a)|0}p[i>>2]=0;p[e+272>>2]=0;p[e+276>>2]=0}d[e+280>>0]=0;t=e+252|0;i=p[t>>2]|0;if(i){if(!(i&7))ot(i,0,0,1,0)|0;else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yi(a,1084,o)|0;vi(a)|0}p[t>>2]=0;p[e+256>>2]=0;p[e+260>>2]=0}d[e+264>>0]=0;t=e+236|0;i=p[t>>2]|0;if(!i){s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);C=l;return}if(!(i&7))ot(i,0,0,1,0)|0;else{p[s>>2]=1138;p[s+4>>2]=2502;p[s+8>>2]=1504;yi(a,1084,s)|0;vi(a)|0}p[t>>2]=0;p[e+240>>2]=0;p[e+244>>2]=0;s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);C=l;return}function Lt(e,t){e=e|0;t=t|0;var i=0;i=C;C=C+16|0;p[i>>2]=t;t=p[60]|0;Ci(t,e,i)|0;fi(10,t)|0;De()}function Bt(){var e=0,t=0;e=C;C=C+16|0;if(!(Ve(192,2)|0)){t=be(p[47]|0)|0;C=e;return t|0}else Lt(2078,e);return 0}function Ft(e){e=e|0;zi(e);return}function kt(e){e=e|0;var t=0;t=C;C=C+16|0;Pr[e&3]();Lt(2127,t)}function Vt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=p[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(p[e>>2]&-256|0)==1126902528?(p[e+4>>2]|0)==1129074247:0):0)kt(p[t+12>>2]|0);t=p[26]|0;p[26]=t+0;kt(t)}function zt(e){e=e|0;return}function Ut(e){e=e|0;return}function Gt(e){e=e|0;return}function Ht(e){e=e|0;return}function Wt(e){e=e|0;Ft(e);return}function qt(e){e=e|0;Ft(e);return}function jt(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;a=C;C=C+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Kt(t,24,40,0)|0,(n|0)!=0):0){t=o;r=t+56|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(r|0));p[o>>2]=n;p[o+8>>2]=e;p[o+12>>2]=-1;p[o+48>>2]=1;Mr[p[(p[n>>2]|0)+28>>2]&3](n,o,p[i>>2]|0,1);if((p[o+24>>2]|0)==1){p[i>>2]=p[o+16>>2];t=1}else t=0}else t=0;else t=1;C=a;return t|0}function Yt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0;e=t+16|0;n=p[e>>2]|0;do if(n){if((n|0)!=(i|0)){r=t+36|0;p[r>>2]=(p[r>>2]|0)+1;p[t+24>>2]=2;d[t+54>>0]=1;break}e=t+24|0;if((p[e>>2]|0)==2)p[e>>2]=r}else{p[e>>2]=i;p[t+24>>2]=r;p[t+36>>2]=1}while(0);return}function Xt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,i,r);return}function Zt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,i,r);else{e=p[e+8>>2]|0;Mr[p[(p[e>>2]|0)+28>>2]&3](e,t,i,r)}return}function Kt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,f=0,m=0,_=0;_=C;C=C+64|0;m=_;f=p[e>>2]|0;c=e+(p[f+-8>>2]|0)|0;f=p[f+-4>>2]|0;p[m>>2]=i;p[m+4>>2]=e;p[m+8>>2]=t;p[m+12>>2]=r;r=m+16|0;e=m+20|0;t=m+24|0;n=m+28|0;o=m+32|0;a=m+40|0;s=(f|0)==(i|0);l=r;u=l+36|0;do{p[l>>2]=0;l=l+4|0}while((l|0)<(u|0));h[r+36>>1]=0;d[r+38>>0]=0;e:do if(s){p[m+48>>2]=1;Dr[p[(p[i>>2]|0)+20>>2]&3](i,m,c,c,1,0);r=(p[t>>2]|0)==1?c:0}else{br[p[(p[f>>2]|0)+24>>2]&3](f,m,c,1,0);switch(p[m+36>>2]|0){case 0:{r=(p[a>>2]|0)==1&(p[n>>2]|0)==1&(p[o>>2]|0)==1?p[e>>2]|0:0;break e}case 1:break;default:{r=0;break e}}if((p[t>>2]|0)!=1?!((p[a>>2]|0)==0&(p[n>>2]|0)==1&(p[o>>2]|0)==1):0){r=0;break}r=p[r>>2]|0}while(0);C=_;return r|0}function Qt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;d[t+53>>0]=1;do if((p[t+4>>2]|0)==(r|0)){d[t+52>>0]=1;r=t+16|0;e=p[r>>2]|0;if(!e){p[r>>2]=i;p[t+24>>2]=n;p[t+36>>2]=1;if(!((n|0)==1?(p[t+48>>2]|0)==1:0))break;d[t+54>>0]=1;break}if((e|0)!=(i|0)){n=t+36|0;p[n>>2]=(p[n>>2]|0)+1;d[t+54>>0]=1;break}e=t+24|0;r=p[e>>2]|0;if((r|0)==2){p[e>>2]=n;r=n}if((r|0)==1?(p[t+48>>2]|0)==1:0)d[t+54>>0]=1}while(0);return}function Jt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0;e:do if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(i|0)?(o=t+28|0,(p[o>>2]|0)!=1):0)p[o>>2]=r}else{if((e|0)!=(p[t>>2]|0)){s=p[e+8>>2]|0;br[p[(p[s>>2]|0)+24>>2]&3](s,t,i,r,n);break}if((p[t+16>>2]|0)!=(i|0)?(a=t+20|0,(p[a>>2]|0)!=(i|0)):0){p[t+32>>2]=r;r=t+44|0;if((p[r>>2]|0)==4)break;o=t+52|0;d[o>>0]=0;l=t+53|0;d[l>>0]=0;e=p[e+8>>2]|0;Dr[p[(p[e>>2]|0)+20>>2]&3](e,t,i,i,1,n);if(d[l>>0]|0){if(!(d[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do if((s|0)==13){p[a>>2]=i;l=t+40|0;p[l>>2]=(p[l>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0){d[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;p[r>>2]=4;break e}while(0);p[r>>2]=3;break}if((r|0)==1)p[t+32>>2]=1}while(0);return}function $t(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0;do if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(i|0)?(a=t+28|0,(p[a>>2]|0)!=1):0)p[a>>2]=r}else if((e|0)==(p[t>>2]|0)){if((p[t+16>>2]|0)!=(i|0)?(o=t+20|0,(p[o>>2]|0)!=(i|0)):0){p[t+32>>2]=r;p[o>>2]=i;n=t+40|0;p[n>>2]=(p[n>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0)d[t+54>>0]=1;p[t+44>>2]=4;break;
}if((r|0)==1)p[t+32>>2]=1}while(0);return}function ei(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Qt(0,t,i,r,n);else{e=p[e+8>>2]|0;Dr[p[(p[e>>2]|0)+20>>2]&3](e,t,i,r,n,o)}return}function ti(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Qt(0,t,i,r,n);return}function ii(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;n=C;C=C+16|0;r=n;p[r>>2]=p[i>>2];e=Er[p[(p[e>>2]|0)+16>>2]&7](e,t,r)|0;if(e)p[i>>2]=p[r>>2];C=n;return e&1|0}function ri(e){e=e|0;if(!e)e=0;else e=(Kt(e,24,72,0)|0)!=0;return e&1|0}function ni(){var e=0,t=0,i=0,r=0,n=0,o=0,a=0,s=0;n=C;C=C+48|0;a=n+32|0;i=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(r=p[e>>2]|0,(r|0)!=0):0){e=r+48|0;t=p[e>>2]|0;e=p[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){p[i>>2]=2406;Lt(2356,i)}if((t|0)==1126902529&(e|0)==1129074247)e=p[r+44>>2]|0;else e=r+80|0;p[n>>2]=e;r=p[r>>2]|0;e=p[r+4>>2]|0;if(Er[p[(p[8>>2]|0)+16>>2]&7](8,r,n)|0){s=p[n>>2]|0;s=xr[p[(p[s>>2]|0)+8>>2]&1](s)|0;p[o>>2]=2406;p[o+4>>2]=e;p[o+8>>2]=s;Lt(2270,o)}else{p[s>>2]=2406;p[s+4>>2]=e;Lt(2315,s)}}Lt(2394,a)}function oi(){var e=0;e=C;C=C+16|0;if(!(Ne(188,6)|0)){C=e;return}else Lt(2167,e)}function ai(e){e=e|0;var t=0;t=C;C=C+16|0;zi(e);if(!(Te(p[47]|0,0)|0)){C=t;return}else Lt(2217,t)}function si(e){e=e|0;var t=0,i=0;t=0;while(1){if((f[2415+t>>0]|0)==(e|0)){i=2;break}t=t+1|0;if((t|0)==87){t=87;e=2503;i=5;break}}if((i|0)==2)if(!t)e=2503;else{e=2503;i=5}if((i|0)==5)while(1){i=e;while(1){e=i+1|0;if(!(d[i>>0]|0))break;else i=e}t=t+-1|0;if(!t)break;else i=5}return e|0}function li(){var e=0;if(!0)e=248;else{e=(Pe()|0)+60|0;e=p[e>>2]|0}return e|0}function ui(e){e=e|0;var t=0;if(e>>>0>4294963200){t=li()|0;p[t>>2]=0-e;e=-1}return e|0}function ci(e,t){e=+e;t=t|0;var i=0,r=0,n=0;v[S>>3]=e;i=p[S>>2]|0;r=p[S+4>>2]|0;n=Zi(i|0,r|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0){e=+ci(e*0x10000000000000000,t);i=(p[t>>2]|0)+-64|0}else i=0;p[t>>2]=i;break}case 2047:break;default:{p[t>>2]=n+-1022;p[S>>2]=i;p[S+4>>2]=r&-2146435073|1071644672;e=+v[S>>3]}}return+e}function di(e,t){e=+e;t=t|0;return+ +ci(e,t)}function hi(e,t,i){e=e|0;t=t|0;i=i|0;do if(e){if(t>>>0<128){d[e>>0]=t;e=1;break}if(t>>>0<2048){d[e>>0]=t>>>6|192;d[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){d[e>>0]=t>>>12|224;d[e+1>>0]=t>>>6&63|128;d[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){d[e>>0]=t>>>18|240;d[e+1>>0]=t>>>12&63|128;d[e+2>>0]=t>>>6&63|128;d[e+3>>0]=t&63|128;e=4;break}else{e=li()|0;p[e>>2]=84;e=-1;break}}else e=1;while(0);return e|0}function pi(e,t){e=e|0;t=t|0;if(!e)e=0;else e=hi(e,t,0)|0;return e|0}function fi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0;if((p[t+76>>2]|0)>=0?(Ei(t)|0)!=0:0){if((d[t+75>>0]|0)!=(e|0)?(r=t+20|0,n=p[r>>2]|0,n>>>0<(p[t+16>>2]|0)>>>0):0){p[r>>2]=n+1;d[n>>0]=e;i=e&255}else i=Ti(t,e)|0;bi(t)}else a=3;do if((a|0)==3){if((d[t+75>>0]|0)!=(e|0)?(o=t+20|0,i=p[o>>2]|0,i>>>0<(p[t+16>>2]|0)>>>0):0){p[o>>2]=i+1;d[i>>0]=e;i=e&255;break}i=Ti(t,e)|0}while(0);return i|0}function mi(e,t){e=e|0;t=t|0;return(gi(e,Ri(e)|0,1,t)|0)+-1|0}function _i(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;r=i+16|0;n=p[r>>2]|0;if(!n)if(!(Mi(i)|0)){n=p[r>>2]|0;o=4}else r=0;else o=4;e:do if((o|0)==4){a=i+20|0;o=p[a>>2]|0;if((n-o|0)>>>0<t>>>0){r=Er[p[i+36>>2]&7](i,e,t)|0;break}t:do if((d[i+75>>0]|0)>-1){r=t;while(1){if(!r){n=o;r=0;break t}n=r+-1|0;if((d[e+n>>0]|0)==10)break;else r=n}if((Er[p[i+36>>2]&7](i,e,r)|0)>>>0<r>>>0)break e;t=t-r|0;e=e+r|0;n=p[a>>2]|0}else{n=o;r=0}while(0);Qi(n|0,e|0,t|0)|0;p[a>>2]=(p[a>>2]|0)+t;r=r+t|0}while(0);return r|0}function gi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0;n=ce(i,t)|0;if((p[r+76>>2]|0)>-1){o=(Ei(r)|0)==0;e=_i(e,n,r)|0;if(!o)bi(r)}else e=_i(e,n,r)|0;if((e|0)!=(n|0))i=(e>>>0)/(t>>>0)|0;return i|0}function vi(e){e=e|0;var t=0,i=0,r=0,n=0;r=p[61]|0;if((p[r+76>>2]|0)>-1)n=Ei(r)|0;else n=0;do if((mi(e,r)|0)<0)t=1;else{if((d[r+75>>0]|0)!=10?(t=r+20|0,i=p[t>>2]|0,i>>>0<(p[r+16>>2]|0)>>>0):0){p[t>>2]=i+1;d[i>>0]=10;t=0;break}t=(Ti(r,10)|0)<0}while(0);if(n)bi(r);return t<<31>>31|0}function yi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;r=C;C=C+16|0;n=r;p[n>>2]=i;i=Si(e,t,n)|0;C=r;return i|0}function Ci(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,f=0,m=0,_=0,g=0;g=C;C=C+224|0;h=g+120|0;_=g+80|0;m=g;f=g+136|0;r=_;n=r+40|0;do{p[r>>2]=0;r=r+4|0}while((r|0)<(n|0));p[h>>2]=p[i>>2];if((Oi(0,t,h,m,_)|0)<0)i=-1;else{if((p[e+76>>2]|0)>-1)u=Ei(e)|0;else u=0;i=p[e>>2]|0;c=i&32;if((d[e+74>>0]|0)<1)p[e>>2]=i&-33;i=e+48|0;if(!(p[i>>2]|0)){n=e+44|0;o=p[n>>2]|0;p[n>>2]=f;a=e+28|0;p[a>>2]=f;s=e+20|0;p[s>>2]=f;p[i>>2]=80;l=e+16|0;p[l>>2]=f+80;r=Oi(e,t,h,m,_)|0;if(o){Er[p[e+36>>2]&7](e,0,0)|0;r=(p[s>>2]|0)==0?-1:r;p[n>>2]=o;p[i>>2]=0;p[l>>2]=0;p[a>>2]=0;p[s>>2]=0}}else r=Oi(e,t,h,m,_)|0;i=p[e>>2]|0;p[e>>2]=i|c;if(u)bi(e);i=(i&32|0)==0?r:-1}C=g;return i|0}function wi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0;c=C;C=C+128|0;n=c+112|0;u=c;o=u;a=252;s=o+112|0;do{p[o>>2]=p[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;l=4}else{t=li()|0;p[t>>2]=75;t=-1}else{n=e;l=4}if((l|0)==4){l=-2-n|0;l=t>>>0>l>>>0?l:t;p[u+48>>2]=l;e=u+20|0;p[e>>2]=n;p[u+44>>2]=n;t=n+l|0;n=u+16|0;p[n>>2]=t;p[u+28>>2]=t;t=Ci(u,i,r)|0;if(l){i=p[e>>2]|0;d[i+(((i|0)==(p[n>>2]|0))<<31>>31)>>0]=0}}C=c;return t|0}function Si(e,t,i){e=e|0;t=t|0;i=i|0;return wi(e,2147483647,t,i)|0}function Ei(e){e=e|0;return 0}function bi(e){e=e|0;return}function Ti(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+16|0;s=l;a=t&255;d[s>>0]=a;r=e+16|0;n=p[r>>2]|0;if(!n)if(!(Mi(e)|0)){n=p[r>>2]|0;o=4}else i=-1;else o=4;do if((o|0)==4){r=e+20|0;o=p[r>>2]|0;if(o>>>0<n>>>0?(i=t&255,(i|0)!=(d[e+75>>0]|0)):0){p[r>>2]=o+1;d[o>>0]=a;break}if((Er[p[e+36>>2]&7](e,s,1)|0)==1)i=f[s>>0]|0;else i=-1}while(0);C=l;return i|0}function xi(e){e=e|0;var t=0,i=0;t=C;C=C+16|0;i=t;p[i>>2]=p[e+60>>2];e=ui(Ie(6,i|0)|0)|0;C=t;return e|0}function Ai(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0;n=C;C=C+32|0;o=n;r=n+20|0;p[o>>2]=p[e+60>>2];p[o+4>>2]=0;p[o+8>>2]=t;p[o+12>>2]=r;p[o+16>>2]=i;if((ui(ke(140,o|0)|0)|0)<0){p[r>>2]=-1;e=-1}else e=p[r>>2]|0;C=n;return e|0}function Pi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;m=C;C=C+48|0;d=m+16|0;c=m;r=m+32|0;h=e+28|0;n=p[h>>2]|0;p[r>>2]=n;f=e+20|0;n=(p[f>>2]|0)-n|0;p[r+4>>2]=n;p[r+8>>2]=t;p[r+12>>2]=i;l=e+60|0;u=e+44|0;t=2;n=n+i|0;while(1){if(!(p[49]|0)){p[d>>2]=p[l>>2];p[d+4>>2]=r;p[d+8>>2]=t;a=ui(Ge(146,d|0)|0)|0}else{Me(7,e|0);p[c>>2]=p[l>>2];p[c+4>>2]=r;p[c+8>>2]=t;a=ui(Ge(146,c|0)|0)|0;Ee(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=p[r+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){p[h>>2]=(p[h>>2]|0)+a;s=o;t=2}else s=o;else{s=p[u>>2]|0;p[h>>2]=s;p[f>>2]=s;s=p[r+12>>2]|0;a=a-o|0;r=r+8|0;t=t+-1|0}p[r>>2]=(p[r>>2]|0)+a;p[r+4>>2]=s-a}if((n|0)==6){d=p[u>>2]|0;p[e+16>>2]=d+(p[e+48>>2]|0);e=d;p[h>>2]=e;p[f>>2]=e}else if((n|0)==8){p[e+16>>2]=0;p[h>>2]=0;p[f>>2]=0;p[e>>2]=p[e>>2]|32;if((t|0)==2)i=0;else i=i-(p[r+4>>2]|0)|0}C=m;return i|0}function Di(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;n=C;C=C+80|0;r=n;p[e+36>>2]=3;if((p[e>>2]&64|0)==0?(p[r>>2]=p[e+60>>2],p[r+4>>2]=21505,p[r+8>>2]=n+12,(Fe(54,r|0)|0)!=0):0)d[e+75>>0]=-1;r=Pi(e,t,i)|0;C=n;return r|0}function Mi(e){e=e|0;var t=0,i=0;t=e+74|0;i=d[t>>0]|0;d[t>>0]=i+255|i;t=p[e>>2]|0;if(!(t&8)){p[e+8>>2]=0;p[e+4>>2]=0;t=p[e+44>>2]|0;p[e+28>>2]=t;p[e+20>>2]=t;p[e+16>>2]=t+(p[e+48>>2]|0);t=0}else{p[e>>2]=t|32;t=-1}return t|0}function Ii(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;o=t&255;r=(i|0)!=0;e:do if(r&(e&3|0)!=0){n=t&255;while(1){if((d[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;i=i+-1|0;r=(i|0)!=0;if(!(r&(e&3|0)!=0)){a=5;break}}}else a=5;while(0);if((a|0)==5)if(r)a=6;else i=0;e:do if((a|0)==6){n=t&255;if((d[e>>0]|0)!=n<<24>>24){r=ce(o,16843009)|0;t:do if(i>>>0>3)while(1){o=p[e>>2]^r;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;i=i+-4|0;if(i>>>0<=3){a=11;break t}}else a=11;while(0);if((a|0)==11)if(!i){i=0;break}while(1){if((d[e>>0]|0)==n<<24>>24)break e;e=e+1|0;i=i+-1|0;if(!i){i=0;break}}}}while(0);return((i|0)!=0?e:0)|0}function Ri(e){e=e|0;var t=0,i=0,r=0;r=e;e:do if(!(r&3))i=4;else{t=e;e=r;while(1){if(!(d[t>>0]|0))break e;t=t+1|0;e=t;if(!(e&3)){e=t;i=4;break}}}while(0);if((i|0)==4){while(1){t=p[e>>2]|0;if(!((t&-2139062144^-2139062144)&t+-16843009))e=e+4|0;else break}if((t&255)<<24>>24)do e=e+1|0;while((d[e>>0]|0)!=0)}return e-r|0}function Oi(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,m=0,_=0,g=0,y=0,w=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0;ae=C;C=C+624|0;te=ae+24|0;re=ae+16|0;ie=ae+588|0;K=ae+576|0;ee=ae;Y=ae+536|0;oe=ae+8|0;ne=ae+528|0;F=(e|0)!=0;k=Y+40|0;j=k;Y=Y+39|0;X=oe+4|0;Z=K+12|0;K=K+11|0;Q=ie;J=Z;$=J-Q|0;V=-2-Q|0;U=J+2|0;G=te+288|0;H=ie+9|0;W=H;q=ie+8|0;o=0;w=t;a=0;t=0;e:while(1){do if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=li()|0;p[o>>2]=75;o=-1;break}else{o=a+o|0;break}while(0);a=d[w>>0]|0;if(!(a<<24>>24)){B=245;break}else s=w;t:while(1){switch(a<<24>>24){case 37:{a=s;B=9;break t}case 0:{a=s;break t}default:{}}L=s+1|0;a=d[L>>0]|0;s=L}t:do if((B|0)==9)while(1){B=0;if((d[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((d[a>>0]|0)==37)B=9;else break}while(0);b=s-w|0;if(F?(p[e>>2]&32|0)==0:0)_i(w,b,e)|0;if((s|0)!=(w|0)){w=a;a=b;continue}c=a+1|0;s=d[c>>0]|0;l=(s<<24>>24)+-48|0;if(l>>>0<10){L=(d[a+2>>0]|0)==36;c=L?a+3|0:c;s=d[c>>0]|0;g=L?l:-1;t=L?1:t}else g=-1;a=s<<24>>24;t:do if((a&-32|0)==32){l=0;while(1){if(!(1<<a+-32&75913)){m=l;a=c;break t}l=1<<(s<<24>>24)+-32|l;c=c+1|0;s=d[c>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){m=l;a=c;break}}}else{m=0;a=c}while(0);do if(s<<24>>24==42){l=a+1|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+2>>0]|0)==36:0){p[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=p[r+((d[l>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!F){E=m;a=l;t=0;L=0;break}t=(p[i>>2]|0)+(4-1)&~(4-1);s=p[t>>2]|0;p[i>>2]=t+4;t=0;a=l}if((s|0)<0){E=m|8192;L=0-s|0}else{E=m;L=s}}else{l=(s<<24>>24)+-48|0;if(l>>>0<10){s=0;do{s=(s*10|0)+l|0;a=a+1|0;l=(d[a>>0]|0)+-48|0}while(l>>>0<10);if((s|0)<0){o=-1;break e}else{E=m;L=s}}else{E=m;L=0}}while(0);t:do if((d[a>>0]|0)==46){l=a+1|0;s=d[l>>0]|0;if(s<<24>>24!=42){c=(s<<24>>24)+-48|0;if(c>>>0<10){a=l;s=0}else{a=l;c=0;break}while(1){s=(s*10|0)+c|0;a=a+1|0;c=(d[a>>0]|0)+-48|0;if(c>>>0>=10){c=s;break t}}}l=a+2|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+3>>0]|0)==36:0){p[n+(s<<2)>>2]=10;a=a+4|0;c=p[r+((d[l>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(F){a=(p[i>>2]|0)+(4-1)&~(4-1);c=p[a>>2]|0;p[i>>2]=a+4;a=l}else{a=l;c=0}}else c=-1;while(0);_=0;while(1){s=(d[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}l=a+1|0;s=d[5347+(_*58|0)+s>>0]|0;m=s&255;if((m+-1|0)>>>0<8){a=l;_=m}else{N=l;break}}if(!(s<<24>>24)){o=-1;break}l=(g|0)>-1;do if(s<<24>>24==19)if(l){o=-1;break e}else B=52;else{if(l){p[n+(g<<2)>>2]=m;R=r+(g<<3)|0;O=p[R+4>>2]|0;B=ee;p[B>>2]=p[R>>2];p[B+4>>2]=O;B=52;break}if(!F){o=0;break e}Bi(ee,m,i)}while(0);if((B|0)==52?(B=0,!F):0){w=N;a=b;continue}g=d[a>>0]|0;g=(_|0)!=0&(g&15|0)==3?g&-33:g;l=E&-65537;O=(E&8192|0)==0?E:l;t:do switch(g|0){case 110:switch(_|0){case 0:{p[p[ee>>2]>>2]=o;w=N;a=b;continue e}case 1:{p[p[ee>>2]>>2]=o;w=N;a=b;continue e}case 2:{w=p[ee>>2]|0;p[w>>2]=o;p[w+4>>2]=((o|0)<0)<<31>>31;w=N;a=b;continue e}case 3:{h[p[ee>>2]>>1]=o;w=N;a=b;continue e}case 4:{d[p[ee>>2]>>0]=o;w=N;a=b;continue e}case 6:{p[p[ee>>2]>>2]=o;w=N;a=b;continue e}case 7:{w=p[ee>>2]|0;p[w>>2]=o;p[w+4>>2]=((o|0)<0)<<31>>31;w=N;a=b;continue e}default:{w=N;a=b;continue e}}case 112:{_=O|8;c=c>>>0>8?c:8;g=120;B=64;break}case 88:case 120:{_=O;B=64;break}case 111:{l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;if((s|0)==0&(l|0)==0)a=k;else{a=k;do{a=a+-1|0;d[a>>0]=s&7|48;s=Zi(s|0,l|0,3)|0;l=z}while(!((s|0)==0&(l|0)==0))}if(!(O&8)){s=O;_=0;m=5827;B=77}else{_=j-a+1|0;s=O;c=(c|0)<(_|0)?_:c;_=0;m=5827;B=77}break}case 105:case 100:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;if((s|0)<0){a=ji(0,0,a|0,s|0)|0;s=z;l=ee;p[l>>2]=a;p[l+4>>2]=s;l=1;m=5827;B=76;break t}if(!(O&2048)){m=O&1;l=m;m=(m|0)==0?5827:5829;B=76}else{l=1;m=5828;B=76}break}case 117:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;l=0;m=5827;B=76;break}case 99:{d[Y>>0]=p[ee>>2];w=Y;s=1;_=0;g=5827;a=k;break}case 109:{a=li()|0;a=si(p[a>>2]|0)|0;B=82;break}case 115:{a=p[ee>>2]|0;a=(a|0)!=0?a:5837;B=82;break}case 67:{p[oe>>2]=p[ee>>2];p[X>>2]=0;p[ee>>2]=oe;c=-1;B=86;break}case 83:{if(!c){ki(e,32,L,0,O);a=0;B=98}else B=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+v[ee>>3];p[re>>2]=0;v[S>>3]=u;if((p[S+4>>2]|0)>=0)if(!(O&2048)){R=O&1;I=R;R=(R|0)==0?5845:5850}else{I=1;R=5847}else{u=-u;I=1;R=5844}v[S>>3]=u;M=p[S+4>>2]&2146435072;do if(M>>>0<2146435072|(M|0)==2146435072&0<0){y=+di(u,re)*2;s=y!=0;if(s)p[re>>2]=(p[re>>2]|0)+-1;P=g|32;if((P|0)==97){w=g&32;b=(w|0)==0?R:R+9|0;E=I|2;a=12-c|0;do if(!(c>>>0>11|(a|0)==0)){u=8;do{a=a+-1|0;u=u*16}while((a|0)!=0);if((d[b>>0]|0)==45){u=-(u+(-y-u));break}else{u=y+u-u;break}}else u=y;while(0);s=p[re>>2]|0;a=(s|0)<0?0-s|0:s;a=Fi(a,((a|0)<0)<<31>>31,Z)|0;if((a|0)==(Z|0)){d[K>>0]=48;a=K}d[a+-1>>0]=(s>>31&2)+43;_=a+-2|0;d[_>>0]=g+15;m=(c|0)<1;l=(O&8|0)==0;s=ie;while(1){R=~~u;a=s+1|0;d[s>>0]=f[5811+R>>0]|w;u=(u-+(R|0))*16;do if((a-Q|0)==1){if(l&(m&u==0))break;d[a>>0]=46;a=s+2|0}while(0);if(!(u!=0))break;else s=a}c=(c|0)!=0&(V+a|0)<(c|0)?U+c-_|0:$-_+a|0;l=c+E|0;ki(e,32,L,l,O);if(!(p[e>>2]&32))_i(b,E,e)|0;ki(e,48,L,l,O^65536);a=a-Q|0;if(!(p[e>>2]&32))_i(ie,a,e)|0;s=J-_|0;ki(e,48,c-(a+s)|0,0,0);if(!(p[e>>2]&32))_i(_,s,e)|0;ki(e,32,L,l,O^8192);a=(l|0)<(L|0)?L:l;break}a=(c|0)<0?6:c;if(s){s=(p[re>>2]|0)+-28|0;p[re>>2]=s;u=y*268435456}else{u=y;s=p[re>>2]|0}M=(s|0)<0?te:G;D=M;s=M;do{A=~~u>>>0;p[s>>2]=A;s=s+4|0;u=(u-+(A>>>0))*1e9}while(u!=0);l=s;s=p[re>>2]|0;if((s|0)>0){m=M;while(1){_=(s|0)>29?29:s;c=l+-4|0;do if(c>>>0<m>>>0)c=m;else{s=0;do{A=Ki(p[c>>2]|0,0,_|0)|0;A=Yi(A|0,z|0,s|0,0)|0;s=z;x=or(A|0,s|0,1e9,0)|0;p[c>>2]=x;s=nr(A|0,s|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=m>>>0);if(!s){c=m;break}c=m+-4|0;p[c>>2]=s}while(0);while(1){if(l>>>0<=c>>>0)break;s=l+-4|0;if(!(p[s>>2]|0))l=s;else break}s=(p[re>>2]|0)-_|0;p[re>>2]=s;if((s|0)>0)m=c;else break}}else c=M;if((s|0)<0){b=((a+25|0)/9|0)+1|0;T=(P|0)==102;w=c;while(1){E=0-s|0;E=(E|0)>9?9:E;do if(w>>>0<l>>>0){s=(1<<E)+-1|0;m=1e9>>>E;c=0;_=w;do{A=p[_>>2]|0;p[_>>2]=(A>>>E)+c;c=ce(A&s,m)|0;_=_+4|0}while(_>>>0<l>>>0);s=(p[w>>2]|0)==0?w+4|0:w;if(!c){c=s;break}p[l>>2]=c;c=s;l=l+4|0}else c=(p[w>>2]|0)==0?w+4|0:w;while(0);s=T?M:c;l=(l-s>>2|0)>(b|0)?s+(b<<2)|0:l;s=(p[re>>2]|0)+E|0;p[re>>2]=s;if((s|0)>=0){w=c;break}else w=c}}else w=c;do if(w>>>0<l>>>0){s=(D-w>>2)*9|0;m=p[w>>2]|0;if(m>>>0<10)break;else c=10;do{c=c*10|0;s=s+1|0}while(m>>>0>=c>>>0)}else s=0;while(0);x=(P|0)==103;A=(a|0)!=0;c=a-((P|0)!=102?s:0)+((A&x)<<31>>31)|0;if((c|0)<(((l-D>>2)*9|0)+-9|0)){_=c+9216|0;T=(_|0)/9|0;c=M+(T+-1023<<2)|0;_=((_|0)%9|0)+1|0;if((_|0)<9){m=10;do{m=m*10|0;_=_+1|0}while((_|0)!=9)}else m=10;E=p[c>>2]|0;b=(E>>>0)%(m>>>0)|0;if((b|0)==0?(M+(T+-1022<<2)|0)==(l|0):0)m=w;else B=163;do if((B|0)==163){B=0;y=(((E>>>0)/(m>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;_=(m|0)/2|0;do if(b>>>0<_>>>0)u=.5;else{if((b|0)==(_|0)?(M+(T+-1022<<2)|0)==(l|0):0){u=1;break}u=1.5}while(0);do if(I){if((d[R>>0]|0)!=45)break;y=-y;u=-u}while(0);_=E-b|0;p[c>>2]=_;if(!(y+u!=y)){m=w;break}P=_+m|0;p[c>>2]=P;if(P>>>0>999999999){s=w;while(1){m=c+-4|0;p[c>>2]=0;if(m>>>0<s>>>0){s=s+-4|0;p[s>>2]=0}P=(p[m>>2]|0)+1|0;p[m>>2]=P;if(P>>>0>999999999)c=m;else{w=s;c=m;break}}}s=(D-w>>2)*9|0;_=p[w>>2]|0;if(_>>>0<10){m=w;break}else m=10;do{m=m*10|0;s=s+1|0}while(_>>>0>=m>>>0);m=w}while(0);P=c+4|0;w=m;l=l>>>0>P>>>0?P:l}b=0-s|0;while(1){if(l>>>0<=w>>>0){T=0;P=l;break}c=l+-4|0;if(!(p[c>>2]|0))l=c;else{T=1;P=l;break}}do if(x){a=(A&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){g=g+-1|0;a=a+-1-s|0}else{g=g+-2|0;a=a+-1|0}l=O&8;if(l)break;do if(T){l=p[P+-4>>2]|0;if(!l){c=9;break}if(!((l>>>0)%10|0)){m=10;c=0}else{c=0;break}do{m=m*10|0;c=c+1|0}while(((l>>>0)%(m>>>0)|0|0)==0)}else c=9;while(0);l=((P-D>>2)*9|0)+-9|0;if((g|32|0)==102){l=l-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}else{l=l+s-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}}else l=O&8;while(0);E=a|l;m=(E|0)!=0&1;_=(g|32|0)==102;if(_){s=(s|0)>0?s:0;g=0}else{c=(s|0)<0?b:s;c=Fi(c,((c|0)<0)<<31>>31,Z)|0;if((J-c|0)<2)do{c=c+-1|0;d[c>>0]=48}while((J-c|0)<2);d[c+-1>>0]=(s>>31&2)+43;D=c+-2|0;d[D>>0]=g;s=J-D|0;g=D}b=I+1+a+m+s|0;ki(e,32,L,b,O);if(!(p[e>>2]&32))_i(R,I,e)|0;ki(e,48,L,b,O^65536);do if(_){c=w>>>0>M>>>0?M:w;s=c;do{l=Fi(p[s>>2]|0,0,H)|0;do if((s|0)==(c|0)){if((l|0)!=(H|0))break;d[q>>0]=48;l=q}else{if(l>>>0<=ie>>>0)break;do{l=l+-1|0;d[l>>0]=48}while(l>>>0>ie>>>0)}while(0);if(!(p[e>>2]&32))_i(l,W-l|0,e)|0;s=s+4|0}while(s>>>0<=M>>>0);do if(E){if(p[e>>2]&32)break;_i(5879,1,e)|0}while(0);if((a|0)>0&s>>>0<P>>>0){l=s;while(1){s=Fi(p[l>>2]|0,0,H)|0;if(s>>>0>ie>>>0)do{s=s+-1|0;d[s>>0]=48}while(s>>>0>ie>>>0);if(!(p[e>>2]&32))_i(s,(a|0)>9?9:a,e)|0;l=l+4|0;s=a+-9|0;if(!((a|0)>9&l>>>0<P>>>0)){a=s;break}else a=s}}ki(e,48,a+9|0,9,0)}else{_=T?P:w+4|0;if((a|0)>-1){m=(l|0)==0;c=w;do{s=Fi(p[c>>2]|0,0,H)|0;if((s|0)==(H|0)){d[q>>0]=48;s=q}do if((c|0)==(w|0)){l=s+1|0;if(!(p[e>>2]&32))_i(s,1,e)|0;if(m&(a|0)<1){s=l;break}if(p[e>>2]&32){s=l;break}_i(5879,1,e)|0;s=l}else{if(s>>>0<=ie>>>0)break;do{s=s+-1|0;d[s>>0]=48}while(s>>>0>ie>>>0)}while(0);l=W-s|0;if(!(p[e>>2]&32))_i(s,(a|0)>(l|0)?l:a,e)|0;a=a-l|0;c=c+4|0}while(c>>>0<_>>>0&(a|0)>-1)}ki(e,48,a+18|0,18,0);if(p[e>>2]&32)break;_i(g,J-g|0,e)|0}while(0);ki(e,32,L,b,O^8192);a=(b|0)<(L|0)?L:b}else{_=(g&32|0)!=0;m=u!=u|0!=0;s=m?0:I;c=s+3|0;ki(e,32,L,c,l);a=p[e>>2]|0;if(!(a&32)){_i(R,s,e)|0;a=p[e>>2]|0}if(!(a&32))_i(m?_?5871:5875:_?5863:5867,3,e)|0;ki(e,32,L,c,O^8192);a=(c|0)<(L|0)?L:c}while(0);w=N;continue e}default:{l=O;s=c;_=0;g=5827;a=k}}while(0);t:do if((B|0)==64){l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;m=g&32;if(!((s|0)==0&(l|0)==0)){a=k;do{a=a+-1|0;d[a>>0]=f[5811+(s&15)>>0]|m;s=Zi(s|0,l|0,4)|0;l=z}while(!((s|0)==0&(l|0)==0));B=ee;if((_&8|0)==0|(p[B>>2]|0)==0&(p[B+4>>2]|0)==0){s=_;_=0;m=5827;B=77}else{s=_;_=2;m=5827+(g>>4)|0;B=77}}else{a=k;s=_;_=0;m=5827;B=77}}else if((B|0)==76){a=Fi(a,s,k)|0;s=O;_=l;B=77}else if((B|0)==82){B=0;O=Ii(a,0,c)|0;R=(O|0)==0;w=a;s=R?c:O-a|0;_=0;g=5827;a=R?a+c|0:O}else if((B|0)==86){B=0;s=0;a=0;m=p[ee>>2]|0;while(1){l=p[m>>2]|0;if(!l)break;a=pi(ne,l)|0;if((a|0)<0|a>>>0>(c-s|0)>>>0)break;s=a+s|0;if(c>>>0>s>>>0)m=m+4|0;else break}if((a|0)<0){o=-1;break e}ki(e,32,L,s,O);if(!s){a=0;B=98}else{l=0;c=p[ee>>2]|0;while(1){a=p[c>>2]|0;if(!a){a=s;B=98;break t}a=pi(ne,a)|0;l=a+l|0;if((l|0)>(s|0)){a=s;B=98;break t}if(!(p[e>>2]&32))_i(ne,a,e)|0;if(l>>>0>=s>>>0){a=s;B=98;break}else c=c+4|0}}}while(0);if((B|0)==98){B=0;ki(e,32,L,a,O^8192);w=N;a=(L|0)>(a|0)?L:a;continue}if((B|0)==77){B=0;l=(c|0)>-1?s&-65537:s;s=ee;s=(p[s>>2]|0)!=0|(p[s+4>>2]|0)!=0;if((c|0)!=0|s){s=(s&1^1)+(j-a)|0;w=a;s=(c|0)>(s|0)?c:s;g=m;a=k}else{w=k;s=0;g=m;a=k}}m=a-w|0;s=(s|0)<(m|0)?m:s;c=_+s|0;a=(L|0)<(c|0)?c:L;ki(e,32,a,c,l);if(!(p[e>>2]&32))_i(g,_,e)|0;ki(e,48,a,c,l^65536);ki(e,48,s,m,0);if(!(p[e>>2]&32))_i(w,m,e)|0;ki(e,32,a,c,l^8192);w=N}e:do if((B|0)==245)if(!e)if(t){o=1;while(1){t=p[n+(o<<2)>>2]|0;if(!t)break;Bi(r+(o<<3)|0,t,i);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(p[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0;while(0);C=ae;return o|0}function Ni(e){e=e|0;if(!(p[e+68>>2]|0))bi(e);return}function Li(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;r=e+20|0;n=p[r>>2]|0;e=(p[e+16>>2]|0)-n|0;e=e>>>0>i>>>0?i:e;Qi(n|0,t|0,e|0)|0;p[r>>2]=(p[r>>2]|0)+e;return i|0}function Bi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0;e:do if(t>>>0<=20)do switch(t|0){case 9:{r=(p[i>>2]|0)+(4-1)&~(4-1);t=p[r>>2]|0;p[i>>2]=r+4;p[e>>2]=t;break e}case 10:{r=(p[i>>2]|0)+(4-1)&~(4-1);t=p[r>>2]|0;p[i>>2]=r+4;r=e;p[r>>2]=t;p[r+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{r=(p[i>>2]|0)+(4-1)&~(4-1);t=p[r>>2]|0;p[i>>2]=r+4;r=e;p[r>>2]=t;p[r+4>>2]=0;break e}case 12:{r=(p[i>>2]|0)+(8-1)&~(8-1);t=r;n=p[t>>2]|0;t=p[t+4>>2]|0;p[i>>2]=r+8;r=e;p[r>>2]=n;p[r+4>>2]=t;break e}case 13:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;r=(r&65535)<<16>>16;n=e;p[n>>2]=r;p[n+4>>2]=((r|0)<0)<<31>>31;break e}case 14:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;n=e;p[n>>2]=r&65535;p[n+4>>2]=0;break e}case 15:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;r=(r&255)<<24>>24;n=e;p[n>>2]=r;p[n+4>>2]=((r|0)<0)<<31>>31;break e}case 16:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;n=e;p[n>>2]=r&255;p[n+4>>2]=0;break e}case 17:{n=(p[i>>2]|0)+(8-1)&~(8-1);o=+v[n>>3];p[i>>2]=n+8;v[e>>3]=o;break e}case 18:{n=(p[i>>2]|0)+(8-1)&~(8-1);o=+v[n>>3];p[i>>2]=n+8;v[e>>3]=o;break e}default:break e}while(0);while(0);return}function Fi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){r=or(e|0,t|0,10,0)|0;i=i+-1|0;d[i>>0]=r|48;r=nr(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=r;t=z}else{e=r;break}}if(e)while(1){i=i+-1|0;d[i>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return i|0}function ki(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0;s=C;C=C+256|0;a=s;do if((i|0)>(r|0)&(n&73728|0)==0){n=i-r|0;Xi(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=p[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){r=i-r|0;do{if(o){_i(a,256,e)|0;t=p[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=r&255;else break}else if(!o)break;_i(a,n,e)|0}while(0);C=s;return}function Vi(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0,g=0,v=0,y=0,C=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,D=0,M=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0;do if(e>>>0<245){f=e>>>0<11?16:e+11&-8;e=f>>>3;s=p[147]|0;i=s>>>e;if(i&3){e=(i&1^1)+e|0;r=e<<1;i=628+(r<<2)|0;r=628+(r+2<<2)|0;n=p[r>>2]|0;o=n+8|0;a=p[o>>2]|0;do if((i|0)!=(a|0)){if(a>>>0<(p[151]|0)>>>0)De();t=a+12|0;if((p[t>>2]|0)==(n|0)){p[t>>2]=i;p[r>>2]=a;break}else De()}else p[147]=s&~(1<<e);while(0);k=e<<3;p[n+4>>2]=k|3;k=n+(k|4)|0;p[k>>2]=p[k>>2]|1;k=o;return k|0}a=p[149]|0;if(f>>>0>a>>>0){if(i){r=2<<e;r=i<<e&(r|0-r);r=(r&0-r)+-1|0;l=r>>>12&16;r=r>>>l;n=r>>>5&8;r=r>>>n;o=r>>>2&4;r=r>>>o;i=r>>>1&2;r=r>>>i;e=r>>>1&1;e=(n|l|o|i|e)+(r>>>e)|0;r=e<<1;i=628+(r<<2)|0;r=628+(r+2<<2)|0;o=p[r>>2]|0;l=o+8|0;n=p[l>>2]|0;do if((i|0)!=(n|0)){if(n>>>0<(p[151]|0)>>>0)De();t=n+12|0;if((p[t>>2]|0)==(o|0)){p[t>>2]=i;p[r>>2]=n;u=p[149]|0;break}else De()}else{p[147]=s&~(1<<e);u=a}while(0);k=e<<3;a=k-f|0;p[o+4>>2]=f|3;s=o+f|0;p[o+(f|4)>>2]=a|1;p[o+k>>2]=a;if(u){n=p[152]|0;i=u>>>3;t=i<<1;r=628+(t<<2)|0;e=p[147]|0;i=1<<i;if(e&i){e=628+(t+2<<2)|0;t=p[e>>2]|0;if(t>>>0<(p[151]|0)>>>0)De();else{c=e;d=t}}else{p[147]=e|i;c=628+(t+2<<2)|0;d=r}p[c>>2]=n;p[d+12>>2]=n;p[n+8>>2]=d;p[n+12>>2]=r}p[149]=a;p[152]=s;k=l;return k|0}e=p[148]|0;if(e){i=(e&0-e)+-1|0;F=i>>>12&16;i=i>>>F;B=i>>>5&8;i=i>>>B;k=i>>>2&4;i=i>>>k;e=i>>>1&2;i=i>>>e;r=i>>>1&1;r=p[892+((B|F|k|e|r)+(i>>>r)<<2)>>2]|0;i=(p[r+4>>2]&-8)-f|0;e=r;while(1){t=p[e+16>>2]|0;if(!t){t=p[e+20>>2]|0;if(!t){l=i;break}}e=(p[t+4>>2]&-8)-f|0;k=e>>>0<i>>>0;i=k?e:i;e=t;r=k?t:r}o=p[151]|0;if(r>>>0<o>>>0)De();s=r+f|0;if(r>>>0>=s>>>0)De();a=p[r+24>>2]|0;i=p[r+12>>2]|0;do if((i|0)==(r|0)){e=r+20|0;t=p[e>>2]|0;if(!t){e=r+16|0;t=p[e>>2]|0;if(!t){h=0;break}}while(1){i=t+20|0;n=p[i>>2]|0;if(n){t=n;e=i;continue}i=t+16|0;n=p[i>>2]|0;if(!n)break;else{t=n;e=i}}if(e>>>0<o>>>0)De();else{p[e>>2]=0;h=t;break}}else{n=p[r+8>>2]|0;if(n>>>0<o>>>0)De();t=n+12|0;if((p[t>>2]|0)!=(r|0))De();e=i+8|0;if((p[e>>2]|0)==(r|0)){p[t>>2]=i;p[e>>2]=n;h=i;break}else De()}while(0);do if(a){t=p[r+28>>2]|0;e=892+(t<<2)|0;if((r|0)==(p[e>>2]|0)){p[e>>2]=h;if(!h){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(r|0))p[t>>2]=h;else p[a+20>>2]=h;if(!h)break}e=p[151]|0;if(h>>>0<e>>>0)De();p[h+24>>2]=a;t=p[r+16>>2]|0;do if(t)if(t>>>0<e>>>0)De();else{p[h+16>>2]=t;p[t+24>>2]=h;break}while(0);t=p[r+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[h+20>>2]=t;p[t+24>>2]=h;break}}while(0);if(l>>>0<16){k=l+f|0;p[r+4>>2]=k|3;k=r+(k+4)|0;p[k>>2]=p[k>>2]|1}else{p[r+4>>2]=f|3;p[r+(f|4)>>2]=l|1;p[r+(l+f)>>2]=l;t=p[149]|0;if(t){o=p[152]|0;i=t>>>3;t=i<<1;n=628+(t<<2)|0;e=p[147]|0;i=1<<i;if(e&i){t=628+(t+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{m=t;_=e}}else{p[147]=e|i;m=628+(t+2<<2)|0;_=n}p[m>>2]=o;p[_+12>>2]=o;p[o+8>>2]=_;p[o+12>>2]=n}p[149]=l;p[152]=s}k=r+8|0;return k|0}else _=f}else _=f}else if(e>>>0<=4294967231){e=e+11|0;d=e&-8;c=p[148]|0;if(c){i=0-d|0;e=e>>>8;if(e)if(d>>>0>16777215)u=31;else{_=(e+1048320|0)>>>16&8;w=e<<_;m=(w+520192|0)>>>16&4;w=w<<m;u=(w+245760|0)>>>16&2;u=14-(m|_|u)+(w<<u>>>15)|0;u=d>>>(u+7|0)&1|u<<1}else u=0;e=p[892+(u<<2)>>2]|0;e:do if(!e){n=0;e=0;w=86}else{a=i;n=0;s=d<<((u|0)==31?0:25-(u>>>1)|0);l=e;e=0;while(1){o=p[l+4>>2]&-8;i=o-d|0;if(i>>>0<a>>>0)if((o|0)==(d|0)){o=l;e=l;w=90;break e}else e=l;else i=a;w=p[l+20>>2]|0;l=p[l+16+(s>>>31<<2)>>2]|0;n=(w|0)==0|(w|0)==(l|0)?n:w;if(!l){w=86;break}else{a=i;s=s<<1}}}while(0);if((w|0)==86){if((n|0)==0&(e|0)==0){e=2<<u;e=c&(e|0-e);if(!e){_=d;break}e=(e&0-e)+-1|0;h=e>>>12&16;e=e>>>h;c=e>>>5&8;e=e>>>c;m=e>>>2&4;e=e>>>m;_=e>>>1&2;e=e>>>_;n=e>>>1&1;n=p[892+((c|h|m|_|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=i;l=e}else{o=n;w=90}}if((w|0)==90)while(1){w=0;_=(p[o+4>>2]&-8)-d|0;n=_>>>0<i>>>0;i=n?_:i;e=n?o:e;n=p[o+16>>2]|0;if(n){o=n;w=90;continue}o=p[o+20>>2]|0;if(!o){s=i;l=e;break}else w=90}if((l|0)!=0?s>>>0<((p[149]|0)-d|0)>>>0:0){n=p[151]|0;if(l>>>0<n>>>0)De();a=l+d|0;if(l>>>0>=a>>>0)De();o=p[l+24>>2]|0;i=p[l+12>>2]|0;do if((i|0)==(l|0)){e=l+20|0;t=p[e>>2]|0;if(!t){e=l+16|0;t=p[e>>2]|0;if(!t){f=0;break}}while(1){i=t+20|0;r=p[i>>2]|0;if(r){t=r;e=i;continue}i=t+16|0;r=p[i>>2]|0;if(!r)break;else{t=r;e=i}}if(e>>>0<n>>>0)De();else{p[e>>2]=0;f=t;break}}else{r=p[l+8>>2]|0;if(r>>>0<n>>>0)De();t=r+12|0;if((p[t>>2]|0)!=(l|0))De();e=i+8|0;if((p[e>>2]|0)==(l|0)){p[t>>2]=i;p[e>>2]=r;f=i;break}else De()}while(0);do if(o){t=p[l+28>>2]|0;e=892+(t<<2)|0;if((l|0)==(p[e>>2]|0)){p[e>>2]=f;if(!f){p[148]=p[148]&~(1<<t);break}}else{if(o>>>0<(p[151]|0)>>>0)De();t=o+16|0;if((p[t>>2]|0)==(l|0))p[t>>2]=f;else p[o+20>>2]=f;if(!f)break}e=p[151]|0;if(f>>>0<e>>>0)De();p[f+24>>2]=o;t=p[l+16>>2]|0;do if(t)if(t>>>0<e>>>0)De();else{p[f+16>>2]=t;p[t+24>>2]=f;break}while(0);t=p[l+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[f+20>>2]=t;p[t+24>>2]=f;break}}while(0);e:do if(s>>>0>=16){p[l+4>>2]=d|3;p[l+(d|4)>>2]=s|1;p[l+(s+d)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;r=628+(e<<2)|0;i=p[147]|0;t=1<<t;if(i&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{v=t;y=e}}else{p[147]=i|t;v=628+(e+2<<2)|0;y=r}p[v>>2]=a;p[y+12>>2]=a;p[l+(d+8)>>2]=y;p[l+(d+12)>>2]=r;break}t=s>>>8;if(t)if(s>>>0>16777215)r=31;else{F=(t+1048320|0)>>>16&8;k=t<<F;B=(k+520192|0)>>>16&4;k=k<<B;r=(k+245760|0)>>>16&2;r=14-(B|F|r)+(k<<r>>>15)|0;r=s>>>(r+7|0)&1|r<<1}else r=0;t=892+(r<<2)|0;p[l+(d+28)>>2]=r;p[l+(d+20)>>2]=0;p[l+(d+16)>>2]=0;e=p[148]|0;i=1<<r;if(!(e&i)){p[148]=e|i;p[t>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break}t=p[t>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(s|0)){r=s<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=p[e>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(s|0)){b=i;break t}else{r=r<<1;t=i}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break e}}else b=t;while(0);t=b+8|0;e=p[t>>2]|0;k=p[151]|0;if(e>>>0>=k>>>0&b>>>0>=k>>>0){p[e+12>>2]=a;p[t>>2]=a;p[l+(d+8)>>2]=e;p[l+(d+12)>>2]=b;p[l+(d+24)>>2]=0;break}else De()}else{k=s+d|0;p[l+4>>2]=k|3;k=l+(k+4)|0;p[k>>2]=p[k>>2]|1}while(0);k=l+8|0;return k|0}else _=d}else _=d}else _=-1;while(0);i=p[149]|0;if(i>>>0>=_>>>0){t=i-_|0;e=p[152]|0;if(t>>>0>15){p[152]=e+_;p[149]=t;p[e+(_+4)>>2]=t|1;p[e+i>>2]=t;p[e+4>>2]=_|3}else{p[149]=0;p[152]=0;p[e+4>>2]=i|3;k=e+(i+4)|0;p[k>>2]=p[k>>2]|1}k=e+8|0;return k|0}e=p[150]|0;if(e>>>0>_>>>0){F=e-_|0;p[150]=F;k=p[153]|0;p[153]=k+_;p[k+(_+4)>>2]=F|1;p[k+4>>2]=_|3;k=k+8|0;return k|0}do if(!(p[265]|0)){e=Ue(30)|0;if(!(e+-1&e)){p[267]=e;p[266]=e;p[268]=-1;p[269]=-1;p[270]=0;p[258]=0;b=(Oe(0)|0)&-16^1431655768;p[265]=b;break}else De()}while(0);l=_+48|0;s=p[267]|0;u=_+47|0;a=s+u|0;s=0-s|0;c=a&s;if(c>>>0<=_>>>0){k=0;return k|0}e=p[257]|0;if((e|0)!=0?(y=p[255]|0,b=y+c|0,b>>>0<=y>>>0|b>>>0>e>>>0):0){k=0;return k|0}e:do if(!(p[258]&4)){e=p[153]|0;t:do if(e){n=1036;while(1){i=p[n>>2]|0;if(i>>>0<=e>>>0?(g=n+4|0,(i+(p[g>>2]|0)|0)>>>0>e>>>0):0){o=n;e=g;break}n=p[n+8>>2]|0;if(!n){w=174;break t}}i=a-(p[150]|0)&s;if(i>>>0<2147483647){n=Re(i|0)|0;b=(n|0)==((p[o>>2]|0)+(p[e>>2]|0)|0);e=b?i:0;if(b){if((n|0)!=(-1|0)){S=n;m=e;w=194;break e}}else w=184}else e=0}else w=174;while(0);do if((w|0)==174){o=Re(0)|0;if((o|0)!=(-1|0)){e=o;i=p[266]|0;n=i+-1|0;if(!(n&e))i=c;else i=c-e+(n+e&0-i)|0;e=p[255]|0;n=e+i|0;if(i>>>0>_>>>0&i>>>0<2147483647){b=p[257]|0;if((b|0)!=0?n>>>0<=e>>>0|n>>>0>b>>>0:0){e=0;break}n=Re(i|0)|0;b=(n|0)==(o|0);e=b?i:0;if(b){S=o;m=e;w=194;break e}else w=184}else e=0}else e=0}while(0);t:do if((w|0)==184){o=0-i|0;do if(l>>>0>i>>>0&(i>>>0<2147483647&(n|0)!=(-1|0))?(C=p[267]|0,C=u-i+C&0-C,C>>>0<2147483647):0)if((Re(C|0)|0)==(-1|0)){Re(o|0)|0;break t}else{i=C+i|0;break}while(0);if((n|0)!=(-1|0)){S=n;m=i;w=194;break e}}while(0);p[258]=p[258]|4;w=191}else{e=0;w=191}while(0);if((((w|0)==191?c>>>0<2147483647:0)?(S=Re(c|0)|0,E=Re(0)|0,S>>>0<E>>>0&((S|0)!=(-1|0)&(E|0)!=(-1|0))):0)?(T=E-S|0,x=T>>>0>(_+40|0)>>>0,x):0){m=x?T:e;w=194}if((w|0)==194){e=(p[255]|0)+m|0;p[255]=e;if(e>>>0>(p[256]|0)>>>0)p[256]=e;a=p[153]|0;e:do if(a){o=1036;do{e=p[o>>2]|0;i=o+4|0;n=p[i>>2]|0;if((S|0)==(e+n|0)){A=e;P=i;D=n;M=o;w=204;break}o=p[o+8>>2]|0}while((o|0)!=0);if(((w|0)==204?(p[M+12>>2]&8|0)==0:0)?a>>>0<S>>>0&a>>>0>=A>>>0:0){p[P>>2]=D+m;k=(p[150]|0)+m|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;B=k-F|0;p[153]=a+F;p[150]=B;p[a+(F+4)>>2]=B|1;p[a+(k+4)>>2]=40;p[154]=p[269];break}e=p[151]|0;if(S>>>0<e>>>0){p[151]=S;e=S}i=S+m|0;o=1036;while(1){if((p[o>>2]|0)==(i|0)){n=o;i=o;w=212;break}o=p[o+8>>2]|0;if(!o){i=1036;break}}if((w|0)==212)if(!(p[i+12>>2]&8)){p[n>>2]=S;h=i+4|0;p[h>>2]=(p[h>>2]|0)+m;h=S+8|0;h=(h&7|0)==0?0:0-h&7;u=S+(m+8)|0;u=(u&7|0)==0?0:0-u&7;t=S+(u+m)|0;d=h+_|0;f=S+d|0;c=t-(S+h)-_|0;p[S+(h+4)>>2]=_|3;t:do if((t|0)!=(a|0)){if((t|0)==(p[152]|0)){k=(p[149]|0)+c|0;p[149]=k;p[152]=f;p[S+(d+4)>>2]=k|1;p[S+(k+d)>>2]=k;break}s=m+4|0;i=p[S+(s+u)>>2]|0;if((i&3|0)==1){l=i&-8;o=i>>>3;i:do if(i>>>0>=256){a=p[S+((u|24)+m)>>2]|0;r=p[S+(m+12+u)>>2]|0;do if((r|0)==(t|0)){n=u|16;r=S+(s+n)|0;i=p[r>>2]|0;if(!i){r=S+(n+m)|0;i=p[r>>2]|0;if(!i){L=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<e>>>0)De();else{p[r>>2]=0;L=i;break}}else{n=p[S+((u|8)+m)>>2]|0;if(n>>>0<e>>>0)De();e=n+12|0;if((p[e>>2]|0)!=(t|0))De();i=r+8|0;if((p[i>>2]|0)==(t|0)){p[e>>2]=r;p[i>>2]=n;L=r;break}else De()}while(0);if(!a)break;e=p[S+(m+28+u)>>2]|0;i=892+(e<<2)|0;do if((t|0)!=(p[i>>2]|0)){if(a>>>0<(p[151]|0)>>>0)De();e=a+16|0;if((p[e>>2]|0)==(t|0))p[e>>2]=L;else p[a+20>>2]=L;if(!L)break i}else{p[i>>2]=L;if(L)break;p[148]=p[148]&~(1<<e);break i}while(0);i=p[151]|0;if(L>>>0<i>>>0)De();p[L+24>>2]=a;t=u|16;e=p[S+(t+m)>>2]|0;do if(e)if(e>>>0<i>>>0)De();else{p[L+16>>2]=e;p[e+24>>2]=L;break}while(0);t=p[S+(s+t)>>2]|0;if(!t)break;if(t>>>0<(p[151]|0)>>>0)De();else{p[L+20>>2]=t;p[t+24>>2]=L;break}}else{r=p[S+((u|8)+m)>>2]|0;n=p[S+(m+12+u)>>2]|0;i=628+(o<<1<<2)|0;do if((r|0)!=(i|0)){if(r>>>0<e>>>0)De();if((p[r+12>>2]|0)==(t|0))break;De()}while(0);if((n|0)==(r|0)){p[147]=p[147]&~(1<<o);break}do if((n|0)==(i|0))I=n+8|0;else{if(n>>>0<e>>>0)De();e=n+8|0;if((p[e>>2]|0)==(t|0)){I=e;break}De()}while(0);p[r+12>>2]=n;p[I>>2]=r}while(0);t=S+((l|u)+m)|0;n=l+c|0}else n=c;t=t+4|0;p[t>>2]=p[t>>2]&-2;p[S+(d+4)>>2]=n|1;p[S+(n+d)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;r=628+(e<<2)|0;i=p[147]|0;t=1<<t;do if(!(i&t)){p[147]=i|t;B=628+(e+2<<2)|0;F=r}else{t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0>=(p[151]|0)>>>0){B=t;F=e;break}De()}while(0);p[B>>2]=f;p[F+12>>2]=f;p[S+(d+8)>>2]=F;p[S+(d+12)>>2]=r;break}t=n>>>8;do if(!t)r=0;else{if(n>>>0>16777215){r=31;break}B=(t+1048320|0)>>>16&8;F=t<<B;L=(F+520192|0)>>>16&4;F=F<<L;r=(F+245760|0)>>>16&2;r=14-(L|B|r)+(F<<r>>>15)|0;r=n>>>(r+7|0)&1|r<<1}while(0);t=892+(r<<2)|0;p[S+(d+28)>>2]=r;p[S+(d+20)>>2]=0;p[S+(d+16)>>2]=0;e=p[148]|0;i=1<<r;if(!(e&i)){p[148]=e|i;p[t>>2]=f;
p[S+(d+24)>>2]=t;p[S+(d+12)>>2]=f;p[S+(d+8)>>2]=f;break}t=p[t>>2]|0;i:do if((p[t+4>>2]&-8|0)!=(n|0)){r=n<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=p[e>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(n|0)){k=i;break i}else{r=r<<1;t=i}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=f;p[S+(d+24)>>2]=t;p[S+(d+12)>>2]=f;p[S+(d+8)>>2]=f;break t}}else k=t;while(0);t=k+8|0;e=p[t>>2]|0;F=p[151]|0;if(e>>>0>=F>>>0&k>>>0>=F>>>0){p[e+12>>2]=f;p[t>>2]=f;p[S+(d+8)>>2]=e;p[S+(d+12)>>2]=k;p[S+(d+24)>>2]=0;break}else De()}else{k=(p[150]|0)+c|0;p[150]=k;p[153]=f;p[S+(d+4)>>2]=k|1}while(0);k=S+(h|8)|0;return k|0}else i=1036;while(1){e=p[i>>2]|0;if(e>>>0<=a>>>0?(t=p[i+4>>2]|0,r=e+t|0,r>>>0>a>>>0):0)break;i=p[i+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0<n>>>0?a:e;t=e+8|0;i=S+8|0;i=(i&7|0)==0?0:0-i&7;k=m+-40-i|0;p[153]=S+i;p[150]=k;p[S+(i+4)>>2]=k|1;p[S+(m+-36)>>2]=40;p[154]=p[269];i=e+4|0;p[i>>2]=27;p[t>>2]=p[259];p[t+4>>2]=p[260];p[t+8>>2]=p[261];p[t+12>>2]=p[262];p[259]=S;p[260]=m;p[262]=0;p[261]=t;t=e+28|0;p[t>>2]=7;if((e+32|0)>>>0<r>>>0)do{k=t;t=t+4|0;p[t>>2]=7}while((k+8|0)>>>0<r>>>0);if((e|0)!=(a|0)){o=e-a|0;p[i>>2]=p[i>>2]&-2;p[a+4>>2]=o|1;p[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;r=628+(e<<2)|0;i=p[147]|0;t=1<<t;if(i&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{R=t;O=e}}else{p[147]=i|t;R=628+(e+2<<2)|0;O=r}p[R>>2]=a;p[O+12>>2]=a;p[a+8>>2]=O;p[a+12>>2]=r;break}t=o>>>8;if(t)if(o>>>0>16777215)r=31;else{F=(t+1048320|0)>>>16&8;k=t<<F;B=(k+520192|0)>>>16&4;k=k<<B;r=(k+245760|0)>>>16&2;r=14-(B|F|r)+(k<<r>>>15)|0;r=o>>>(r+7|0)&1|r<<1}else r=0;i=892+(r<<2)|0;p[a+28>>2]=r;p[a+20>>2]=0;p[n>>2]=0;t=p[148]|0;e=1<<r;if(!(t&e)){p[148]=t|e;p[i>>2]=a;p[a+24>>2]=i;p[a+12>>2]=a;p[a+8>>2]=a;break}t=p[i>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(o|0)){r=o<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=p[e>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(o|0)){N=i;break t}else{r=r<<1;t=i}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=a;p[a+24>>2]=t;p[a+12>>2]=a;p[a+8>>2]=a;break e}}else N=t;while(0);t=N+8|0;e=p[t>>2]|0;k=p[151]|0;if(e>>>0>=k>>>0&N>>>0>=k>>>0){p[e+12>>2]=a;p[t>>2]=a;p[a+8>>2]=e;p[a+12>>2]=N;p[a+24>>2]=0;break}else De()}}else{k=p[151]|0;if((k|0)==0|S>>>0<k>>>0)p[151]=S;p[259]=S;p[260]=m;p[262]=0;p[156]=p[265];p[155]=-1;t=0;do{k=t<<1;F=628+(k<<2)|0;p[628+(k+3<<2)>>2]=F;p[628+(k+2<<2)>>2]=F;t=t+1|0}while((t|0)!=32);k=S+8|0;k=(k&7|0)==0?0:0-k&7;F=m+-40-k|0;p[153]=S+k;p[150]=F;p[S+(k+4)>>2]=F|1;p[S+(m+-36)>>2]=40;p[154]=p[269]}while(0);t=p[150]|0;if(t>>>0>_>>>0){F=t-_|0;p[150]=F;k=p[153]|0;p[153]=k+_;p[k+(_+4)>>2]=F|1;p[k+4>>2]=_|3;k=k+8|0;return k|0}}k=li()|0;p[k>>2]=12;k=0;return k|0}function zi(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0,g=0,v=0,y=0,C=0;if(!e)return;t=e+-8|0;s=p[151]|0;if(t>>>0<s>>>0)De();i=p[e+-4>>2]|0;r=i&3;if((r|0)==1)De();f=i&-8;_=e+(f+-8)|0;do if(!(i&1)){t=p[t>>2]|0;if(!r)return;l=-8-t|0;c=e+l|0;d=t+f|0;if(c>>>0<s>>>0)De();if((c|0)==(p[152]|0)){t=e+(f+-4)|0;i=p[t>>2]|0;if((i&3|0)!=3){C=c;o=d;break}p[149]=d;p[t>>2]=i&-2;p[e+(l+4)>>2]=d|1;p[_>>2]=d;return}n=t>>>3;if(t>>>0<256){r=p[e+(l+8)>>2]|0;i=p[e+(l+12)>>2]|0;t=628+(n<<1<<2)|0;if((r|0)!=(t|0)){if(r>>>0<s>>>0)De();if((p[r+12>>2]|0)!=(c|0))De()}if((i|0)==(r|0)){p[147]=p[147]&~(1<<n);C=c;o=d;break}if((i|0)!=(t|0)){if(i>>>0<s>>>0)De();t=i+8|0;if((p[t>>2]|0)==(c|0))a=t;else De()}else a=i+8|0;p[r+12>>2]=i;p[a>>2]=r;C=c;o=d;break}a=p[e+(l+24)>>2]|0;r=p[e+(l+12)>>2]|0;do if((r|0)==(c|0)){i=e+(l+20)|0;t=p[i>>2]|0;if(!t){i=e+(l+16)|0;t=p[i>>2]|0;if(!t){u=0;break}}while(1){r=t+20|0;n=p[r>>2]|0;if(n){t=n;i=r;continue}r=t+16|0;n=p[r>>2]|0;if(!n)break;else{t=n;i=r}}if(i>>>0<s>>>0)De();else{p[i>>2]=0;u=t;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)De();t=n+12|0;if((p[t>>2]|0)!=(c|0))De();i=r+8|0;if((p[i>>2]|0)==(c|0)){p[t>>2]=r;p[i>>2]=n;u=r;break}else De()}while(0);if(a){t=p[e+(l+28)>>2]|0;i=892+(t<<2)|0;if((c|0)==(p[i>>2]|0)){p[i>>2]=u;if(!u){p[148]=p[148]&~(1<<t);C=c;o=d;break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(c|0))p[t>>2]=u;else p[a+20>>2]=u;if(!u){C=c;o=d;break}}i=p[151]|0;if(u>>>0<i>>>0)De();p[u+24>>2]=a;t=p[e+(l+16)>>2]|0;do if(t)if(t>>>0<i>>>0)De();else{p[u+16>>2]=t;p[t+24>>2]=u;break}while(0);t=p[e+(l+20)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[u+20>>2]=t;p[t+24>>2]=u;C=c;o=d;break}else{C=c;o=d}}else{C=c;o=d}}else{C=t;o=f}while(0);if(C>>>0>=_>>>0)De();t=e+(f+-4)|0;i=p[t>>2]|0;if(!(i&1))De();if(!(i&2)){if((_|0)==(p[153]|0)){y=(p[150]|0)+o|0;p[150]=y;p[153]=C;p[C+4>>2]=y|1;if((C|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((_|0)==(p[152]|0)){y=(p[149]|0)+o|0;p[149]=y;p[152]=C;p[C+4>>2]=y|1;p[C+y>>2]=y;return}o=(i&-8)+o|0;n=i>>>3;do if(i>>>0>=256){a=p[e+(f+16)>>2]|0;t=p[e+(f|4)>>2]|0;do if((t|0)==(_|0)){i=e+(f+12)|0;t=p[i>>2]|0;if(!t){i=e+(f+8)|0;t=p[i>>2]|0;if(!t){m=0;break}}while(1){r=t+20|0;n=p[r>>2]|0;if(n){t=n;i=r;continue}r=t+16|0;n=p[r>>2]|0;if(!n)break;else{t=n;i=r}}if(i>>>0<(p[151]|0)>>>0)De();else{p[i>>2]=0;m=t;break}}else{i=p[e+f>>2]|0;if(i>>>0<(p[151]|0)>>>0)De();r=i+12|0;if((p[r>>2]|0)!=(_|0))De();n=t+8|0;if((p[n>>2]|0)==(_|0)){p[r>>2]=t;p[n>>2]=i;m=t;break}else De()}while(0);if(a){t=p[e+(f+20)>>2]|0;i=892+(t<<2)|0;if((_|0)==(p[i>>2]|0)){p[i>>2]=m;if(!m){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(_|0))p[t>>2]=m;else p[a+20>>2]=m;if(!m)break}i=p[151]|0;if(m>>>0<i>>>0)De();p[m+24>>2]=a;t=p[e+(f+8)>>2]|0;do if(t)if(t>>>0<i>>>0)De();else{p[m+16>>2]=t;p[t+24>>2]=m;break}while(0);t=p[e+(f+12)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[m+20>>2]=t;p[t+24>>2]=m;break}}}else{r=p[e+f>>2]|0;i=p[e+(f|4)>>2]|0;t=628+(n<<1<<2)|0;if((r|0)!=(t|0)){if(r>>>0<(p[151]|0)>>>0)De();if((p[r+12>>2]|0)!=(_|0))De()}if((i|0)==(r|0)){p[147]=p[147]&~(1<<n);break}if((i|0)!=(t|0)){if(i>>>0<(p[151]|0)>>>0)De();t=i+8|0;if((p[t>>2]|0)==(_|0))h=t;else De()}else h=i+8|0;p[r+12>>2]=i;p[h>>2]=r}while(0);p[C+4>>2]=o|1;p[C+o>>2]=o;if((C|0)==(p[152]|0)){p[149]=o;return}}else{p[t>>2]=i&-2;p[C+4>>2]=o|1;p[C+o>>2]=o}t=o>>>3;if(o>>>0<256){i=t<<1;n=628+(i<<2)|0;r=p[147]|0;t=1<<t;if(r&t){t=628+(i+2<<2)|0;i=p[t>>2]|0;if(i>>>0<(p[151]|0)>>>0)De();else{g=t;v=i}}else{p[147]=r|t;g=628+(i+2<<2)|0;v=n}p[g>>2]=C;p[v+12>>2]=C;p[C+8>>2]=v;p[C+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{g=(t+1048320|0)>>>16&8;v=t<<g;_=(v+520192|0)>>>16&4;v=v<<_;n=(v+245760|0)>>>16&2;n=14-(_|g|n)+(v<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=892+(n<<2)|0;p[C+28>>2]=n;p[C+20>>2]=0;p[C+16>>2]=0;i=p[148]|0;r=1<<n;e:do if(i&r){t=p[t>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){i=t+16+(n>>>31<<2)|0;r=p[i>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(o|0)){y=r;break t}else{n=n<<1;t=r}}if(i>>>0<(p[151]|0)>>>0)De();else{p[i>>2]=C;p[C+24>>2]=t;p[C+12>>2]=C;p[C+8>>2]=C;break e}}else y=t;while(0);t=y+8|0;i=p[t>>2]|0;v=p[151]|0;if(i>>>0>=v>>>0&y>>>0>=v>>>0){p[i+12>>2]=C;p[t>>2]=C;p[C+8>>2]=i;p[C+12>>2]=y;p[C+24>>2]=0;break}else De()}else{p[148]=i|r;p[t>>2]=C;p[C+24>>2]=t;p[C+12>>2]=C;p[C+8>>2]=C}while(0);C=(p[155]|0)+-1|0;p[155]=C;if(!C)t=1044;else return;while(1){t=p[t>>2]|0;if(!t)break;else t=t+8|0}p[155]=-1;return}function Ui(e,t){e=e|0;t=t|0;var i=0,r=0;if(!e){e=Vi(t)|0;return e|0}if(t>>>0>4294967231){e=li()|0;p[e>>2]=12;e=0;return e|0}i=Hi(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(i){e=i+8|0;return e|0}i=Vi(t)|0;if(!i){e=0;return e|0}r=p[e+-4>>2]|0;r=(r&-8)-((r&3|0)==0?8:4)|0;Qi(i|0,e|0,(r>>>0<t>>>0?r:t)|0)|0;zi(e);e=i;return e|0}function Gi(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=p[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Hi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;f=e+4|0;m=p[f>>2]|0;l=m&-8;c=e+l|0;s=p[151]|0;i=m&3;if(!((i|0)!=1&e>>>0>=s>>>0&e>>>0<c>>>0))De();r=e+(l|4)|0;n=p[r>>2]|0;if(!(n&1))De();if(!i){if(t>>>0<256){e=0;return e|0}if(l>>>0>=(t+4|0)>>>0?(l-t|0)>>>0<=p[267]<<1>>>0:0)return e|0;e=0;return e|0}if(l>>>0>=t>>>0){i=l-t|0;if(i>>>0<=15)return e|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=i|3;p[r>>2]=p[r>>2]|1;Wi(e+t|0,i);return e|0}if((c|0)==(p[153]|0)){i=(p[150]|0)+l|0;if(i>>>0<=t>>>0){e=0;return e|0}h=i-t|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|1;p[153]=e+t;p[150]=h;return e|0}if((c|0)==(p[152]|0)){r=(p[149]|0)+l|0;if(r>>>0<t>>>0){e=0;return e|0}i=r-t|0;if(i>>>0>15){p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=i|1;p[e+r>>2]=i;r=e+(r+4)|0;p[r>>2]=p[r>>2]&-2;r=e+t|0}else{p[f>>2]=m&1|r|2;r=e+(r+4)|0;p[r>>2]=p[r>>2]|1;r=0;i=0}p[149]=i;p[152]=r;return e|0}if(n&2){e=0;return e|0}d=(n&-8)+l|0;if(d>>>0<t>>>0){e=0;return e|0}h=d-t|0;o=n>>>3;do if(n>>>0>=256){a=p[e+(l+24)>>2]|0;o=p[e+(l+12)>>2]|0;do if((o|0)==(c|0)){r=e+(l+20)|0;i=p[r>>2]|0;if(!i){r=e+(l+16)|0;i=p[r>>2]|0;if(!i){u=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<s>>>0)De();else{p[r>>2]=0;u=i;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)De();i=n+12|0;if((p[i>>2]|0)!=(c|0))De();r=o+8|0;if((p[r>>2]|0)==(c|0)){p[i>>2]=o;p[r>>2]=n;u=o;break}else De()}while(0);if(a){i=p[e+(l+28)>>2]|0;r=892+(i<<2)|0;if((c|0)==(p[r>>2]|0)){p[r>>2]=u;if(!u){p[148]=p[148]&~(1<<i);break}}else{if(a>>>0<(p[151]|0)>>>0)De();i=a+16|0;if((p[i>>2]|0)==(c|0))p[i>>2]=u;else p[a+20>>2]=u;if(!u)break}r=p[151]|0;if(u>>>0<r>>>0)De();p[u+24>>2]=a;i=p[e+(l+16)>>2]|0;do if(i)if(i>>>0<r>>>0)De();else{p[u+16>>2]=i;p[i+24>>2]=u;break}while(0);i=p[e+(l+20)>>2]|0;if(i)if(i>>>0<(p[151]|0)>>>0)De();else{p[u+20>>2]=i;p[i+24>>2]=u;break}}}else{n=p[e+(l+8)>>2]|0;r=p[e+(l+12)>>2]|0;i=628+(o<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0<s>>>0)De();if((p[n+12>>2]|0)!=(c|0))De()}if((r|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((r|0)!=(i|0)){if(r>>>0<s>>>0)De();i=r+8|0;if((p[i>>2]|0)==(c|0))a=i;else De()}else a=r+8|0;p[n+12>>2]=r;p[a>>2]=n}while(0);if(h>>>0<16){p[f>>2]=d|m&1|2;t=e+(d|4)|0;p[t>>2]=p[t>>2]|1;return e|0}else{p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|3;m=e+(d|4)|0;p[m>>2]=p[m>>2]|1;Wi(e+t|0,h);return e|0}return 0}function Wi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0,g=0,v=0,y=0;_=e+t|0;i=p[e+4>>2]|0;do if(!(i&1)){u=p[e>>2]|0;if(!(i&3))return;h=e+(0-u)|0;d=u+t|0;l=p[151]|0;if(h>>>0<l>>>0)De();if((h|0)==(p[152]|0)){r=e+(t+4)|0;i=p[r>>2]|0;if((i&3|0)!=3){y=h;a=d;break}p[149]=d;p[r>>2]=i&-2;p[e+(4-u)>>2]=d|1;p[_>>2]=d;return}o=u>>>3;if(u>>>0<256){n=p[e+(8-u)>>2]|0;r=p[e+(12-u)>>2]|0;i=628+(o<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0<l>>>0)De();if((p[n+12>>2]|0)!=(h|0))De()}if((r|0)==(n|0)){p[147]=p[147]&~(1<<o);y=h;a=d;break}if((r|0)!=(i|0)){if(r>>>0<l>>>0)De();i=r+8|0;if((p[i>>2]|0)==(h|0))s=i;else De()}else s=r+8|0;p[n+12>>2]=r;p[s>>2]=n;y=h;a=d;break}s=p[e+(24-u)>>2]|0;n=p[e+(12-u)>>2]|0;do if((n|0)==(h|0)){n=16-u|0;r=e+(n+4)|0;i=p[r>>2]|0;if(!i){r=e+n|0;i=p[r>>2]|0;if(!i){c=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<l>>>0)De();else{p[r>>2]=0;c=i;break}}else{o=p[e+(8-u)>>2]|0;if(o>>>0<l>>>0)De();i=o+12|0;if((p[i>>2]|0)!=(h|0))De();r=n+8|0;if((p[r>>2]|0)==(h|0)){p[i>>2]=n;p[r>>2]=o;c=n;break}else De()}while(0);if(s){i=p[e+(28-u)>>2]|0;r=892+(i<<2)|0;if((h|0)==(p[r>>2]|0)){p[r>>2]=c;if(!c){p[148]=p[148]&~(1<<i);y=h;a=d;break}}else{if(s>>>0<(p[151]|0)>>>0)De();i=s+16|0;if((p[i>>2]|0)==(h|0))p[i>>2]=c;else p[s+20>>2]=c;if(!c){y=h;a=d;break}}n=p[151]|0;if(c>>>0<n>>>0)De();p[c+24>>2]=s;i=16-u|0;r=p[e+i>>2]|0;do if(r)if(r>>>0<n>>>0)De();else{p[c+16>>2]=r;p[r+24>>2]=c;break}while(0);i=p[e+(i+4)>>2]|0;if(i)if(i>>>0<(p[151]|0)>>>0)De();else{p[c+20>>2]=i;p[i+24>>2]=c;y=h;a=d;break}else{y=h;a=d}}else{y=h;a=d}}else{y=e;a=t}while(0);l=p[151]|0;if(_>>>0<l>>>0)De();i=e+(t+4)|0;r=p[i>>2]|0;if(!(r&2)){if((_|0)==(p[153]|0)){v=(p[150]|0)+a|0;p[150]=v;p[153]=y;p[y+4>>2]=v|1;if((y|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((_|0)==(p[152]|0)){v=(p[149]|0)+a|0;p[149]=v;p[152]=y;p[y+4>>2]=v|1;p[y+v>>2]=v;return}a=(r&-8)+a|0;o=r>>>3;do if(r>>>0>=256){s=p[e+(t+24)>>2]|0;n=p[e+(t+12)>>2]|0;do if((n|0)==(_|0)){r=e+(t+20)|0;i=p[r>>2]|0;if(!i){r=e+(t+16)|0;i=p[r>>2]|0;if(!i){m=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<l>>>0)De();else{p[r>>2]=0;m=i;break}}else{o=p[e+(t+8)>>2]|0;if(o>>>0<l>>>0)De();i=o+12|0;if((p[i>>2]|0)!=(_|0))De();r=n+8|0;if((p[r>>2]|0)==(_|0)){p[i>>2]=n;p[r>>2]=o;m=n;break}else De()}while(0);if(s){i=p[e+(t+28)>>2]|0;r=892+(i<<2)|0;if((_|0)==(p[r>>2]|0)){p[r>>2]=m;if(!m){p[148]=p[148]&~(1<<i);break}}else{if(s>>>0<(p[151]|0)>>>0)De();i=s+16|0;if((p[i>>2]|0)==(_|0))p[i>>2]=m;else p[s+20>>2]=m;if(!m)break}r=p[151]|0;if(m>>>0<r>>>0)De();p[m+24>>2]=s;i=p[e+(t+16)>>2]|0;do if(i)if(i>>>0<r>>>0)De();else{p[m+16>>2]=i;p[i+24>>2]=m;break}while(0);i=p[e+(t+20)>>2]|0;if(i)if(i>>>0<(p[151]|0)>>>0)De();else{p[m+20>>2]=i;p[i+24>>2]=m;break}}}else{n=p[e+(t+8)>>2]|0;r=p[e+(t+12)>>2]|0;i=628+(o<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0<l>>>0)De();if((p[n+12>>2]|0)!=(_|0))De()}if((r|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((r|0)!=(i|0)){if(r>>>0<l>>>0)De();i=r+8|0;if((p[i>>2]|0)==(_|0))f=i;else De()}else f=r+8|0;p[n+12>>2]=r;p[f>>2]=n}while(0);p[y+4>>2]=a|1;p[y+a>>2]=a;if((y|0)==(p[152]|0)){p[149]=a;return}}else{p[i>>2]=r&-2;p[y+4>>2]=a|1;p[y+a>>2]=a}i=a>>>3;if(a>>>0<256){r=i<<1;o=628+(r<<2)|0;n=p[147]|0;i=1<<i;if(n&i){i=628+(r+2<<2)|0;r=p[i>>2]|0;if(r>>>0<(p[151]|0)>>>0)De();else{g=i;v=r}}else{p[147]=n|i;g=628+(r+2<<2)|0;v=o}p[g>>2]=y;p[v+12>>2]=y;p[y+8>>2]=v;p[y+12>>2]=o;return}i=a>>>8;if(i)if(a>>>0>16777215)o=31;else{g=(i+1048320|0)>>>16&8;v=i<<g;_=(v+520192|0)>>>16&4;v=v<<_;o=(v+245760|0)>>>16&2;o=14-(_|g|o)+(v<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;i=892+(o<<2)|0;p[y+28>>2]=o;p[y+20>>2]=0;p[y+16>>2]=0;r=p[148]|0;n=1<<o;if(!(r&n)){p[148]=r|n;p[i>>2]=y;p[y+24>>2]=i;p[y+12>>2]=y;p[y+8>>2]=y;return}i=p[i>>2]|0;e:do if((p[i+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){r=i+16+(o>>>31<<2)|0;n=p[r>>2]|0;if(!n)break;if((p[n+4>>2]&-8|0)==(a|0)){i=n;break e}else{o=o<<1;i=n}}if(r>>>0<(p[151]|0)>>>0)De();p[r>>2]=y;p[y+24>>2]=i;p[y+12>>2]=y;p[y+8>>2]=y;return}while(0);r=i+8|0;n=p[r>>2]|0;v=p[151]|0;if(!(n>>>0>=v>>>0&i>>>0>=v>>>0))De();p[n+12>>2]=y;p[r>>2]=y;p[y+8>>2]=n;p[y+12>>2]=i;p[y+24>>2]=0;return}function qi(){}function ji(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;r=t-r-(i>>>0>e>>>0|0)>>>0;return(z=r,e-i>>>0|0)|0}function Yi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;i=e+i>>>0;return(z=t+r+(i>>>0<e>>>0|0)>>>0,i|0)|0}function Xi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;r=e+i|0;if((i|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=r&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){d[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){p[e>>2]=a;e=e+4|0}}while((e|0)<(r|0)){d[e>>0]=t;e=e+1|0}return e-i|0}function Zi(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){z=t>>>i;return e>>>i|(t&(1<<i)-1)<<32-i}z=0;return t>>>i-32|0}function Ki(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){z=t<<i|(e&(1<<i)-1<<32-i)>>>32-i;return e<<i}z=e<<i-32;return 0}function Qi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if((i|0)>=4096)return Be(e|0,t|0,i|0)|0;r=e|0;if((e&3)==(t&3)){while(e&3){if(!i)return r|0;d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;i=i-1|0}while((i|0)>=4){p[e>>2]=p[t>>2];e=e+4|0;t=t+4|0;i=i-4|0}}while((i|0)>0){d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;i=i-1|0}return r|0}function Ji(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){z=t>>i;return e>>>i|(t&(1<<i)-1)<<32-i}z=(t|0)<0?-1:0;return t>>i-32|0}function $i(e){e=e|0;var t=0;t=d[b+(e&255)>>0]|0;if((t|0)<8)return t|0;t=d[b+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=d[b+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(d[b+(e>>>24)>>0]|0)+24|0}function er(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0;o=e&65535;n=t&65535;i=ce(n,o)|0;r=e>>>16;e=(i>>>16)+(ce(n,r)|0)|0;n=t>>>16;t=ce(n,o)|0;return(z=(e>>>16)+(ce(n,r)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|i&65535|0)|0}function tr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=t>>31|((t|0)<0?-1:0)<<1;l=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=r>>31|((r|0)<0?-1:0)<<1;n=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;s=ji(u^e,l^t,u,l)|0;a=z;e=o^u;t=n^l;return ji((ar(s,a,ji(o^i,n^r,o,n)|0,z,0)|0)^e,z^t,e,t)|0}function ir(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0;n=C;C=C+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=r>>31|((r|0)<0?-1:0)<<1;l=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;e=ji(a^e,o^t,a,o)|0;t=z;ar(e,t,ji(u^i,l^r,u,l)|0,z,s)|0;r=ji(p[s>>2]^a,p[s+4>>2]^o,a,o)|0;i=z;C=n;return(z=i,r)|0}function rr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0;n=e;o=i;i=er(n,o)|0;e=z;return(z=(ce(t,o)|0)+(ce(r,n)|0)+e|e&0,i|0|0)|0}function nr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;return ar(e,t,i,r,0)|0}function or(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0;o=C;C=C+16|0;n=o|0;ar(e,t,i,r,n)|0;C=o;return(z=p[n+4>>2]|0,p[n>>2]|0)|0}function ar(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;c=e;l=t;u=l;a=i;h=r;s=h;if(!u){o=(n|0)!=0;if(!s){if(o){p[n>>2]=(c>>>0)%(a>>>0);p[n+4>>2]=0}h=0;n=(c>>>0)/(a>>>0)>>>0;return(z=h,n)|0}else{if(!o){h=0;n=0;return(z=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=t&0;h=0;n=0;return(z=h,n)|0}}o=(s|0)==0;do if(a){if(!o){o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=31){d=o+1|0;s=31-o|0;t=o-31>>31;a=d;e=c>>>(d>>>0)&t|u<<s;t=u>>>(d>>>0)&t;o=0;s=c<<s;break}if(!n){h=0;n=0;return(z=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;h=0;n=0;return(z=h,n)|0}o=a-1|0;if(o&a){s=(he(a|0)|0)+33-(he(u|0)|0)|0;m=64-s|0;d=32-s|0;l=d>>31;f=s-32|0;t=f>>31;a=s;e=d-1>>31&u>>>(f>>>0)|(u<<d|c>>>(s>>>0))&t;t=t&u>>>(s>>>0);o=c<<m&l;s=(u<<m|c>>>(f>>>0))&l|c<<d&s-33>>31;break}if(n){p[n>>2]=o&c;p[n+4>>2]=0}if((a|0)==1){f=l|t&0;m=e|0|0;return(z=f,m)|0}else{m=$i(a|0)|0;f=u>>>(m>>>0)|0;m=u<<32-m|c>>>(m>>>0)|0;return(z=f,m)|0}}else{if(o){if(n){p[n>>2]=(u>>>0)%(a>>>0);p[n+4>>2]=0}f=0;m=(u>>>0)/(a>>>0)>>>0;return(z=f,m)|0}if(!c){if(n){p[n>>2]=0;p[n+4>>2]=(u>>>0)%(s>>>0)}f=0;m=(u>>>0)/(s>>>0)>>>0;return(z=f,m)|0}o=s-1|0;if(!(o&s)){if(n){p[n>>2]=e|0;p[n+4>>2]=o&u|t&0}f=0;m=u>>>(($i(s|0)|0)>>>0);return(z=f,m)|0}o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=u<<s|c>>>(t>>>0);t=u>>>(t>>>0);o=0;s=c<<s;break}if(!n){f=0;m=0;return(z=f,m)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;f=0;m=0;return(z=f,m)|0}while(0);if(!a){u=s;l=0;s=0}else{d=i|0|0;c=h|r&0;u=Yi(d|0,c|0,-1,-1)|0;i=z;l=s;s=0;do{r=l;l=o>>>31|l<<1;o=s|o<<1;r=e<<1|r>>>31|0;h=e>>>31|t<<1|0;ji(u,i,r,h)|0;m=z;f=m>>31|((m|0)<0?-1:0)<<1;s=f&1;e=ji(r,h,f&d,(((m|0)<0?-1:0)>>31|((m|0)<0?-1:0)<<1)&c)|0;t=z;a=a-1|0}while((a|0)!=0);u=l;l=0}a=0;if(n){p[n>>2]=e;p[n+4>>2]=t}f=(o|0)>>>31|(u|a)<<1|(a<<1|o>>>31)&0|l;m=(o<<1|0>>>31)&-2|s;return(z=f,m)|0}function sr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;return Er[e&7](t|0,i|0,r|0)|0}function lr(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;br[e&3](t|0,i|0,r|0,n|0,o|0)}function ur(e,t){e=e|0;t=t|0;Tr[e&7](t|0)}function cr(e,t){e=e|0;t=t|0;return xr[e&1](t|0)|0}function dr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;Ar[e&0](t|0,i|0,r|0)}function hr(e){e=e|0;Pr[e&3]()}function pr(e,t,i,r,n,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;Dr[e&3](t|0,i|0,r|0,n|0,o|0,a|0)}function fr(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;Mr[e&3](t|0,i|0,r|0,n|0)}function mr(e,t,i){e=e|0;t=t|0;i=i|0;pe(0);return 0}function _r(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;pe(1)}function gr(e){e=e|0;pe(2)}function vr(e){e=e|0;pe(3);return 0}function yr(e,t,i){e=e|0;t=t|0;i=i|0;pe(4)}function Cr(){pe(5)}function wr(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;pe(6)}function Sr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;pe(7)}var Er=[mr,jt,Li,Pi,Ai,Di,mr,mr];var br=[_r,$t,Jt,_r];var Tr=[gr,Ut,Wt,Gt,Ht,qt,ai,Ni];var xr=[vr,xi];var Ar=[yr];var Pr=[Cr,ni,oi,Cr];var Dr=[wr,ti,ei,wr];var Mr=[Sr,Xt,Zt,Sr];return{___cxa_can_catch:ii,_crn_get_levels:Ct,_crn_get_uncompressed_size:Et,_crn_decompress:bt,_i64Add:Yi,_crn_get_width:vt,___cxa_is_pointer_type:ri,_crn_get_bytes_per_block:St,_memset:Xi,_malloc:Vi,_memcpy:Qi,_i64Subtract:ji,_bitshift64Lshr:Zi,_free:zi,_bitshift64Shl:Ki,_crn_get_height:yt,_crn_get_dxt_format:wt,runPostSets:qi,_emscripten_replace_memory:qe,stackAlloc:je,stackSave:Ye,stackRestore:Xe,establishStackSpace:Ze,setThrew:Ke,setTempRet0:$e,getTempRet0:et,dynCall_iiii:sr,dynCall_viiiii:lr,dynCall_vi:ur,dynCall_ii:cr,dynCall_viii:dr,dynCall_v:hr,dynCall_viiiiii:pr,dynCall_viiii:fr}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,runPostSets=Module.runPostSets=asm.runPostSets,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_i64Add=Module._i64Add=asm._i64Add,_crn_get_height=Module._crn_get_height=asm._crn_get_height,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_free=Module._free=asm._free,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function t(){for(var e=0;e<3;e++)r.push(0)}assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ensureInitRuntime();var i=e.length+1,r=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var n=0;n<i-1;n+=1)r.push(allocate(intArrayFromString(e[n]),"i8",ALLOC_NORMAL)),t();r.push(0),r=allocate(r,"i32",ALLOC_NORMAL);try{var o=Module._main(i,r,0);exit(o,!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),function(){!function(e){var t=this||(0,eval)("this"),i=t.document,r=t.navigator,n=t.jQuery,o=t.JSON;!function(e){"function"==typeof define&&define.amd?define("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(a,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=m.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=m.a.setTimeout(e,t)}}function d(e,t){t&&t!==g?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function h(e,t){null!==t&&t.k&&t.k()}function p(e,t){var i=this.Hc,r=i[S];r.R||(this.lb&&this.Ma[t]?(i.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):r.r[t]||i.Pb(t,e,r.s?{ia:e}:i.uc(e)))}function f(e,t,i,r){m.d[e]={init:function(e,n,o,a,s){var l,u;return m.m(function(){var o=m.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&m.va.Aa()&&(u=m.a.ua(m.f.childNodes(e),!0)),a?(c||m.f.da(e,m.a.ua(u)),m.eb(r?r(s,o):s,e)):m.f.xa(e),l=a)},null,{i:e}),{controlsDescendantBindings:!0}}},m.h.ta[e]=!1,m.f.Z[e]=!0}var m="undefined"!=typeof a?a:{};m.b=function(e,t){for(var i=e.split("."),r=m,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},m.G=function(e,t,i){e[t]=i},m.version="3.4.0",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1},m.a=function(){function a(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(g)||[];m.a.q(i.match(g),function(e){m.a.pa(n,e,r)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,h={},p={};h[r&&/Firefox\/2/i.test(r.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(h,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=e});var f={propertychange:!0},_=i&&function(){for(var t=3,r=i.createElement("div"),n=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),g=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var i=0,r=e.length;i<r;i++)t(e[i],i)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Sb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r))return e[r];return null},La:function(e,t){var i=m.a.o(e,t);0<i?e.splice(i,1):0===i&&e.shift()},Tb:function(e){e=e||[];for(var t=[],i=0,r=e.length;i<r;i++)0>m.a.o(t,e[i])&&t.push(e[i]);return t},fb:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)i.push(t(e[r],r));return i},Ka:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)t(e[r],r)&&i.push(e[r]);return i},ra:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},pa:function(e,t,i){var r=m.a.o(m.a.zb(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:a,Ca:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},ob:function(e){for(;e.firstChild;)m.removeNode(e.firstChild)},jc:function(e){e=m.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||i).createElement("div"),r=0,n=e.length;r<n;r++)t.appendChild(m.$(e[r]));return t},ua:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?m.$(o):o)}return n},da:function(e,t){if(m.a.ob(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},qc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)m.removeNode(i[o])}},za:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},sc:function(e,t){7>_?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return m.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!m.a.Sb(e,m.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return m.onError?function(){try{return e.apply(this,arguments)}catch(e){throw m.onError&&m.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(m.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw m.onError&&m.onError(e),e},0)},p:function(e,t,i){var r=m.a.Wb(i);if(i=_&&f[t],m.options.useOnlyNativeEvents||i||!n)if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,o),m.a.F.oa(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,r,!1);else n(e).bind(t,r)},Da:function(e,r){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===m.a.A(e)&&e.type&&"click"==r.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,m.options.useOnlyNativeEvents||!n||o)if("function"==typeof i.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=i.createEvent(p[r]||"HTMLEvents"),o.initEvent(r,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+r)}else n(e).trigger(r)},c:function(e){return m.H(e)?e():e},zb:function(e){return m.H(e)?e.t():e},bb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],m.a.q(t.match(g),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Za:function(t,i){var r=m.a.c(i);null!==r&&r!==e||(r="");var n=m.f.firstChild(t);!n||3!=n.nodeType||m.f.nextSibling(n)?m.f.da(t,[t.ownerDocument.createTextNode(r)]):n.data=r,m.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=_)try{e.mergeAttributes(i.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=_&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(_){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=m.a.c(e),t=m.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},V:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Yb:function(e){return d?Symbol(e):e},rd:6===_,sd:7===_,C:_,ec:function(e,t){for(var i=m.a.V(e.getElementsByTagName("input")).concat(m.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},ed:function(e){return"string"==typeof e&&(e=m.a.$a(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},Eb:function(e,t,i){if(!o||!o.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 o.stringify(m.a.c(e),t,i)},fd:function(e,t,r){r=r||{};var n=r.params||{},o=r.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===m.a.A(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var u=m.a.ec(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value;t=m.a.c(t);var d=i.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var h in t)e=i.createElement("input"),e.type="hidden",e.name=h,e.value=m.a.Eb(m.a.c(t[h])),d.appendChild(e);a(n,function(e,t){var r=i.createElement("input");r.type="hidden",r.name=e,r.value=t,d.appendChild(r)}),i.body.appendChild(d),r.submitter?r.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.q),m.b("utils.arrayFirst",m.a.Sb),m.b("utils.arrayFilter",m.a.Ka),m.b("utils.arrayGetDistinctValues",m.a.Tb),m.b("utils.arrayIndexOf",m.a.o),m.b("utils.arrayMap",m.a.fb),m.b("utils.arrayPushAll",m.a.ra),m.b("utils.arrayRemoveItem",m.a.La),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.cc),m.b("utils.getFormFields",m.a.ec),
m.b("utils.peekObservable",m.a.zb),m.b("utils.postJson",m.a.fd),m.b("utils.parseJson",m.a.ed),m.b("utils.registerEventHandler",m.a.p),m.b("utils.stringifyJson",m.a.Eb),m.b("utils.range",m.a.hd),m.b("utils.toggleDomNodeCssClass",m.a.bb),m.b("utils.triggerEvent",m.a.Da),m.b("utils.unwrapObservable",m.a.c),m.b("utils.objectForEach",m.a.D),m.b("utils.addOrRemoveItem",m.a.pa),m.b("utils.setTextContent",m.a.Za),m.b("unwrap",m.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),m.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){n===e&&t(i,!1)===e||(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return!!t&&(delete n[t],e[r]=null,!0)},I:function(){return i++ +r}}},m.b("utils.domData",m.a.e),m.b("utils.domData.clear",m.a.e.clear),m.a.F=new function(){function t(t,i){var n=m.a.e.get(t,r);return n===e&&i&&(n=[],m.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(m.a.e.clear(e),m.a.F.cleanExternalData(e),a[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=m.a.e.I(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},pc:function(i,n){var o=t(i,!1);o&&(m.a.La(o,n),0==o.length&&m.a.e.set(i,r,e))},$:function(e){if(o[e.nodeType]&&(i(e),a[e.nodeType])){var t=[];m.a.ra(t,e.getElementsByTagName("*"));for(var r=0,n=t.length;r<n;r++)i(t[r])}return e},removeNode:function(e){m.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},m.$=m.a.F.$,m.removeNode=m.a.F.removeNode,m.b("cleanNode",m.$),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.F),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.F.oa),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.F.pc),function(){var r=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=m.a.C;m.a.ma=function(e,o){var a;if(n){if(n.parseHTML)a=n.parseHTML(e,o)||[];else if((a=n.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=i);var c,s=a.parentWindow||a.defaultView||t,d=m.a.$a(e).toLowerCase(),h=a.createElement("div");for(c=(d=d.match(/^<([a-z]+)[ >]/))&&l[d[1]]||r,d=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?h.appendChild(s.innerShiv(c)):(u&&a.appendChild(h),h.innerHTML=c,u&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=m.a.V(h.lastChild.childNodes)}return a},m.a.Cb=function(t,i){if(m.a.ob(t),i=m.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),n)n(t).html(i);else for(var r=m.a.ma(i,t.ownerDocument),o=0;o<r.length;o++)t.appendChild(r[o])}}(),m.b("utils.parseHtmlFragment",m.a.ma),m.b("utils.setHtml",m.a.Cb),m.M=function(){function t(e,i){if(e)if(8==e.nodeType){var r=m.M.lc(e.nodeValue);null!=r&&i.push({Lc:e,cd:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{wb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},xc:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},yc:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].Lc,s=[a];i&&m.a.ra(s,i),m.M.xc(r[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),m.b("memoization",m.M),m.b("memoization.memoize",m.M.wb),m.b("memoization.unmemoize",m.M.xc),m.b("memoization.parseMemoText",m.M.lc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.M.yc),m.Y=function(){function e(){if(o)for(var e,t=o,i=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++i){s=o,m.a.$b(Error("'Too much recursion' after processing "+i+" task groups."));break}t=o}try{e()}catch(e){m.a.$b(e)}}}function r(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=i.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(r):i&&"onreadystatechange"in i.createElement("script")?function(e){var t=i.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,i.documentElement.removeChild(t),t=null,e()},i.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||m.Y.scheduler(r),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),m.b("tasks",m.Y),m.b("tasks.schedule",m.Y.Wa),m.b("tasks.runEarly",m.Y.md),m.ya={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return m.B({read:e,write:function(r){clearTimeout(i),i=m.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.cb=!1,n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(i){var r;return function(){m.Y.cancel(r),r=m.Y.Wa(i),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.ya),m.vc=function(e,t,i){this.ia=e,this.gb=t,this.Kc=i,this.R=!1,m.G(this,"dispose",this.k)},m.vc.prototype.k=function(){this.R=!0,this.Kc()},m.J=function(){m.a.Ya(this,v),v.rb(this)};var g="change",v={rb:function(e){e.K={},e.Nb=1},X:function(e,t,i){var r=this;i=i||g;var n=new m.vc(r,t?e.bind(t):e,function(){m.a.La(r.K[i],n),r.Ia&&r.Ia(i)});return r.sa&&r.sa(i),r.K[i]||(r.K[i]=[]),r.K[i].push(n),n},notifySubscribers:function(e,t){if(t=t||g,t===g&&this.zc(),this.Pa(t))try{m.l.Ub();for(var i,r=this.K[t].slice(0),n=0;i=r[n];++n)i.R||i.gb(e)}finally{m.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,i,r,n=this,o=m.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=d);var a=e(function(){n.Mb=!1,o&&r===n&&(r=n()),t=!1,n.tb(i,r)&&n.Ha(i=r)});n.Lb=function(e){n.Mb=t=!0,r=e,a()},n.Kb=function(e){t||(i=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return m.a.D(this.K,function(e,i){"dirty"!==e&&(t+=i.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&m.a.D(e,function(e,i){var r=m.ya[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};m.G(v,"subscribe",v.X),m.G(v,"extend",v.extend),m.G(v,"getSubscriptionsCount",v.Sc),m.a.ka&&m.a.Xa(v,Function.prototype),m.J.fn=v,m.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},m.b("subscribable",m.J),m.b("isSubscribable",m.hc),m.va=m.l=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ub:e,end:t,oc:function(e){if(i){if(!m.hc(e))throw Error("Only subscribable things can act as dependencies");i.gb.call(i.Gc,e,e.Cc||(e.Cc=++n))}},w:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},Aa:function(){if(i)return i.m.Aa()},Sa:function(){if(i)return i.Sa}}}(),m.b("computedContext",m.va),m.b("computedContext.getDependenciesCount",m.va.Aa),m.b("computedContext.isInitial",m.va.Sa),m.b("ignoreDependencies",m.qd=m.l.w);var y=m.a.Yb("_latestValue");m.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(m.l.oc(t),t[y])}return t[y]=e,m.a.ka||m.a.extend(t,m.J.fn),m.J.fn.rb(t),m.a.Ya(t,C),m.options.deferUpdates&&m.ya.deferred(t,!0),t};var C={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};m.a.ka&&m.a.Xa(C,m.J.fn);var w=m.N.gd="__ko_proto__";C[w]=m.N,m.Oa=function(t,i){return null!==t&&t!==e&&t[w]!==e&&(t[w]===i||m.Oa(t[w],i))},m.H=function(e){return m.Oa(e,m.N)},m.Ba=function(e){return!!("function"==typeof e&&e[w]===m.N||"function"==typeof e&&e[w]===m.B&&e.Vc)},m.b("observable",m.N),m.b("isObservable",m.H),m.b("isWriteableObservable",m.Ba),m.b("isWritableObservable",m.Ba),m.b("observable.fn",C),m.G(C,"peek",C.t),m.G(C,"valueHasMutated",C.fa),m.G(C,"valueWillMutate",C.ga),m.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=m.N(e),m.a.Ya(e,m.la.fn),e.extend({trackArrayChanges:!0})},m.la.fn={remove:function(e){for(var t=this.t(),i=[],r="function"!=typeof e||m.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.ga(),i.push(o),t.splice(n,1),n--)}return i.length&&this.fa(),i},removeAll:function(t){if(t===e){var i=this.t(),r=i.slice(0);return this.ga(),i.splice(0,i.length),this.fa(),r}return t?this.remove(function(e){return 0<=m.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),i="function"!=typeof e||m.H(e)?function(t){return t===e}:e;this.ga();for(var r=t.length-1;0<=r;r--)i(t[r])&&(t[r]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=m.a.o(t,e)}):[]},indexOf:function(e){var t=this();return m.a.o(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ga(),this.t()[i]=t,this.fa())}},m.a.ka&&m.a.Xa(m.la.fn,m.N.fn),m.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){m.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var i=t[e].apply(t,arguments);return this.fa(),i===t?this:i}}),m.a.q(["slice"],function(e){m.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),m.b("observableArray",m.la),m.ya.trackArrayChanges=function(e,t){function i(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==g||++a,t.apply(this,arguments)};var i=[].concat(e.t()||[]);o=null,r=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var r;(!o||1<a)&&(o=m.a.ib(i,t,e.hb)),r=o}i=t,o=null,a=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&m.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var r,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&i()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(r.k(),n=!1)},e.Vb=function(e,t,i){function r(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(n&&!a){var s=[],l=e.length,u=i.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)r("added",i[t],c+t);break;case"pop":c=l-1;case"shift":l&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?l+i[0]:i[0]),l);for(var l=1===u?l:Math.min(t+(i[1]||0),l),u=t+u-2,c=Math.max(l,u),d=[],h=[],p=2;t<c;++t,++p)t<l&&h.push(r("deleted",e[t],t)),t<u&&d.push(r("added",i[p],t));m.a.dc(h,d);break;default:return}o=s}}}};var S=m.a.Yb("_state");m.m=m.B=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.pb,arguments),this}return m.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:i||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return n[S]=a,n.Vc="function"==typeof o,m.a.ka||m.a.extend(n,m.J.fn),m.J.fn.rb(n),m.a.Ya(n,E),r.pure?(a.Va=!0,a.s=!0,m.a.extend(n,b)):r.deferEvaluation&&m.a.extend(n,T),m.options.deferUpdates&&m.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||r.deferEvaluation||n.aa(),a.i&&n.ba()&&m.a.F.oa(a.i,a.mb=function(){n.k()}),n};var E={equalityComparer:l,Aa:function(){return this[S].L},Pb:function(e,t,i){if(this[S].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].r[e]=i,i.Ga=this[S].L++,i.na=t.Na()},Qa:function(){var e,t,i=this[S].r;for(e in i)if(i.hasOwnProperty(e)&&(t=i[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[S].Ra&&this.Fa()},ba:function(){return this[S].S||0<this[S].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[S].i){var t=e.X(this.bd,this,"dirty"),i=e.X(this.ld,this);return{ia:e,k:function(){t.k(),i.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].bc),this[S].bc=m.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[S],i=t.wa;if(!t.Ra&&!t.R){if(t.i&&!m.a.nb(t.i)||i&&i()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var i=this[S],r=i.Va?e:!i.L,n={Hc:this,Ma:i.r,lb:i.L};m.l.Ub({Gc:n,gb:p,m:this,Sa:r}),i.r={},i.L=0,n=this.Pc(i,n),this.tb(i.T,n)&&(i.s||this.notifySubscribers(i.T,"beforeChange"),i.T=n,i.s?this.zc():t&&this.notifySubscribers(i.T)),r&&this.notifySubscribers(i.T,"awake")},Pc:function(e,t){try{var i=e.jd;return e.pb?i.call(e.pb):i()}finally{m.l.end(),t.lb&&!e.s&&m.a.D(t.Ma,h),e.S=!1}},t:function(){var e=this[S];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){m.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[S].T),this[S].S=!0,this.Lb(this)}},k:function(){var e=this[S];!e.s&&e.r&&m.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&m.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},b={sa:function(e){var t=this,i=t[S];if(!i.R&&i.s&&"change"==e){if(i.s=!1,i.S||t.Qa())i.r=null,i.L=0,i.S=!0,t.aa();else{var r=[];m.a.D(i.r,function(e,t){r[t.Ga]=e}),m.a.q(r,function(e,r){var n=i.r[e],o=t.uc(n.ia);o.Ga=r,o.na=n.na,i.r[e]=o})}i.R||t.notifySubscribers(i.T,"awake")}},Ia:function(t){var i=this[S];i.R||"change"!=t||this.Pa("change")||(m.a.D(i.r,function(e,t){t.k&&(i.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),i.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[S];return e.s&&(e.S||this.Qa())&&this.aa(),m.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};m.a.ka&&m.a.Xa(E,m.J.fn);var x=m.N.gd;m.m[x]=m.N,E[x]=m.m,m.Xc=function(e){return m.Oa(e,m.m)},m.Yc=function(e){return m.Oa(e,m.m)&&e[S]&&e[S].Va},m.b("computed",m.m),m.b("dependentObservable",m.m),m.b("isComputed",m.Xc),m.b("isPureComputed",m.Yc),m.b("computed.fn",E),m.G(E,"peek",E.t),m.G(E,"dispose",E.k),m.G(E,"isActive",E.ba),m.G(E,"getDependenciesCount",E.Aa),m.nc=function(e,t){return"function"==typeof e?m.m(e,t,{pure:!0}):(e=m.a.extend({},e),e.pure=!0,m.m(e,t))},m.b("pureComputed",m.nc),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.Ib=[]}m.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;m.H(e)&&10>t;t++)e=e();return e})},m.toJSON=function(e,t,i){return e=m.wc(e),m.a.Eb(e,t,i)},r.prototype={save:function(e,t){var i=m.a.o(this.keys,e);0<=i?this.Ib[i]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=m.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),m.b("toJS",m.wc),m.b("toJSON",m.toJSON),function(){m.j={u:function(t){switch(m.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?m.a.e.get(t,m.d.options.xb):7>=m.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,i,r){switch(m.a.A(t)){case"option":switch(typeof i){case"string":m.a.e.set(t,m.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:m.a.e.set(t,m.d.options.xb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=m.j.u(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),m.b("selectExtensions",m.j),m.b("selectExtensions.readValue",m.j.u),m.b("selectExtensions.writeValue",m.j.ha),m.h=function(){function e(e){e=m.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=e.match(r),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var d=u.charCodeAt(0);if(44===d){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===d){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===d&&c&&1<u.length?(d=a[c-1].match(n))&&!o[d[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(r),a.push(","),c=-1,u="/"):40===d||123===d||91===d?++l:41===d||125===d||93===d?--l:t||s.length||34!==d&&39!==d||(u=u.slice(1,-1));s.push(u)}}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(r,n){function o(e,r){var n;if(!c){var d=m.getBindingHandler(e);if(d&&d.preprocess&&!(r=d.preprocess(r,e,o)))return;(d=a[e])&&(n=r,0<=m.a.o(t,n)?n=!1:(d=n.match(i),n=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:n)),d=n),d&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,d="string"==typeof r?e(r):r;return m.a.q(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},Ea:function(e,t,i,r,n){e&&m.H(e)?!m.Ba(e)||n&&e.t()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),m.b("expressionRewriting",m.h),m.b("expressionRewriting.bindingRewriteValidators",m.h.ta),m.b("expressionRewriting.parseObjectLiteral",m.h.yb),m.b("expressionRewriting.preProcessBindings",m.h.Ua),m.b("expressionRewriting._twoWayBindings",m.h.ea),m.b("jsonExpressionRewriting",m.h),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function r(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var i=r(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var o=i&&"<!--test-->"===i.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};m.f={Z:{},childNodes:function(t){return e(t)?r(t):t.childNodes},xa:function(t){if(e(t)){t=m.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)m.removeNode(t[i])}else m.a.ob(t)},da:function(t,i){if(e(t)){m.f.xa(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else m.a.da(t,i)},mc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},gc:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):m.f.mc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(i){if(l[m.a.A(i)]){var r=i.firstChild;if(r)do if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(r=r.nextSibling)}}}}(),m.b("virtualElements",m.f),m.b("virtualElements.allowedBindings",m.f.Z),m.b("virtualElements.emptyNode",m.f.xa),m.b("virtualElements.insertAfter",m.f.gc),m.b("virtualElements.prepend",m.f.mc),m.b("virtualElements.setDomNodeChildren",m.f.da),function(){m.Q=function(){this.Fc={}},m.a.extend(m.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||m.g.getComponentNameForNode(e);case 8:return m.f.Tc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return m.g.Ob(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return m.g.Ob(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return m.f.pd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Fc,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+m.h.Ua(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),m.Q.instance=new m.Q}(),m.b("bindingProvider",m.Q),function(){function i(e){return function(){return e}}function r(e){return e()}function o(e){return m.a.Ca(m.l.w(e),function(t,i){return function(){return e()[i]}})}function a(e,t,r){return"function"==typeof e?o(e.bind(null,t,r)):m.a.Ca(e,i)}function s(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t,i){var r,n=m.f.firstChild(t),o=m.Q.instance,a=o.preprocessNode;if(a){for(;r=n;)n=m.f.nextSibling(r),a.call(o,r);n=m.f.firstChild(t)}for(;r=n;)n=m.f.nextSibling(r),u(e,r,i)}function u(e,t,i){var r=!0,n=1===t.nodeType;n&&m.f.kc(t),(n&&i||m.Q.instance.nodeHasBindings(t))&&(r=d(t,null,e,i).shouldBindDescendants),r&&!p[m.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],i={},r=[];return m.a.D(e,function n(o){if(!i[o]){var a=m.getBindingHandler(o);a&&(a.after&&(r.push(o),m.a.q(a.after,function(t){if(e[t]){if(-1!==m.a.o(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,fc:a})),i[o]=!0}}),t}function d(t,i,n,o){var a=m.a.e.get(t,f);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");m.a.e.set(t,f,!0)}!a&&o&&m.tc(t,n);var l;if(i&&"function"!=typeof i)l=i;else{var u=m.Q.instance,d=u.getBindingAccessors||s,h=m.B(function(){return(l=i?i(n,t):d.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&h.ba()||(h=null)}var p;if(l){var _=h?function(e){return function(){return r(h()[e])}}:function(e){return l[e]},g=function(){return m.a.Ca(h?h():l,r)};g.get=function(e){return l[e]&&r(_(e))},g.has=function(e){return e in l},o=c(l),m.a.q(o,function(i){var r=i.fc.init,o=i.fc.update,a=i.key;if(8===t.nodeType&&!m.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&m.l.w(function(){var i=r(t,_(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&m.B(function(){o(t,_(a),g,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function h(e){return e&&e instanceof m.U?e:new m.U(e)}m.d={};var p={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(e){return m.d[e]},m.U=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!m.H(t),l=m.B(function(){var e=s?t():t,o=m.a.c(e);return i?(i.P&&i.P(),m.a.extend(a,i),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=m),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{wa:function(){return o&&!m.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),m.a.F.oa(t,function(t){m.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},m.U.prototype.createChildContext=function(e,t,i){return new m.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},m.U.prototype.extend=function(e){return new m.U(this.P||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,m.a.extend(t,"function"==typeof e?e():e)})};var f=m.a.e.I(),_=m.a.e.I();m.tc=function(e,t){return 2!=arguments.length?m.a.e.get(e,_):(m.a.e.set(e,_,t),void(t.P&&t.P.Ac(e)))},m.Ja=function(e,t,i){return 1===e.nodeType&&m.f.kc(e),d(e,t,h(i),!0)},m.Dc=function(e,t,i){return i=h(i),m.Ja(e,a(t,i,e),i)},m.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(h(e),t,!0)},m.Rb=function(e,i){if(!n&&t.jQuery&&(n=t.jQuery),i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||t.document.body,u(h(e),i,!0)},m.kb=function(t){switch(t.nodeType){case 1:case 8:var i=m.tc(t);if(i)return i;if(t.parentNode)return m.kb(t.parentNode)}return e},m.Jc=function(t){return(t=m.kb(t))?t.$data:e},m.b("bindingHandlers",m.d),m.b("applyBindings",m.Rb),m.b("applyBindingsToDescendants",m.eb),m.b("applyBindingAccessorsToNode",m.Ja),m.b("applyBindingsToNode",m.Dc),m.b("contextFor",m.kb),m.b("dataFor",m.Jc)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(r):(s=n[t]=new m.J,s.X(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Zc:r},delete n[t],a||r?s.notifySubscribers(e):m.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=m.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};m.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?n.Zc?m.l.w(function(){r(n.definition)}):m.Y.Wa(function(){r(n.definition)}):t(i,r)},Xb:function(e){delete o[e]},Jb:r},m.g.loaders=[],m.b("components",m.g),m.b("components.get",m.g.get),m.b("components.clearCachedDefinition",m.g.Xb)}(),function(){function e(e,t,i,r){function n(){0===--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){m.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){m.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function r(e,t,i){if("function"==typeof t)i(function(e){return new t(e)});else if("function"==typeof t[c])i(t[c]);else if("instance"in t){var n=t.instance;i(function(){return n})}else"viewModel"in t?r(e,t.viewModel,i):e("Unknown viewModel value: "+t)}function n(e){switch(m.a.A(e)){case"script":return m.a.ma(e.text);case"textarea":return m.a.ma(e.value);case"template":if(o(e.content))return m.a.ua(e.content.childNodes)}return m.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};m.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(m.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},m.g.ub=function(e){return u.hasOwnProperty(e)},m.g.od=function(e){delete u[e],m.g.Xb(e)},m.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,r,a){if(e=l(e),"string"==typeof r)a(m.a.ma(r));else if(r instanceof Array)a(r);else if(o(r))a(m.a.V(r.childNodes));else if(r.element)if(r=r.element,t.HTMLElement?r instanceof HTMLElement:r&&r.tagName&&1===r.nodeType)a(n(r));else if("string"==typeof r){var s=i.getElementById(r);s?a(n(s)):e("Cannot find element with ID "+r)}else e("Unknown element type: "+r);else e("Unknown template value: "+r)},loadViewModel:function(e,t,i){r(l(e),t,i)}};var c="createViewModel";m.b("components.register",m.g.register),m.b("components.isRegistered",m.g.ub),m.b("components.unregister",m.g.od),m.b("components.defaultLoader",m.g.Zb),m.g.loaders.push(m.g.Zb),m.g.Bc=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=m.a.Ca(r,function(t){return m.m(t,null,{i:e})}),n=m.a.Ca(r,function(t){var i=t.t();return t.ba()?m.m({read:function(){return m.a.c(t())},write:m.Ba(i)&&function(e){t()(e)},i:e}):i});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}m.g.getComponentNameForNode=function(e){var t=m.a.A(e);if(m.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=m.a.C&&e.tagName===t))return t},m.g.Ob=function(t,i,r,n){if(1===i.nodeType){var o=m.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new m.Q;9>m.a.C&&(m.g.register=function(e){return function(t){return i.createElement(t),e.apply(this,arguments)}}(m.g.register),i.createDocumentFragment=function(e){return function(){var t,i=e(),r=m.g.Bc;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(i.createDocumentFragment))}(),function(e){function t(e,t,i){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=m.a.ua(t),m.f.da(i,e)}function i(e,t,i,r){var n=e.createViewModel;return n?n.call(e,r,{element:t,templateNodes:i}):r}var r=0;m.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),d=c=null}var c,d,h=m.a.V(m.f.childNodes(n));return m.a.F.oa(n,u),m.m(function(){var a,s,p=m.a.c(o());if("string"==typeof p?a=p:(a=m.a.c(p.name),s=m.a.c(p.params)),!a)throw Error("No component name specified");var f=d=++r;m.g.get(a,function(r){if(d===f){if(u(),!r)throw Error("Unknown component '"+a+"'");t(a,r,n);var o=i(r,n,h,s);r=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=h}),c=o,m.eb(r,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},m.f.Z.component=!0}();var A={class:"className",for:"htmlFor"};m.d.attr={update:function(t,i){var r=m.a.c(i())||{};m.a.D(r,function(i,r){r=m.a.c(r);
var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=m.a.C&&i in A?(i=A[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&m.a.rc(t,n?"":r.toString())})}},function(){m.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=p?a():e;if(!m.va.Sa()&&(!l||e)){var o=m.l.w(i);if(c){var s=d?o.t():o;h!==n?(e&&(m.a.pa(s,n,!0),m.a.pa(s,h,!1)),h=n):m.a.pa(s,n,e),d&&m.Ba(o)&&o(s)}else m.h.Ea(o,r,"checked",n,!0)}}function o(){var e=m.a.c(i());t.checked=c?0<=m.a.o(e,a()):s?e:a()===e}var a=m.nc(function(){return r.has("checkedValue")?m.a.c(r.get("checkedValue")):r.has("value")?m.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&m.a.c(u)instanceof Array,d=!(c&&u.push&&u.splice),h=c?a():e,p=l||c;l&&!t.name&&m.d.uniqueName.init(t,function(){return!0}),m.m(n,null,{i:t}),m.a.p(t,"click",n),m.m(o,null,{i:t}),u=e}}},m.h.ea.checked=!0,m.d.checkedValue={update:function(e,t){e.value=m.a.c(t())}}}(),m.d.css={update:function(e,t){var i=m.a.c(t());null!==i&&"object"==typeof i?m.a.D(i,function(t,i){i=m.a.c(i),m.a.bb(e,t,i)}):(i=m.a.$a(String(i||"")),m.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,m.a.bb(e,i,!0))}},m.d.enable={update:function(e,t){var i=m.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},m.d.disable={update:function(e,t){m.d.enable.update(e,function(){return!m.a.c(t())})}},m.d.event={init:function(e,t,i,r,n){var o=t()||{};m.a.D(o,function(o){"string"==typeof o&&m.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=m.a.V(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},m.d.foreach={ic:function(e){return function(){var t=e(),i=m.a.zb(t);return i&&"number"!=typeof i.length?(m.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:m.W.sb}):{foreach:t,templateEngine:m.W.sb}}},init:function(e,t){return m.d.template.init(e,m.d.foreach.ic(t))},update:function(e,t,i,r,n){return m.d.template.update(e,m.d.foreach.ic(t),i,r,n)}},m.h.ta.foreach=!1,m.f.Z.foreach=!0,m.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),m.h.Ea(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);m.a.p(e,"focus",n),m.a.p(e,"focusin",n),m.a.p(e,"blur",o),m.a.p(e,"focusout",o)},update:function(e,t){var i=!!m.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),m.l.w(m.a.Da,null,[e,i?"focusin":"focusout"]))}},m.h.ea.hasfocus=!0,m.d.hasFocus=m.d.hasfocus,m.h.ea.hasFocus=!0,m.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Cb(e,t())}},f("if"),f("ifnot",!1,!0),f("with",!0,!1,function(e,t){return e.createChildContext(t)});var P={};m.d.options={init:function(e){if("select"!==m.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return m.a.Ka(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(f&&c)m.j.ha(t,m.a.c(r.get("value")),!0);else if(p.length){var n=0<=m.a.o(p,m.j.u(i[0]));m.a.sc(i[0],n),f&&!n&&m.l.w(m.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=m.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),d=r.get("optionsIncludeDestroyed");i={};var h,p=[];c||(s?p=m.a.fb(n(),m.j.u):0<=t.selectedIndex&&p.push(m.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),h=m.a.Ka(u,function(t){return d||t===e||null===t||!m.a.c(t._destroy)}),r.has("optionsCaption")&&(u=m.a.c(r.get("optionsCaption")),null!==u&&u!==e&&h.unshift(P)));var f=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),m.l.w(r.get("optionsAfterRender"),null,[i[0],t!==P?t:e])}),m.a.Bb(t,h,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[m.j.u(a[0])]:[],f=!0),n=t.ownerDocument.createElement("option"),i===P?(m.a.Za(n,r.get("optionsCaption")),m.j.ha(n,e)):(a=o(i,r.get("optionsValue"),i),m.j.ha(n,m.a.c(a)),i=o(i,r.get("optionsText"),a),m.a.Za(n,i)),[n]},i,u),m.l.w(function(){c?m.j.ha(t,m.a.c(r.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&m.a.Da(t,"change")}),m.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},m.d.options.xb=m.a.e.I(),m.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){m.a.p(e,"change",function(){var r=t(),n=[];m.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(m.j.u(e))}),m.h.Ea(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=m.a.A(e))throw Error("values binding applies only to SELECT elements");var i=m.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&m.a.q(e.getElementsByTagName("option"),function(e){var t=0<=m.a.o(i,m.j.u(e));e.selected!=t&&m.a.sc(e,t)}),e.scrollTop=r}},m.h.ea.selectedOptions=!0,m.d.style={update:function(t,i){var r=m.a.c(i()||{});m.a.D(r,function(i,r){r=m.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),t.style[i]=r})}},m.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");m.a.p(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},m.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Za(e,t())}},m.f.Z.text=!0,function(){if(t&&t.navigator)var i=function(e){if(e)return parseFloat(e[1])},r=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=i(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=i(n.match(/Firefox\/([^ ]*)/));if(10>m.a.C)var s=m.a.e.I(),l=m.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&m.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;m.a.e.get(i,s)||(m.a.e.set(i,s,!0),m.a.p(i,"selectionchange",u)),m.a.e.set(e,l,t)};m.d.textInput={init:function(t,i,n){function s(e,i){m.a.p(t,e,i)}function l(){var r=m.a.c(i());null!==r&&r!==e||(r=""),p!==e&&r===p?m.a.setTimeout(l,4):t.value!==r&&(f=r,t.value=r)}function u(){h||(p=t.value,h=m.a.setTimeout(d,4))}function d(){clearTimeout(h),p=h=e;var r=t.value;f!==r&&(f=r,m.h.Ea(i(),n,"textInput",r))}var h,p,f=t.value,_=9==m.a.C?u:d;10>m.a.C?(s("propertychange",function(e){"value"===e.propertyName&&_(e)}),8==m.a.C&&(s("keyup",d),s("keydown",d)),8<=m.a.C&&(c(t,_),s("dragend",u))):(s("input",d),5>o&&"textarea"===m.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>r?s("keydown",u):4>a&&(s("DOMAutoComplete",d),s("dragdrop",d),s("drop",d))),s("change",d),m.m(l,null,{i:t})}},m.h.ea.textInput=!0,m.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),m.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++m.d.uniqueName.Ic;m.a.rc(e,i)}}},m.d.uniqueName.Ic=0,m.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),m.a.ra(r,n),r=m.a.Tb(r));var s=function(){a=null,o=!1;var r=t(),n=m.j.u(e);m.h.Ea(r,i,"value",n)};!m.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=m.a.o(r,"propertychange")||(m.a.p(e,"propertychange",function(){o=!0}),m.a.p(e,"focus",function(){o=!1}),m.a.p(e,"blur",function(){o&&s()})),m.a.q(r,function(t){var i=s;m.a.nd(t,"after")&&(i=function(){a=m.j.u(e),m.a.setTimeout(s,0)},t=t.substring(5)),m.a.p(e,t,i)});var l=function(){var r=m.a.c(t()),n=m.j.u(e);if(null!==a&&r===a)m.a.setTimeout(l,0);else if(r!==n)if("select"===m.a.A(e)){var o=i.get("valueAllowUnset"),n=function(){m.j.ha(e,r,o)};n(),o||r===m.j.u(e)?m.a.setTimeout(n,0):m.l.w(m.a.Da,null,[e,"change"])}else m.j.ha(e,r)};m.m(l,null,{i:e})}else m.Ja(e,{checkedValue:t})},update:function(){}},m.h.ea.value=!0,m.d.visible={update:function(e,t){var i=m.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){m.d[e]={init:function(t,i,r,n,o){return m.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),m.O=function(){},m.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||i;var r=t.getElementById(e);if(!r)throw Error("Cannot find template with ID "+e);return new m.v.n(r)}if(1==e.nodeType||8==e.nodeType)return new m.v.qa(e);throw Error("Unknown template type: "+e)},m.O.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},m.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},m.O.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},m.b("templateEngine",m.O),m.Gb=function(){function e(e,t,i,r){e=m.h.yb(e);for(var n=m.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.h.Ua(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return m.Gb.dd(e,t)},i)},dd:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return m.M.wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&m.Ja(n,e,r)})}}}(),m.b("__tr_ambtns",m.Gb.Ec),function(){m.v={},m.v.n=function(e){if(this.n=e){var t=m.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},m.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?m.a.Cb(this.n,t):this.n[e]=t};var t=m.a.e.I()+"_";m.v.n.prototype.data=function(e){return 1===arguments.length?m.a.e.get(this.n,t+e):void m.a.e.set(this.n,t+e,arguments[1])};var i=m.a.e.I();m.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(m.a.e.get(t,i)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void m.a.e.set(t,i,{jb:arguments[0]})},m.v.qa=function(e){this.n=e},m.v.qa.prototype=new m.v.n,m.v.qa.prototype.text=function(){if(0==arguments.length){var t=m.a.e.get(this.n,i)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}m.a.e.set(this.n,i,{Hb:arguments[0]})},m.b("templateSources",m.v),m.b("templateSources.domElement",m.v.n),m.b("templateSources.anonymousTemplate",m.v.qa)}(),function(){function t(e,t,i){var r;for(t=m.f.nextSibling(t);e&&(r=e)!==t;)e=m.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=m.Q.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),m.a.za(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.Rb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.M.yc(e,[i])}),m.a.za(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(m.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":m.f.da(e,n),l=!0;break;case"replaceNode":m.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&m.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,i){return m.H(e)?e():"function"==typeof e?e(t,i):e}var a;m.Db=function(t){if(t!=e&&!(t instanceof m.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},m.Ab=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return m.B(function(){var e=i&&i instanceof m.U?i:new m.U(m.a.c(i)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{wa:function(){return!c||!m.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return m.M.wb(function(e){m.Ab(t,i,s,e,"replaceNode")})},m.kd=function(t,r,a,s,l){function u(e,t){i(t,d),a.afterRender&&a.afterRender(t,e),d=null}function c(e,i){d=l.createChildContext(e,a.as,function(e){e.$index=i});var r=o(t,e,d);return n(null,"ignoreTargetNode",r,d,a)}var d;return m.B(function(){var t=m.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=m.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!m.a.c(t._destroy)}),m.l.w(m.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=m.a.e.I();m.d.template={init:function(e,t){var i=m.a.c(t());if("string"==typeof i||i.name)m.f.xa(e);else{if("nodes"in i){if(i=i.nodes||[],m.H(i))throw Error('The "nodes" option must be a plain, non-observable array.')}else i=m.f.childNodes(e);i=m.a.jc(i),new m.v.qa(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a,l=i();i=m.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=m.a.c(i.if)),r&&"ifnot"in i&&(r=!m.a.c(i.ifnot)),a=m.a.c(i.data)),"foreach"in i?n=m.kd(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(a,i.as):o,n=m.Ab(l||t,o,i,t)):m.f.xa(t),o=n,(a=m.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),m.a.e.set(t,s,o&&o.ba()?o:e)}},m.h.ta.template=function(e){return e=m.h.yb(e),1==e.length&&e[0].unknown||m.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.f.Z.template=!0}(),m.b("setTemplateEngine",m.Db),m.b("renderTemplate",m.Ab),m.a.dc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},m.a.ib=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,f=t.length,_=f-p||1,g=p+f+1;for(o=0;o<=p;o++)for(l=s,h.push(s=[]),u=c(f,o+_),a=d(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],d=[],_=[],o=p,a=f;o||a;)f=h[o][a]-1,a&&f===h[o][a-1]?d.push(c[c.length]={status:i,value:t[--a],index:a}):o&&f===h[o-1][a]?_.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return m.a.dc(_,d,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),m.b("utils.compareArrays",m.a.ib),function(){function t(t,i,r,n,o){var a=[],s=m.B(function(){var e=i(r,o,m.a.za(a,t))||[];0<a.length&&(m.a.qc(a,e),n&&m.l.w(n,null,[r,e,o])),a.length=0,m.a.ra(a,e)},null,{i:t,wa:function(){return!m.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var i=m.a.e.I(),r=m.a.e.I();m.a.Bb=function(n,o,a,s,l){function u(e,t){w=h[t],v!==t&&(b[e]=w),w.qb(v++),m.a.za(w.ca,n),_.push(w),C.push(w)}function c(e,t){if(e)for(var i=0,r=t.length;i<r;i++)t[i]&&m.a.q(t[i].ca,function(r){e(r,i,t[i].ja)})}o=o||[],s=s||{};var d=m.a.e.get(n,i)===e,h=m.a.e.get(n,i)||[],p=m.a.fb(h,function(e){return e.ja}),f=m.a.ib(p,o,s.dontLimitMoves),_=[],g=0,v=0,y=[],C=[];o=[];for(var w,S,E,b=[],p=[],T=0;S=f[T];T++)switch(E=S.moved,S.status){case"deleted":E===e&&(w=h[g],w.B&&(w.B.k(),w.B=e),m.a.za(w.ca,n).length&&(s.beforeRemove&&(_.push(w),C.push(w),w.ja===r?w=null:o[T]=w),w&&y.push.apply(y,w.ca))),g++;break;case"retained":u(T,g++);break;case"added":E!==e?u(T,E):(w={ja:S.value,qb:m.N(v++)},_.push(w),C.push(w),d||(p[T]=w))}m.a.e.set(n,i,_),c(s.beforeMove,b),m.a.q(y,s.beforeRemove?m.$:m.removeNode);for(var x,T=0,d=m.f.firstChild(n);w=C[T];T++){for(w.ca||m.a.extend(w,t(n,a,w.ja,l,w.qb)),g=0;f=w.ca[g];d=f.nextSibling,x=f,g++)f!==d&&m.f.gc(n,f,x);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=r);c(s.afterMove,b),c(s.afterAdd,p)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.Bb),m.W=function(){this.allowTemplateRewriting=!1},m.W.prototype=new m.O,m.W.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>m.a.C?0:e.nodes)?e.nodes():null)?m.a.V(t.cloneNode(!0).childNodes):(e=e.text(),m.a.ma(e,r))},m.W.sb=new m.W,m.Db(m.W.sb),m.b("nativeTemplateEngine",m.W),function(){m.vb=function(){var e=this.$c=function(){if(!n||!n.tmpl)return 0;try{if(0<=n.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,r,o,a){if(a=a||i,o=o||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=n.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[r.$data],r=n.extend({koBindingContext:r},o.templateOptions),r=n.tmpl(s,t,r),r.appendTo(a.createElement("div")),n.fragments={},r},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){i.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(n.tmpl.tag.ko_code={open:"__.push($1 || '');"},n.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.vb.prototype=new m.O;var e=new m.vb;0<e.$c&&m.Db(e),m.b("jqueryTmplTemplateEngine",m.vb)}()})}()}(),define("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==d&&t!==h&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[d];return!i&&t&&(i={},Object.defineProperty(e,d,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[h];if(!i){i=new e.subscribable,Object.defineProperty(t,h,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var d="__knockoutObservables",h="__knockoutSubscribable";return{attachToKo:c}}),define("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),define("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),define("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),define("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),define("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(v,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function d(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function h(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function f(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),d=n-a-u.left,h=o-s-u.top,p=180*Math.atan2(h,d)/Math.PI+90;p>180&&(p-=360);var f=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):p<f?i.slower():p>f&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function m(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function _(e,t){function i(e){f(x,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(v,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var d=document.createElementNS(v,"g");this._topG=d,this._realtimeSVG=new m(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new m(h(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new m(h(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new m(h(84,99,"#animation_pathPause"),t.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var w=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,E=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var b=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:S}),T=document.createElementNS(v,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),d.appendChild(T),d.appendChild(w),d.appendChild(_),T.appendChild(g),T.appendChild(C),T.appendChild(this._shuttleRingPointer),w.appendChild(this._knobOuter),w.appendChild(E),w.appendChild(this._knobDate),w.appendChild(this._knobTime),w.appendChild(this._knobStatus),w.appendChild(b),s.appendChild(d),e.appendChild(s);var x=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),
this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),w=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),E=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return m.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();r(this)},m.prototype.isDestroyed=function(){return!1},m.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},m.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")))},m.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(_.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;i<n;i++)t[i].dispose();return r(this)},_.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),h=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(e,C)},{tagName:"stop",offset:"12%","stop-color":d(e,w)},{tagName:"stop",offset:"46%","stop-color":d(e,S)},{tagName:"stop",offset:"81%","stop-color":d(e,E)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(i,C)},{tagName:"stop",offset:"12%","stop-color":d(i,w)},{tagName:"stop",offset:"46%","stop-color":d(i,S)},{tagName:"stop",offset:"81%","stop-color":d(i,E)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(r,C)},{tagName:"stop",offset:"12%","stop-color":d(r,w)},{tagName:"stop",offset:"46%","stop-color":d(r,S)},{tagName:"stop",offset:"81%","stop-color":d(r,E)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(n,b)},{tagName:"stop",offset:"75%","stop-color":d(n,T)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":d(a,A)},{tagName:"stop",offset:"100%","stop-color":d(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(o,C)},{tagName:"stop",offset:"60%","stop-color":d(o,x)},{tagName:"stop",offset:"85%","stop-color":d(o,w)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(o,x)},{tagName:"stop",offset:"60%","stop-color":d(o,C)},{tagName:"stop",offset:"85%","stop-color":d(o,E)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(h,this._defsElement):this._svgNode.appendChild(h),this._defsElement=h},_}),define("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),define("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),define("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t){return e-t}function h(t,i){var r=e(i,t,d);return r<0?~r:r}function p(e,t){if(Math.abs(e)<=g)return e/g;var i,r,n=g,o=v,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function f(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=g,l=v,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function m(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=m.defaultDateFormatter,this._timeFormatter=m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(m.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return f(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===v)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(r.snapToTicks)o=t[h(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:r._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var d=u(function(){r._clockViewModel.clockStep=i.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(d,{toggled:s.computed(function(){return e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=h(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=h(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,v=105;return m.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},m.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],m.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},m.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(d);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(m.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}}}),m._maxShuttleRingAngle=v,m._realtimeShuttleRingAngle=g,m}),define("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;i<n;i++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var d=e.creationCommand();if(o(d)){var h=d.length;for(i=h-1;i>=0;i--)a.addImageryProvider(d[i],0);this._currentImageryProviders=d.slice(0)}else this._currentImageryProviders=[d],a.addImageryProvider(d,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var d=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,d(e),this.dropDownVisible=!1}});var h=this;this._toggleDropDown=s(function(){h.dropDownVisible=!h.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),define("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(d);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),d.appendChild(h);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-itemLabel",f.setAttribute("data-bind","text: name"),h.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",u.appendChild(m);var _=document.createElement("div");_.className="cesium-baseLayerPicker-choices",_.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),_.appendChild(g);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),g.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),define("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),define("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide.  The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal.  Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")
})}})),l}return l}),define("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),define("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t){var i;if(e(t)){i="Command Statistics";var r=t.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>&nbsp;&nbsp;&nbsp;&nbsp;"+r[n]+" in frustum "+o}i+="<br>Total: "+t.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function f(t,i){function r(t){var i=f._scene.pick({x:t.position.x,y:t.position.y});e(i)&&(f.primitive=e(i.collection)?i.collection:i.primitive),f.pickPrimitiveActive=!1}function h(t){var i,r=g.ellipsoid,o=f._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},r);if(e(o))for(var a=r.cartesianToCartographic(o),s=g._surface.tileProvider._tilesToRenderByTextureCount,l=0;!i&&l<s.length;++l){var u=s[l];if(e(u))for(var c=0;!i&&c<u.length;++c){var d=u[c];n.contains(d.rectangle,a)&&(i=d)}}f.tile=i,f.pickTileActive=!1}var f=this,m=t.canvas,_=new o(m);this._eventHandler=_,this._scene=t,this._canvas=m,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",this.generalSwitchText=c.pureComputed(function(){return f.generalVisible?"-":"+"}),this.primitivesSwitchText=c.pureComputed(function(){return f.primitivesVisible?"-":"+"}),this.terrainSwitchText=c.pureComputed(function(){return f.terrainVisible?"-":"+"}),c.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=d(function(){f.dropDownVisible=!f.dropDownVisible}),this._toggleGeneral=d(function(){f.generalVisible=!f.generalVisible}),this._togglePrimitives=d(function(){f.primitivesVisible=!f.primitivesVisible}),this._toggleTerrain=d(function(){f.terrainVisible=!f.terrainVisible}),this._frustumsSubscription=c.getObservable(this,"frustums").subscribe(function(e){f._scene.debugShowFrustums=e}),this._frustumPlanesSubscription=c.getObservable(this,"frustumPlanes").subscribe(function(e){f._scene.debugShowFrustumPlanes=e}),this._performanceSubscription=c.getObservable(this,"performance").subscribe(function(e){e?f._performanceDisplay=new l({container:f._performanceContainer}):f._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=d(function(){return f._primitive.debugShowBoundingVolume=f.primitiveBoundingSphere,!0}),this._primitiveBoundingSphereSubscription=c.getObservable(this,"primitiveBoundingSphere").subscribe(function(){f._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=d(function(){if(f.primitiveReferenceFrame){var t=f._primitive.modelMatrix;f._modelMatrixPrimitive=new s({modelMatrix:t}),f._scene.primitives.add(f._modelMatrixPrimitive)}else e(f._modelMatrixPrimitive)&&(f._scene.primitives.remove(f._modelMatrixPrimitive),f._modelMatrixPrimitive=void 0);return!0}),this._primitiveReferenceFrameSubscription=c.getObservable(this,"primitiveReferenceFrame").subscribe(function(){f._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=d(function(){return f.filterPrimitive?f._scene.debugCommandFilter=function(t){return!(!e(f._modelMatrixPrimitive)||t.owner!==f._modelMatrixPrimitive._primitive)||!!e(f._primitive)&&(t.owner===f._primitive||t.owner===f._primitive._billboardCollection||t.owner.primitive===f._primitive)}:f._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=c.getObservable(this,"filterPrimitive").subscribe(function(){f._doFilterPrimitive()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){g._surface.tileProvider._debug.wireframe=e}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){f._scene.debugShowGlobeDepth=e}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){f._scene.debugShowPickDepth=e}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){f.scene.debugShowDepthFrustum=e}),this._incrementDepthFrustum=d(function(){var e=f.depthFrustum+1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._decrementDepthFrustum=d(function(){var e=f.depthFrustum-1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._suspendUpdatesSubscription=c.getObservable(this,"suspendUpdates").subscribe(function(e){g._surface._debug.suspendLodUpdate=e,e||(f.filterTile=!1)});var v;this._showTileCoordinates=d(function(){return f.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!f.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._tileCoordinatesSubscription=c.getObservable(this,"tileCoordinates").subscribe(function(){f._showTileCoordinates()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){f._showTileBoundingSphere()}),this._showTileBoundingSphere=d(function(){return f.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=f._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return f.filterTile?(f.suspendUpdates=!0,g._surface._tilesToRender=[],e(f._tile)&&f._tile.renderable&&g._surface._tilesToRender.push(f._tile)):f.suspendUpdates=!1,!0}),this._filterTileSubscription=c.getObservable(this,"filterTile").subscribe(function(){f.doFilterTile()}),this._pickPrimitive=d(function(){f.pickPrimitiveActive=!f.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=c.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?_.setInputAction(r,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)}),this._pickTile=d(function(){f.pickTileActive=!f.pickTileActive}),this._pickTileActiveSubscription=c.getObservable(this,"pickTileActive").subscribe(function(e){e?_.setInputAction(h,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)})}return t(f.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.southeastChild})}},primitive:{set:function(t){var i=this._primitive;t!==i&&(this.hasPickedPrimitive=!0,e(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(t){if(e(t)){this.hasPickedTile=!0;var i=this._tile;if(t!==i){this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north;var r=t.data;e(r)?this.tileText+="<br>Min: "+r.minimumHeight+" Max: "+r.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=h(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t,e.depthFrustum=p(1,t,e.depthFrustum),e.depthFrustumText=e.depthFrustum+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),i(this)},f}),define("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=document.createElement("div"),r=new a(t,i);this._viewModel=r,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var d=document.createElement("span");d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(d),c.appendChild(document.createTextNode("General")),u.appendChild(c);var h=document.createElement("div");h.className="cesium-cesiumInspector-section",h.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(h);var p=document.createElement("div");h.appendChild(p);var f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStats",f.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" :  !frustums}, html: frustumStatisticText');var m=document.createElement("input");m.type="checkbox",m.setAttribute("data-bind","checked: frustums"),p.appendChild(m),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(f);var _=document.createElement("div");h.appendChild(_);var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: frustumPlanes"),_.appendChild(g),_.appendChild(document.createTextNode("Show Frustum Planes"));var v=document.createElement("div");h.appendChild(v);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance"),v.appendChild(y),v.appendChild(document.createTextNode("Performance Display")),i.className="cesium-cesiumInspector-performanceDisplay",h.appendChild(i);var C=document.createElement("div");C.className="cesium-cesiumInspector-shaderCache",C.setAttribute("data-bind","html: shaderCacheText"),h.appendChild(C);var w=document.createElement("div");h.appendChild(w);var S=document.createElement("input");S.type="checkbox",S.setAttribute("data-bind","checked: globeDepth"),w.appendChild(S),w.appendChild(document.createTextNode("Show globe depth"));var E=document.createElement("div");w.appendChild(E);var b=document.createElement("div");h.appendChild(b);var T=document.createElement("input");T.type="checkbox",T.setAttribute("data-bind","checked: pickDepth"),b.appendChild(T),b.appendChild(document.createTextNode("Show pick depth"));var x=document.createElement("div");h.appendChild(x);var A=document.createElement("span");A.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),x.appendChild(A);var P=document.createElement("span");P.setAttribute("data-bind","text: depthFrustumText"),x.appendChild(P);var D=document.createElement("input");D.type="button",D.value="-",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: decrementDepthFrustum"),x.appendChild(D);var M=document.createElement("input");M.type="button",M.value="+",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: incrementDepthFrustum"),x.appendChild(M);var I=document.createElement("div");I.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),I.appendChild(d),I.appendChild(document.createTextNode("Primitives")),u.appendChild(I);var R=document.createElement("div");R.className="cesium-cesiumInspector-section",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(R);var O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",R.appendChild(O);var N=document.createElement("input");N.type="button",N.value="Pick a primitive",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var L=document.createElement("div");L.className="cesium-cesiumInspector-center",L.appendChild(N),O.appendChild(L);var B=document.createElement("div");O.appendChild(B);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveBoundingSphere, enable: hasPickedPrimitive"),B.appendChild(F),B.appendChild(document.createTextNode("Show bounding sphere"));var k=document.createElement("div");O.appendChild(k);var V=document.createElement("input");V.type="checkbox",V.setAttribute("data-bind","checked: primitiveReferenceFrame, enable: hasPickedPrimitive"),k.appendChild(V),k.appendChild(document.createTextNode("Show reference frame"));var z=document.createElement("div");this._primitiveOnly=z,O.appendChild(z);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: filterPrimitive, enable: hasPickedPrimitive"),z.appendChild(U),z.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(d),G.appendChild(document.createTextNode("Terrain")),u.appendChild(G);var H=document.createElement("div");H.className="cesium-cesiumInspector-section",H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" :  !terrainVisible}'),u.appendChild(H);var W=document.createElement("div");W.className="cesium-cesiumInspector-pickSection",H.appendChild(W);var q=document.createElement("input");q.type="button",q.value="Pick a tile",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),L=document.createElement("div"),L.appendChild(q),L.className="cesium-cesiumInspector-center",W.appendChild(L);var j=document.createElement("div");W.appendChild(j);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");var K=document.createElement("input");K.type="button",K.value="SW",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSW");var Q=document.createElement("input");Q.type="button",Q.value="SE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",j.className="cesium-cesiumInspector-frustumStats",j.appendChild(J),j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" :  !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",j.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),ie=document.createElement("tr"),re=document.createElement("td");re.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Z),te.appendChild(re),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(K);var le=document.createElement("td");le.appendChild(Q),ie.appendChild(ae),ie.appendChild(se),ie.appendChild(le),ee.appendChild(te),ee.appendChild(ie),j.appendChild(ee);var ue=document.createElement("div");W.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var de=document.createElement("div");W.appendChild(de);var he=document.createElement("input");he.type="checkbox",he.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile"),de.appendChild(he),de.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");H.appendChild(pe);var fe=document.createElement("input");fe.type="checkbox",fe.setAttribute("data-bind","checked: wireframe"),pe.appendChild(fe),pe.appendChild(document.createTextNode("Wireframe"));var me=document.createElement("div");H.appendChild(me);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: suspendUpdates"),me.appendChild(_e),me.appendChild(document.createTextNode("Suspend LOD update"));var ge=document.createElement("div");H.appendChild(ge);var ve=document.createElement("input");ve.type="checkbox",ve.setAttribute("data-bind","checked: tileCoordinates"),ge.appendChild(ve),ge.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(r,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),define("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),h(t)}else e.resize(),e.render(),h(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering.  Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;h(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function A(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function P(e,a){e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),d=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=d,d&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var h=document.createElement("div");h.className="cesium-widget-credits";var T=o(a.creditContainer)?E(a.creditContainer):s;T.appendChild(h);var P=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=h,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var M=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:h,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=M,M.camera.constrainedAxis=t.UNIT_Z,A(this);var I=n(M.mapProjection.ellipsoid,u.WGS84),R=M.frameState.creditDisplay,O=new r("Cesium",D,"http://cesiumjs.org/");R.addDefaultCredit(O);var N=a.globe;o(N)||(N=new m(I)),N!==!1&&(M.globe=N,M.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new w({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),L!==!1&&(M.skyBox=L,M.sun=new S,M.moon=new _);var B=a.skyAtmosphere;o(B)||(B=new C(I)),B!==!1&&(M.skyAtmosphere=B);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new f({url:"https://dev.virtualearth.net"})),F!==!1&&M.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(M.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var k=this;M.renderError.addEventListener(function(e,t){if(k._useDefaultRenderLoop=!1,k._renderLoopRunning=!1,k._showRenderLoopErrors){var i="An error occurred while rendering.  Rendering has stopped.";k.showErrorPanel(i,void 0,t)}})}catch(e){if(P){var V="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:';this.showErrorPanel(V,z,e)}throw e}}var D="data:image/png;base64,[encoded data, 5656 characters]";
return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var h="(no error details available)";o(i)&&(h=d(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(h)),u.appendChild(p);var f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(f);var m=document.createElement("button");m.setAttribute("type","button"),m.className="cesium-button",m.appendChild(document.createTextNode("OK")),m.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},f.appendChild(m),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+h)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),A(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),define("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(i.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){i.startTime=e,this.synchronize()},this),this.stopTime=a.observable(i.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){i.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(i.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){i.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(i.multiplier),this.multiplier.subscribe(function(e){i.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(i.clockStep),this.clockStep.subscribe(function(e){i.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(i.clockRange),this.clockRange.subscribe(function(e){i.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(i.canAnimate),this.canAnimate.subscribe(function(e){i.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(i.shouldAnimate),this.shouldAnimate.subscribe(function(e){i.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),define("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),define("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),define("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsGeocoderService","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/CartographicGeocoderService","../../Core/Matrix4","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(r){i(r.geocoderServices)?this._geocoderServices=r.geocoderServices:this._geocoderServices=[new a,new e({scene:r.scene})],this._viewContainer=r.container,this._scene=r.scene,this._flightDuration=r.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new o,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._updateCamera=m,this._adjustSuggestionsScroll=v,this._updateSearchSuggestions=S,this._handleArrowDown=f,this._handleArrowUp=p;var n=this;this._suggestionsVisible=l.pureComputed(function(){var e=l.getObservable(n,"_suggestions"),t=e().length>0,i=l.getObservable(n,"_showSuggestions")();return t&&i}),this._searchCommand=c(function(){return n.hideSuggestions(),n._focusTextbox=!1,i(n._selectedSuggestion)?(n.activateSuggestion(n._selectedSuggestion),!1):void(n.isSearchInProgress?y(n):g(n,n._geocoderServices))}),this.deselectSuggestion=function(){n._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,o="Enter"===t.key||13===t.keyCode;return r?p(n):i?f(n):o&&n._searchCommand(),!0},this.activateSuggestion=function(e){n.hideSuggestions(),n._searchText=e.displayName;var t=e.destination;w(n),m(n,t)},this.hideSuggestions=function(){n._showSuggestions=!1,n._selectedSuggestion=void 0},this.showSuggestions=function(){n._showSuggestions=!0},this.handleMouseover=function(e,t){e!==n._selectedSuggestion&&(n._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=t(r.autocomplete,!0),this._focusTextbox=!1,l.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var s=l.getObservable(this,"_searchText");s.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=s.subscribe(function(){S(n)}),this.isSearchInProgress=void 0,l.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,l.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,l.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function p(e){if(0!==e._suggestions.length){var t,i=e._suggestions.indexOf(e._selectedSuggestion);if(i===-1||0===i)return void(e._selectedSuggestion=void 0);t=i-1,e._selectedSuggestion=e._suggestions[t],v(e,t)}}function f(e){if(0!==e._suggestions.length){var t=e._suggestions.length,i=e._suggestions.indexOf(e._selectedSuggestion),r=(i+1)%t;e._selectedSuggestion=e._suggestions[r],v(e,r)}}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:s.IDENTITY})}function _(e,t,r){return e.then(function(e){if(i(e)&&"fulfilled"===e.state&&e.value.length>0)return e;var n=t.geocode(r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}});return n})}function g(e,t){var r=e._searchText;if(C(r))return void e.showSuggestions();e._isSearchInProgress=!0;for(var n=u.resolve(),o=0;o<t.length;o++)n=_(n,t[o],r);e._geocodePromise=n,n.then(function(t){if(!n.cancel){e._isSearchInProgress=!1;var o=t.value;return"fulfilled"===t.state&&i(o)&&o.length>0?(e._searchText=o[0].displayName,void m(e,o[0].destination)):void(e._searchText=r+" (not found)")}})}function v(e,t){var i=d(e._viewContainer),r=i.getElementsByClassName("search-results")[0],n=i.getElementsByTagName("li"),o=n[t];if(0===t)return void(r.scrollTop=0);var a=o.offsetTop;a+o.clientHeight>r.clientHeight?r.scrollTop=a+o.clientHeight:a<r.scrollTop&&(r.scrollTop=a)}function y(e){e._isSearchInProgress=!1,i(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function C(e){return/^\s*$/.test(e)}function w(e){l.getObservable(e,"_suggestions").removeAll()}function S(e){if(e.autoComplete){var t=e._searchText;if(w(e),!C(t)){var i=u.resolve([]);e._geocoderServices.forEach(function(e){i=i.then(function(i){return i.length>=5?i:e.geocode(t).then(function(e){return i=i.concat(e)})})}),i.then(function(t){for(var i=e._suggestions,r=0;r<t.length;r++)i.push(t[r])})}}}return r(h.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),h.prototype.destroy=function(){this._suggestionSubscription.dispose()},h}),define("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),r.appendChild(l),this._textBox=l;var d=document.createElement("span");d.className="cesium-geocoder-searchButton",d.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(d),t.appendChild(r);var h=document.createElement("div");h.className="search-results",h.setAttribute("data-bind","visible: _suggestionsVisible");var p=document.createElement("ul");p.setAttribute("data-bind","foreach: _suggestions");var f=document.createElement("li");p.appendChild(f),f.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),h.appendChild(p),t.appendChild(h),o.applyBindings(i,r),o.applyBindings(i,h),this._container=t,this._searchSuggestionsContainer=h,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||(i._focusTextbox=!1,i.hideSuggestions())},this._onInputEnd=function(e){t.contains(e.target)&&(i._focusTextbox=!0,i.showSuggestions())},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),o.cleanNode(this._form),o.cleanNode(this._searchSuggestionsContainer),this._container.removeChild(this._form),this._container.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),i(this)},l}),define("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var i=this;this._command=n(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",r.track(this,["tooltip"])}return t(o.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),o}),define("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),define("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-infoBox-close",d.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),d.innerHTML="&times;",n.appendChild(d);var h=document.createElement("iframe");h.className="cesium-infoBox-iframe",h.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),h.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),h.setAttribute("allowfullscreen",!0),n.appendChild(h);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=h,this._viewModel=p,this._descriptionSubscription=void 0;var f=this;h.addEventListener("load",function(){var r=h.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),f._descriptionSubscription=l(p,"description",function(e){h.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;h.style.height=c+"px"})}),h.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),define("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),define("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",d.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(d);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var f=document.createElement("img");f.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",p.appendChild(f),p.appendChild(document.createTextNode("Mouse"));var m=document.createElement("button");m.type="button",m.className="cesium-navigation-button cesium-navigation-button-right",m.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var _=document.createElement("img");_.src=e("Widgets/Images/NavigationHelp/Touch.svg"),_.className="cesium-navigation-button-icon",_.style.width="25px",_.style.height="25px",m.appendChild(_),m.appendChild(document.createTextNode("Touch")),h.appendChild(p),h.appendChild(m);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML='            <table>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">Left click + drag</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Right click + drag, or</div>                        <div class="cesium-navigation-help-details">Mouse wheel scroll</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Rotate view</div>                        <div class="cesium-navigation-help-details">Middle click + drag, or</div>                        <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div>                    </td>                </tr>            </table>',h.appendChild(g);var v=document.createElement("div");v.className="cesium-touch-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),v.innerHTML='            <table>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">One finger drag</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Two finger pinch</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Tilt view</div>                        <div class="cesium-navigation-help-details">Two finger drag, same direction</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">Rotate view</div>                        <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div>                    </td>                </tr>            </table>',h.appendChild(v),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),
document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),define("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),define("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="&times;",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/ProjectionPicker/ProjectionPickerViewModel",["../../Core/Cartesian2","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Math","../../Core/Matrix4","../../Core/Ray","../../Scene/OrthographicFrustum","../../Scene/PerspectiveFrustum","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){this._scene=e,this._orthographic=e.camera.frustum instanceof d,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,f.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var t=this;f.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=m(function(){t.sceneMode===p.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new s,this._eventHelper.add(e.morphComplete,function(e,i,r,n){t.sceneMode=r,t._orthographic=r===p.SCENE2D||t._scene.camera.frustum instanceof d}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=r(e.camera._currentFlight)}),this._switchToPerspective=m(function(){t.sceneMode!==p.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=m(function(){t.sceneMode!==p.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=p}return n(_.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._eventHelper.removeAll(),o(this)},_}),define("Widgets/ProjectionPicker/ProjectionPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./ProjectionPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t);i._perspectivePath=u,i._orthographicPath=c;var r=document.createElement("span");r.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(r);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button",l.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic,       "cesium-projectionPicker-buttonOrthographic": _orthographic,       "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress,        "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),l.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',r.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",d.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),       "cesium-projectionPicker-none" : !_orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),r.appendChild(d);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",h.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),       "cesium-projectionPicker-none" : _orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),r.appendChild(h),o.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.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))}var u="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",c="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),define("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),define("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=d;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button",h.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),h.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var 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.SCENE2D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(f);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.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(m),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878         -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132         -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285         11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z         M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201         5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461         -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",d="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),define("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),define("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var d=new a(t,this._element,this._container);this._viewModel=d,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),define("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),define("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var d=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(d,n)?u=l:!t(c)&&i.greaterThanOrEquals(d,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),define("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=v.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=d(this),this._onMouseMove=h(this),this._onMouseWheel=p(this),this._onTouchStart=f(this),this._onTouchMove=_(this),this._onTouchEnd=m(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==v.touchOnly&&(0===t.button?(e._mouseMode=v.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=v.zoom:e._mouseMode=v.slide)),t.preventDefault()}}function d(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function h(e){return function(t){var i;if(e._mouseMode===v.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===v.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)));
}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function f(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function m(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=v.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _(e){return function(i){var r,o,a,s,l,u,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-d,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-d,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-d,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return w[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(E/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-E)/_}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var d="",h=.01,p=31536e6,f=1e-10,m=0,_=this._timeBarSecondsSpan;_<h?(_=h,this._timeBarSecondsSpan=h,this._endJulian=n.addSeconds(this._startJulian,h,new n)):_>p&&(_=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;g<10&&(g=10);var v,y=this._startJulian,w=Math.min(_/g*1e-5,.4),S=n.toGregorianDate(y);v=_>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(S.year/100),0))):_>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(S.year/10),0))):_>86400?n.fromDate(new Date(Date.UTC(S.year,0))):n.fromDate(new Date(Date.UTC(S.year,S.month,S.day)));var E=n.secondsDifference(this._startJulian,n.addSeconds(v,w,new n)),b=E+_;this._epochJulian=v,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-h,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=m;m-=f;var A={startTime:E,startJulian:y,epochJulian:v,duration:_,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){d+=e.render(A)});var P=0,D=0,M=0,I=T/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var R,O=-1,N=-1,L=C.length;for(R=0;R<L;++R){var B=C[R];if(++O,P=B,B>I&&B>m)break;N<0&&g*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=O)}if(O>0){for(;O>0;)if(--O,Math.abs(r(P,C[O]))<1e-5){C[O]>=m&&(D=C[O]);break}if(N>=0)for(;N<O;){if(Math.abs(r(D,C[N]))<1e-5&&C[N]>=m){M=C[N];break}++N}}m=x,m>f&&M<1e-5&&Math.abs(m-P)>f&&(M=m,m<=P+f&&(D=0));var F,k=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);o<=b;o=t(o,M))d+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=b;o=t(o,D))d+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,b+=P,o=e(P);for(var V=n.computeTaiMinusUtc(v);o<=b;){var z=n.addSeconds(y,o-E,new n);if(P>2.1){var U=n.computeTaiMinusUtc(z);Math.abs(U-V)>.1&&(o+=U-V,z=n.addSeconds(y,o-E,new n))}var G=Math.round(g*i(o)),H=this.makeLabel(z);this._rulerEle.innerHTML=H,F=this._rulerEle.offsetWidth,F<10&&(F=T);var W=G-(F/2-1);W>k?(k=W+F+5,d+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+W.toString()+'px;">'+H+"</span>"):d+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;d+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=d,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(c._context,A),A.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),define("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Scene/OrthographicFrustum","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function p(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function f(e,t,i,r){r()||(i()?(t.useWebVR=!1,e._locked&&(p(),e._locked=!1),e._noSleep.disable(),a.exitFullscreen(),i(!1)):(a.fullscreen||a.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=h("landscape")),t.useWebVR=!0,i(!0)))}function m(t,i){var r=this,n=l.observable(a.enabled),h=l.observable(!1);this.isVRMode=void 0,l.defineProperty(this,"isVRMode",{get:function(){return h()}}),this.isVREnabled=void 0,l.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&a.enabled)}}),this.tooltip=void 0,l.defineProperty(this,"tooltip",function(){return n()?h()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var m=l.observable(!1);this._isOrthographic=void 0,l.defineProperty(this,"_isOrthographic",{get:function(){return m()}}),this._eventHelper=new o,this._eventHelper.add(t.preRender,function(){m(t.camera.frustum instanceof s)}),this._locked=!1,this._noSleep=new u,this._command=c(function(){f(r,t,h,m)},l.getObservable(this,"isVREnabled")),this._vrElement=e(d(i),document.body),this._callback=function(){!a.fullscreen&&h()&&(t.useWebVR=!1,r._locked&&(p(),r._locked=!1),r._noSleep.disable(),h(!1))},document.addEventListener(a.changeEventName,this._callback)}return i(m.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(a.changeEventName,this._callback),r(this)},m}),define("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../ProjectionPicker/ProjectionPicker","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G){"use strict";function H(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function W(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof g)return o}if(r(e.scene.globe))return j(e,t.position)}function q(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function j(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new g({id:"Loading...",description:"Loading feature information..."});return E(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=Y());var i=t[0],n=new g({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ie);n.position=new f(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=Y())}),a}}function Y(){return new g({id:"None",description:"No features found."})}function X(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._projectionPicker,s=e._baseLayerPicker,l=e._animation,u=e._timeline,c=e._fullscreenButton,d=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=p),r(n)&&(n.container.style.visibility=p),r(o)&&(o.container.style.visibility=p),r(a)&&(a.container.style.visibility=p),r(s)&&(s.container.style.visibility=p),r(l)&&(l.container.style.visibility=p),r(u)&&(u.container.style.visibility=p),r(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=p),r(d)&&(d.container.style.visibility=p),r(h)&&(h.container.style.visibility=p),e._container){var f=t||!r(c)?0:c.container.clientWidth;e._vrButton.container.style.right=f+"px",e.forceResize()}}function Z(e,t){function n(e){var t=W(c,e);r(t)&&(y.getValueOrUndefined(t.position,c.clock.currentTime)?c.trackedEntity=t:c.zoomTo(t))}function o(e){c.selectedEntity=W(c,e)}e=O(e),t=i(t,i.EMPTY_OBJECT);var a=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),c=this,d=document.createElement("div");d.className="cesium-viewer",e.appendChild(d);var p=document.createElement("div");p.className="cesium-viewer-cesiumWidgetContainer",d.appendChild(p);var f=document.createElement("div");f.className="cesium-viewer-bottom",d.appendChild(f);var g=i(t.scene3DOnly,!1),v=new D(p,{terrainProvider:t.terrainProvider,imageryProvider:!a&&t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:f,scene3DOnly:g,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),C=t.dataSources,w=!1;r(C)||(C=new m,w=!0);var E=new _({scene:v.scene,dataSourceCollection:C}),q=v.clock,j=new M(q),Y=new l;Y.add(q.onTick,Z.prototype._onTick,this),Y.add(v.scene.morphStart,Z.prototype._clearTrackedObject,this);var K;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var Q=document.createElement("div");Q.className="cesium-viewer-selectionIndicatorContainer",d.appendChild(Q),K=new V(Q,v.scene)}var J;if(!r(t.infoBox)||t.infoBox!==!1){var $=document.createElement("div");$.className="cesium-viewer-infoBoxContainer",d.appendChild($),J=new L($);var ee=J.viewModel;Y.add(ee.cameraClicked,Z.prototype._onInfoBoxCameraClicked,this),Y.add(ee.closeClicked,Z.prototype._onInfoBoxClockClicked,this)}var te=document.createElement("div");te.className="cesium-viewer-toolbar",d.appendChild(te);var ie;if(!r(t.geocoder)||t.geocoder!==!1){var re=document.createElement("div");re.className="cesium-viewer-geocoderContainer",te.appendChild(re),ie=new R({container:re,geocoderServices:r(t.geocoder)?u(t.geocoder)?t.geocoder:[t.geocoder]:void 0,scene:v.scene}),Y.add(ie.viewModel.search.beforeExecute,Z.prototype._clearObjects,this)}var ne;r(t.homeButton)&&t.homeButton===!1||(ne=new N(te,v.scene),r(ie)&&Y.add(ne.viewModel.command.afterExecute,function(){var e=ie.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),Y.add(ne.viewModel.command.beforeExecute,Z.prototype._clearTrackedObject,this));var oe;g||r(t.sceneModePicker)&&t.sceneModePicker===!1||(oe=new k(te,v.scene));var ae;t.projectionPicker&&(ae=new F(te,v.scene));var se,le;if(a){var ue=i(t.imageryProviderViewModels,A()),ce=i(t.terrainProviderViewModels,P());se=new x(te,{globe:v.scene.globe,imageryProviderViewModels:ue,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:ce,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var de=te.getElementsByClassName("cesium-baseLayerPicker-dropDown");le=de[0]}var he;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var pe=!0;try{if(r(window.localStorage)){var fe=window.localStorage.getItem("cesium-hasSeenNavHelp");r(fe)&&Boolean(fe)?pe=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}he=new B({container:te,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,pe)})}var me;if(!r(t.animation)||t.animation!==!1){var _e=document.createElement("div");_e.className="cesium-viewer-animationContainer",d.appendChild(_e),me=new b(_e,new T(j))}var ge;if(!r(t.timeline)||t.timeline!==!1){var ve=document.createElement("div");ve.className="cesium-viewer-timelineContainer",d.appendChild(ve),ge=new U(ve,q),ge.addEventListener("settime",H,!1),ge.zoomTo(q.startTime,q.stopTime)}var ye,Ce;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var we=document.createElement("div");we.className="cesium-viewer-fullscreenContainer",d.appendChild(we),ye=new I(we,t.fullscreenElement),Ce=z(ye.viewModel,"isFullscreenEnabled",function(e){we.style.display=e?"block":"none",r(ge)&&(ge.container.style.right=we.clientWidth+"px",ge.resize())})}var Se,Ee,be;if(t.vrButton){var Te=document.createElement("div");Te.className="cesium-viewer-vrContainer",d.appendChild(Te),Se=new G(Te,v.scene,t.fullScreenElement),Ee=z(Se.viewModel,"isVREnabled",function(e){Te.style.display=e?"block":"none",r(ye)&&(Te.style.right=we.clientWidth+"px"),r(ge)&&(ge.container.style.right=Te.clientWidth+"px",ge.resize())}),be=z(Se.viewModel,"isVRMode",function(e){X(c,e)})}this._baseLayerPickerDropDown=le,this._fullscreenSubscription=Ce,this._vrSubscription=Ee,this._vrModeSubscription=be,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=f,this._element=d,this._cesiumWidget=v,this._selectionIndicator=K,this._infoBox=J,this._dataSourceCollection=C,this._destroyDataSourceCollection=w,this._dataSourceDisplay=E,this._clockViewModel=j,this._toolbar=te,this._homeButton=ne,this._sceneModePicker=oe,this._projectionPicker=ae,this._baseLayerPicker=se,this._navigationHelpButton=he,this._animation=me,this._timeline=ge,this._fullscreenButton=ye,this._vrButton=Se,this._geocoder=ie,this._eventHelper=Y,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(J)||r(K),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,this._selectedEntityChanged=new s,this._trackedEntityChanged=new s,S.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),Y.add(C.dataSourceAdded,Z.prototype._onDataSourceAdded,this),Y.add(C.dataSourceRemoved,Z.prototype._onDataSourceRemoved,this),Y.add(v.scene.preRender,Z.prototype.resize,this),Y.add(v.scene.postRender,Z.prototype._postRender,this);for(var xe=C.length,Ae=0;Ae<xe;Ae++)this._dataSourceAdded(C,C.get(Ae));this._dataSourceAdded(void 0,E.defaultDataSource),Y.add(C.dataSourceAdded,Z.prototype._dataSourceAdded,this),Y.add(C.dataSourceRemoved,Z.prototype._dataSourceRemoved,this),v.screenSpaceEventHandler.setInputAction(o,h.LEFT_CLICK),v.screenSpaceEventHandler.setInputAction(n,h.LEFT_DOUBLE_CLICK)}function K(e,t,n,o){J(e);var a=E.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,E(t,function(t){if(e._zoomPromise===a){if(t instanceof C)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(u(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),r(t.entities)&&(t=t.entities.values),u(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function Q(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function J(e){var t=e._zoomPromise;r(t)&&(Q(e),t.resolve(!1))}function $(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==w.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(n instanceof d){var u={destination:n,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(u):(a.setView(u),s.resolve(!0)),void Q(t)}for(var h=[],f=0,m=n.length;f<m;f++){var _=t._dataSourceDisplay.getBoundingSphere(n[f],!1,te);if(_===p.PENDING)return;_!==p.FAILED&&h.push(e.clone(te))}if(0===h.length)return void J(t);t.trackedEntity=void 0;var g=e.fromBoundingSpheres(h),v=o.screenSpaceCameraController;v.minimumZoomDistance=Math.min(v.minimumZoomDistance,.5*g.radius),t._zoomIsFlight?(Q(t),a.flyToBoundingSphere(g,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(g,t._zoomOptions),a.lookAtTransform(c.IDENTITY),Q(t),s.resolve(!0))}}function ee(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=y.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,te);if(a!==p.PENDING){var s=o.mode;s!==w.COLUMBUS_VIEW&&s!==w.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==w.COLUMBUS_VIEW&&s!==w.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==p.FAILED?te:void 0;e._entityView=new v(t,o,o.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var te=new e,ie=new t;return n(Z.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}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,J(this);var t=this.scene,i=t.mode;r(e)&&r(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==w.COLUMBUS_VIEW&&i!==w.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==w.COLUMBUS_VIEW&&i!==w.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(c.IDENTITY)),this._trackedEntityChanged.raiseEvent(e)}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,q(this._timeline,this.clock,e))}}}),Z.prototype.extend=function(e,t){e(this,t)},Z.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);
if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;if(r(l)&&(l.style.maxHeight=s+"px"),r(this._geocoder)){var u=this._geocoder.searchSuggestionsContainer;u.style.maxHeight=s+"px"}r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var c,d=this._timeline,h=0,p=0,f=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;c=this._animation.container,i>900?(h=169,m<=900&&(c.style.width="169px",c.style.height="112px",this._animation.resize())):i>=600?(h=136,(m<600||m>900)&&(c.style.width="136px",c.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(c.style.width="106px",c.style.height="70px",this._animation.resize())),p=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var _=this._fullscreenButton,g=this._vrButton,v=d.container,y=v.style;f=v.clientHeight+3,y.left=h+"px";var C=0;r(_)&&(C+=_.container.clientWidth),r(g)&&(C+=g.container.clientWidth),y.right=C+"px",d.resize()}this._bottomContainer.style.left=p+"px",this._bottomContainer.style.bottom=f+"px",this._lastWidth=i,this._lastHeight=n}},Z.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Z.prototype.render=function(){this._cesiumWidget.render()},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",H,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),o(this)},Z.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Z.prototype._onEntityCollectionChanged,this)},Z.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Z.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Z.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(r(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,te);l===p.DONE&&a.update(n,te)}var u,c=!1,d=this.selectedEntity,h=r(d)&&this._enableInfoOrSelection;if(h&&d.isShowing&&d.isAvailable(n)){var f=this._dataSourceDisplay.getBoundingSphere(d,!0,te);f!==p.FAILED?u=te.center:r(d.position)&&(u=d.position.getValue(n,u)),c=r(u)}var m=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(m)&&(m.position=t.clone(u,m.position),m.showSelection=h&&c,m.update());var _=r(this._infoBox)?this._infoBox.viewModel:void 0;r(_)&&(_.showInfo=h,_.enableCamera=c,_.isCameraTracking=this.trackedEntity===this.selectedEntity,h?(_.titleText=i(d.name,d.id),_.description=y.getValueOrDefault(d.description,n,"")):(_.titleText="",_.description=""))},Z.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Z.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Z.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Z.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Z.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Z.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&q(this.timeline,this.clock,e)},Z.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Z.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Z.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Z.prototype.zoomTo=function(e,t){return K(this,e,t,!1)},Z.prototype.flyTo=function(e,t){return K(this,e,t,!0)},Z.prototype._postRender=function(){$(this),ee(this)},Z}),define("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(e){var i=document.createElement("div");i.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesiumInspector:{get:function(){return n}}}),e.scene.postRender.addEventListener(function(){e.cesiumInspector.viewModel.update()})}return n}),define("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){d(e),_&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;n<r;n++){var o=i[n],a=new FileReader;a.onload=f(t,o,y,v),a.onerror=m(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=e(r.flyToOnDrop,!0),c=new n,_=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),v=e(r.clampToGround,!0),y=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){h(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):h(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return _},set:function(e){_=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return v},set:function(e){v=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function d(e){e.stopPropagation(),e.preventDefault()}function h(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",d,!1),r.removeEventListener("dragover",d,!1),r.removeEventListener("dragexit",d,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",d,!1),e.addEventListener("dragover",d,!1),e.addEventListener("dragexit",d,!1)}function f(e,i,r,n){var o=e.scene;return function(u){var c=i.name;try{var d;if(/\.czml$/i.test(c))d=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))d=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);d=l.load(i,{sourceUri:c,proxy:r,camera:o.camera,canvas:o.canvas})}t(d)&&e.dataSources.add(d).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function m(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),define("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(t,r){r=e(r,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});i(t,{performanceWatchdog:{get:function(){return o}}})}return o}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n  with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),define("Cesium",["./Core/appendForwardSlash","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CartographicGeocoderService","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CompressedTextureBuffer","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeocoderService","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadCRN","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadKTX","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileAvailability","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Axis","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/BlendOption","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/OrthographicOffCenterFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/crunch","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/ProjectionPicker/ProjectionPicker","./Widgets/ProjectionPicker/ProjectionPickerViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le,Be,Fe,ke,Ve,ze,Ue,Ge,He,We,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,dt,ht,pt,ft,mt,_t,gt,vt,yt,Ct,wt,St,Et,bt,Tt,xt,At,Pt,Dt,Mt,It,Rt,Ot,Nt,Lt,Bt,Ft,kt,Vt,zt,Ut,Gt,Ht,Wt,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,di,hi,pi,fi,mi,_i,gi,vi,yi,Ci,wi,Si,Ei,bi,Ti,xi,Ai,Pi,Di,Mi,Ii,Ri,Oi,Ni,Li,Bi,Fi,ki,Vi,zi,Ui,Gi,Hi,Wi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,dr,hr,pr,fr,mr,_r,gr,vr,yr,Cr,wr,Sr,Er,br,Tr,xr,Ar,Pr,Dr,Mr,Ir,Rr,Or,Nr,Lr,Br,Fr,kr,Vr,zr,Ur,Gr,Hr,Wr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,dn,hn,pn,fn,mn,_n,gn,vn,yn,Cn,wn,Sn,En,bn,Tn,xn,An,Pn,Dn,Mn,In,Rn,On,Nn,Ln,Bn,Fn,kn,Vn,zn,Un,Gn,Hn,Wn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,fo,mo,_o,go,vo,yo,Co,wo,So,Eo,bo,To,xo,Ao,Po,Do,Mo,Io,Ro,Oo,No,Lo,Bo,Fo,ko,Vo,zo,Uo,Go,Ho,Wo,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,da,ha,pa,fa,ma,_a,ga,va,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Aa,Pa,Da,Ma,Ia,Ra,Oa,Na,La,Ba,Fa,ka,Va,za,Ua,Ga,Ha,Wa,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,_s,gs,vs,ys,Cs,ws,Ss,Es,bs,Ts,xs,As,Ps,Ds,Ms,Is,Rs,Os,Ns,Ls,Bs,Fs,ks,Vs,zs,Us,Gs,Hs,Ws,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,_l,gl,vl,yl,Cl,wl,Sl,El,bl,Tl,xl,Al,Pl,Dl,Ml,Il,Rl,Ol,Nl,Ll,Bl,Fl,kl,Vl,zl,Ul,Gl,Hl,Wl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,_u,gu,vu,yu,Cu,wu,Su,Eu,bu,Tu,xu,Au,Pu,Du,Mu,Iu,Ru,Ou,Nu,Lu,Bu,Fu,ku,Vu,zu,Uu,Gu,Hu,Wu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,_c,gc,vc,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Ac,Pc,Dc,Mc,Ic,Rc,Oc,Nc,Lc,Bc,Fc,kc,Vc,zc,Uc,Gc,Hc,Wc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,_d,gd,vd,yd,Cd,wd,Sd,Ed,bd,Td,xd,Ad,Pd,Dd,Md,Id,Rd,Od,Nd,Ld,Bd,Fd,kd,Vd,zd,Ud,Gd,Hd,Wd){
"use strict";var qd={VERSION:"1.32",_shaders:{}};return qd.appendForwardSlash=e,qd.arrayRemoveDuplicates=t,qd.AssociativeArray=i,qd.AttributeCompression=r,qd.AxisAlignedBoundingBox=n,qd.barycentricCoordinates=o,qd.binarySearch=a,qd.BingMapsApi=s,qd.BingMapsGeocoderService=l,qd.BoundingRectangle=u,qd.BoundingSphere=c,qd.BoxGeometry=d,qd.BoxOutlineGeometry=h,qd.buildModuleUrl=p,qd.cancelAnimationFrame=f,qd.Cartesian2=m,qd.Cartesian3=_,qd.Cartesian4=g,qd.Cartographic=v,qd.CartographicGeocoderService=y,qd.CatmullRomSpline=C,qd.CesiumTerrainProvider=w,qd.Check=S,qd.CircleGeometry=E,qd.CircleOutlineGeometry=b,qd.Clock=T,qd.ClockRange=x,qd.ClockStep=A,qd.clone=P,qd.Color=D,qd.ColorGeometryInstanceAttribute=M,qd.combine=I,qd.ComponentDatatype=R,qd.CompressedTextureBuffer=O,qd.CornerType=N,qd.CorridorGeometry=L,qd.CorridorGeometryLibrary=B,qd.CorridorOutlineGeometry=F,qd.createGuid=k,qd.Credit=V,qd.CubicRealPolynomial=z,qd.CylinderGeometry=U,qd.CylinderGeometryLibrary=G,qd.CylinderOutlineGeometry=H,qd.DefaultProxy=W,qd.defaultValue=q,qd.defined=j,qd.defineProperties=Y,qd.deprecationWarning=X,qd.destroyObject=Z,qd.DeveloperError=K,qd.DistanceDisplayCondition=Q,qd.DistanceDisplayConditionGeometryInstanceAttribute=J,qd.EarthOrientationParameters=$,qd.EarthOrientationParametersSample=ee,qd.EasingFunction=te,qd.EllipseGeometry=ie,qd.EllipseGeometryLibrary=re,qd.EllipseOutlineGeometry=ne,qd.Ellipsoid=oe,qd.EllipsoidalOccluder=ae,qd.EllipsoidGeodesic=se,qd.EllipsoidGeometry=le,qd.EllipsoidOutlineGeometry=ue,qd.EllipsoidTangentPlane=ce,qd.EllipsoidTerrainProvider=de,qd.EncodedCartesian3=he,qd.Event=pe,qd.EventHelper=fe,qd.ExtrapolationType=me,qd.FeatureDetection=_e,qd.formatError=ge,qd.freezeObject=ve,qd.Fullscreen=ye,qd.GeocoderService=Ce,qd.GeographicProjection=we,qd.GeographicTilingScheme=Se,qd.Geometry=Ee,qd.GeometryAttribute=be,qd.GeometryAttributes=Te,qd.GeometryInstance=xe,qd.GeometryInstanceAttribute=Ae,qd.GeometryPipeline=Pe,qd.GeometryType=De,qd.getAbsoluteUri=Me,qd.getBaseUri=Ie,qd.getExtensionFromUri=Re,qd.getFilenameFromUri=Oe,qd.getImagePixels=Ne,qd.getMagic=Le,qd.getStringFromTypedArray=Be,qd.getTimestamp=Fe,qd.GregorianDate=ke,qd.HeadingPitchRange=Ve,qd.HeadingPitchRoll=ze,qd.HeightmapTerrainData=Ue,qd.HeightmapTessellator=Ge,qd.HermitePolynomialApproximation=He,qd.HermiteSpline=We,qd.Iau2000Orientation=qe,qd.Iau2006XysData=je,qd.Iau2006XysSample=Ye,qd.IauOrientationAxes=Xe,qd.IauOrientationParameters=Ze,qd.IndexDatatype=Ke,qd.InterpolationAlgorithm=Qe,qd.Intersect=Je,qd.Intersections2D=$e,qd.IntersectionTests=et,qd.Interval=tt,qd.isArray=it,qd.isCrossOriginUrl=rt,qd.isLeapYear=nt,qd.Iso8601=ot,qd.joinUrls=at,qd.JulianDate=st,qd.KeyboardEventModifier=lt,qd.LagrangePolynomialApproximation=ut,qd.LeapSecond=ct,qd.LinearApproximation=dt,qd.LinearSpline=ht,qd.loadArrayBuffer=pt,qd.loadBlob=ft,qd.loadCRN=mt,qd.loadImage=_t,qd.loadImageFromTypedArray=gt,qd.loadImageViaBlob=vt,qd.loadJson=yt,qd.loadJsonp=Ct,qd.loadKTX=wt,qd.loadText=St,qd.loadWithXhr=Et,qd.loadXML=bt,qd.MapboxApi=Tt,qd.MapProjection=xt,qd.Math=At,qd.Matrix2=Pt,qd.Matrix3=Dt,qd.Matrix4=Mt,qd.mergeSort=It,qd.NearFarScalar=Rt,qd.objectToQuery=Ot,qd.Occluder=Nt,qd.oneTimeWarning=Lt,qd.OrientedBoundingBox=Bt,qd.Packable=Ft,qd.PackableForInterpolation=kt,qd.parseResponseHeaders=Vt,qd.PinBuilder=zt,qd.PixelFormat=Ut,qd.Plane=Gt,qd.PointGeometry=Ht,qd.pointInsideTriangle=Wt,qd.PolygonGeometry=qt,qd.PolygonGeometryLibrary=jt,qd.PolygonHierarchy=Yt,qd.PolygonOutlineGeometry=Xt,qd.PolygonPipeline=Zt,qd.PolylineGeometry=Kt,qd.PolylinePipeline=Qt,qd.PolylineVolumeGeometry=Jt,qd.PolylineVolumeGeometryLibrary=$t,qd.PolylineVolumeOutlineGeometry=ei,qd.PrimitiveType=ti,qd.QuadraticRealPolynomial=ii,qd.QuantizedMeshTerrainData=ri,qd.QuarticRealPolynomial=ni,qd.Quaternion=oi,qd.QuaternionSpline=ai,qd.queryToObject=si,qd.Queue=li,qd.Ray=ui,qd.Rectangle=ci,qd.RectangleGeometry=di,qd.RectangleGeometryLibrary=hi,qd.RectangleOutlineGeometry=pi,qd.ReferenceFrame=fi,qd.requestAnimationFrame=mi,qd.RequestErrorEvent=_i,qd.RuntimeError=gi,qd.sampleTerrain=vi,qd.sampleTerrainMostDetailed=yi,qd.scaleToGeodeticSurface=Ci,qd.ScreenSpaceEventHandler=wi,qd.ScreenSpaceEventType=Si,qd.ShowGeometryInstanceAttribute=Ei,qd.Simon1994PlanetaryPositions=bi,qd.SimplePolylineGeometry=Ti,qd.SphereGeometry=xi,qd.SphereOutlineGeometry=Ai,qd.Spherical=Pi,qd.Spline=Di,qd.subdivideArray=Mi,qd.TaskProcessor=Ii,qd.TerrainData=Ri,qd.TerrainEncoding=Oi,qd.TerrainMesh=Ni,qd.TerrainProvider=Li,qd.TerrainQuantization=Bi,qd.throttleRequestByServer=Fi,qd.TileAvailability=ki,qd.TileProviderError=Vi,qd.TilingScheme=zi,qd.TimeConstants=Ui,qd.TimeInterval=Gi,qd.TimeIntervalCollection=Hi,qd.TimeStandard=Wi,qd.Tipsify=qi,qd.Transforms=ji,qd.TranslationRotationScale=Yi,qd.TridiagonalSystemSolver=Xi,qd.TrustedServers=Zi,qd.VertexFormat=Ki,qd.VideoSynchronizer=Qi,qd.Visibility=Ji,qd.VRTheWorldTerrainProvider=$i,qd.WallGeometry=er,qd.WallGeometryLibrary=tr,qd.WallOutlineGeometry=ir,qd.WebGLConstants=rr,qd.WebMercatorProjection=nr,qd.WebMercatorTilingScheme=or,qd.WindingOrder=ar,qd.wrapFunction=sr,qd.writeTextToCanvas=lr,qd.BillboardGraphics=ur,qd.BillboardVisualizer=cr,qd.BoundingSphereState=dr,qd.BoxGeometryUpdater=hr,qd.BoxGraphics=pr,qd.CallbackProperty=fr,qd.CheckerboardMaterialProperty=mr,qd.ColorMaterialProperty=_r,qd.CompositeEntityCollection=gr,qd.CompositeMaterialProperty=vr,qd.CompositePositionProperty=yr,qd.CompositeProperty=Cr,qd.ConstantPositionProperty=wr,qd.ConstantProperty=Sr,qd.CorridorGeometryUpdater=Er,qd.CorridorGraphics=br,qd.createMaterialPropertyDescriptor=Tr,qd.createPropertyDescriptor=xr,qd.createRawPropertyDescriptor=Ar,qd.CustomDataSource=Pr,qd.CylinderGeometryUpdater=Dr,qd.CylinderGraphics=Mr,qd.CzmlDataSource=Ir,qd.DataSource=Rr,qd.DataSourceClock=Or,qd.DataSourceCollection=Nr,qd.DataSourceDisplay=Lr,qd.dynamicGeometryGetBoundingSphere=Br,qd.DynamicGeometryUpdater=Fr,qd.EllipseGeometryUpdater=kr,qd.EllipseGraphics=Vr,qd.EllipsoidGeometryUpdater=zr,qd.EllipsoidGraphics=Ur,qd.Entity=Gr,qd.EntityCluster=Hr,qd.EntityCollection=Wr,qd.EntityView=qr,qd.GeoJsonDataSource=jr,qd.GeometryUpdater=Yr,qd.GeometryVisualizer=Xr,qd.GridMaterialProperty=Zr,qd.ImageMaterialProperty=Kr,qd.KmlDataSource=Qr,qd.LabelGraphics=Jr,qd.LabelVisualizer=$r,qd.MaterialProperty=en,qd.ModelGraphics=tn,qd.ModelVisualizer=rn,qd.NodeTransformationProperty=nn,qd.PathGraphics=on,qd.PathVisualizer=an,qd.PointGraphics=sn,qd.PointVisualizer=ln,qd.PolygonGeometryUpdater=un,qd.PolygonGraphics=cn,qd.PolylineArrowMaterialProperty=dn,qd.PolylineGeometryUpdater=hn,qd.PolylineGlowMaterialProperty=pn,qd.PolylineGraphics=fn,qd.PolylineOutlineMaterialProperty=mn,qd.PolylineVolumeGeometryUpdater=_n,qd.PolylineVolumeGraphics=gn,qd.PositionProperty=vn,qd.PositionPropertyArray=yn,qd.Property=Cn,qd.PropertyArray=wn,qd.PropertyBag=Sn,qd.RectangleGeometryUpdater=En,qd.RectangleGraphics=bn,qd.ReferenceProperty=Tn,qd.Rotation=xn,qd.SampledPositionProperty=An,qd.SampledProperty=Pn,qd.ScaledPositionProperty=Dn,qd.StaticGeometryColorBatch=Mn,qd.StaticGeometryPerMaterialBatch=In,qd.StaticGroundGeometryColorBatch=Rn,qd.StaticOutlineGeometryBatch=On,qd.StripeMaterialProperty=Nn,qd.StripeOrientation=Ln,qd.TimeIntervalCollectionPositionProperty=Bn,qd.TimeIntervalCollectionProperty=Fn,qd.VelocityOrientationProperty=kn,qd.VelocityVectorProperty=Vn,qd.Visualizer=zn,qd.WallGeometryUpdater=Un,qd.WallGraphics=Gn,qd.AutomaticUniforms=Hn,qd.Buffer=Wn,qd.BufferUsage=qn,qd.ClearCommand=jn,qd.ComputeCommand=Yn,qd.ComputeEngine=Xn,qd.Context=Zn,qd.ContextLimits=Kn,qd.createUniform=Qn,qd.createUniformArray=Jn,qd.CubeMap=$n,qd.CubeMapFace=eo,qd.DrawCommand=to,qd.Framebuffer=io,qd.loadCubeMap=ro,qd.MipmapHint=no,qd.Pass=oo,qd.PassState=ao,qd.PickFramebuffer=so,qd.PixelDatatype=lo,qd.Renderbuffer=uo,qd.RenderbufferFormat=co,qd.RenderState=ho,qd.Sampler=po,qd.ShaderCache=fo,qd.ShaderProgram=mo,qd.ShaderSource=_o,qd.Texture=go,qd.TextureMagnificationFilter=vo,qd.TextureMinificationFilter=yo,qd.TextureWrap=Co,qd.UniformState=wo,qd.VertexArray=So,qd.VertexArrayFacade=Eo,qd.Appearance=bo,qd.ArcGisMapServerImageryProvider=To,qd.Axis=xo,qd.BatchTable=Ao,qd.Billboard=Po,qd.BillboardCollection=Do,qd.BingMapsImageryProvider=Mo,qd.BingMapsStyle=Io,qd.BlendEquation=Ro,qd.BlendFunction=Oo,qd.BlendingState=No,qd.BlendOption=Lo,qd.Camera=Bo,qd.CameraEventAggregator=Fo,qd.CameraEventType=ko,qd.CameraFlightPath=Vo,qd.ColorBlendMode=zo,qd.createOpenStreetMapImageryProvider=Uo,qd.createTangentSpaceDebugPrimitive=Go,qd.createTileMapServiceImageryProvider=Ho,qd.CreditDisplay=Wo,qd.CullFace=qo,qd.CullingVolume=jo,qd.DebugAppearance=Yo,qd.DebugCameraPrimitive=Xo,qd.DebugModelMatrixPrimitive=Zo,qd.DepthFunction=Ko,qd.DepthPlane=Qo,qd.DeviceOrientationCameraController=Jo,qd.DiscardMissingTileImagePolicy=$o,qd.EllipsoidPrimitive=ea,qd.EllipsoidSurfaceAppearance=ta,qd.Fog=ia,qd.FrameRateMonitor=ra,qd.FrameState=na,qd.FrustumCommands=oa,qd.FXAA=aa,qd.getAttributeOrUniformBySemantic=sa,qd.getBinaryAccessor=la,qd.GetFeatureInfoFormat=ua,qd.Globe=ca,qd.GlobeDepth=da,qd.GlobeSurfaceShaderSet=ha,qd.GlobeSurfaceTile=pa,qd.GlobeSurfaceTileProvider=fa,qd.GoogleEarthImageryProvider=ma,qd.GridImageryProvider=_a,qd.GroundPrimitive=ga,qd.HeightReference=va,qd.HorizontalOrigin=ya,qd.Imagery=Ca,qd.ImageryLayer=wa,qd.ImageryLayerCollection=Sa,qd.ImageryLayerFeatureInfo=Ea,qd.ImageryProvider=ba,qd.ImagerySplitDirection=Ta,qd.ImageryState=xa,qd.Label=Aa,qd.LabelCollection=Pa,qd.LabelStyle=Da,qd.MapboxImageryProvider=Ma,qd.MapMode2D=Ia,qd.Material=Ra,qd.MaterialAppearance=Oa,qd.Model=Na,qd.ModelAnimation=La,qd.ModelAnimationCache=Ba,qd.ModelAnimationCollection=Fa,qd.ModelAnimationLoop=ka,qd.ModelAnimationState=Va,qd.ModelMaterial=za,qd.modelMaterialsCommon=Ua,qd.ModelMesh=Ga,qd.ModelNode=Ha,qd.Moon=Wa,qd.NeverTileDiscardPolicy=qa,qd.OIT=ja,qd.OrthographicFrustum=Ya,qd.OrthographicOffCenterFrustum=Xa,qd.PerformanceDisplay=Za,qd.PerInstanceColorAppearance=Ka,qd.PerspectiveFrustum=Qa,qd.PerspectiveOffCenterFrustum=Ja,qd.PickDepth=$a,qd.PointAppearance=es,qd.PointPrimitive=ts,qd.PointPrimitiveCollection=is,qd.Polyline=rs,qd.PolylineCollection=ns,qd.PolylineColorAppearance=os,qd.PolylineMaterialAppearance=as,qd.Primitive=ss,qd.PrimitiveCollection=ls,qd.PrimitivePipeline=us,qd.PrimitiveState=cs,qd.QuadtreeOccluders=ds,qd.QuadtreePrimitive=hs,qd.QuadtreeTile=ps,qd.QuadtreeTileLoadState=fs,qd.QuadtreeTileProvider=ms,qd.Scene=_s,qd.SceneMode=gs,qd.SceneTransforms=vs,qd.SceneTransitioner=ys,qd.ScreenSpaceCameraController=Cs,qd.ShadowMap=ws,qd.ShadowMapShader=Ss,qd.ShadowMode=Es,qd.SingleTileImageryProvider=bs,qd.SkyAtmosphere=Ts,qd.SkyBox=xs,qd.StencilFunction=As,qd.StencilOperation=Ps,qd.Sun=Ds,qd.SunPostProcess=Ms,qd.TerrainState=Is,qd.TextureAtlas=Rs,qd.TileBoundingBox=Os,qd.TileCoordinatesImageryProvider=Ns,qd.TileDiscardPolicy=Ls,qd.TileImagery=Bs,qd.TileReplacementQueue=Fs,qd.TileState=ks,qd.TileTerrain=Vs,qd.TweenCollection=zs,qd.UrlTemplateImageryProvider=Us,qd.VerticalOrigin=Gs,qd.ViewportQuad=Hs,qd.WebMapServiceImageryProvider=Ws,qd.WebMapTileServiceImageryProvider=qs,qd._shaders.AdjustTranslucentFS=js,qd._shaders.AllMaterialAppearanceFS=Ys,qd._shaders.AllMaterialAppearanceVS=Xs,qd._shaders.BasicMaterialAppearanceFS=Zs,qd._shaders.BasicMaterialAppearanceVS=Ks,qd._shaders.EllipsoidSurfaceAppearanceFS=Qs,qd._shaders.EllipsoidSurfaceAppearanceVS=Js,qd._shaders.PerInstanceColorAppearanceFS=$s,qd._shaders.PerInstanceColorAppearanceVS=el,qd._shaders.PerInstanceFlatColorAppearanceFS=tl,qd._shaders.PerInstanceFlatColorAppearanceVS=il,qd._shaders.PointAppearanceFS=rl,qd._shaders.PointAppearanceVS=nl,qd._shaders.PolylineColorAppearanceVS=ol,qd._shaders.PolylineMaterialAppearanceVS=al,qd._shaders.TexturedMaterialAppearanceFS=sl,qd._shaders.TexturedMaterialAppearanceVS=ll,qd._shaders.BillboardCollectionFS=ul,qd._shaders.BillboardCollectionVS=cl,qd._shaders.degreesPerRadian=dl,qd._shaders.depthRange=hl,qd._shaders.epsilon1=pl,qd._shaders.epsilon2=fl,qd._shaders.epsilon3=ml,qd._shaders.epsilon4=_l,qd._shaders.epsilon5=gl,qd._shaders.epsilon6=vl,qd._shaders.epsilon7=yl,qd._shaders.infinity=Cl,qd._shaders.oneOverPi=wl,qd._shaders.oneOverTwoPi=Sl,qd._shaders.passCompute=El,qd._shaders.passEnvironment=bl,qd._shaders.passGlobe=Tl,qd._shaders.passGround=xl,qd._shaders.passOpaque=Al,qd._shaders.passOverlay=Pl,qd._shaders.passTranslucent=Dl,qd._shaders.pi=Ml,qd._shaders.piOverFour=Il,qd._shaders.piOverSix=Rl,qd._shaders.piOverThree=Ol,qd._shaders.piOverTwo=Nl,qd._shaders.radiansPerDegree=Ll,qd._shaders.sceneMode2D=Bl,qd._shaders.sceneMode3D=Fl,qd._shaders.sceneModeColumbusView=kl,qd._shaders.sceneModeMorphing=Vl,qd._shaders.solarRadius=zl,qd._shaders.threePiOver2=Ul,qd._shaders.twoPi=Gl,qd._shaders.webMercatorMaxLatitude=Hl,qd._shaders.CzmBuiltins=Wl,qd._shaders.alphaWeight=ql,qd._shaders.antialias=jl,qd._shaders.cascadeColor=Yl,qd._shaders.cascadeDistance=Xl,qd._shaders.cascadeMatrix=Zl,qd._shaders.cascadeWeights=Kl,qd._shaders.columbusViewMorph=Ql,qd._shaders.computePosition=Jl,qd._shaders.cosineAndSine=$l,qd._shaders.decompressTextureCoordinates=eu,qd._shaders.eastNorthUpToEyeCoordinates=tu,qd._shaders.ellipsoidContainsPoint=iu,qd._shaders.ellipsoidNew=ru,qd._shaders.ellipsoidWgs84TextureCoordinates=nu,qd._shaders.equalsEpsilon=ou,qd._shaders.eyeOffset=au,qd._shaders.eyeToWindowCoordinates=su,qd._shaders.fog=lu,qd._shaders.geodeticSurfaceNormal=uu,qd._shaders.getDefaultMaterial=cu,qd._shaders.getLambertDiffuse=du,qd._shaders.getSpecular=hu,qd._shaders.getWaterNoise=pu,qd._shaders.getWgs84EllipsoidEC=fu,qd._shaders.hue=mu,qd._shaders.isEmpty=_u,qd._shaders.isFull=gu,qd._shaders.latitudeToWebMercatorFraction=vu,qd._shaders.luminance=yu,qd._shaders.metersPerPixel=Cu,qd._shaders.modelToWindowCoordinates=wu,qd._shaders.multiplyWithColorBalance=Su,qd._shaders.nearFarScalar=Eu,qd._shaders.octDecode=bu,qd._shaders.packDepth=Tu,qd._shaders.phong=xu,qd._shaders.pointAlongRay=Au,qd._shaders.rayEllipsoidIntersectionInterval=Pu,qd._shaders.RGBToXYZ=Du,qd._shaders.saturation=Mu,qd._shaders.shadowDepthCompare=Iu,qd._shaders.shadowVisibility=Ru,qd._shaders.signNotZero=Ou,qd._shaders.tangentToEyeSpaceMatrix=Nu,qd._shaders.translateRelativeToEye=Lu,qd._shaders.translucentPhong=Bu,qd._shaders.transpose=Fu,qd._shaders.unpackDepth=ku,qd._shaders.windowToEyeCoordinates=Vu,qd._shaders.XYZToRGB=zu,qd._shaders.depthRangeStruct=Uu,qd._shaders.ellipsoid=Gu,qd._shaders.material=Hu,qd._shaders.materialInput=Wu,qd._shaders.ray=qu,qd._shaders.raySegment=ju,qd._shaders.shadowParameters=Yu,qd._shaders.CompositeOITFS=Xu,qd._shaders.DepthPlaneFS=Zu,qd._shaders.DepthPlaneVS=Ku,qd._shaders.EllipsoidFS=Qu,qd._shaders.EllipsoidVS=Ju,qd._shaders.GlobeFS=$u,qd._shaders.GlobeVS=ec,qd._shaders.GroundAtmosphere=tc,qd._shaders.BumpMapMaterial=ic,qd._shaders.CheckerboardMaterial=rc,qd._shaders.DotMaterial=nc,qd._shaders.FadeMaterial=oc,qd._shaders.GridMaterial=ac,qd._shaders.NormalMapMaterial=sc,qd._shaders.PolylineArrowMaterial=lc,qd._shaders.PolylineGlowMaterial=uc,qd._shaders.PolylineOutlineMaterial=cc,qd._shaders.RimLightingMaterial=dc,qd._shaders.StripeMaterial=hc,qd._shaders.Water=pc,qd._shaders.PointPrimitiveCollectionFS=fc,qd._shaders.PointPrimitiveCollectionVS=mc,qd._shaders.PolylineCommon=_c,qd._shaders.PolylineFS=gc,qd._shaders.PolylineVS=vc,qd._shaders.AdditiveBlend=yc,qd._shaders.BrightPass=Cc,qd._shaders.FXAA=wc,qd._shaders.GaussianBlur1D=Sc,qd._shaders.PassThrough=Ec,qd._shaders.ReprojectWebMercatorFS=bc,qd._shaders.ReprojectWebMercatorVS=Tc,qd._shaders.ShadowVolumeFS=xc,qd._shaders.ShadowVolumeVS=Ac,qd._shaders.SkyAtmosphereFS=Pc,qd._shaders.SkyAtmosphereVS=Dc,qd._shaders.SkyBoxFS=Mc,qd._shaders.SkyBoxVS=Ic,qd._shaders.SunFS=Rc,qd._shaders.SunTextureFS=Oc,qd._shaders.SunVS=Nc,qd._shaders.ViewportQuadFS=Lc,qd._shaders.ViewportQuadVS=Bc,qd.Autolinker=Fc,qd.crunch=kc,qd["earcut-2.1.1"]=Vc,qd.gltfDefaults=zc,qd.kdbush=Uc,qd["knockout-3.4.0"]=Gc,qd["knockout-es5"]=Hc,qd.knockout=Wc,qd.measureText=qc,qd["mersenne-twister"]=jc,qd.NoSleep=Yc,qd.sprintf=Xc,qd.topojson=Zc,qd.Tween=Kc,qd.Uri=Qc,qd.when=Jc,qd.zip=$c,qd.Animation=ed,qd.AnimationViewModel=td,qd.BaseLayerPicker=id,qd.BaseLayerPickerViewModel=rd,qd.createDefaultImageryProviderViewModels=nd,qd.createDefaultTerrainProviderViewModels=od,qd.ProviderViewModel=ad,qd.CesiumInspector=sd,qd.CesiumInspectorViewModel=ld,qd.CesiumWidget=ud,qd.ClockViewModel=cd,qd.Command=dd,qd.createCommand=hd,qd.FullscreenButton=pd,qd.FullscreenButtonViewModel=fd,qd.Geocoder=md,qd.GeocoderViewModel=_d,qd.getElement=gd,qd.HomeButton=vd,qd.HomeButtonViewModel=yd,qd.InfoBox=Cd,qd.InfoBoxViewModel=wd,qd.NavigationHelpButton=Sd,qd.NavigationHelpButtonViewModel=Ed,qd.PerformanceWatchdog=bd,qd.PerformanceWatchdogViewModel=Td,qd.ProjectionPicker=xd,qd.ProjectionPickerViewModel=Ad,qd.SceneModePicker=Pd,qd.SceneModePickerViewModel=Dd,qd.SelectionIndicator=Md,qd.SelectionIndicatorViewModel=Id,qd.subscribeAndEvaluate=Rd,qd.SvgPathBindingHandler=Od,qd.Timeline=Nd,qd.TimelineHighlightRange=Ld,qd.TimelineTrack=Bd,qd.ToggleButtonViewModel=Fd,qd.Viewer=kd,qd.viewerCesiumInspectorMixin=Vd,qd.viewerDragDropMixin=zd,qd.viewerPerformanceWatchdogMixin=Ud,qd.VRButton=Gd,qd.VRButtonViewModel=Hd,qd.createTaskProcessorWorker=Wd,qd}),require(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}();