123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565 |
- /**
- * 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
- *
- * 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
- 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
- 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.
- */
- /*!
- * protobuf.js v6.7.0 (c) 2016, Daniel Wirtz
- * Compiled Wed, 22 Mar 2017 17:30:26 UTC
- * Licensed under the BSD-3-Clause License
- * see: https://github.com/dcodeIO/protobuf.js for details
- */
- /**
- * Dictionary of provider id to copyright strings.
- * @type {Object}
- * @default {}
- */
- /**
- @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) 2014-2015, NVIDIA CORPORATION. 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 NVIDIA CORPORATION 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 ``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
- * 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.
- */
- /*
- Copyright 2015-2018 Esri
- 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.
- A copy of the license and additional notices are located with the
- source distribution at:
- http://github.com/Esri/lerc/
- Contributors: Johannes Schmid, (LERC v1)
- Chayanika Khatua, (LERC v1)
- Wenxue Ju (LERC v1, v2.x)
- */
- /* Copyright 2015-2018 Esri. 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 @preserve */
- /*! NoSleep.js v0.7.0 - git.io/vfn01 - Rich Tibbett - MIT license */
- /*!
- * Knockout JavaScript library v3.5.0
- * (c) The Knockout.js team - http://knockoutjs.com/
- * License: MIT (http://www.opensource.org/licenses/mit-license.php)
- */
- /**
- * @license
- * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
- * Copyright (c) Steve Sanderson
- * MIT license
- */
- !function(){var 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]))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[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 void 0!==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,b,S=[],T=typeof s;if(u=u||i,C=l(u),"undefined"===T||"function"===T){for(n=!n.length&&s.length?["require","exports","module"]:n,y=0;y<n.length;y+=1)if(v=h(n[y],C),"require"===(d=v.f))S[y]=p.require(i);else if("exports"===d)S[y]=p.exports(i),b=!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&&b||(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/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("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();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}),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&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(e,t){var i;return"undefined"!=typeof document&&(i=document),n._implementation(e,t,i)}return n._implementation=function(r,n,o){if(!i(n)){if(void 0===o)return r;n=t(o.baseURI,o.location.href)}var a=new e(n);return new e(r).resolve(a).toString()},n}),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){return new r(function(i){try{return t(i?i(e):e)}catch(e){return o(e)}})}function o(e){return new r(function(i,r){try{return r?t(r(e)):o(e)}catch(e){return o(e)}})}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=b,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(null!=(i=t[--r])&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,b;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(b,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(b,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/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),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.typeOf.number.equals=function(e,i,r,o){if(n.typeOf.number(e,r),n.typeOf.number(i,o),r!==o)throw new t(e+" must be equal to "+i+", the actual values are "+r+" and "+o)},n}),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/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],u[a]="object"==typeof l?i(s,l,o):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/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/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return-1!==o&&(n=i.substring(0,o+1)),r?(i=new e(i),t(i.query)&&(n+="?"+i.query),t(i.fragment)&&(n+="#"+i.fragment),n):n}return r}),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-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=-1===n?"":r.substr(n+1)}return r}),define("Core/isBlobUri",["./Check"],function(e){"use strict";function t(e){return i.test(e)}var i=/^blob:/i;return t}),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/isDataUri",["./Check"],function(e){"use strict";function t(e){return i.test(e)}var i=/^data:/i;return t}),define("Core/loadAndExecuteScript",["../ThirdParty/when"],function(e){"use strict";function t(t){var i=e.defer(),r=document.createElement("script");r.async=!0,r.src=t;var n=document.getElementsByTagName("head")[0];return r.onload=function(){r.onload=void 0,n.removeChild(r),i.resolve()},r.onerror=function(e){i.reject(e)},n.appendChild(r),i.promise}return t}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/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/RequestState",["../Core/freezeObject"],function(e){"use strict";return e({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5})}),define("Core/RequestType",["../Core/freezeObject"],function(e){"use strict";return e({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3})}),define("Core/Request",["./defaultValue","./defined","./RequestState","./RequestType"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT);var n=e(t.throttleByServer,!1),o=e(t.throttle,!1);this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=e(t.priority,0),this.throttle=o,this.throttleByServer=n,this.type=e(t.type,r.OTHER),this.serverKey=void 0,this.state=i.UNISSUED,this.deferred=void 0,this.cancelled=!1}return n.prototype.cancel=function(){this.cancelled=!0},n.prototype.clone=function(e){return t(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new n(this)},n}),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/Event",["./Check","./defined","./defineProperties"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function n(e,t){return t-e}return i(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-1!==n&&(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 e,i=this._listeners,r=this._scopes,o=i.length;for(e=0;e<o;e++){var a=i[e];t(a)&&i[e].apply(r[e],arguments)}var s=this._toRemove;if((o=s.length)>0){for(s.sort(n),e=0;e<o;e++){var l=s[e];i.splice(l,1),r.splice(l,1)}s.length=0}this._insideRaiseEvent=!1},r}),define("Core/Heap",["./Check","./defaultValue","./defined","./defineProperties"],function(e,t,i,r){"use strict";function n(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function o(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}return r(n.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),n.prototype.reserve=function(e){e=t(e,this._length),this._array.length=e},n.prototype.heapify=function(e){e=t(e,0);for(var i=this._length,r=this._comparator,n=this._array,a=-1,s=!0;s;){var l=2*(e+1),u=l-1;a=u<i&&r(n[u],n[e])<0?u:e,l<i&&r(n[l],n[a])<0&&(a=l),a!==e?(o(n,a,e),e=a):s=!1}},n.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},n.prototype.insert=function(e){var t=this._array,r=this._comparator,n=this._maximumLength,a=this._length++;for(a<t.length?t[a]=e:t.push(e);0!==a;){var s=Math.floor((a-1)/2);if(!(r(t[a],t[s])<0))break;o(t,a,s),a=s}var l;return i(n)&&this._length>n&&(l=t[n],this._length=n),l},n.prototype.pop=function(e){if(e=t(e,0),0!==this._length){var i=this._array,r=i[e];return o(i,e,--this._length),this.heapify(e),r}},n}),define("Core/RequestScheduler",["../ThirdParty/Uri","../ThirdParty/when","./Check","./defaultValue","./defined","./defineProperties","./Event","./Heap","./isBlobUri","./isDataUri","./RequestState"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t){return e.priority-t.priority}function h(){}function p(e){n(e.priorityFunction)&&(e.priority=e.priorityFunction())}function f(e){var t=r(h.requestsByServer[e],h.maximumRequestsPerServer);return A[e]<t}function m(e){return e.state===c.UNISSUED&&(e.state=c.ISSUED,e.deferred=t.defer()),e.deferred.promise}function _(e){return function(t){e.state!==c.CANCELLED&&(--b.numberOfActiveRequests,--A[e.serverKey],x.raiseEvent(),e.state=c.RECEIVED,e.deferred.resolve(t))}}function g(e){return function(t){e.state!==c.CANCELLED&&(++b.numberOfFailedRequests,--b.numberOfActiveRequests,--A[e.serverKey],x.raiseEvent(t),e.state=c.FAILED,e.deferred.reject(t))}}function v(e){var t=m(e);return e.state=c.ACTIVE,E.push(e),++b.numberOfActiveRequests,++b.numberOfActiveRequestsEver,++A[e.serverKey],e.requestFunction().then(_(e)).otherwise(g(e)),t}function y(e){var t=e.state===c.ACTIVE;e.state=c.CANCELLED,++b.numberOfCancelledRequests,e.deferred.reject(),t&&(--b.numberOfActiveRequests,--A[e.serverKey],++b.numberOfCancelledActiveRequests),n(e.cancelFunction)&&e.cancelFunction()}function C(){h.debugShowStatistics&&(0===b.numberOfActiveRequests&&b.lastNumberOfActiveRequests>0&&(b.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+b.numberOfAttemptedRequests),b.numberOfAttemptedRequests=0),b.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+b.numberOfCancelledRequests),b.numberOfCancelledRequests=0),b.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+b.numberOfCancelledActiveRequests),b.numberOfCancelledActiveRequests=0),b.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+b.numberOfFailedRequests),b.numberOfFailedRequests=0)),b.lastNumberOfActiveRequests=b.numberOfActiveRequests)}var b={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},S=20,T=new s({comparator:d});T.maximumLength=S,T.reserve(S);var E=[],A={},w="undefined"!=typeof document?new e(document.location.href):new e,x=new a;return h.maximumRequests=50,h.maximumRequestsPerServer=6,h.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},h.throttleRequests=!0,h.debugShowStatistics=!1,h.requestCompletedEvent=x,o(h,{statistics:{get:function(){return b}},priorityHeapLength:{get:function(){return S},set:function(e){if(e<S)for(;T.length>e;){var t=T.pop();y(t)}S=e,T.maximumLength=e,T.reserve(e)}}}),h.update=function(){var e,t,i=0,r=E.length;for(e=0;e<r;++e)t=E[e],t.cancelled&&y(t),t.state===c.ACTIVE?i>0&&(E[e-i]=t):++i;E.length-=i;var n=T.internalArray,o=T.length;for(e=0;e<o;++e)p(n[e]);T.resort();for(var a=Math.max(h.maximumRequests-E.length,0),s=0;s<a&&T.length>0;)t=T.pop(),t.cancelled?y(t):!t.throttleByServer||f(t.serverKey)?(v(t),++s):y(t);C()},h.getServerKey=function(t){var i=new e(t).resolve(w);i.normalize();var r=i.authority;/:/.test(r)||(r=r+":"+("https"===i.scheme?"443":"80"));var o=A[r];return n(o)||(A[r]=0),r},h.request=function(e){if(u(e.url)||l(e.url))return x.raiseEvent(),e.state=c.RECEIVED,e.requestFunction();if(++b.numberOfAttemptedRequests,n(e.serverKey)||(e.serverKey=h.getServerKey(e.url)),!e.throttleByServer||f(e.serverKey)){if(!h.throttleRequests||!e.throttle)return v(e);if(!(E.length>=h.maximumRequests)){p(e);var t=T.insert(e);if(n(t)){if(t===e)return;y(t)}return m(e)}}},h.clearForSpecs=function(){for(;T.length>0;){y(T.pop())}for(var e=E.length,t=0;t<e;++t)y(E[t]);E.length=0,A={},b.numberOfAttemptedRequests=0,b.numberOfActiveRequests=0,b.numberOfCancelledRequests=0,b.numberOfCancelledActiveRequests=0,b.numberOfFailedRequests=0,b.numberOfActiveRequestsEver=0,b.lastNumberOfActiveRequests=0},h.numberOfActiveRequestsByServer=function(e){return A[e]},h.requestHeap=T,h}),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/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(-1!==n.indexOf("@")){n=n.split("@")[1]}if(-1===n.indexOf(":")){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)n+=":80";else{if("https"!==o)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/Resource",["../ThirdParty/Uri","../ThirdParty/when","./appendForwardSlash","./Check","./clone","./combine","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./getAbsoluteUri","./getBaseUri","./getExtensionFromUri","./isBlobUri","./isCrossOriginUrl","./isDataUri","./loadAndExecuteScript","./objectToQuery","./queryToObject","./Request","./RequestErrorEvent","./RequestScheduler","./RequestState","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A){"use strict";function w(e,t,i,r){var n=e.query;if(!s(n)||0===n.length)return{};var o;if(-1===n.indexOf("=")){var a={};a[n]=void 0,o=a}else o=y(n);t._queryParameters=i?I(o,t._queryParameters,r):o,e.query=void 0}function x(e,t){var i=t._queryParameters,r=Object.keys(i);1!==r.length||s(i[r[0]])?e.query=v(i):e.query=r[0]}function P(e,t){return s(e)?s(e.clone)?e.clone():n(e):t}function D(e){if(e.state===T.ISSUED||e.state===T.ACTIVE)throw new E("The Resource is already being fetched.");e.state=T.UNISSUED,e.deferred=void 0}function I(e,t,i){if(!i)return o(e,t);var r=n(e,!0);for(var a in t)if(t.hasOwnProperty(a)){var l=r[a],u=t[a];s(l)?(Array.isArray(l)||(l=r[a]=[l]),r[a]=l.concat(u)):r[a]=Array.isArray(u)?u.slice():u}return r}function M(t){t=a(t,a.EMPTY_OBJECT),"string"==typeof t&&(t={url:t}),this._url=void 0,this._templateValues=P(t.templateValues,{}),this._queryParameters=P(t.queryParameters,{}),this.headers=P(t.headers,{}),this.request=a(t.request,new C),this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=a(t.retryAttempts,0),this._retryCount=0;var i=new e(t.url);w(i,this,!0,!0),i.fragment=void 0,this._url=i.toString()}function R(e){var i=e.resource,r=e.flipY,n=e.preferImageBitmap,o=i.request;o.url=i.url,o.requestFunction=function(){var e=i.url,o=!1;i.isDataUri||i.isBlobUri||(o=i.isCrossOriginUrl);var a=t.defer();return M._Implementations.createImage(e,o,a,r,n),a.promise};var a=S.request(o);if(s(a))return a.otherwise(function(e){return o.state!==T.FAILED?t.reject(e):i.retryOnError(e).then(function(a){return a?(o.state=T.UNISSUED,o.deferred=void 0,R({resource:i,flipY:r,preferImageBitmap:n})):t.reject(e)})})}function O(e,i,r){var n={};n[i]=r,e.setQueryParameters(n);var o=e.request;o.url=e.url,o.requestFunction=function(){var i=t.defer();return window[r]=function(e){i.resolve(e);try{delete window[r]}catch(e){window[r]=void 0}},M._Implementations.loadAndExecuteScript(e.url,r,i),i.promise};var a=S.request(o);if(s(a))return a.otherwise(function(n){return o.state!==T.FAILED?t.reject(n):e.retryOnError(n).then(function(a){return a?(o.state=T.UNISSUED,o.deferred=void 0,O(e,i,r)):t.reject(n)})})}function L(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function N(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 F(e,t){t=a(t,"");var i=e[1],r=!!e[2],n=e[3];switch(t){case"":case"text":return L(r,n);case"arraybuffer":return N(r,n);case"blob":var o=N(r,n);return new Blob([o],{type:i});case"document":return(new DOMParser).parseFromString(L(r,n),i);case"json":return JSON.parse(L(r,n))}}function B(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(A.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e}function k(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function z(e,t,i,r,n,o,a){var s=global.require,l=s("url").parse(e),u=s("https:"===l.protocol?"https":"http"),c=s("zlib"),d={protocol:l.protocol,hostname:l.hostname,port:l.port,path:l.path,query:l.query,method:i,headers:n};u.request(d).on("response",function(e){if(e.statusCode<200||e.statusCode>=300)return void o.reject(new b(e.statusCode,e,e.headers));var i=[];e.on("data",function(e){i.push(e)}),e.on("end",function(){var r=Buffer.concat(i);"gzip"===e.headers["content-encoding"]?c.gunzip(r,function(e,i){e?o.reject(new E("Error decompressing response.")):o.resolve(k(i,t))}):o.resolve(k(r,t))})}).on("error",function(e){o.reject(new b)}).end()}var V=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();M.createIfNeeded=function(e){return e instanceof M?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new M({url:e})};var U;M.supportsImageBitmapOptions=function(){if(s(U))return U;if("function"!=typeof createImageBitmap)return U=t.resolve(!1);return U=M.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then(function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})}).then(function(e){return!0}).otherwise(function(){return!1})},l(M,{isBlobSupported:{get:function(){return V}}}),l(M.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){var i=new e(t);w(i,this,!1),i.fragment=void 0,this._url=i.toString()}},extension:{get:function(){return p(this._url)}},isDataUri:{get:function(){return _(this._url)}},isBlobUri:{get:function(){return f(this._url)}},isCrossOriginUrl:{get:function(){return m(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),M.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;var r=new e(this._url);t&&x(r,this);var n=r.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),o=this._templateValues;return n=n.replace(/{(.*?)}/g,function(e,t){var i=o[t];return s(i)?encodeURIComponent(i):e}),i&&s(this.proxy)&&(n=this.proxy.getURL(n)),n},M.prototype.setQueryParameters=function(e,t){this._queryParameters=t?I(this._queryParameters,e,!1):I(e,this._queryParameters,!1)},M.prototype.appendQueryParameters=function(e){this._queryParameters=I(e,this._queryParameters,!0)},M.prototype.setTemplateValues=function(e,t){this._templateValues=t?o(this._templateValues,e):o(e,this._templateValues)},M.prototype.getDerivedResource=function(t){var i=this.clone();if(i._retryCount=0,s(t.url)){var r=new e(t.url);w(r,i,!0,a(t.preserveQueryParameters,!1)),r.fragment=void 0,i._url=r.resolve(new e(d(this._url))).toString()}return s(t.queryParameters)&&(i._queryParameters=o(t.queryParameters,i._queryParameters)),s(t.templateValues)&&(i._templateValues=o(t.templateValues,i.templateValues)),s(t.headers)&&(i.headers=o(t.headers,i.headers)),s(t.proxy)&&(i.proxy=t.proxy),s(t.request)&&(i.request=t.request),s(t.retryCallback)&&(i.retryCallback=t.retryCallback),s(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},M.prototype.retryOnError=function(e){var i=this.retryCallback;if("function"!=typeof i||this._retryCount>=this.retryAttempts)return t(!1);var r=this;return t(i(this,e)).then(function(e){return++r._retryCount,e})},M.prototype.clone=function(e){return s(e)||(e=new M({url:this._url})),e._url=this._url,e._queryParameters=n(this._queryParameters),e._templateValues=n(this._templateValues),e.headers=n(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},M.prototype.getBaseUri=function(e){return h(this.getUrlComponent(e),e)},M.prototype.appendForwardSlash=function(){this._url=i(this._url)},M.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},
- M.fetchArrayBuffer=function(e){return new M(e).fetchArrayBuffer()},M.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},M.fetchBlob=function(e){return new M(e).fetchBlob()},M.prototype.fetchImage=function(e){e=a(e,a.EMPTY_OBJECT);var i=a(e.preferImageBitmap,!1),r=a(e.preferBlob,!1),n=a(e.flipY,!1);if(D(this.request),!V||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return R({resource:this,flipY:n,preferImageBitmap:i});var o=this.fetchBlob();if(s(o)){var l,u,c,d;return M.supportsImageBitmapOptions().then(function(e){return l=e,u=l&&i,o}).then(function(e){if(s(e)){if(d=e,u)return M.createImageBitmapFromBlob(e,{flipY:n,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return c=new M({url:t}),R({resource:c,flipY:n,preferImageBitmap:!1})}}).then(function(e){if(s(e))return e.blob=d,u?e:(window.URL.revokeObjectURL(c.url),e)}).otherwise(function(e){return s(c)&&window.URL.revokeObjectURL(c.url),e.blob=d,t.reject(e)})}},M.fetchImage=function(e){return new M(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},M.prototype.fetchText=function(){return this.fetch({responseType:"text"})},M.fetchText=function(e){return new M(e).fetchText()},M.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(s(e))return e.then(function(e){if(s(e))return JSON.parse(e)})},M.fetchJson=function(e){return new M(e).fetchJson()},M.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},M.fetchXML=function(e){return new M(e).fetchXML()},M.prototype.fetchJsonp=function(e){e=a(e,"callback"),D(this.request);var t;do{t="loadJsonp"+Math.random().toString().substring(2,8)}while(s(window[t]));return O(this,e,t)},M.fetchJsonp=function(e){return new M(e).fetchJsonp(e.callbackParameterName)},M.prototype._makeRequest=function(e){var i=this;D(i.request);var r=i.request;r.url=i.url,r.requestFunction=function(){var n=e.responseType,a=o(e.headers,i.headers),l=e.overrideMimeType,u=e.method,c=e.data,d=t.defer(),h=M._Implementations.loadWithXhr(i.url,n,u,c,a,d,l);return s(h)&&s(h.abort)&&(r.cancelFunction=function(){h.abort()}),d.promise};var n=S.request(r);if(s(n))return n.then(function(e){return e}).otherwise(function(n){return r.state!==T.FAILED?t.reject(n):i.retryOnError(n).then(function(o){return o?(r.state=T.UNISSUED,r.deferred=void 0,i.fetch(e)):t.reject(n)})})};var G=/^data:(.*?)(;base64)?,(.*)$/;M.prototype.fetch=function(e){return e=P(e,{}),e.method="GET",this._makeRequest(e)},M.fetch=function(e){return new M(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.delete=function(e){return e=P(e,{}),e.method="DELETE",this._makeRequest(e)},M.delete=function(e){return new M(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},M.prototype.head=function(e){return e=P(e,{}),e.method="HEAD",this._makeRequest(e)},M.head=function(e){return new M(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.options=function(e){return e=P(e,{}),e.method="OPTIONS",this._makeRequest(e)},M.options=function(e){return new M(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.post=function(e,t){return r.defined("data",e),t=P(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},M.post=function(e){return new M(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.put=function(e,t){return r.defined("data",e),t=P(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},M.put=function(e){return new M(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.patch=function(e,t){return r.defined("data",e),t=P(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},M.patch=function(e){return new M(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M._Implementations={},M._Implementations.createImage=function(e,t,i,r,n){M.supportsImageBitmapOptions().then(function(o){return o&&n?M.fetchBlob({url:e}).then(function(t){return s(t)?M.createImageBitmapFromBlob(t,{flipY:r,premultiplyAlpha:!1}):void i.reject(new E("Successfully retrieved "+e+" but it contained no content."))}).then(i.resolve):void B(e,t,i)}).otherwise(i.reject)},M.createImageBitmapFromBlob=function(e,t){return r.defined("options",t),r.typeOf.bool("options.flipY",t.flipY),r.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var H="undefined"==typeof XMLHttpRequest;return M._Implementations.loadWithXhr=function(e,t,i,r,n,o,a){var l=G.exec(e);if(null!==l)return void o.resolve(F(l,t));if(H)return void z(e,t,i,r,n,o,a);var u=new XMLHttpRequest;if(A.contains(e)&&(u.withCredentials=!0),u.open(i,e,!0),s(a)&&s(u.overrideMimeType)&&u.overrideMimeType(a),s(n))for(var c in n)n.hasOwnProperty(c)&&u.setRequestHeader(c,n[c]);s(t)&&(u.responseType=t);var d=!1;return"string"==typeof e&&(d=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),u.onload=function(){if((u.status<200||u.status>=300)&&(!d||0!==u.status))return void o.reject(new b(u.status,u.response,u.getAllResponseHeaders()));var e=u.response,r=u.responseType;if("HEAD"===i||"OPTIONS"===i){var n=u.getAllResponseHeaders(),a=n.trim().split(/[\r\n]+/),l={};return a.forEach(function(e){var t=e.split(": "),i=t.shift();l[i]=t.join(": ")}),void o.resolve(l)}if(204===u.status)o.resolve();else if(!s(e)||s(t)&&r!==t)if("json"===t&&"string"==typeof e)try{o.resolve(JSON.parse(e))}catch(e){o.reject(e)}else(""===r||"document"===r)&&s(u.responseXML)&&u.responseXML.hasChildNodes()?o.resolve(u.responseXML):""!==r&&"text"!==r||!s(u.responseText)?o.reject(new E("Invalid XMLHttpRequest response type.")):o.resolve(u.responseText);else o.resolve(e)},u.onerror=function(e){o.reject(new b)},u.send(r),u},M._Implementations.loadAndExecuteScript=function(e,t,i){return g(e,t).otherwise(i.reject)},M._DefaultImplementations={},M._DefaultImplementations.createImage=M._Implementations.createImage,M._DefaultImplementations.loadWithXhr=M._Implementations.loadWithXhr,M._DefaultImplementations.loadAndExecuteScript=M._Implementations.loadAndExecuteScript,M.DEFAULT=c(new M({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),M}),define("Core/buildModuleUrl",["./defined","./DeveloperError","./getAbsoluteUri","./Resource","require"],function(e,t,i,r,n){"use strict";function o(){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 a(t){return"undefined"==typeof document?t:(e(d)||(d=document.createElement("a")),d.href=t,d.href=d.href,d.href)}function s(){if(e(h))return h;var t;return t="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:e(define.amd)&&!define.amd.toUrlUndefined&&e(n.toUrl)?i("..",c("Core/buildModuleUrl.js")):o(),h=new r({url:a(t)}),h.appendForwardSlash(),h}function l(e){return a(n.toUrl("../"+e))}function u(e){return s().getDerivedResource({url:e}).url}function c(t){return e(p)||(p=e(define.amd)&&!define.amd.toUrlUndefined&&e(n.toUrl)?l:u),p(t)}var d,h,p,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=f,c._buildModuleUrlFromBaseUrl=u,c._clearBaseResource=function(){h=void 0},c.setBaseUrl=function(e){h=r.DEFAULT.getDerivedResource({url:e})},c.getCesiumBaseUrl=s,c}),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)>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./Check","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";var o={};o.EPSILON1=.1,o.EPSILON2=.01,o.EPSILON3=.001,o.EPSILON4=1e-4,o.EPSILON5=1e-5,o.EPSILON6=1e-6,o.EPSILON7=1e-7,o.EPSILON8=1e-8,o.EPSILON9=1e-9,o.EPSILON10=1e-10,o.EPSILON11=1e-11,o.EPSILON12=1e-12,o.EPSILON13=1e-13,o.EPSILON14=1e-14,o.EPSILON15=1e-15,o.EPSILON16=1e-16,o.EPSILON17=1e-17,o.EPSILON18=1e-18,o.EPSILON19=1e-19,o.EPSILON20=1e-20,o.EPSILON21=1e-21,o.GRAVITATIONALPARAMETER=3986004418e5,o.SOLAR_RADIUS=6955e5,o.LUNAR_RADIUS=1737400,o.SIXTY_FOUR_KILOBYTES=65536,o.FOUR_GIGABYTES=4294967296,o.sign=i(Math.sign,function(e){return e=+e,0===e||e!==e?e:e>0?1:-1}),o.signNotZero=function(e){return e<0?-1:1},o.toSNorm=function(e,t){return t=i(t,255),Math.round((.5*o.clamp(e,-1,1)+.5)*t)},o.fromSNorm=function(e,t){return t=i(t,255),o.clamp(e,0,t)/t*2-1},o.normalize=function(e,t,i){return i=Math.max(i-t,0),0===i?0:o.clamp((e-t)/i,0,1)},o.sinh=i(Math.sinh,function(e){return(Math.exp(e)-Math.exp(-e))/2}),o.cosh=i(Math.cosh,function(e){return(Math.exp(e)+Math.exp(-e))/2}),o.lerp=function(e,t,i){return(1-i)*e+i*t},o.PI=Math.PI,o.ONE_OVER_PI=1/Math.PI,o.PI_OVER_TWO=Math.PI/2,o.PI_OVER_THREE=Math.PI/3,o.PI_OVER_FOUR=Math.PI/4,o.PI_OVER_SIX=Math.PI/6,o.THREE_PI_OVER_TWO=3*Math.PI/2,o.TWO_PI=2*Math.PI,o.ONE_OVER_TWO_PI=1/(2*Math.PI),o.RADIANS_PER_DEGREE=Math.PI/180,o.DEGREES_PER_RADIAN=180/Math.PI,o.RADIANS_PER_ARCSECOND=o.RADIANS_PER_DEGREE/3600,o.toRadians=function(e){return e*o.RADIANS_PER_DEGREE},o.toDegrees=function(e){return e*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(e){var t=o.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},o.clampToLatitudeRange=function(e){return o.clamp(e,-1*o.PI_OVER_TWO,o.PI_OVER_TWO)},o.negativePiToPi=function(e){return o.zeroToTwoPi(e+o.PI)-o.PI},o.zeroToTwoPi=function(e){var t=o.mod(e,o.TWO_PI);return Math.abs(t)<o.EPSILON14&&Math.abs(e)>o.EPSILON14?o.TWO_PI:t},o.mod=function(e,t){return(e%t+t)%t},o.equalsEpsilon=function(e,t,r,n){n=i(n,r);var o=Math.abs(e-t);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(t))},o.lessThan=function(e,t,i){return e-t<-i},o.lessThanOrEquals=function(e,t,i){return e-t<i},o.greaterThan=function(e,t,i){return e-t>i},o.greaterThanOrEquals=function(e,t,i){return e-t>-i};var a=[1];o.factorial=function(e){var t=a.length;if(e>=t)for(var i=a[t-1],r=t;r<=e;r++){var n=i*r;a.push(n),i=n}return a[e]},o.incrementWrap=function(e,t,r){return r=i(r,0),++e,e>t&&(e=r),e},o.isPowerOfTwo=function(e){return 0!==e&&0==(e&e-1)},o.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},o.clamp=function(e,t,i){return e<t?t:e>i?i:e};var s=new e;return o.setRandomNumberSeed=function(t){s=new e(t)},o.nextRandomNumber=function(){return s.random()},o.randomBetween=function(e,t){return o.nextRandomNumber()*(t-e)+e},o.acosClamped=function(e){return Math.acos(o.clamp(e,-1,1))},o.asinClamped=function(e){return Math.asin(o.clamp(e,-1,1))},o.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},o.logBase=function(e,t){return Math.log(e)/Math.log(t)},o.cbrt=i(Math.cbrt,function(e){var t=Math.pow(Math.abs(e),1/3);return e<0?-t:t}),o.log2=i(Math.log2,function(e){return Math.log(e)*Math.LOG2E}),o.fog=function(e,t){var i=e*t;return 1-Math.exp(-i*i)},o.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},o.fastApproximateAtan2=function(e,t){var i,r,n=Math.abs(e);i=Math.abs(t),r=Math.max(n,i),i=Math.min(n,i);var a=i/r;return n=o.fastApproximateAtan(a),n=Math.abs(t)>Math.abs(e)?o.PI_OVER_TWO-n:n,n=e<0?o.PI-n:n,n=t<0?-n:n},o}),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.projectVector=function(e,t,i){var r=a.dot(e,t)/a.dot(t,t);return a.multiplyByScalar(t,r,i)},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.midpoint=function(e,t,i){return i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y),i.z=.5*(e.z+t.z),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/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),b=e.multiplyByScalar(i,C,o);if(y<l)return isFinite(C)?e.clone(b,u):void 0;var S=s.x,T=s.y,E=s.z,A=a;A.x=b.x*S*2,A.y=b.y*T*2,A.z=b.z*E*2;var w,x,P,D,I,M,R,O,L,N,F,B=(1-C)*e.magnitude(i)/(.5*e.magnitude(A)),k=0;do{B-=k,P=1/(1+B*S),D=1/(1+B*T),I=1/(1+B*E),M=P*P,R=D*D,O=I*I,L=M*P,N=R*D,F=O*I,w=_*M+g*R+v*O-1,x=_*L*S+g*N*T+v*F*E;k=w/(-2*x)}while(Math.abs(w)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=d*D,u.z=h*I,u):new e(c*P,d*D,h*I)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,r){this.longitude=i(e,0),this.latitude=i(t,0),this.height=i(r,0)}s.fromRadians=function(e,t,n,o){return n=i(n,0),r(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new s(e,t,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,i,n){var f=r(i)?i.oneOverRadii:d,m=r(i)?i.oneOverRadiiSquared:h,_=r(i)?i._centerToleranceSquared:p,g=a(t,f,m,_,u);if(r(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),b=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return r(n)?(n.longitude=C,n.latitude=b,n.height=S,n):new s(C,b,S)}},s.toCartesian=function(t,i,r){return e.fromRadians(t.longitude,t.latitude,t.height,i,r)},s.clone=function(e,t){if(r(e))return r(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||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},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","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n,o){i=r(i,0),n=r(n,0),o=r(o,0),t._radii=new e(i,n,o),t._radiiSquared=new e(i*i,n*n,o*o),t._radiiToTheFourth=new e(i*i*i*i,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===i?0:1/i,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===i?0:1/(i*i),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(i,n,o),t._maximumRadius=Math.max(i,n,o),t._centerToleranceSquared=l.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function d(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._squaredXOverSquaredZ=void 0,c(this,e,t,i)}o(d.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}}}),d.clone=function(t,i){if(n(t)){var r=t._radii;return n(i)?(e.clone(r,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 d(r.x,r.y,r.z)}},d.fromCartesian3=function(e,t){return n(t)||(t=new d),n(e)?(c(t,e.x,e.y,e.z),t):t},d.WGS84=s(new d(6378137,6378137,6356752.314245179)),d.UNIT_SPHERE=s(new d(1,1,1)),d.MOON=s(new d(l.LUNAR_RADIUS,l.LUNAR_RADIUS,l.LUNAR_RADIUS)),d.prototype.clone=function(e){return d.clone(this,e)},d.packedLength=e.packedLength,d.pack=function(t,i,n){return n=r(n,0),e.pack(t._radii,i,n),i},d.unpack=function(t,i,n){i=r(i,0);var o=e.unpack(t,i);return d.fromCartesian3(o,n)},d.prototype.geocentricSurfaceNormal=e.normalize,d.prototype.geodeticSurfaceNormalCartographic=function(t,i){var r=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(r),l=a*Math.sin(r),u=Math.sin(o);return n(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},d.prototype.geodeticSurfaceNormal=function(t,i){return n(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,p=new e;d.prototype.cartographicToCartesian=function(t,i){var r=h,o=p;this.geodeticSurfaceNormalCartographic(t,r),e.multiplyComponents(this._radiiSquared,r,o);var a=Math.sqrt(e.dot(r,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(r,t.height,r),n(i)||(i=new e),e.add(o,r,i)},d.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;n(t)?t.length=i:t=new Array(i);for(var r=0;r<i;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var f=new e,m=new e,_=new e;return d.prototype.cartesianToCartographic=function(i,r){var o=this.scaleToGeodeticSurface(i,m);if(n(o)){var a=this.geodeticSurfaceNormal(o,f),s=e.subtract(i,o,_),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),d=l.sign(e.dot(s,i))*e.magnitude(s);return n(r)?(r.longitude=u,r.latitude=c,r.height=d,r):new t(u,c,d)}},d.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;n(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},d.prototype.scaleToGeodeticSurface=function(e,t){return u(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},d.prototype.scaleToGeocentricSurface=function(t,i){n(i)||(i=new e);var r=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(r*r*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,i)},d.prototype.transformPositionToScaledSpace=function(t,i){return n(i)||(i=new e),e.multiplyComponents(t,this._oneOverRadii,i)},d.prototype.transformPositionFromScaledSpace=function(t,i){return n(i)||(i=new e),e.multiplyComponents(t,this._radii,i)},d.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},d.prototype.toString=function(){return this._radii.toString()},d.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,o){i=r(i,0);var a=this._squaredXOverSquaredZ;if(n(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=this._radii.z-i))return o},d}),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/Intersect",["./freezeObject"],function(e){"use strict";return e({OUTSIDE:-1,INTERSECTING:0,INSIDE:1})}),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),b=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]=b,t[6]=_,t[7]=y,t[8]=S,t):new l(f,m,_,g,v,y,C,b,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=-u*n+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=0,o=0;r(t)||(t={});for(var a=t.unitary=l.clone(l.IDENTITY,t.unitary),h=t.diagonal=l.clone(e,t.diagonal),p=i*u(h);o<10&&c(h)>p;)d(h,_),l.transpose(_,g),l.multiply(h,_,h),l.multiply(g,h,h),l.multiply(a,_,a),++n>2&&(++o,n=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;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+")"};var c=new Float32Array(1);return a.packFloat=function(e,t){if(i(t)||(t=new a),c[0]=e,0===(e=c[0]))return a.clone(a.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(o.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=38);var s=256*e;return t.x=Math.floor(s),s=256*(s-t.x),t.y=Math.floor(s),s=256*(s-t.y),t.z=Math.floor(s),t.w=2*(r+38)+n,t},a.unpackFloat=function(e){var t=e.w/2,i=Math.floor(t),r=2*(t-i);if(i-=38,r=2*r-1,r=-r,i>=38)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*(1/256);return n+=r*e.y*(1/65536),(n+=r*e.z*(1/16777216))*Math.pow(10,i)},a}),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),b=2*(d+m),S=2*(u+g),T=-l+p-_+v,E=2*(f-h),A=2*(d-m),w=2*(f+h),x=-l-p+_+v;return r[0]=y*o,r[1]=S*o,r[2]=A*o,r[3]=0,r[4]=C*a,r[5]=T*a,r[6]=w*a,r[7]=0,r[8]=b*s,r[9]=E*s,r[10]=x*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,b=r.y,S=r.z,T=s*-C+l*-b+u*-S,E=g*-C+v*-b+y*-S,A=f*C+m*b+_*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]=T,i[13]=E,i[14]=A,i[15]=1,i):new c(s,l,u,T,g,v,y,E,-f,-m,-_,A,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=-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]=-1,a[12]=0,a[13]=0,a[14]=h,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=-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]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,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;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]=1,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};var f=new e;c.setScale=function(t,i,r){var n=c.getScale(t,f),o=e.divideComponents(i,n,f);return c.multiplyByScale(t,o,r)},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 m=new e;c.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),i};var _=new e;c.getMaximumScale=function(t){return c.getScale(t,_),e.maximumComponent(_)},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],b=t[2],S=t[3],T=t[4],E=t[5],A=t[6],w=t[7],x=t[8],P=t[9],D=t[10],I=t[11],M=t[12],R=t[13],O=t[14],L=t[15],N=r*y+s*C+d*b+m*S,F=n*y+l*C+h*b+_*S,B=o*y+u*C+p*b+g*S,k=a*y+c*C+f*b+v*S,z=r*T+s*E+d*A+m*w,V=n*T+l*E+h*A+_*w,U=o*T+u*E+p*A+g*w,G=a*T+c*E+f*A+v*w,H=r*x+s*P+d*D+m*I,W=n*x+l*P+h*D+_*I,q=o*x+u*P+p*D+g*I,Y=a*x+c*P+f*D+v*I,j=r*M+s*R+d*O+m*L,X=n*M+l*R+h*O+_*L,Q=o*M+u*R+p*O+g*L,K=a*M+c*R+f*O+v*L;return i[0]=N,i[1]=F,i[2]=B,i[3]=k,i[4]=z,i[5]=V,i[6]=U,i[7]=G,i[8]=H,i[9]=W,i[10]=q,i[11]=Y,i[12]=j,i[13]=X,i[14]=Q,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],b=t[8],S=t[9],T=t[10],E=t[12],A=t[13],w=t[14],x=r*m+a*_+u*g,P=n*m+s*_+c*g,D=o*m+l*_+d*g,I=r*v+a*y+u*C,M=n*v+s*y+c*C,R=o*v+l*y+d*C,O=r*b+a*S+u*T,L=n*b+s*S+c*T,N=o*b+l*S+d*T,F=r*E+a*A+u*w+h,B=n*E+s*A+c*w+p,k=o*E+l*A+d*w+f;return i[0]=x,i[1]=P,i[2]=D,i[3]=0,i[4]=I,i[5]=M,i[6]=R,i[7]=0,i[8]=O,i[9]=L,i[10]=N,i[11]=0,i[12]=F,i[13]=B,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],b=r*h+a*p+u*f,S=n*h+s*p+c*f,T=o*h+l*p+d*f,E=r*m+a*_+u*g,A=n*m+s*_+c*g,w=o*m+l*_+d*g,x=r*v+a*y+u*C,P=n*v+s*y+c*C,D=o*v+l*y+d*C;return i[0]=b,i[1]=S,i[2]=T,i[3]=0,i[4]=E,i[5]=A,i[6]=w,i[7]=0,i[8]=x,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 g=new e;c.multiplyByUniformScale=function(e,t,i){return g.x=t,g.y=t,g.z=t,c.multiplyByScale(e,g,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 v=new l,y=new l,C=new t,b=new t(0,0,0,1);return c.inverse=function(e,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],g=e[10],S=e[14],T=e[3],E=e[7],A=e[11],w=e[15],x=g*w,P=S*A,D=_*w,I=S*E,M=_*A,R=g*E,O=m*w,L=S*T,N=m*A,F=g*T,B=m*E,k=_*T,z=x*h+I*p+M*f-(P*h+D*p+R*f),V=P*d+O*p+F*f-(x*d+L*p+N*f),U=D*d+L*h+B*f-(I*d+O*h+k*f),G=R*d+N*h+k*p-(M*d+F*h+B*p),H=P*n+D*o+R*a-(x*n+I*o+M*a),W=x*r+L*o+N*a-(P*r+O*o+F*a),q=I*r+O*n+k*a-(D*r+L*n+B*a),Y=M*r+F*n+B*o-(R*r+N*n+k*o);x=o*f,P=a*p,D=n*f,I=a*h,M=n*p,R=o*h,O=r*f,L=a*d,N=r*p,F=o*d,B=r*h,k=n*d;var j=x*E+I*A+M*w-(P*E+D*A+R*w),X=P*T+O*A+F*w-(x*T+L*A+N*w),Q=D*T+L*E+B*w-(I*T+O*E+k*w),K=R*T+N*E+k*A-(M*T+F*E+B*A),Z=D*g+R*S+P*_-(M*S+x*_+I*g),J=N*S+x*m+L*g-(O*g+F*S+P*m),$=O*_+k*S+I*m-(B*S+D*m+L*_),ee=B*g+M*m+F*_-(N*_+k*g+R*m),te=r*z+n*V+o*U+a*G;if(Math.abs(te)<s.EPSILON21){if(l.equalsEpsilon(c.getRotation(e,v),y,s.EPSILON7)&&t.equals(c.getRow(e,3,C),b))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;throw new u("matrix is not invertible because its determinate is zero.")}return te=1/te,i[0]=z*te,i[1]=V*te,i[2]=U*te,i[3]=G*te,i[4]=H*te,i[5]=W*te,i[6]=q*te,i[7]=Y*te,i[8]=j*te,i[9]=X*te,i[10]=Q*te,i[11]=K*te,i[12]=Z*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/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,n){t=i(t,o.WGS84);for(var a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=Number.MAX_VALUE,p=-Number.MAX_VALUE,f=0,m=e.length;f<m;f++){var _=t.cartesianToCartographic(e[f]);a=Math.min(a,_.longitude),u=Math.max(u,_.longitude),h=Math.min(h,_.latitude),p=Math.max(p,_.latitude);var g=_.longitude>=0?_.longitude:_.longitude+s.TWO_PI;c=Math.min(c,g),d=Math.max(d,g)}return u-a>d-c&&(a=c,u=d,u>s.PI&&(u-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=h,n.east=u,n.north=p,n):new l(a,h,u,p)},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.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},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 l.equalsEpsilon(this,e,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++,m.latitude=d<0?d:h>0?h: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/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Math","./Matrix3","./Matrix4","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(t,i){this.center=e.clone(r(t,e.ZERO)),this.radius=r(i,0)}var f=new e,m=new e,_=new e,g=new e,v=new e,y=new e,C=new e,b=new e,S=new e,T=new e,E=new e,A=new e,w=4/3*u.PI;p.fromPoints=function(t,i){if(n(i)||(i=new p),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var r,o=e.clone(t[0],C),a=e.clone(o,f),s=e.clone(o,m),l=e.clone(o,_),u=e.clone(o,g),c=e.clone(o,v),d=e.clone(o,y),h=t.length;for(r=1;r<h;r++){e.clone(t[r],o);var w=o.x,x=o.y,P=o.z;w<a.x&&e.clone(o,a),w>u.x&&e.clone(o,u),x<s.y&&e.clone(o,s),x>c.y&&e.clone(o,c),P<l.z&&e.clone(o,l),P>d.z&&e.clone(o,d)}var D=e.magnitudeSquared(e.subtract(u,a,b)),I=e.magnitudeSquared(e.subtract(c,s,b)),M=e.magnitudeSquared(e.subtract(d,l,b)),R=a,O=u,L=D;I>L&&(L=I,R=s,O=c),M>L&&(L=M,R=l,O=d);var N=S;N.x=.5*(R.x+O.x),N.y=.5*(R.y+O.y),N.z=.5*(R.z+O.z);var F=e.magnitudeSquared(e.subtract(O,N,b)),B=Math.sqrt(F),k=T;k.x=a.x,k.y=s.y,k.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=d.z;var V=e.midpoint(k,z,A),U=0;for(r=0;r<h;r++){e.clone(t[r],o);var G=e.magnitude(e.subtract(o,V,b));G>U&&(U=G);var H=e.magnitudeSquared(e.subtract(o,N,b));if(H>F){var W=Math.sqrt(H);B=.5*(B+W),F=B*B;var q=W-B;N.x=(B*N.x+q*o.x)/W,N.y=(B*N.y+q*o.y)/W,N.z=(B*N.z+q*o.z)/W}}return B<U?(e.clone(N,i.center),i.radius=B):(e.clone(V,i.center),i.radius=U),i};var x=new a,P=new e,D=new e,I=new t,M=new t;p.fromRectangle2D=function(e,t,i){return p.fromRectangleWithHeights2D(e,t,0,0,i)},p.fromRectangleWithHeights2D=function(t,i,o,a,s){if(n(s)||(s=new p),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;i=r(i,x),h.southwest(t,I),I.height=o,h.northeast(t,M),M.height=a;var l=i.project(I,P),u=i.project(M,D),c=u.x-l.x,d=u.y-l.y,f=u.z-l.z;s.radius=.5*Math.sqrt(c*c+d*d+f*f);var m=s.center;return m.x=l.x+.5*c,m.y=l.y+.5*d,m.z=l.z+.5*f,s};var R=[];p.fromRectangle3D=function(t,i,a,s){if(i=r(i,o.WGS84),a=r(a,0),n(s)||(s=new p),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;var l=h.subsample(t,i,a,R);return p.fromPoints(l,s)},p.fromVertices=function(t,i,o,a){if(n(a)||(a=new p),!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=C;s.x=t[0]+i.x,s.y=t[1]+i.y,s.z=t[2]+i.z;var l,u=e.clone(s,f),c=e.clone(s,m),d=e.clone(s,_),h=e.clone(s,g),w=e.clone(s,v),x=e.clone(s,y),P=t.length;for(l=0;l<P;l+=o){var D=t[l]+i.x,I=t[l+1]+i.y,M=t[l+2]+i.z;s.x=D,s.y=I,s.z=M,D<u.x&&e.clone(s,u),D>h.x&&e.clone(s,h),I<c.y&&e.clone(s,c),I>w.y&&e.clone(s,w),M<d.z&&e.clone(s,d),M>x.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(h,u,b)),O=e.magnitudeSquared(e.subtract(w,c,b)),L=e.magnitudeSquared(e.subtract(x,d,b)),N=u,F=h,B=R;O>B&&(B=O,N=c,F=w),L>B&&(B=L,N=d,F=x);var k=S;k.x=.5*(N.x+F.x),k.y=.5*(N.y+F.y),k.z=.5*(N.z+F.z);var z=e.magnitudeSquared(e.subtract(F,k,b)),V=Math.sqrt(z),U=T;U.x=u.x,U.y=c.y,U.z=d.z;var G=E;G.x=h.x,G.y=w.y,G.z=x.z;var H=e.midpoint(U,G,A),W=0;for(l=0;l<P;l+=o){s.x=t[l]+i.x,s.y=t[l+1]+i.y,s.z=t[l+2]+i.z;var q=e.magnitude(e.subtract(s,H,b));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(s,k,b));if(Y>z){var j=Math.sqrt(Y);V=.5*(V+j),z=V*V;var X=j-V;k.x=(V*k.x+X*s.x)/j,k.y=(V*k.y+X*s.y)/j,k.z=(V*k.z+X*s.z)/j}}return V<W?(e.clone(k,a.center),a.radius=V):(e.clone(H,a.center),a.radius=W),a},p.fromEncodedCartesianVertices=function(t,i,r){if(n(r)||(r=new p),!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=C;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];var a,s=e.clone(o,f),l=e.clone(o,m),u=e.clone(o,_),c=e.clone(o,g),d=e.clone(o,v),h=e.clone(o,y),w=t.length;for(a=0;a<w;a+=3){var x=t[a]+i[a],P=t[a+1]+i[a+1],D=t[a+2]+i[a+2];o.x=x,o.y=P,o.z=D,x<s.x&&e.clone(o,s),x>c.x&&e.clone(o,c),P<l.y&&e.clone(o,l),P>d.y&&e.clone(o,d),D<u.z&&e.clone(o,u),D>h.z&&e.clone(o,h)}var I=e.magnitudeSquared(e.subtract(c,s,b)),M=e.magnitudeSquared(e.subtract(d,l,b)),R=e.magnitudeSquared(e.subtract(h,u,b)),O=s,L=c,N=I;M>N&&(N=M,O=l,L=d),R>N&&(N=R,O=u,L=h);var F=S;F.x=.5*(O.x+L.x),F.y=.5*(O.y+L.y),F.z=.5*(O.z+L.z);var B=e.magnitudeSquared(e.subtract(L,F,b)),k=Math.sqrt(B),z=T;z.x=s.x,z.y=l.y,z.z=u.z;var V=E;V.x=c.x,V.y=d.y,V.z=h.z;var U=e.midpoint(z,V,A),G=0;for(a=0;a<w;a+=3){o.x=t[a]+i[a],o.y=t[a+1]+i[a+1],o.z=t[a+2]+i[a+2];var H=e.magnitude(e.subtract(o,U,b));H>G&&(G=H);var W=e.magnitudeSquared(e.subtract(o,F,b));if(W>B){var q=Math.sqrt(W);k=.5*(k+q),B=k*k;var Y=q-k;F.x=(k*F.x+Y*o.x)/q,F.y=(k*F.y+Y*o.y)/q,F.z=(k*F.z+Y*o.z)/q}}return k<G?(e.clone(F,r.center),r.radius=k):(e.clone(U,r.center),r.radius=G),r},p.fromCornerPoints=function(t,i,r){n(r)||(r=new p);var o=e.midpoint(t,i,r.center);return r.radius=e.distance(o,i),r},p.fromEllipsoid=function(t,i){return n(i)||(i=new p),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var O=new e;p.fromBoundingSpheres=function(t,i){if(n(i)||(i=new p),!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 p.clone(t[0],i);if(2===r)return p.union(t[0],t[1],i);var o,a=[];for(o=0;o<r;o++)a.push(t[o].center);i=p.fromPoints(a,i);var s=i.center,l=i.radius;for(o=0;o<r;o++){var u=t[o];l=Math.max(l,e.distance(s,u.center,O)+u.radius)}return i.radius=l,i};var L=new e,N=new e,F=new e
- ;p.fromOrientedBoundingBox=function(t,i){n(i)||(i=new p);var r=t.halfAxes,o=c.getColumn(r,0,L),a=c.getColumn(r,1,N),s=c.getColumn(r,2,F);return e.add(o,a,o),e.add(o,s,o),i.center=e.clone(t.center,i.center),i.radius=e.magnitude(o),i},p.clone=function(t,i){if(n(t))return n(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new p(t.center,t.radius)},p.packedLength=4,p.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},p.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new p);var o=i.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],i.radius=e[t],i};var B=new e,k=new e;p.union=function(t,i,r){n(r)||(r=new p);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,B),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),h=e.multiplyByScalar(u,(-a+d)/c,k);return e.add(h,o,h),e.clone(h,r.center),r.radius=d,r};var z=new e;p.expand=function(t,i,r){r=p.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,z));return n>r.radius&&(r.radius=n),r},p.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a<n?s.INTERSECTING:s.INSIDE},p.transform=function(e,t,i){return n(i)||(i=new p),i.center=d.multiplyByPoint(t,e.center,i.center),i.radius=d.getMaximumScale(t)*e.radius,i};var V=new e;p.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,V);return e.magnitudeSquared(r)-t.radius*t.radius},p.transformWithoutScale=function(e,t,i){return n(i)||(i=new p),i.center=d.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var U=new e;p.computePlaneDistances=function(t,i,r,o){n(o)||(o=new l);var a=e.subtract(t.center,i,U),s=e.dot(r,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var G=new e,H=new e,W=new e,q=new e,Y=new e,j=new t,X=new Array(8),Q=0;Q<8;++Q)X[Q]=new e;var K=new a;return p.projectTo2D=function(t,i,n){i=r(i,K);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,G),u=e.cross(e.UNIT_Z,l,H);e.normalize(u,u);var c=e.cross(l,u,W);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,Y),h=e.negate(u,q),f=X,m=f[0];e.add(l,c,m),e.add(m,u,m),m=f[1],e.add(l,c,m),e.add(m,h,m),m=f[2],e.add(l,d,m),e.add(m,h,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,h,m),m=f[6],e.add(l,d,m),e.add(m,h,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,j);i.project(y,v)}n=p.fromPoints(f,n),a=n.center;var C=a.x,b=a.y,S=a.z;return a.x=S,a.y=C,a.z=b,n},p.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},p.equals=function(t,i){return t===i||n(t)&&n(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},p.prototype.intersectPlane=function(e){return p.intersectPlane(this,e)},p.prototype.distanceSquaredTo=function(e){return p.distanceSquaredTo(this,e)},p.prototype.computePlaneDistances=function(e,t,i){return p.computePlaneDistances(this,e,t,i)},p.prototype.isOccluded=function(e){return p.isOccluded(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.volume=function(){var e=this.radius;return w*e*e*e},p}),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/GeographicTilingScheme",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=i(e,{}),this._ellipsoid=i(e.ellipsoid,o.WGS84),this._rectangle=i(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=i(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=i(e.numberOfLevelZeroTilesY,1)}return n(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var i=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return r(t)?(t.west=i,t.south=n,t.east=o,t.north=a,t):new l(i,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,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,i,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),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 r(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,i,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(i),u=this.getNumberOfYTilesAtLevel(i),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),r(n)?(n.x=p,n.y=f,n):new e(p,f)}},u}),define("Core/ApproximateTerrainHeights",["./buildModuleUrl","./defaultValue","./defined","./defineProperties","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./DeveloperError","./Ellipsoid","./GeographicTilingScheme","./Rectangle","./Resource"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){s.fromRadians(e.east,e.north,0,S[0]),s.fromRadians(e.west,e.north,0,S[1]),s.fromRadians(e.east,e.south,0,S[2]),s.fromRadians(e.west,e.south,0,S[3]);var t,i=0,r=0,n=0,o=0,a=E._terrainHeightsMaxLevel;for(t=0;t<=a;++t){for(var l=!1,u=0;u<4;++u){var c=S[u];if(b.positionToTileXY(c,t,T),0===u)n=T.x,o=T.y;else if(n!==T.x||o!==T.y){l=!0;break}}if(l)break;i=n,r=o}if(0!==t)return{x:i,y:r,level:t>a?a:t-1}}var m=new a,_=new a,g=new s,v=new a,y=new a,C=new n,b=new d,S=[new s,new s,new s,new s],T=new o,E={};return E.initialize=function(){var t=E._initPromise;return i(t)?t:(t=p.fetchJson(e("Assets/approximateTerrainHeights.json")).then(function(e){E._terrainHeights=e}),E._initPromise=t,t)},E.getMinimumMaximumHeights=function(e,r){r=t(r,c.WGS84);var n=f(e),o=E._defaultMinTerrainHeight,s=E._defaultMaxTerrainHeight;if(i(n)){var l=n.level+"-"+n.x+"-"+n.y,u=E._terrainHeights[l];i(u)&&(o=u[0],s=u[1]),r.cartographicToCartesian(h.northeast(e,g),m),r.cartographicToCartesian(h.southwest(e,g),_),a.midpoint(_,m,v);var d=r.scaleToGeodeticSurface(v,y);if(i(d)){var p=a.distance(v,d);o=Math.min(o,-p)}else o=E._defaultMinTerrainHeight}return o=Math.max(E._defaultMinTerrainHeight,o),{minimumTerrainHeight:o,maximumTerrainHeight:s}},E.getBoundingSphere=function(e,r){r=t(r,c.WGS84);var o=f(e),a=E._defaultMaxTerrainHeight;if(i(o)){var s=o.level+"-"+o.x+"-"+o.y,l=E._terrainHeights[s];i(l)&&(a=l[1])}var u=n.fromRectangle3D(e,r,0);return n.fromRectangle3D(e,r,a,C),n.union(u,C,u)},E._terrainHeightsMaxLevel=6,E._defaultMaxTerrainHeight=9e3,E._defaultMinTerrainHeight=-1e5,E._terrainHeights=void 0,E._initPromise=void 0,r(E,{initialized:{get:function(){return i(E._terrainHeights)}}}),E}),function(e,t){"function"==typeof define&&define.amd?define("ThirdParty/purify",t):e.DOMPurify=t()}(this,function(){"use strict";function e(e,t){for(var i=t.length;i--;)"string"==typeof t[i]&&(t[i]=t[i].toLowerCase()),e[t[i]]=!0;return e}function t(e){var t={},i=void 0;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}function i(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function r(){var S=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b(),T=function(e){return r(e)};if(T.version="1.0.8",T.removed=[],!S||!S.document||9!==S.document.nodeType)return T.isSupported=!1,T;var E=S.document,A=!1,w=!1,x=S.document,P=S.DocumentFragment,D=S.HTMLTemplateElement,I=S.Node,M=S.NodeFilter,R=S.NamedNodeMap,O=void 0===R?S.NamedNodeMap||S.MozNamedAttrMap:R,L=S.Text,N=S.Comment,F=S.DOMParser;if("function"==typeof D){var B=x.createElement("template");B.content&&B.content.ownerDocument&&(x=B.content.ownerDocument)}var k=x,z=k.implementation,V=k.createNodeIterator,U=k.getElementsByTagName,G=k.createDocumentFragment,H=E.importNode,W={};T.isSupported=z&&void 0!==z.createHTMLDocument&&9!==x.documentMode;var q=p,Y=f,j=m,X=_,Q=v,K=y,Z=g,J=null,$=e({},[].concat(i(n),i(o),i(a),i(s),i(l))),ee=null,te=e({},[].concat(i(u),i(c),i(d),i(h))),ie=null,re=null,ne=!0,oe=!0,ae=!1,se=!1,le=!1,ue=!1,ce=!1,de=!1,he=!1,pe=!1,fe=!1,me=!0,_e=!0,ge=!1,ve={},ye=e({},["audio","head","math","script","style","template","svg","video"]),Ce=e({},["audio","video","img","source","image"]),be=e({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Se=null,Te=x.createElement("form"),Ee=function(r){"object"!==(void 0===r?"undefined":C(r))&&(r={}),J="ALLOWED_TAGS"in r?e({},r.ALLOWED_TAGS):$,ee="ALLOWED_ATTR"in r?e({},r.ALLOWED_ATTR):te,ie="FORBID_TAGS"in r?e({},r.FORBID_TAGS):{},re="FORBID_ATTR"in r?e({},r.FORBID_ATTR):{},ve="USE_PROFILES"in r&&r.USE_PROFILES,ne=!1!==r.ALLOW_ARIA_ATTR,oe=!1!==r.ALLOW_DATA_ATTR,ae=r.ALLOW_UNKNOWN_PROTOCOLS||!1,se=r.SAFE_FOR_JQUERY||!1,le=r.SAFE_FOR_TEMPLATES||!1,ue=r.WHOLE_DOCUMENT||!1,he=r.RETURN_DOM||!1,pe=r.RETURN_DOM_FRAGMENT||!1,fe=r.RETURN_DOM_IMPORT||!1,de=r.FORCE_BODY||!1,me=!1!==r.SANITIZE_DOM,_e=!1!==r.KEEP_CONTENT,ge=r.IN_PLACE||!1,Z=r.ALLOWED_URI_REGEXP||Z,le&&(oe=!1),pe&&(he=!0),ve&&(J=e({},[].concat(i(l))),ee=[],!0===ve.html&&(e(J,n),e(ee,u)),!0===ve.svg&&(e(J,o),e(ee,c),e(ee,h)),!0===ve.svgFilters&&(e(J,a),e(ee,c),e(ee,h)),!0===ve.mathMl&&(e(J,s),e(ee,d),e(ee,h))),r.ADD_TAGS&&(J===$&&(J=t(J)),e(J,r.ADD_TAGS)),r.ADD_ATTR&&(ee===te&&(ee=t(ee)),e(ee,r.ADD_ATTR)),r.ADD_URI_SAFE_ATTR&&e(be,r.ADD_URI_SAFE_ATTR),_e&&(J["#text"]=!0),ue&&e(J,["html","head","body"]),J.table&&e(J,["tbody"]),Object&&"freeze"in Object&&Object.freeze(r),Se=r},Ae=function(e){T.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},we=function(e,t){try{T.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){T.removed.push({attribute:null,from:t})}t.removeAttribute(e)},xe=function(t){var i=void 0,r=void 0;if(de)t="<remove></remove>"+t;else{var n=t.match(/^[\s]+/);r=n&&n[0],r&&(t=t.slice(r.length))}if(A)try{i=(new F).parseFromString(t,"text/html")}catch(e){}if(w&&e(ie,["title"]),!i||!i.documentElement){i=z.createHTMLDocument("");var o=i,a=o.body;a.parentNode.removeChild(a.parentNode.firstElementChild),a.outerHTML=t}return r&&i.body.insertBefore(x.createTextNode(r),i.body.childNodes[0]||null),U.call(i,ue?"html":"body")[0]};T.isSupported&&(function(){try{xe('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">').querySelector("svg img")&&(A=!0)}catch(e){}}(),function(){try{xe("<x/><title></title><img>").querySelector("title").textContent.match(/<\/title/)&&(w=!0)}catch(e){}}());var Pe=function(e){return V.call(e.ownerDocument||e,e,M.SHOW_ELEMENT|M.SHOW_COMMENT|M.SHOW_TEXT,function(){return M.FILTER_ACCEPT},!1)},De=function(e){return!(e instanceof L||e instanceof N)&&!("string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof O&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute)},Ie=function(e){return"object"===(void 0===I?"undefined":C(I))?e instanceof I:e&&"object"===(void 0===e?"undefined":C(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Me=function(e,t,i){W[e]&&W[e].forEach(function(e){e.call(T,t,i,Se)})},Re=function(e){var t=void 0;if(Me("beforeSanitizeElements",e,null),De(e))return Ae(e),!0;var i=e.nodeName.toLowerCase();if(Me("uponSanitizeElement",e,{tagName:i,allowedTags:J}),!J[i]||ie[i]){if(_e&&!ye[i]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(e){}return Ae(e),!0}return!se||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(T.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),le&&3===e.nodeType&&(t=e.textContent,t=t.replace(q," "),t=t.replace(Y," "),e.textContent!==t&&(T.removed.push({element:e.cloneNode()}),e.textContent=t)),Me("afterSanitizeElements",e,null),!1},Oe=function(e,t,i){if(me&&("id"===t||"name"===t)&&(i in x||i in Te))return!1;if(le&&(i=i.replace(q," "),i=i.replace(Y," ")),oe&&j.test(t));else if(ne&&X.test(t));else{if(!ee[t]||re[t])return!1;if(be[t]);else if(Z.test(i.replace(K,"")));else if("src"!==t&&"xlink:href"!==t||"script"===e||0!==i.indexOf("data:")||!Ce[e]){if(ae&&!Q.test(i.replace(K,"")));else if(i)return!1}else;}return!0},Le=function(e){var t=void 0,i=void 0,r=void 0,n=void 0,o=void 0;Me("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee};for(o=a.length;o--;){t=a[o];var l=t,u=l.name,c=l.namespaceURI;if(i=t.value.trim(),r=u.toLowerCase(),s.attrName=r,s.attrValue=i,s.keepAttr=!0,Me("uponSanitizeAttribute",e,s),i=s.attrValue,"name"===r&&"IMG"===e.nodeName&&a.id)n=a.id,a=Array.prototype.slice.apply(a),we("id",e),we(u,e),a.indexOf(n)>o&&e.setAttribute("id",n.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===i&&(ee[r]||!re[r]))continue;"id"===u&&e.setAttribute(u,""),we(u,e)}if(s.keepAttr){var d=e.nodeName.toLowerCase();if(Oe(d,r,i))try{c?e.setAttributeNS(c,u,i):e.setAttribute(u,i),T.removed.pop()}catch(e){}}}Me("afterSanitizeAttributes",e,null)}},Ne=function e(t){var i=void 0,r=Pe(t);for(Me("beforeSanitizeShadowDOM",t,null);i=r.nextNode();)Me("uponSanitizeShadowNode",i,null),Re(i)||(i.content instanceof P&&e(i.content),Le(i));Me("afterSanitizeShadowDOM",t,null)};return T.sanitize=function(e,t){var i=void 0,r=void 0,n=void 0,o=void 0,a=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!T.isSupported){if("object"===C(S.toStaticHTML)||"function"==typeof S.toStaticHTML){if("string"==typeof e)return S.toStaticHTML(e);if(Ie(e))return S.toStaticHTML(e.outerHTML)}return e}if(ce||Ee(t),T.removed=[],ge);else if(e instanceof I)i=xe("\x3c!--\x3e"),r=i.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName?i=r:i.appendChild(r);else{if(!he&&!ue&&-1===e.indexOf("<"))return e;if(!(i=xe(e)))return he?null:""}i&&de&&Ae(i.firstChild);for(var s=Pe(ge?e:i);n=s.nextNode();)3===n.nodeType&&n===o||Re(n)||(n.content instanceof P&&Ne(n.content),Le(n),o=n);if(ge)return e;if(he){if(pe)for(a=G.call(i.ownerDocument);i.firstChild;)a.appendChild(i.firstChild);else a=i;return fe&&(a=H.call(E,a,!0)),a}return ue?i.outerHTML:i.innerHTML},T.setConfig=function(e){Ee(e),ce=!0},T.clearConfig=function(){Se=null,ce=!1},T.isValidAttribute=function(e,t,i){Se||Ee({});var r=e.toLowerCase(),n=t.toLowerCase();return Oe(r,n,i)},T.addHook=function(e,t){"function"==typeof t&&(W[e]=W[e]||[],W[e].push(t))},T.removeHook=function(e){W[e]&&W[e].pop()},T.removeHooks=function(e){W[e]&&(W[e]=[])},T.removeAllHooks=function(){W={}},T}var n=["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"],o=["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"],a=["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"],s=["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"],l=["#text"],u=["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"],c=["accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"],d=["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"],h=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"],p=/\{\{[\s\S]*|[\s\S]*\}\}/gm,f=/<%[\s\S]*|[\s\S]*%>/gm,m=/^data-[\-\w.\u00B7-\uFFFF]/,_=/^aria-[\-\w]+$/,g=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,v=/^(?:\w+script|data):/i,y=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b=function(){return"undefined"==typeof window?null:window};return r()}),define("Core/Credit",["../ThirdParty/purify","./defaultValue","./defined","./defineProperties","./Check"],function(e,t,i,r,n){"use strict";function o(e,r){var n,o=e;i(s[o])?n=s[o]:(n=a++,s[o]=n),r=t(r,!1),this._id=n,this._html=e,this._showOnScreen=r,this._element=void 0}var a=0,s={};return r(o.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){if(!i(this._element)){var t=e.sanitize(this._html),r=document.createElement("div");r._creditId=this._id,r.style.display="inline",r.innerHTML=t;for(var n=r.querySelectorAll("a"),o=0;o<n.length;o++)n[o].setAttribute("target","_blank");this._element=r}return this._element}}}),o.equals=function(e,t){return e===t||i(e)&&i(t)&&e._id===t._id},o.prototype.equals=function(e){return o.equals(this,e)},o.getIonCredit=function(e){var t=i(e.collapsible)&&!e.collapsible,r=new o(e.html,t);return r._isIon=-1!==r.html.indexOf("ion-credit.png"),r},o.clone=function(e){if(i(e))return new o(e.html,e.showOnScreen)},o}),define("Core/HeightmapEncoding",["./freezeObject"],function(e){"use strict";return e({NONE:0,LERC:1})}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,i,r,n){"use strict";function o(t,n,o){this.minimum=e.clone(i(t,e.ZERO)),this.maximum=e.clone(i(n,e.ZERO)),o=r(o)?e.clone(o):e.midpoint(this.minimum,this.maximum,new e),this.center=o}o.fromPoints=function(t,i){if(r(i)||(i=new o),!r(t)||0===t.length)return i.minimum=e.clone(e.ZERO,i.minimum),i.maximum=e.clone(e.ZERO,i.maximum),i.center=e.clone(e.ZERO,i.center),i;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,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=i.minimum;g.x=n,g.y=a,g.z=s;var v=i.maximum;return v.x=l,v.y=u,v.z=c,i.center=e.midpoint(g,v,i.center),i},o.clone=function(t,i){if(r(t))return r(i)?(i.minimum=e.clone(t.minimum,i.minimum),i.maximum=e.clone(t.maximum,i.maximum),i.center=e.clone(t.center,i.center),i):new o(t.minimum,t.maximum,t.center)},o.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&e.equals(t.minimum,i.minimum)&&e.equals(t.maximum,i.maximum)};var a=new e;return o.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/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./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,n(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;return 1/(l*c-u*(Math.sqrt(o-1)*c))}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(_,_))}o(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);return!(r<0?o>0:o>r&&o*o/t.magnitudeSquared(n)>r)},s.prototype.computeHorizonCullingPoint=function(e,i,r){n(r)||(r=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,r)};var h=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,i,o,a,s){n(s)||(s=new t),a=r(a,t.ZERO);for(var d=this._ellipsoid,p=c(d,e),f=0,m=0,_=i.length;m<_;m+=o){h.x=i[m]+a.x,h.y=i[m+1]+a.y,h.z=i[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){return t*t-4*e*i},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)<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 b=C<0?-1:1,S=-b*Math.abs(v)*Math.sqrt(-g);o=-C+S;var T=o/2,E=T<0?-Math.pow(-T,1/3):Math.pow(T,1/3),A=o===S?-E:-y/E;return n=y<=0?E+A:-C/(E*E+A*A+y),h*d>=c*p?[(n-s)/a]:[-u/(n+l)]}var w=f,x=-2*s*f+a*m,P=_,D=-u*m+2*l*_,I=Math.sqrt(g),M=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*I,-x)/3);n=2*Math.sqrt(-w);var O=Math.cos(R);o=n*O;var L=n*(-O/2-M*Math.sin(R)),N=o+L>2*s?o-s:L-s,F=a,B=N/F;R=Math.abs(Math.atan2(u*I,-D)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,L=n*(-O/2-M*Math.sin(R));var k=-u,z=o+L<2*l?o+l:L+l,V=k/z,U=F*z,G=-N*z-F*k,H=N*k,W=(l*G-s*H)/(-s*G+l*U);return B<=W?B<=V?W<=V?[B,W,V]:[B,V,W]:[V,B,W]:B<=V?[W,B,V]:W<=V?[W,V,B]:[V,W,B]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i;return 18*e*t*i*r+o*a-27*n*(r*r)-4*(e*a*i+o*t*r)},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),b=(l+p-u/C)/2,S=(l+p+u/C)/2,T=r.computeRealRoots(1,C,b),E=r.computeRealRoots(1,-C,S);return 0!==T.length?(T[0]+=h,T[1]+=h,0!==E.length?(E[0]+=h,E[1]+=h,T[1]<=E[0]?[T[0],T[1],E[0],E[1]]:E[1]<=T[0]?[E[0],E[1],T[0],T[1]]:T[0]>=E[0]&&T[1]<=E[1]?[E[0],T[0],T[1],E[1]]:E[0]>=T[0]&&E[1]<=T[1]?[T[0],E[0],E[1],T[1]]:T[0]>E[0]&&T[0]<E[1]?[E[0],T[0],E[1],T[1]]:[T[0],E[0],T[1],E[1]]):T):0!==E.length?(E[0]+=h,E[1]+=h,E):[]}}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,b=v-4*a,S=v+4*Math.abs(a),T=u-4*_,E=u+4*Math.abs(_);if(_<0||b*E<T*S){var A=Math.sqrt(T);f=A/2,m=0===A?0:(t*C-o)/A}else{var w=Math.sqrt(b);f=0===w?0:(t*C-o)/w,m=w/2}var x,P;0===y&&0===f?(x=0,P=0):i.sign(y)===i.sign(f)?(x=y+f,P=_/x):(P=y-f,x=_/P);var D,I;0===C&&0===m?(D=0,I=0):i.sign(C)===i.sign(m)?(D=C+m,I=a/D):(I=C-m,D=a/I);var M=r.computeRealRoots(1,x,D),R=r.computeRealRoots(1,P,I);if(0!==M.length)return 0!==R.length?M[1]<=R[0]?[M[0],M[1],R[0],R[1]]:R[1]<=M[0]?[R[0],R[1],M[0],M[1]]:M[0]>=R[0]&&M[1]<=R[1]?[R[0],M[0],M[1],R[1]]:R[0]>=M[0]&&R[1]<=M[1]?[M[0],R[0],R[1],M[1]]:M[0]>R[0]&&M[0]<R[1]?[R[0],M[0],R[1],M[1]]:[M[0],R[0],M[1],R[1]]:M;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;return s*u*d-4*l*h-4*e*c*d+18*e*t*i*h-27*o*d*d+256*a*(p*n)+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)},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:case 2:return o(u,c,d,h);case 3:case 4:return n(u,c,d,h);case 5:return o(u,c,d,h);case 6:case 7:return n(u,c,d,h);case 8:return o(u,c,d,h);case 9:case 10:return n(u,c,d,h);case 11:return o(u,c,d,h);case 12:case 13:case 14:case 15:return n(u,c,d,h);default:return}},a}),define("Core/Ray",["./Cartesian3","./Check","./defaultValue","./defined"],function(e,t,i,r){"use strict";function n(t,r){r=e.clone(i(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(i(t,e.ZERO)),this.direction=r}return n.clone=function(t,i){if(r(t))return r(i)?(i.origin=e.clone(t.origin),i.direction=e.clone(t.direction),i):new n(t.origin,t.direction)},n.getPoint=function(t,i,n){return r(n)||(n=new e),n=e.multiplyByScalar(t.direction,i,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],b=Math.sqrt(Math.max(1-C*C,0));if(y.push(new e(n,o*C,o*-b)),y.push(new e(n,o*C,o*b)),2===c.length){var S=c[1],T=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,o*S,o*-T)),y.push(new e(n,o*S,o*T))}return y}var E=v*v,A=g*g,w=f*f,x=v*g,P=w+A,D=2*(m*f+x),I=2*_*f+m*m-A+E,M=2*(_*m-x),R=_*_-E;if(0===P&&0===D&&0===I&&0===M)return y;c=u.computeRealRoots(P,D,I,M,R);var O=c.length;if(0===O)return y;for(var L=0;L<O;++L){var N,F=c[L],B=F*F,k=Math.max(1-B,0),z=Math.sqrt(k);N=a.sign(f)===a.sign(_)?p(f*B+_,m*F,a.EPSILON12):a.sign(_)===a.sign(m*F)?p(f*B,m*F+_,a.EPSILON12):p(f*B+m*F,_,a.EPSILON12);var V=p(g*F,v,a.EPSILON15),U=N*V;U<0?y.push(new e(n,o*F,o*z)):U>0?y.push(new e(n,o*F,o*-z)):0!==z?(y.push(new e(n,o*F,o*-z)),y.push(new e(n,o*F,o*z)),++L):y.push(new e(n,o*F,o*z))}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,_),b=e.subtract(o,r,g),S=e.cross(f,b,v),T=e.dot(m,S);if(s){if(T<a.EPSILON6)return;if(l=e.subtract(p,r,y),(c=e.dot(l,S))<0||c>T)return;if(u=e.cross(l,m,C),(d=e.dot(f,u))<0||c+d>T)return;h=e.dot(b,u)/T}else{if(Math.abs(T)<a.EPSILON6)return;var E=1/T;if(l=e.subtract(p,r,y),(c=e.dot(l,S)*E)<0||c>1)return;if(u=e.cross(l,m,C),(d=e.dot(f,u)*E)<0||c+d>1)return;h=e.dot(b,u)*E}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 b=new c;m.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=b;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 T=new c;m.lineSegmentSphere=function(t,i,n,o){var a=T;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var E=new e,A=new e;m.rayEllipsoid=function(t,i){var r,n,a,s,l,u=i.oneOverRadii,c=e.multiplyComponents(u,t.origin,E),d=e.multiplyComponents(u,t.direction,A),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 w=new e,x=new e,P=new e,D=new e,I=new e,M=new s,R=new s,O=new s,L=new s,N=new s,F=new s,B=new s,k=new e,z=new e,V=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,w);if(e.dot(o,l)>=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(o,w),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,D),p=e.normalize(e.cross(h,d,x),x),m=e.normalize(e.cross(d,p,P),P),_=M;_[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,L),C=N;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 b,S,T=s.multiply(s.multiply(g,y,F),C,F),E=s.multiply(s.multiply(T,v,B),_,B),A=s.multiplyByVector(T,n,I),U=f(E,e.negate(A,w),0,0,1),G=U.length;if(G>0){for(var H=e.clone(e.ZERO,z),W=Number.NEGATIVE_INFINITY,q=0;q<G;++q){b=s.multiplyByVector(v,s.multiplyByVector(_,U[q],k),k);var Y=e.normalize(e.subtract(b,n,D),D),j=e.dot(Y,o);j>W&&(W=j,H=e.clone(b,H))}var X=i.cartesianToCartographic(H,V);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","./Check","./defined","./DeveloperError","./freezeObject","./Math","./Matrix4"],function(e,t,i,r,n,o,a){"use strict";function s(t,i){this.normal=e.clone(t),this.distance=i}s.fromPointNormal=function(t,r,n){var o=-e.dot(r,t);return i(n)?(e.clone(r,n.normal),n.distance=o,n):new s(r,o)};var l=new e;s.fromCartesian4=function(t,r){var n=e.fromCartesian4(t,l),o=t.w;return i(r)?(e.clone(n,r.normal),r.distance=o,r):new s(n,o)},s.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance};var u=new e;s.projectPointOntoPlane=function(t,r,n){i(n)||(n=new e);var o=s.getPointDistance(t,r),a=e.multiplyByScalar(t.normal,o,u);return e.subtract(r,a,n)};var c=new e;return s.transform=function(t,i,r){return a.multiplyByPointAsVector(i,t.normal,l),e.normalize(l,l),e.multiplyByScalar(t.normal,-t.distance,c),a.multiplyByPoint(i,c,c),s.fromPointNormal(c,l,r)},s.clone=function(t,r){return i(r)?(e.clone(t.normal,r.normal),r.distance=t.distance,r):new s(t.normal,t.distance)},s.equals=function(t,i){return t.distance===i.distance&&e.equals(t.normal,i.normal)},s.ORIGIN_XY_PLANE=n(new s(e.UNIT_Z,0)),s.ORIGIN_YZ_PLANE=n(new s(e.UNIT_X,0)),s.ORIGIN_ZX_PLANE=n(new s(e.UNIT_Y,0)),s}),define("Core/binarySearch",["./Check"],function(e){"use strict";function t(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))<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return t}),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,b=!1,S=" ",T=l.length,E=0;l&&E<T;E++)switch(l.charAt(E)){case" ":y=" ";break;case"+":y="+";break;case"-":v=!0;break;case"'":S=l.charAt(E+1);break;case"0":C=!0;break;case"#":b=!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,b,v,u,d,C);case"o":return a(g,8,b,v,u,d,C);case"x":return a(g,16,b,v,u,d,C);case"X":return a(g,16,b,v,u,d,C).toUpperCase();case"u":return a(g,10,b,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";return e({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})}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";return e({UTC:0,TAI:1})}),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){v.julianDate=e;var i=m.leapSeconds,r=t(i,v,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){m.secondsDifference(i[r].julianDate,e)>n&&(r--,n=i[r].offset)}m.addSeconds(e,n,e)}function h(e,i){v.julianDate=e;var r=m.leapSeconds,n=t(r,v,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)<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=new s,y=/^(\d{4})$/,C=/^(\d{4})-(\d{2})$/,b=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,T=/^(\d{4})-?(\d{2})-?(\d{2})$/,E=/([Z+\-])?(\d{2})?:?(\d{2})?$/,A=/^(\d{2})(\.\d+)?/.source+E.source,w=/^(\d{2}):?(\d{2})(\.\d+)?/.source+E.source,x=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+E.source;m.fromGregorianDate=function(e,t){var i=f(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r(t)?(p(i[0],i[1],t),d(t),t):new m(i[0],i[1],u.UTC)},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,v=0,E=0,P=s[0],D=s[1];if(null!==(s=P.match(T)))i=+s[1],l=+s[2],c=+s[3];else if(null!==(s=P.match(C)))i=+s[1],l=+s[2];else if(null!==(s=P.match(y)))i=+s[1];else{var I;if(null!==(s=P.match(b)))i=+s[1],I=+s[2],o=a(i);else if(null!==(s=P.match(S))){i=+s[1];var M=+s[2],R=+s[3]||0,O=new Date(Date.UTC(i,0,4));I=7*M+R-O.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(D)){s=D.match(x),null!==s?(h=+s[1],_=+s[2],v=+s[3],E=1e3*+(s[4]||0),L=5):(s=D.match(w),null!==s?(h=+s[1],_=+s[2],v=60*+(s[3]||0),L=4):null!==(s=D.match(A))&&(h=+s[1],_=60*+(s[2]||0),L=3));var N=s[L],F=+s[L+1],B=+(s[L+2]||0);switch(N){case"+":h-=F,_-=B;break;case"-":h+=F,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,h,_)).getTimezoneOffset()}}var k=60===v;for(k&&v--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===l?29:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?29: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?29:g[l-1],c+=n;var z=f(i,l,c,h,_,v,E);return r(t)?(p(z[0],z[1],t),d(t)):t=new m(z[0],z[1],u.UTC),k&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var P=new m(0,0,u.TAI);return m.toGregorianDate=function(e,t){var i=!1,n=h(e,P);r(n)||(m.addSeconds(e,-1,P),n=h(P,P),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 b=0|y,S=(y-b)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(b+=1),r(t)?(t.year=g,t.month=_,t.day=f,t.hour=v,t.minute=C,t.second=b,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,f,v,C,b,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=m.toGregorianDate(t,_),o=n.year,a=n.month,s=n.day,l=n.hour,u=n.minute,c=n.second,d=n.millisecond;1e4===o&&1===a&&1===s&&0===l&&0===u&&0===c&&0===d&&(o=9999,a=12,s=31,l=24);var h;return r(i)||0===d?r(i)&&0!==i?(h=(.01*d).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o,a,s,l,u,c,h)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o,a,s,l,u,c):(h=(.01*d).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o,a,s,l,u,c,h))},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){return(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY},m.computeTaiMinusUtc=function(e){v.julianDate=e;var i=m.leapSeconds,r=t(i,v,c);return r<0&&(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){return p(e.dayNumber+t,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/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./Resource","./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=l.createIfNeeded(t.url),o=this;this._downloadPromise=e(n.fetchJson(),function(e){f(o,e)},function(){o._dataError="An error occurred while retrieving the EOP data from the URL "+n.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,b=_.length;C<b;C+=e._columnCount){var S=_[C+n],T=_[C+m],E=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new a(E,T,d.TAI);if(g.push(A),y){if(T!==v&&r(v)){var w=a.leapSeconds,x=t(w,A,p);if(x<0){var P=new s(A,T);w.splice(~x,0,P)}}v=T}}}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)<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/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 o=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),s=2*(e.w*e.x+e.y*e.z),l=1-2*(e.y*e.y+e.z*e.z),u=2*(e.w*e.z+e.x*e.y);return i.heading=-Math.atan2(u,l),i.roll=Math.atan2(s,a),i.pitch=-r.asinClamped(o),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/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","./Resource","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._xysFileUrlTemplate=a.createIfNeeded(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),l=Math.pow(this._stepSizeDays,t),u=0;u<=t;++u){r[u]=l,n[u]=u*this._stepSizeDays;for(var c=0;c<=t;++c)c!==u&&(r[u]*=u-c);r[u]=1/r[u]}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.getDerivedResource({templateValues:{0:n}}):new a({url:t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json")}),e(s.fetchJson(),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)<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 b=3*(l+f);i.x+=y[f]*p[b++],i.y+=y[f]*p[b++],i.s+=y[f]*p[b]}return i}}}},l}),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","./defineProperties","./DeveloperError","./Fullscreen","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function s(){if(!t(A)&&(A=!1,!m())){var e=/ Chrome\/([\.0-9]+)/.exec(E.userAgent);null!==e&&(A=!0,w=a(e[1]))}return A}function l(){return s()&&w}function u(){if(!t(x)&&(x=!1,!s()&&!m()&&/ Safari\/[\.0-9]+/.test(E.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(E.userAgent);null!==e&&(x=!0,P=a(e[1]))}return x}function c(){return u()&&P}function d(){if(!t(D)){D=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(E.userAgent);null!==e&&(D=!0,I=a(e[1]),I.isNightly=!!e[2])}return D}function h(){return d()&&I}function p(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===E.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(E.userAgent))&&(M=!0,R=a(e[1])):"Netscape"===E.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(E.userAgent))&&(M=!0,R=a(e[1]))}return M}function f(){return p()&&R}function m(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(E.userAgent);null!==e&&(O=!0,L=a(e[1]))}return O}function _(){return m()&&L}function g(){if(!t(N)){N=!1;var e=/Firefox\/([\.0-9]+)/.exec(E.userAgent);null!==e&&(N=!0,F=a(e[1]))}return N}function v(){return t(B)||(B=/Windows/i.test(E.appVersion)),B}function y(){return g()&&F}function C(){return t(k)||(k=!g()&&"undefined"!=typeof PointerEvent&&(!t(E.pointerEnabled)||E.pointerEnabled)),k}function b(){if(!t(V)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;V=t(i)&&""!==i,V&&(z=i)}return V}function S(){return b()?z:void 0}function T(){return T._result}var E;E="undefined"!=typeof navigator?navigator:{};var A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V;T._promise=void 0,T._result=void 0,T.initialize=function(){if(t(T._promise))return T._promise;var e=o.defer();if(T._promise=e.promise,m())return T._result=!1,e.resolve(T._result),e.promise;var i=new Image;return i.onload=function(){T._result=i.width>0&&i.height>0,e.resolve(T._result)},i.onerror=function(){T._result=!1,e.resolve(T._result)},i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},i(T,{initialized:{get:function(){return t(T._result)}}});var U=[];"undefined"!=typeof ArrayBuffer&&(U.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&U.push(Uint8ClampedArray),"undefined"!=typeof CanvasPixelArray&&U.push(CanvasPixelArray));var G={isChrome:s,chromeVersion:l,isSafari:u,safariVersion:c,isWebkit:d,webkitVersion:h,isInternetExplorer:p,internetExplorerVersion:f,isEdge:m,edgeVersion:_,isFirefox:g,firefoxVersion:y,isWindows:v,hardwareConcurrency:e(E.hardwareConcurrency,3),supportsPointerEvents:C,supportsImageRenderingPixelated:b,supportsWebP:T,imageRenderingValue:S,typedArrayTypes:U};return G.supportsFullscreen=function(){return n.supportsFullscreen()},G.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},G.supportsWebWorkers=function(){return"undefined"!=typeof Worker},G.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!G.isEdge()},G}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.z=i(r,0),this.w=i(n,0)}var u=new e;l.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);u=e.normalize(t,u);var s=u.x*a,c=u.y*a,d=u.z*a,h=Math.cos(o);return r(n)?(n.x=s,n.y=c,n.z=d,n.w=h,n):new l(s,c,d,h)};var c=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var i,n,o,a,u,h=e[s.COLUMN0ROW0],p=e[s.COLUMN1ROW1],f=e[s.COLUMN2ROW2],m=h+p+f;if(m>0)i=Math.sqrt(m+1),u=.5*i,i=.5/i,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*i,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*i,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*i;else{var _=c,g=0;p>h&&(g=1),f>h&&f>p&&(g=2);var v=_[g],y=_[v];i=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(v,v)]-e[s.getElementIndex(y,y)]+1);var C=d;C[g]=.5*i,i=.5/i,u=(e[s.getElementIndex(y,v)]-e[s.getElementIndex(v,y)])*i,C[v]=(e[s.getElementIndex(v,g)]+e[s.getElementIndex(g,v)])*i,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*i,n=-C[0],o=-C[1],a=-C[2]}return r(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var h=new l,p=new l,f=new l,m=new l;l.fromHeadingPitchRoll=function(t,i){return m=l.fromAxisAngle(e.UNIT_X,t.roll,h),f=l.fromAxisAngle(e.UNIT_Y,-t.pitch,i),i=l.multiply(f,m,f),p=l.fromAxisAngle(e.UNIT_Z,-t.heading,h),l.multiply(p,i,i)};var _=new e,g=new e,v=new l,y=new l,C=new l;l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,i,r){l.unpack(e,4*i,C),l.conjugate(C,C);for(var n=0,o=i-t+1;n<o;n++){var a=3*n;l.unpack(e,4*(t+n),v),l.multiply(v,C,v),v.w<0&&l.negate(v,v),l.computeAxis(v,_);var s=l.computeAngle(v);r[a]=_.x*s,r[a+1]=_.y*s,r[a+2]=_.z*s}},l.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new l),e.fromArray(t,0,g);var s=e.magnitude(g);return l.unpack(i,4*o,y),0===s?l.clone(l.IDENTITY,v):l.fromAxisAngle(g,s,v),l.multiply(v,y,a)},l.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 l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var i=1/l.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},l.inverse=function(e,t){var i=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/i,t)},l.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},l.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,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},l.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},l.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},l.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)<a.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},l.computeAngle=function(e){return Math.abs(e.w-1)<a.EPSILON6?0:2*Math.acos(e.w)};var b=new l;l.lerp=function(e,t,i,r){return b=l.multiplyByScalar(t,i,b),r=l.multiplyByScalar(e,1-i,r),l.add(b,r,r)};var S=new l,T=new l,E=new l;l.slerp=function(e,t,i,r){var n=l.dot(e,t),o=t;if(n<0&&(n=-n,o=S=l.negate(t,S)),1-n<a.EPSILON6)return l.lerp(e,o,i,r);var s=Math.acos(n);return T=l.multiplyByScalar(e,Math.sin((1-i)*s),T),E=l.multiplyByScalar(o,Math.sin(i*s),E),r=l.add(T,E,r),l.multiplyByScalar(r,1/Math.sin(s),r)},l.log=function(t,i){var r=a.acosClamped(t.w),n=0;return 0!==r&&(n=r/Math.sin(r)),e.multiplyByScalar(t,n,i)},l.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,w=new e,x=new l,P=new l;l.computeInnerQuadrangle=function(t,i,r,n){var o=l.conjugate(i,x);l.multiply(o,r,P);var a=l.log(P,A);l.multiply(o,t,P);var s=l.log(P,w);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),l.exp(a,x),l.multiply(i,x,n)},l.squad=function(e,t,i,r,n,o){var a=l.slerp(e,t,n,x),s=l.slerp(i,r,n,P);return l.slerp(a,s,2*n*(1-n),o)};for(var D=new l,I=1.9011074535173003,M=n.supportsTypedArrays()?new Float32Array(8):[],R=n.supportsTypedArrays()?new Float32Array(8):[],O=n.supportsTypedArrays()?new Float32Array(8):[],L=n.supportsTypedArrays()?new Float32Array(8):[],N=0;N<7;++N){var F=N+1,B=2*F+1;M[N]=1/(F*B),R[N]=F/B}return M[7]=I/136,R[7]=8*I/17,l.fastSlerp=function(e,t,i,r){var n,o=l.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,u=i*i,c=s*s,d=7;d>=0;--d)O[d]=(M[d]*u-R[d])*a,L[d]=(M[d]*c-R[d])*a;var h=n*i*(1+O[0]*(1+O[1]*(1+O[2]*(1+O[3]*(1+O[4]*(1+O[5]*(1+O[6]*(1+O[7])))))))),p=s*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),f=l.multiplyByScalar(e,p,D);return l.multiplyByScalar(t,h,r),l.add(f,r,r)},l.fastSquad=function(e,t,i,r,n,o){var a=l.fastSlerp(e,t,n,x),s=l.fastSlerp(i,r,n,P);return l.fastSlerp(a,s,2*n*(1-n),o)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";var b={},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"}},T={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},E={},A={east:new i,north:new i,up:new i,west:new i,south:new i,down:new i},w=new i,x=new i,P=new i;b.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new l("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,n=S[e][t],o=e+t;return s(E[o])?r=E[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(T[e],0,w),"east"!==e&&"west"!==e&&i.multiplyByScalar(w,u,w),i.unpack(T[t],0,x),"east"!==t&&"west"!==t&&i.multiplyByScalar(x,u,x),i.unpack(T[n],0,P),"east"!==n&&"west"!==n&&i.multiplyByScalar(P,u,P)}else{o=a(o,d.WGS84),o.geodeticSurfaceNormal(r,A.up);var c=A.up,h=A.east;h.x=-r.y,h.y=r.x,h.z=0,i.normalize(h,A.east),i.cross(c,h,A.north),i.multiplyByScalar(A.up,-1,A.down),i.multiplyByScalar(A.east,-1,A.west),i.multiplyByScalar(A.north,-1,A.south),w=A[e],x=A[t],P=A[n]}return l[0]=w.x,l[1]=w.y,l[2]=w.z,l[3]=0,l[4]=x.x,l[5]=x.y,l[6]=x.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},E[o]=r),r},b.eastNorthUpToFixedFrame=b.localFrameToFixedFrameGenerator("east","north"),b.northEastDownToFixedFrame=b.localFrameToFixedFrameGenerator("north","east"),b.northUpEastToFixedFrame=b.localFrameToFixedFrameGenerator("north","up"),b.northWestUpToFixedFrame=b.localFrameToFixedFrameGenerator("north","west");var D=new y,I=new i(1,1,1),M=new v;b.headingPitchRollToFixedFrame=function(e,t,r,n,o){n=a(n,b.eastNorthUpToFixedFrame);var s=y.fromHeadingPitchRoll(t,D),l=v.fromTranslationQuaternionRotationScale(i.ZERO,s,I,M);return o=n(e,r,o),v.multiply(o,l,o)};var R=new v,O=new g;b.headingPitchRollQuaternion=function(e,t,i,r,n){var o=b.headingPitchRollToFixedFrame(e,t,i,r,R),a=v.getRotation(o,O);return y.fromRotationMatrix(a,n)};var L=new i(1,1,1),N=new i,F=new v,B=new v,k=new g,z=new y;b.fixedFrameToHeadingPitchRoll=function(e,t,r,n){t=a(t,d.WGS84),r=a(r,b.eastNorthUpToFixedFrame),s(n)||(n=new h);var o=v.getTranslation(e,N);if(i.equals(o,i.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;var l=v.inverseTransformation(r(o,t,F),F),u=v.setScale(e,L,B);u=v.setTranslation(u,i.ZERO,u),l=v.multiply(l,u,l);var c=y.fromRotationMatrix(v.getRotation(l,k),z);return c=y.normalize(c,c),h.fromQuaternion(c,n)};var V=_.TWO_PI/86400,U=new m;b.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=24110.54841+i*(8640184.812866+i*(.093104+-62e-7*i)),l=a*V%_.TWO_PI,u=72921158553e-15+1.1772758384668e-19*(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)},b.iau2006XysData=new p,b.earthOrientationParameters=u.NONE;b.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+32.184,n=t.stop.dayNumber,o=t.stop.secondsOfDay+32.184,a=b.iau2006XysData.preload(i,r,n,o),s=b.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},b.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new g);var i=b.computeFixedToIcrfMatrix(e,t);if(s(i))return g.transpose(i,t)};var G=new f(0,0,0),H=new c(0,0,0,0,0,0),W=new g,q=new g;b.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new g);var i=b.earthOrientationParameters.compute(e,H);if(s(i)){var r=e.dayNumber,n=e.secondsOfDay+32.184,o=b.iau2006XysData.computeXysRadians(r,n,G);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=W;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,q),h=g.multiply(c,d,W),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 T=g.fromRotationZ(S,q),E=g.multiply(h,T,W),A=Math.cos(i.xPoleWander),w=Math.cos(i.yPoleWander),x=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),D=r-2451545+n/C.SECONDS_PER_DAY;D/=36525;var I=-47e-6*D*_.RADIANS_PER_DEGREE/3600,M=Math.cos(I),R=Math.sin(I),O=q;return O[0]=A*M,O[1]=A*R,O[2]=x,O[3]=-w*R+P*x*M,O[4]=w*M+P*x*R,O[5]=-P*A,O[6]=-P*R-w*x*M,O[7]=P*M-w*x*R,O[8]=w*A,g.multiply(E,O,t)}}};var Y=new r;b.pointToWindowCoordinates=function(e,t,i,r){return r=b.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},b.pointToGLWindowCoordinates=function(e,i,n,o){s(o)||(o=new t);var a=Y;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,a),a),r.multiplyByScalar(a,1/a.w,a),v.multiplyByVector(i,a,a),t.fromCartesian4(a,o)};var j=new i,X=new i,Q=new i;b.rotationMatrixFromPositionVelocity=function(e,t,r,n){var o=a(r,d.WGS84).geodeticSurfaceNormal(e,j),l=i.cross(t,o,X);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,Q);return i.normalize(u,u),i.cross(t,u,l),i.negate(l,l),i.normalize(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 K=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Z=new n,J=new i,$=new i,ee=new g,te=new v,ie=new v;return b.basisTo2D=function(e,t,r){var n=v.getTranslation(t,$),o=e.ellipsoid,a=o.cartesianToCartographic(n,Z),s=e.project(a,J);i.fromElements(s.z,s.x,s.y,s);var l=b.eastNorthUpToFixedFrame(n,o,te),u=v.inverseTransformation(l,ie),c=v.getRotation(t,ee),d=v.multiplyByMatrix3(u,c,r);return v.multiply(K,d,r),v.setTranslation(r,s,r),r},b.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,o=b.eastNorthUpToFixedFrame(t,n,te),a=v.inverseTransformation(o,ie),s=n.cartesianToCartographic(t,Z),l=e.project(s,J);i.fromElements(l.z,l.x,l.y,l);var u=v.fromTranslation(l,te);return v.multiply(K,a,r),v.multiply(u,r,r),r},b}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./Check","./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,f){"use strict";function m(e,t){t=o(t,u.WGS84),e=t.scaleToGeodeticSurface(e);var r=f.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(d.getColumn(r,0,_)),this._yAxis=i.fromCartesian4(d.getColumn(r,1,_));var n=i.fromCartesian4(d.getColumn(r,2,_));this._plane=h.fromPointNormal(e,n)}var _=new r;s(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var g=new e;m.fromPoints=function(t,i){return new m(e.fromPoints(t,g).center,i)};var v=new p,y=new i;m.prototype.projectPointOntoPlane=function(e,r){var n=v;n.origin=e,i.normalize(e,n.direction);var o=c.rayPlane(n,this._plane,y);if(a(o)||(i.negate(n.direction,n.direction),o=c.rayPlane(n,this._plane,y)),a(o)){var s=i.subtract(o,this._origin,o),l=i.dot(this._xAxis,s),u=i.dot(this._yAxis,s);return a(r)?(r.x=l,r.y=u,r):new t(l,u)}},m.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var i=0,r=e.length,n=0;n<r;n++){var o=this.projectPointOntoPlane(e[n],t[i]);a(o)&&(t[i]=o,i++)}return t.length=i,t},m.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var n=v;n.origin=e,i.clone(this._plane.normal,n.direction);var o=c.rayPlane(n,this._plane,y);a(o)||(i.negate(n.direction,n.direction),o=c.rayPlane(n,this._plane,y));var s=i.subtract(o,this._origin,o),l=i.dot(this._xAxis,s),u=i.dot(this._yAxis,s);return r.x=l,r.y=u,r},m.prototype.projectPointsToNearestOnPlane=function(e,t){a(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 C=new i;return m.prototype.projectPointOntoEllipsoid=function(e,t){a(t)||(t=new i);var r=this._ellipsoid,n=this._origin,o=this._xAxis,s=this._yAxis,l=C;return i.multiplyByScalar(o,e.x,l),t=i.add(n,l,t),i.multiplyByScalar(s,e.y,l),i.add(t,l,t),r.scaleToGeocentricSurface(t,t),t},m.prototype.projectPointsOntoEllipsoid=function(e,t){var i=e.length;a(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.projectPointOntoEllipsoid(e[r],t[r]);return t},m}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./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,m){"use strict";function _(e,t){this.center=i.clone(o(e,i.ZERO)),this.halfAxes=p.clone(o(t,p.ZERO))}function g(e,t,r,n,o,s,l,u){a(u)||(u=new _);var c=u.halfAxes;p.setColumn(c,0,e.xAxis,c),p.setColumn(c,1,e.yAxis,c),p.setColumn(c,2,e.zAxis,c);var d=w;d.x=(t+r)/2,d.y=(n+o)/2,d.z=(s+l)/2;var h=x;h.x=(r-t)/2,h.y=(o-n)/2,h.z=(l-s)/2;var f=u.center;return d=p.multiplyByVector(c,d,d),i.add(e.origin,d,f),p.multiplyByScale(c,h,c),u}_.packedLength=i.packedLength+p.packedLength,_.pack=function(e,t,r){return r=o(r,0),i.pack(e.center,t,r),p.pack(e.halfAxes,t,r+i.packedLength),t},_.unpack=function(e,t,r){return t=o(t,0),a(r)||(r=new _),i.unpack(e,t,r.center),p.unpack(e,t+i.packedLength,r.halfAxes),r};var v=new i,y=new i,C=new i,b=new i,S=new i,T=new i,E=new p,A={unitary:new p,diagonal:new p};_.fromPoints=function(e,t){if(a(t)||(t=new _),!a(e)||0===e.length)return t.halfAxes=p.ZERO,t.center=i.ZERO,t;var r,n=e.length,o=i.clone(e[0],v);for(r=1;r<n;r++)i.add(o,e[r],o);var s=1/n;i.multiplyByScalar(o,s,o);var l,u=0,c=0,d=0,h=0,f=0,m=0;for(r=0;r<n;r++)l=i.subtract(e[r],o,y),u+=l.x*l.x,c+=l.x*l.y,d+=l.x*l.z,h+=l.y*l.y,f+=l.y*l.z,m+=l.z*l.z;u*=s,c*=s,d*=s,h*=s,f*=s,m*=s;var g=E;g[0]=u,g[1]=c,g[2]=d,g[3]=c,g[4]=h,g[5]=f,g[6]=d,g[7]=f,g[8]=m;var w=p.computeEigenDecomposition(g,A),x=p.clone(w.unitary,t.halfAxes),P=p.getColumn(x,0,b),D=p.getColumn(x,1,S),I=p.getColumn(x,2,T),M=-Number.MAX_VALUE,R=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=Number.MAX_VALUE,N=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<n;r++)l=e[r],M=Math.max(i.dot(P,l),M),R=Math.max(i.dot(D,l),R),O=Math.max(i.dot(I,l),O),L=Math.min(i.dot(P,l),L),N=Math.min(i.dot(D,l),N),F=Math.min(i.dot(I,l),F);P=i.multiplyByScalar(P,.5*(L+M),P),D=i.multiplyByScalar(D,.5*(N+R),D),I=i.multiplyByScalar(I,.5*(F+O),I);var B=i.add(P,D,t.center);i.add(B,I,B);var k=C;return k.x=M-L,k.y=R-N,k.z=O-F,i.multiplyByScalar(k,.5,k),p.multiplyByScale(t.halfAxes,k,t.halfAxes),t};var w=new i,x=new i,P=new r,D=new i,I=[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],R=[new t,new t,new t,new t,new t,new t,new t,new t];_.fromRectangle=function(e,t,i,r,n){t=o(t,0),i=o(i,0),r=o(r,l.WGS84);var a=m.center(e,P),s=r.cartographicToCartesian(a,D),c=new u(s,r),d=c.plane,h=I[0],p=I[1],_=I[2],v=I[3],y=I[4],C=I[5],b=I[6],S=I[7],T=a.longitude,E=e.south<0&&e.north>0?0:a.latitude;b.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=E,h.latitude=p.latitude=_.latitude=e.north,b.longitude=S.longitude=h.longitude=e.west,C.longitude=p.longitude=T,y.longitude=v.longitude=_.longitude=e.east,_.height=p.height=h.height=S.height=b.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(I,M),c.projectPointsToNearestOnPlane(M,R);var A=Math.min(R[6].x,R[7].x,R[0].x),w=Math.max(R[2].x,R[3].x,R[4].x),x=Math.min(R[4].y,R[5].y,R[6].y),O=Math.max(R[0].y,R[1].y,R[2].y);return _.height=h.height=y.height=b.height=t,r.cartographicArrayToCartesianArray(I,M),g(c,A,w,x,O,Math.min(f.getPointDistance(d,M[0]),f.getPointDistance(d,M[2]),f.getPointDistance(d,M[4]),f.getPointDistance(d,M[6])),i,n)},_.clone=function(e,t){if(a(e))return a(t)?(i.clone(e.center,t.center),p.clone(e.halfAxes,t.halfAxes),t):new _(e.center,e.halfAxes)},_.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,u=Math.abs(a*o[p.COLUMN0ROW0]+s*o[p.COLUMN0ROW1]+l*o[p.COLUMN0ROW2])+Math.abs(a*o[p.COLUMN1ROW0]+s*o[p.COLUMN1ROW1]+l*o[p.COLUMN1ROW2])+Math.abs(a*o[p.COLUMN2ROW0]+s*o[p.COLUMN2ROW1]+l*o[p.COLUMN2ROW2]),d=i.dot(n,r)+t.distance;return d<=-u?c.OUTSIDE:d>=u?c.INSIDE:c.INTERSECTING};var O=new i,L=new i,N=new i,F=new i;_.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,w),n=e.halfAxes,o=p.getColumn(n,0,O),a=p.getColumn(n,1,L),s=p.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=F;d.x=i.dot(r,o),d.y=i.dot(r,a),d.z=i.dot(r,s);var h,f=0;return d.x<-l?(h=d.x+l,f+=h*h):d.x>l&&(h=d.x-l,f+=h*h),d.y<-u?(h=d.y+u,f+=h*h):d.y>u&&(h=d.y-u,f+=h*h),d.z<-c?(h=d.z+c,f+=h*h):d.z>c&&(h=d.z-c,f+=h*h),f};var B=new i,k=new i;_.computePlaneDistances=function(e,t,r,n){a(n)||(n=new d);var o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,c=p.getColumn(u,0,O),h=p.getColumn(u,1,L),f=p.getColumn(u,2,N),m=i.add(c,h,B);i.add(m,f,m),i.add(m,l,m);var _=i.subtract(m,t,k),g=i.dot(r,_);return o=Math.min(g,o),s=Math.max(g,s),i.add(l,c,m),i.add(m,h,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),i.add(l,c,m),i.subtract(m,h,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),i.add(l,c,m),i.subtract(m,h,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),i.subtract(l,c,m),i.add(m,h,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),i.subtract(l,c,m),i.add(m,h,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),i.subtract(l,c,m),i.subtract(m,h,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),i.subtract(l,c,m),i.subtract(m,h,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),o=Math.min(g,o),s=Math.max(g,s),n.start=o,n.stop=s,n};var z=new e;return _.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,z);return!i.isBoundingSphereVisible(r)},_.prototype.intersectPlane=function(e){return _.intersectPlane(this,e)},_.prototype.distanceSquaredTo=function(e){return _.distanceSquaredTo(this,e)},_.prototype.computePlaneDistances=function(e,t,i){return _.computePlaneDistances(this,e,t,i)},_.prototype.isOccluded=function(e){return _.isOccluded(this,e)},_.equals=function(e,t){return e===t||a(e)&&a(t)&&i.equals(e.center,t.center)&&p.equals(e.halfAxes,t.halfAxes)},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,i,r,n,o){"use strict";function a(e){return c[0]=e,c[0]}function s(e){return e>>1^-(1&e)}var l={};l.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,n=i.y;i.x=(1-Math.abs(n))*o.signNotZero(r),i.y=(1-Math.abs(r))*o.signNotZero(n)}return i.x=o.toSNorm(i.x,t),i.y=o.toSNorm(i.y,t),i},l.octEncode=function(e,t){return l.octEncodeInRange(e,255,t)};var u=new e,c=new Uint8Array(1);l.octEncodeToCartesian4=function(e,t){return l.octEncodeInRange(e,65535,u),t.x=a(u.x*(1/256)),t.y=a(u.x),t.z=a(u.y*(1/256)),t.w=a(u.y),t},l.octDecodeInRange=function(e,i,r,n){if(n.x=o.fromSNorm(e,r),n.y=o.fromSNorm(i,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(a),n.y=(1-Math.abs(a))*o.signNotZero(n.y)}return t.normalize(n,n)},l.octDecode=function(e,t,i){return l.octDecodeInRange(e,t,255,i)},l.octDecodeFromCartesian4=function(e,t){var i=e.x,r=e.y,n=e.z,o=e.w,a=256*i+r,s=256*n+o;return l.octDecodeInRange(a,s,65535,t)},l.octPackFloat=function(e){return 256*e.x+e.y};var d=new e;return l.octEncodeFloat=function(e){return l.octEncode(e,d),l.octPackFloat(d)},l.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return l.octDecode(r,n,t)},l.octPack=function(e,t,i,r){var n=l.octEncodeFloat(e),o=l.octEncodeFloat(t),a=l.octEncode(i,d);return r.x=65536*a.x+n,r.y=65536*a.y+o,r},l.octUnpack=function(e,t,i,r){var n=e.x/65536,o=Math.floor(n),a=65536*(n-o);n=e.y/65536;var s=Math.floor(n),u=65536*(n-s);l.octDecodeFloat(a,t),l.octDecodeFloat(u,i),l.octDecode(o,s,r)},l.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},l.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},l.zigZagDeltaDecode=function(e,t,i){for(var n=e.length,o=0,a=0,l=0,u=0;u<n;++u)o+=s(e[u]),a+=s(t[u]),e[u]=o,t[u]=a,r(i)&&(l+=s(i[u]),i[u]=l)},l}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";return e({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,
- LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,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,HALF_FLOAT_OES:36193,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})}),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/TerrainQuantization",["./freezeObject"],function(e){"use strict";return e({NONE:0,BITS12:1})}),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=l.NONE;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,b=e.maximum,S=i.subtract(b,C,d),T=r-t;y=Math.max(i.maximumComponent(S),T)<m-1?l.BITS12:l.NONE,_=e.center,g=s.inverseTransformation(a,new s);var E=i.negate(C,c);s.multiply(s.fromTranslation(E,p),g,g);var A=c;A.x=1/S.x,A.y=1/S.y,A.z=1/S.z,s.multiply(s.fromScale(A,p),g,g),v=s.clone(a),s.setTranslation(v,i.ZERO,v),a=s.clone(a,new s);var w=s.fromTranslation(C,p),x=s.fromScale(S,f),P=s.multiply(w,x,p);s.multiply(a,P,a),s.multiply(v,P,v)}this.quantization=y,this.minimumHeight=t,this.maximumHeight=r,this.center=_,this.toScaledENU=g,this.fromScaledENU=a,this.matrix=v,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 b=e.compressTextureCoordinates(h);if(r[n++]=y,r[n++]=C,r[n++]=b,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){return e.decompressTextureCoordinates(t[i+1],h).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[i+3]},u.prototype.decodeWebMercatorT=function(t,i){return i*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(t[i+3],h).x:t[i+6]},u.prototype.getOctEncodedNormal=function(e,i,r){i=(i+1)*this.getStride()-1;var n=e[i]/256,o=Math.floor(n),a=256*(n-o);return t.fromElements(o,a,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=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(4+o)*n,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:o,offsetInBytes:4*n,strideInBytes:t}]}var a=3,s=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++a,this.hasWebMercatorT&&this.hasVertexNormals?(++s,t=(a+s)*n,[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:g.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s,offsetInBytes:a*n,strideInBytes:t}]):[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a}]},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,b=new r;return g.computeVertices=function(a){var u,S,T,E,A=Math.cos,w=Math.sin,x=Math.sqrt,P=Math.atan,D=Math.exp,I=c.PI_OVER_TWO,M=c.toRadians,R=a.heightmap,O=a.width,L=a.height,N=a.skirtHeight,F=n(a.isGeographic,!0),B=n(a.ellipsoid,s.WGS84),k=1/B.maximumRadius,z=a.nativeRectangle,V=a.rectangle;o(V)?(u=V.west,S=V.south,T=V.east,E=V.north):F?(u=M(z.west),S=M(z.south),T=M(z.east),E=M(z.north)):(u=z.west*k,S=I-2*P(D(-z.south*k)),T=z.east*k,E=I-2*P(D(-z.north*k)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var H=n(a.exaggeration,1),W=n(a.includeWebMercatorT,!1),q=n(a.structure,g.DEFAULT_STRUCTURE),Y=n(q.heightScale,g.DEFAULT_STRUCTURE.heightScale),j=n(q.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),X=n(q.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(q.stride,g.DEFAULT_STRUCTURE.stride),K=n(q.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),Z=n(q.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),J=p.computeWidth(z),$=p.computeHeight(z),ee=J/(O-1),te=$/(L-1);F||(J*=k,$*=k);var ie,re,ne=B.radiiSquared,oe=ne.x,ae=ne.y,se=ne.z,le=65536,ue=-65536,ce=m.eastNorthUpToFixedFrame(U,B),de=d.inverseTransformation(ce,y);W&&(ie=_.geodeticLatitudeToMercatorAngle(S),re=1/(_.geodeticLatitudeToMercatorAngle(E)-ie));var he=C;he.x=Number.POSITIVE_INFINITY,he.y=Number.POSITIVE_INFINITY,he.z=Number.POSITIVE_INFINITY;var pe=b;pe.x=Number.NEGATIVE_INFINITY,pe.y=Number.NEGATIVE_INFINITY,pe.z=Number.NEGATIVE_INFINITY;var fe=Number.POSITIVE_INFINITY,me=O+(N>0?2:0),_e=L+(N>0?2:0),ge=me*_e,ve=new Array(ge),ye=new Array(ge),Ce=new Array(ge),be=W?new Array(ge):[],Se=0,Te=L,Ee=0,Ae=O;N>0&&(--Se,++Te,--Ee,++Ae);for(var we=0,xe=Se;xe<Te;++xe){var Pe=xe;Pe<0&&(Pe=0),Pe>=L&&(Pe=L-1);var De=z.north-te*Pe;De=F?M(De):I-2*P(D(-De*k));var Ie=A(De),Me=w(De),Re=se*Me,Oe=(De-S)/(E-S);Oe=c.clamp(Oe,0,1);var Le;W&&(Le=(_.geodeticLatitudeToMercatorAngle(De)-ie)*re);for(var Ne=Ee;Ne<Ae;++Ne){var Fe=Ne;Fe<0&&(Fe=0),Fe>=O&&(Fe=O-1);var Be=z.west+ee*Fe;F?Be=M(Be):Be*=k;var ke,ze=Pe*(O*Q)+Fe*Q;if(1===X)ke=R[ze];else{ke=0;var Ve;if(Z)for(Ve=0;Ve<X;++Ve)ke=ke*K+R[ze+Ve];else for(Ve=X-1;Ve>=0;--Ve)ke=ke*K+R[ze+Ve]}ke=(ke*Y+j)*H;var Ue=(Be-u)/(T-u);if(Ue=c.clamp(Ue,0,1),Ce[we]=new i(Ue,Oe),ue=Math.max(ue,ke),le=Math.min(le,ke),Ne!==Fe||xe!==Pe){Ne<0?Be-=1e-5*J:Be+=1e-5*J,xe<0?De+=1e-5*$:De-=1e-5*$,Ie=A(De),Me=w(De),Re=se*Me,ke-=N}var Ge=Ie*A(Be),He=Ie*w(Be),We=oe*Ge,qe=ae*He,Ye=x(We*Ge+qe*He+Re*Me),je=1/Ye,Xe=We*je,Qe=qe*je,Ke=Re*je,Ze=new r;Ze.x=Xe+Ge*ke,Ze.y=Qe+He*ke,Ze.z=Ke+Me*ke,ve[we]=Ze,ye[we]=ke,W&&(be[we]=Le),we++,d.multiplyByPoint(de,Ze,v),r.minimumByComponent(v,he,he),r.maximumByComponent(v,pe,pe),fe=Math.min(fe,ke)}}var Je,$e=t.fromPoints(ve);o(V)&&V.width<c.PI_OVER_TWO+c.EPSILON5&&(Je=h.fromRectangle(V,le,ue,B));var et;if(G){et=new l(B).computeHorizonCullingPoint(U,ve)}for(var tt=new e(he,pe,U),it=new f(tt,fe,ue,ce,!1,W),rt=new Float32Array(ge*it.getStride()),nt=0,ot=0;ot<ge;++ot)nt=it.encode(rt,nt,ve[ot],Ce[ot],ye[ot],void 0,be[ot]);var at,st,lt,ut;if(N>0){ut=[],st=[];for(var ct=0;ct<O;++ct)ut.push(me+1+ct),st.push(me*(_e-1)-2-ct);at=[],lt=[];for(var dt=0;dt<L;++dt)lt.push((dt+1)*me+O),at.push((L-dt)*me+1)}else{ut=[],st=[];for(var ht=0;ht<O;++ht)ut.push(ht),st.push(O*L-1-ht);at=[],lt=[];for(var pt=0;pt<L;++pt)lt.push((pt+1)*O-1),at.push((L-pt-1)*O)}return{vertices:rt,maximumHeight:ue,minimumHeight:le,encoding:it,boundingSphere3D:$e,orientedBoundingBox:Je,occludeePointInScaledSpace:et,westIndicesSouthToNorth:at,southIndicesEastToWest:st,eastIndicesNorthToSouth:lt,northIndicesWestToEast:ut}},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/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./Event","./FeatureDetection","./getAbsoluteUri","./isCrossOriginUrl","./Resource","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(){if(!r(y._canTransferArrayBuffer)){var t=new Worker(m("Workers/transferTypedArrayTest.js"));t.postMessage=i(t.webkitPostMessage,t.postMessage);var n=new Int8Array([99]);try{t.postMessage({array:n},[n.buffer])}catch(e){return y._canTransferArrayBuffer=!1,y._canTransferArrayBuffer}var o=e.defer();t.onmessage=function(e){var i=e.data.array,n=r(i)&&99===i[0];o.resolve(n),t.terminate(),y._canTransferArrayBuffer=n},y._canTransferArrayBuffer=o.promise}return y._canTransferArrayBuffer}function f(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 d(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),b.raiseEvent(s),a.reject(s)}else b.raiseEvent(),a.resolve(t.result);delete n[i]}}function m(e){var i=t(e);if(u(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")}i=(window.URL||window.webkitURL).createObjectURL(r)}return i}function _(){return r(C)||(C=m("Workers/cesiumWorkerBootstrapper.js")),C}function g(e){var n=new Worker(_());n.postMessage=i(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:y._workerModulePrefix+e._workerName};return r(y._loaderConfig)?o.loaderConfig=y._loaderConfig:(r(define.amd)&&!define.amd.toUrlUndefined&&r(h.toUrl)||(o.loaderConfig.paths={Workers:t("Workers")}),o.loaderConfig.baseUrl=t.getCesiumBaseUrl().url),n.postMessage(o),n.onmessage=function(t){f(e,t.data)},n}function v(i,n){var o={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!s.supportsWebAssembly()){if(!r(n.fallbackModulePath))throw new d("This browser does not support Web Assembly, and no backup module was provided for "+i._workerName);return o.modulePath=t(n.fallbackModulePath),e.resolve(o)}return o.modulePath=t(n.modulePath),o.wasmBinaryFile=t(n.wasmBinaryFile),c.fetchArrayBuffer({url:o.wasmBinaryFile}).then(function(e){return o.wasmBinary=e,o})}function y(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var C,b=new a,S=[];return y.prototype.scheduleTask=function(t,i){if(r(this._worker)||(this._worker=g(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(p(),function(o){r(i)?o||(i.length=0):i=S;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},y.prototype.initWebAssemblyModule=function(t){r(this._worker)||(this._worker=g(this));var i=e.defer(),n=this,o=this._worker;return v(this,t).then(function(t){return e(p(),function(e){var a,s=t.wasmBinary;r(s)&&e&&(a=[s]),o.onmessage=function(e){o.onmessage=function(e){f(n,e.data)},i.resolve(e.data)},o.postMessage({webAssemblyConfig:t},a)})}),i},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},y.taskCompletedEvent=b,y._defaultWorkerModulePrefix="Workers/",y._workerModulePrefix=y._defaultWorkerModulePrefix,y._loaderConfig=void 0,y._canTransferArrayBuffer=void 0,y}),define("Core/TerrainMesh",["./Cartesian3","./defaultValue"],function(e,t){"use strict";function i(e,i,r,n,o,a,s,l,u,c,d,h,p,f,m){this.center=e,this.vertices=i,this.stride=t(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,this.westIndicesSouthToNorth=h,this.southIndicesEastToWest=p,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=m}return i}),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 n=o[t];e(n)||(o[t]=n=[]);var a=n[i];if(!e(a)){a=t*i<r.SIXTY_FOUR_KILOBYTES?n[i]=new Uint16Array((t-1)*(i-1)*6):n[i]=new Uint32Array((t-1)*(i-1)*6);for(var s=0,l=0,u=0;u<i-1;++u){for(var c=0;c<t-1;++c){var d=s,h=d+t,p=h+1,f=d+1;a[l++]=d,a[l++]=h,a[l++]=f,a[l++]=f,a[l++]=h,a[l++]=p,++s}++s}}return a},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.prototype.loadTileDataAvailability=i.throwInstantiationError,n}),define("Core/HeightmapTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicProjection","./HeightmapEncoding","./HeightmapTessellator","./OrientedBoundingBox","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=r(e.childTileMask,15),this._encoding=r(e.encoding,l.NONE);var t=u.DEFAULT_STRUCTURE,i=e.structure;n(i)?i!==t&&(i.heightScale=r(i.heightScale,t.heightScale),i.heightOffset=r(i.heightOffset,t.heightOffset),i.elementsPerHeight=r(i.elementsPerHeight,t.elementsPerHeight),i.stride=r(i.stride,t.stride),i.elementMultiplier=r(i.elementMultiplier,t.elementMultiplier),i.isBigEndian=r(i.isBigEndian,t.isBigEndian)):i=t,this._structure=i,this._createdByUpsampling=r(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===l.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}function v(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 _=c-h,g=d-f;return f=s-1-f,m=s-1-m,C(_,g,b(e,t,i,r,n,f*a+h),b(e,t,i,r,n,f*a+p),b(e,t,i,r,n,m*a+h),b(e,t,i,r,n,m*a+p))}function y(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 _=n>0?s-1:s,g=0|h,v=g+1;v>=_&&(v=s-1,g=s-2);var y=d-f,b=h-g;return g=s-1-g,v=s-1-v,C(y,b,(t.decodeHeight(e,g*a+f)/c-i)/r,(t.decodeHeight(e,g*a+m)/c-i)/r,(t.decodeHeight(e,v*a+f)/c-i)/r,(t.decodeHeight(e,v*a+m)/c-i)/r)}function C(e,t,i,r,n,o){return t<e?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function b(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 S(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}o(g.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var T=new p("createVerticesFromHeightmap");return g.prototype.createMesh=function(o,a,l,u,d){var p=o.ellipsoid,g=o.tileXYToNativeRectangle(a,l,u),v=o.tileXYToRectangle(a,l,u);d=r(d,1);var y=p.cartographicToCartesian(h.center(v)),C=this._structure,b=_.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,o.getNumberOfXTilesAtLevel(0)),S=b/(1<<u);this._skirtHeight=Math.min(4*S,1e3);var E=T.scheduleTask({heightmap:this._buffer,structure:C,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:g,rectangle:v,relativeToCenter:y,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:o.projection instanceof s,exaggeration:d,encoding:this._encoding});if(n(E)){var A=this;return e(E,function(e){return A._mesh=new m(y,new Float32Array(e.vertices),_.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,t.clone(e.boundingSphere3D),i.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,c.clone(e.orientedBoundingBox),f.clone(e.encoding),d,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),A._buffer=void 0,A._mesh})}},g.prototype._createMeshSync=function(e,t,i,n,o){var a=e.ellipsoid,l=e.tileXYToNativeRectangle(t,i,n),c=e.tileXYToRectangle(t,i,n);o=r(o,1);var d=a.cartographicToCartesian(h.center(c)),p=this._structure,f=_.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,e.getNumberOfXTilesAtLevel(0)),g=f/(1<<n);this._skirtHeight=Math.min(4*g,1e3);var v=u.computeVertices({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:c,relativeToCenter:d,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:e.projection instanceof s,exaggeration:o});this._buffer=void 0;var y=this._width,C=this._height;return this._skirtHeight>0&&(y+=2,C+=2),new m(d,v.vertices,_.getRegularGridIndices(y,C),v.minimumHeight,v.maximumHeight,v.boundingSphere3D,v.occludeePointInScaledSpace,v.encoding.getStride(),v.orientedBoundingBox,v.encoding,o,v.westIndicesSouthToNorth,v.southIndicesEastToWest,v.eastIndicesNorthToSouth,v.northIndicesWestToEast)},g.prototype.interpolateHeight=function(e,t,i){var r,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(n(this._mesh)){r=y(this._mesh.vertices,this._mesh.encoding,h,p,this._skirtHeight,e,o,a,t,i,this._mesh.exaggeration)}else r=v(this._buffer,u,c,l,d,e,o,a,t,i),r=r*p+h;return r},g.prototype.upsample=function(e,t,i,r,o,a,s){var l=this._mesh;if(n(l)){for(var u=this._width,c=this._height,h=this._structure,p=this._skirtHeight,f=h.stride,m=new this._bufferType(u*c*f),_=l.vertices,v=l.encoding,C=e.tileXYToRectangle(t,i,r),b=e.tileXYToRectangle(o,a,s),T=h.heightOffset,E=h.heightScale,A=l.exaggeration,w=h.elementsPerHeight,x=h.elementMultiplier,P=h.isBigEndian,D=Math.pow(x,w-1),I=0;I<c;++I)for(var M=d.lerp(b.north,b.south,I/(c-1)),R=0;R<u;++R){var O=d.lerp(b.west,b.east,R/(u-1)),L=y(_,v,T,E,p,C,u,c,O,M,A);L=L<h.lowestEncodedHeight?h.lowestEncodedHeight:L,L=L>h.highestEncodedHeight?h.highestEncodedHeight:L,S(m,w,x,D,f,P,I*u+R,L)}return new g({buffer:m,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},g.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)},g.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},g
- }),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=[]}function s(e,t,i,r){for(var n=r.length,o=0;o<n;++o){var a=r[o];if(a.x===t&&a.y===i&&a.level===e)return!0}return!1}function l(e,t,i,r,n){this.tilingScheme=e,this.parent=t,this.level=i,this.x=r,this.y=n,this.extent=e.tileXYToRectangle(r,n,i),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function u(e,t,i,r,n){this.level=e,this.west=t,this.south=i,this.east=r,this.north=n}function c(e,t){var i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),n=Math.min(e.east,t.east);return r<Math.min(e.north,t.north)&&i<n}function d(t,i,r){for(;i.level<t;)if(p(i.nw.extent,r))i=i.nw;else if(p(i.ne.extent,r))i=i.ne;else if(p(i.sw.extent,r))i=i.sw;else{if(!p(i.se.extent,r))break;i=i.se}if(0===i.rectangles.length||i.rectangles[i.rectangles.length-1].level<=r.level)i.rectangles.push(r);else{var n=e(i.rectangles,r.level,h);n<=0&&(n=~n),i.rectangles.splice(n,0,r)}}function h(e,t){return e.level-t}function p(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function f(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function m(e,t,i){for(var r=0,n=!1;!n;){var o=t._nw&&f(t._nw.extent,i),a=t._ne&&f(t._ne.extent,i),s=t._sw&&f(t._sw.extent,i),l=t._se&&f(t._se.extent,i);if(o+a+s+l>1){o&&(r=Math.max(r,m(t,t._nw,i))),a&&(r=Math.max(r,m(t,t._ne,i))),s&&(r=Math.max(r,m(t,t._sw,i))),l&&(r=Math.max(r,m(t,t._se,i)));break}o?t=t._nw:a?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var u=t.rectangles,c=u.length-1;c>=0&&u[c].level>r;--c){var d=u[c];f(d,i)&&(r=d.level)}t=t.parent}return r}function _(e,t,i){if(t){var r,n=!1;for(r=0;r<i.length;++r)n=n||c(t.extent,i[r]);if(n){var o=t.rectangles;for(r=0;r<o.length;++r){var a=o[r];e[a.level]||(e[a.level]=i),e[a.level]=g(e[a.level],a)}_(e,t._nw,i),_(e,t._ne,i),_(e,t._sw,i),_(e,t._se,i)}}}function g(e,t){for(var i=[],r=0;r<e.length;++r){var n=e[r];c(n,t)?(n.west<t.west&&i.push(new 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 v=new o;a.prototype.addAvailableTileRange=function(e,t,i,r,n){var o=this._tilingScheme,a=this._rootNodes;if(0===e)for(var h=i;h<=n;++h)for(var p=t;p<=r;++p)s(e,p,h,a)||a.push(new l(o,void 0,0,p,h));o.tileXYToRectangle(t,i,e,v);var f=v.west,m=v.north;o.tileXYToRectangle(r,n,e,v);for(var _=v.east,g=v.south,y=new u(e,f,g,_,m),C=0;C<a.length;++C){var b=a[C];c(b.extent,y)&&d(this._maximumLevel,b,y)}},a.prototype.computeMaximumLevelAtPosition=function(e){for(var t,r=0;r<this._rootNodes.length;++r){var n=this._rootNodes[r];if(f(n.extent,e)){t=n;break}}return i(t)?m(void 0,t,e):-1};var y=[],C=[],b=new o,S=new o;a.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=y;t.length=0,e.east<e.west?(t.push(o.fromRadians(-Math.PI,e.south,e.east,e.north,b)),t.push(o.fromRadians(e.west,e.south,Math.PI,e.north,S))):t.push(e);var r=C;r.length=0;var n;for(n=0;n<this._rootNodes.length;++n)_(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 T=new t;return a.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(t,i,e,v);return o.center(r,T),this.computeMaximumLevelAtPosition(T)>=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(l.prototype,{nw:{get:function(){return this._nw||(this._nw=new l(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new l(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new l(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new l(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),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/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/ArcGISTiledElevationTerrainProvider",["../ThirdParty/when","./Cartesian2","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapEncoding","./HeightmapTerrainData","./Rectangle","./Request","./RequestState","./RequestType","./Resource","./RuntimeError","./TerrainProvider","./TileAvailability","./TileProviderError","./WebMercatorTilingScheme"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b){"use strict";function S(o){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._ready=!1,this._width=void 0,this._height=void 0,this._encoding=void 0;var a=o.token;this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailablityLoaded=void 0,this._availableCache={};var d=this,p=r(o.ellipsoid,s.WGS84);this._readyPromise=e(o.url).then(function(e){var t=_.createIfNeeded(e);return t.appendForwardSlash(),n(a)&&(t=t.getDerivedResource({queryParameters:{token:a}})),d._resource=t,t.getDerivedResource({queryParameters:{f:"pjson"}}).fetchJson()}).then(function(o){var a=o.copyrightText;n(a)&&(d._credit=new i(a));var s=o.spatialReference,l=r(s.latestWkid,s.wkid),f=o.extent,m={ellipsoid:p};if(4326===l)m.rectangle=h.fromDegrees(f.xmin,f.ymin,f.xmax,f.ymax),d._tilingScheme=new u(m);else{if(3857!==l)return e.reject(new g("Invalid spatial reference"));m.rectangleSouthwestInMeters=new t(f.xmin,f.ymin),m.rectangleNortheastInMeters=new t(f.xmax,f.ymax),d._tilingScheme=new b(m)}var _=o.tileInfo;return n(_)?(d._width=_.rows+1,d._height=_.cols+1,d._encoding="LERC"===_.format?c.LERC:c.NONE,d._lodCount=_.lods.length-1,(d._hasAvailability=-1!==o.capabilities.indexOf("Tilemap"))&&(d._tilesAvailable=new y(d._tilingScheme,d._lodCount),d._tilesAvailable.addAvailableTileRange(0,0,0,d._tilingScheme.getNumberOfXTilesAtLevel(0),d._tilingScheme.getNumberOfYTilesAtLevel(0)),d._tilesAvailablityLoaded=new y(d._tilingScheme,d._lodCount)),d._levelZeroMaximumGeometricError=v.getEstimatedLevelZeroGeometricErrorForAHeightmap(d._tilingScheme.ellipsoid,d._width,d._tilingScheme.getNumberOfXTilesAtLevel(0)),o.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),d._terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:o.minValues[0],highestEncodedHeight:o.maxValues[0]},d._ready=!0,!0):e.reject(new g("tileInfo is required"))}).otherwise(function(t){var i="An error occurred while accessing "+d._resource.url+".";return C.handleError(void 0,d,d._errorEvent,i),e.reject(t)}),this._errorEvent=new l}function T(e,t,i,r){if(e._hasAvailability){var n=e._tilesAvailablityLoaded,o=e._tilesAvailable;return!(t>e._lodCount)&&(!!o.isTileAvailable(t,i,r)||!n.isTileAvailable(t,i,r)&&void 0)}}function E(e,i,r,n){for(var o=i-1,a=r-1,s=n[e.y*i+e.x],l=[],u={startX:e.x,startY:e.y,endX:0,endY:0},c=new t(e.x+1,e.y+1),d=!1,h=!1;!d||!h;){var p=c.x,f=h?c.y+1:c.y;if(!d){for(var m=e.y;m<f;++m)if(n[m*i+c.x]!==s){d=!0;break}d?(l.push(new t(c.x,e.y)),--c.x,--p,u.endX=c.x):c.x===o?(u.endX=c.x,d=!0):++c.x}if(!h){for(var _=c.y*i,g=e.x;g<=p;++g)if(n[_+g]!==s){h=!0;break}h?(l.push(new t(e.x,c.y)),--c.y,u.endY=c.y):c.y===a?(u.endY=c.y,h=!0):++c.y}}return{endingIndices:l,range:u,value:s}}function A(e,i,r,n,o){var a=[];if(o.every(function(e){return e===o[0]}))return 1===o[0]&&a.push({startX:e,startY:i,endX:e+r-1,endY:i+n-1}),a;for(var s=[new t(0,0)];s.length>0;){var l=s.pop(),u=E(l,r,n,o);if(1===u.value){var c=u.range;c.startX+=e,c.endX+=e,c.startY+=i,c.endY+=i,a.push(c)}var d=u.endingIndices;d.length>0&&(s=s.concat(d))}return a}function w(e,t,i,r){if(!e._hasAvailability)return{};var o=128*Math.floor(i/128),a=128*Math.floor(r/128),s=Math.min(1<<t,128),l="tilemap/"+t+"/"+a+"/"+o+"/"+s+"/"+s,u=e._availableCache;if(n(u[l]))return u[l];var c=new p({throttle:!0,throttleByServer:!0,type:m.TERRAIN}),d=e._resource.getDerivedResource({url:l,request:c}),h=d.fetchJson();return n(h)?(h=h.then(function(n){var l=A(o,a,s,s,n.data);e._tilesAvailablityLoaded.addAvailableTileRange(o,a,o+s,a+s);for(var u=e._tilesAvailable,c=0;c<l.length;++c){var d=l[c];u.addAvailableTileRange(t,d.startX,d.startY,d.endX,d.endY)}return T(e,t,i,r)}),u[l]={promise:h,request:c},h=h.always(function(e){return delete u[l],e}),{promise:h,request:c}):{}}return o(S.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),S.prototype.requestTileGeometry=function(t,i,r,o){var a,s=this._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:o}),l=this._hasAvailability,u=e.resolve(!0);if(l&&!n(T(this,r+1,2*t,2*i))){var c=w(this,r+1,2*t,2*i);u=c.promise,a=c.request}var h=s.fetchArrayBuffer();if(n(h)&&n(u)){var p=this,m=this._tilesAvailable;return e.join(h,u).then(function(e){return new d({buffer:e[0],width:p._width,height:p._height,childTileMask:l?m.computeChildMaskForTile(r,t,i):15,structure:p._terrainDataStructure,encoding:p._encoding})}).otherwise(function(t){return n(a)&&a.state===f.CANCELLED?(o.cancel(),o.deferred.promise.always(function(){return o.state=f.CANCELLED,e.reject(t)})):e.reject(t)})}},S.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},S.prototype.getTileDataAvailable=function(e,t,i){if(this._hasAvailability){var r=T(this,i,e,t);if(n(r))return r;w(this,i,e,t)}},S.prototype.loadTileDataAvailability=function(e,t,i){},S}),define("Core/ArcType",["./freezeObject"],function(e){"use strict";return e({NONE:0,GEODESIC:1,RHUMB:2})}),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){t!==this._hash[e]&&(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/BingMapsApi",["./defined"],function(e){"use strict";var t={};return t.defaultKey=void 0,t.getKey=function(i){return e(i)?i:t.defaultKey},t}),define("Core/BingMapsGeocoderService",["./BingMapsApi","./Check","./defaultValue","./defined","./defineProperties","./Rectangle","./Resource"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=i(t,i.EMPTY_OBJECT);var r=t.key;this._key=e.getKey(r),this._resource=new a({url:l,queryParameters:{key:this._key}})}var l="https://dev.virtualearth.net/REST/v1/Locations";return n(s.prototype,{url:{get:function(){return l}},key:{get:function(){return this._key}}}),s.prototype.geocode=function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(e){return 0===e.resourceSets.length?[]:e.resourceSets[0].resources.map(function(e){var t=e.bbox,i=t[0],r=t[1],n=t[2],a=t[3];return{displayName:e.name,destination:o.fromDegrees(r,i,a,n)}})})},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/arrayFill",["./Check","./defaultValue","./defined"],function(e,t,i){"use strict";function r(e,i,r,n){if("function"==typeof e.fill)return e.fill(i,r,n);for(var o=e.length>>>0,a=t(r,0),s=a<0?Math.max(o+a,0):Math.min(a,o),l=t(n,o),u=l<0?Math.max(o+l,0):Math.min(l,o);s<u;)e[s]=i,s++;return e}return r}),define("Core/GeometryOffsetAttribute",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,TOP:1,ALL:2})}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";return e({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3})}),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/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",["./Cartesian2","./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./GeometryOffsetAttribute","./GeometryType","./Matrix2","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){e=n(e,n.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=n(e.primitiveType,h.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=n(e.geometryType,l.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}_.computeNumberOfVertices=function(e){var t=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&o(e.attributes[i])&&o(e.attributes[i].values)){var r=e.attributes[i],n=r.values.length/r.componentsPerAttribute;t=n}return t};var g=new i,v=new t,y=new d,C=[new i,new i,new i],b=[new e,new e,new e],S=[new e,new e,new e],T=new t,E=new p,A=new d,w=new u;return _._textureCoordinateRotationPoints=function(r,n,o,a){var s,l=f.center(a,g),h=i.toCartesian(l,o,v),_=m.eastNorthUpToFixedFrame(h,o,y),x=d.inverse(_,y),P=b,D=C;D[0].longitude=a.west,D[0].latitude=a.south,D[1].longitude=a.west,D[1].latitude=a.north,D[2].longitude=a.east,D[2].latitude=a.south;var I=T;for(s=0;s<3;s++)i.toCartesian(D[s],o,I),I=d.multiplyByPointAsVector(x,I,I),P[s].x=I.x,P[s].y=I.y;var M=p.fromAxisAngle(t.UNIT_Z,-n,E),R=c.fromQuaternion(M,A),O=r.length,L=Number.POSITIVE_INFINITY,N=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,B=Number.NEGATIVE_INFINITY;for(s=0;s<O;s++)I=d.multiplyByPointAsVector(x,r[s],I),I=c.multiplyByVector(R,I,I),L=Math.min(L,I.x),N=Math.min(N,I.y),F=Math.max(F,I.x),B=Math.max(B,I.y);var k=u.fromRotation(n,w),z=S;z[0].x=L,z[0].y=N,z[1].x=L,z[1].y=B,z[2].x=F,z[2].y=N;var V=P[0],U=P[2].x-V.x,G=P[1].y-V.y;for(s=0;s<3;s++){var H=z[s];u.multiplyByVector(k,H,H),H.x=(H.x-V.x)/U,H.y=(H.y-V.y)/G}var W=z[0],q=z[1],Y=z[2],j=new Array(6);return e.pack(W,j),e.pack(q,j,2),e.pack(Y,j,4),j},_}),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",["./arrayFill","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){e=o(e,o.EMPTY_OBJECT);var t=e.minimum,r=e.maximum,n=o(e.vertexFormat,p.DEFAULT);this._minimum=i.clone(t),this._maximum=i.clone(r),this._vertexFormat=n,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}var m=new i;f.fromDimensions=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.dimensions,r=i.multiplyByScalar(t,.5,new i);return new f({minimum:i.negate(r,new i),maximum:r,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},f.fromAxisAlignedBoundingBox=function(e){return new f({minimum:e.minimum,maximum:e.maximum})},f.packedLength=2*i.packedLength+p.packedLength+1,f.pack=function(e,t,r){return r=o(r,0),i.pack(e._minimum,t,r),i.pack(e._maximum,t,r+i.packedLength),p.pack(e._vertexFormat,t,r+2*i.packedLength),t[r+2*i.packedLength+p.packedLength]=o(e._offsetAttribute,-1),t};var _=new i,g=new i,v=new p,y={minimum:_,maximum:g,vertexFormat:v,offsetAttribute:void 0};f.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,_),s=i.unpack(e,t+i.packedLength,g),l=p.unpack(e,t+2*i.packedLength,v),u=e[t+2*i.packedLength+p.packedLength];return a(r)?(r._minimum=i.clone(n,r._minimum),r._maximum=i.clone(s,r._maximum),r._vertexFormat=p.clone(l,r._vertexFormat),r._offsetAttribute=-1===u?void 0:u,r):(y.offsetAttribute=-1===u?void 0:u,new f(y))},f.createGeometry=function(r){var o=r._minimum,s=r._maximum,p=r._vertexFormat;if(!i.equals(o,s)){var f,_,g=new c;if(p.position&&(p.st||p.normal||p.tangent||p.bitangent)){if(p.position&&(_=new Float64Array(72),_[0]=o.x,_[1]=o.y,_[2]=s.z,_[3]=s.x,_[4]=o.y,_[5]=s.z,_[6]=s.x,_[7]=s.y,_[8]=s.z,_[9]=o.x,_[10]=s.y,_[11]=s.z,_[12]=o.x,_[13]=o.y,_[14]=o.z,_[15]=s.x,_[16]=o.y,_[17]=o.z,_[18]=s.x,_[19]=s.y,_[20]=o.z,_[21]=o.x,_[22]=s.y,_[23]=o.z,_[24]=s.x,_[25]=o.y,_[26]=o.z,_[27]=s.x,_[28]=s.y,_[29]=o.z,_[30]=s.x,_[31]=s.y,_[32]=s.z,_[33]=s.x,_[34]=o.y,_[35]=s.z,_[36]=o.x,_[37]=o.y,_[38]=o.z,_[39]=o.x,_[40]=s.y,_[41]=o.z,_[42]=o.x,_[43]=s.y,_[44]=s.z,_[45]=o.x,_[46]=o.y,_[47]=s.z,_[48]=o.x,_[49]=s.y,_[50]=o.z,_[51]=s.x,_[52]=s.y,_[53]=o.z,_[54]=s.x,_[55]=s.y,_[56]=s.z,_[57]=o.x,_[58]=s.y,_[59]=s.z,_[60]=o.x,_[61]=o.y,_[62]=o.z,_[63]=s.x,_[64]=o.y,_[65]=o.z,_[66]=s.x,_[67]=o.y,_[68]=s.z,_[69]=o.x,_[70]=o.y,_[71]=s.z,g.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})),p.normal){var v=new Float32Array(72);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=0,v[5]=1,v[6]=0,v[7]=0,v[8]=1,v[9]=0,v[10]=0,v[11]=1,v[12]=0,v[13]=0,v[14]=-1,v[15]=0,v[16]=0,v[17]=-1,v[18]=0,v[19]=0,v[20]=-1,v[21]=0,v[22]=0,v[23]=-1,v[24]=1,v[25]=0,v[26]=0,v[27]=1,v[28]=0,v[29]=0,v[30]=1,v[31]=0,v[32]=0,v[33]=1,v[34]=0,v[35]=0,v[36]=-1,v[37]=0,v[38]=0,v[39]=-1,v[40]=0,v[41]=0,v[42]=-1,v[43]=0,v[44]=0,v[45]=-1,v[46]=0,v[47]=0,v[48]=0,v[49]=1,v[50]=0,v[51]=0,v[52]=1,v[53]=0,v[54]=0,v[55]=1,v[56]=0,v[57]=0,v[58]=1,v[59]=0,v[60]=0,v[61]=-1,v[62]=0,v[63]=0,v[64]=-1,v[65]=0,v[66]=0,v[67]=-1,v[68]=0,v[69]=0,v[70]=-1,v[71]=0,g.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:v})}if(p.st){var y=new Float32Array(48);y[0]=0,y[1]=0,y[2]=1,y[3]=0,y[4]=1,y[5]=1,y[6]=0,y[7]=1,y[8]=1,y[9]=0,y[10]=0,y[11]=0,y[12]=0,y[13]=1,y[14]=1,y[15]=1,y[16]=0,y[17]=0,y[18]=1,y[19]=0,y[20]=1,y[21]=1,y[22]=0,y[23]=1,y[24]=1,y[25]=0,y[26]=0,y[27]=0,y[28]=0,y[29]=1,y[30]=1,y[31]=1,y[32]=1,y[33]=0,y[34]=0,y[35]=0,y[36]=0,y[37]=1,y[38]=1,y[39]=1,y[40]=0,y[41]=0,y[42]=1,y[43]=0,y[44]=1,y[45]=1,y[46]=0,y[47]=1,g.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})}if(p.tangent){var C=new Float32Array(72);C[0]=1,C[1]=0,C[2]=0,C[3]=1,C[4]=0,C[5]=0,C[6]=1,C[7]=0,C[8]=0,C[9]=1,C[10]=0,C[11]=0,C[12]=-1,C[13]=0,C[14]=0,C[15]=-1,C[16]=0,C[17]=0,C[18]=-1,C[19]=0,C[20]=0,C[21]=-1,C[22]=0,C[23]=0,C[24]=0,C[25]=1,C[26]=0,C[27]=0,C[28]=1,C[29]=0,C[30]=0,C[31]=1,C[32]=0,C[33]=0,C[34]=1,C[35]=0,C[36]=0,C[37]=-1,C[38]=0,C[39]=0,C[40]=-1,C[41]=0,C[42]=0,C[43]=-1,C[44]=0,C[45]=0,C[46]=-1,C[47]=0,C[48]=-1,C[49]=0,C[50]=0,C[51]=-1,C[52]=0,C[53]=0,C[54]=-1,C[55]=0,C[56]=0,C[57]=-1,C[58]=0,C[59]=0,C[60]=1,C[61]=0,C[62]=0,C[63]=1,C[64]=0,C[65]=0,C[66]=1,C[67]=0,C[68]=0,C[69]=1,C[70]=0,C[71]=0,g.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})}if(p.bitangent){var b=new Float32Array(72);b[0]=0,b[1]=1,b[2]=0,b[3]=0,b[4]=1,b[5]=0,b[6]=0,b[7]=1,b[8]=0,b[9]=0,b[10]=1,b[11]=0,b[12]=0,b[13]=1,b[14]=0,b[15]=0,b[16]=1,b[17]=0,b[18]=0,b[19]=1,b[20]=0,b[21]=0,b[22]=1,b[23]=0,b[24]=0,b[25]=0,b[26]=1,b[27]=0,b[28]=0,b[29]=1,b[30]=0,b[31]=0,b[32]=1,b[33]=0,b[34]=0,b[35]=1,b[36]=0,b[37]=0,b[38]=1,b[39]=0,b[40]=0,b[41]=1,b[42]=0,b[43]=0,b[44]=1,b[45]=0,b[46]=0,b[47]=1,b[48]=0,b[49]=0,b[50]=1,b[51]=0,b[52]=0,b[53]=1,b[54]=0,b[55]=0,b[56]=1,b[57]=0,b[58]=0,b[59]=1,b[60]=0,b[61]=0,b[62]=1,b[63]=0,b[64]=0,b[65]=1,b[66]=0,b[67]=0,b[68]=1,b[69]=0,b[70]=0,b[71]=1,g.bitangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})}f=new Uint16Array(36),f[0]=0,f[1]=1,f[2]=2,f[3]=0,f[4]=2,f[5]=3,f[6]=6,f[7]=5,f[8]=4,f[9]=7,f[10]=6,f[11]=4,f[12]=8,f[13]=9,f[14]=10,f[15]=8,f[16]=10,f[17]=11,f[18]=14,f[19]=13,f[20]=12,f[21]=15,f[22]=14,f[23]=12,f[24]=18,f[25]=17,f[26]=16,f[27]=19,f[28]=18,f[29]=16,f[30]=20,f[31]=21,f[32]=22,f[33]=20,f[34]=22,f[35]=23}else _=new Float64Array(24),_[0]=o.x,_[1]=o.y,_[2]=o.z,_[3]=s.x,_[4]=o.y,_[5]=o.z,_[6]=s.x,_[7]=s.y,_[8]=o.z,_[9]=o.x,_[10]=s.y,_[11]=o.z,_[12]=o.x,_[13]=o.y,_[14]=s.z,_[15]=s.x,_[16]=o.y,_[17]=s.z,_[18]=s.x,_[19]=s.y,_[20]=s.z,_[21]=o.x,_[22]=s.y,_[23]=s.z,g.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_}),f=new Uint16Array(36),f[0]=4,f[1]=5,f[2]=6,f[3]=4,f[4]=6,f[5]=7,f[6]=1,f[7]=0,f[8]=3,f[9]=1,f[10]=3,f[11]=2,f[12]=1,f[13]=6,f[14]=5,f[15]=1,f[16]=2,f[17]=6,f[18]=2,
- f[19]=3,f[20]=7,f[21]=2,f[22]=7,f[23]=6,f[24]=3,f[25]=0,f[26]=4,f[27]=3,f[28]=4,f[29]=7,f[30]=0,f[31]=1,f[32]=5,f[33]=0,f[34]=5,f[35]=4;var S=i.subtract(s,o,m),T=.5*i.magnitude(S);if(a(r._offsetAttribute)){var E=_.length,A=new Uint8Array(E/3),w=r._offsetAttribute===d.NONE?0:1;e(A,w),g.applyOffset=new u({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new l({attributes:g,indices:f,primitiveType:h.TRIANGLES,boundingSphere:new t(i.ZERO,T),offsetAttribute:r._offsetAttribute})}};var C;return f.getUnitBox=function(){return a(C)||(C=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:p.POSITION_ONLY}))),C},f}),define("Core/BoxOutlineGeometry",["./arrayFill","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./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.minimum,r=e.maximum;this._min=i.clone(t),this._max=i.clone(r),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}var f=new i;p.fromDimensions=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.dimensions,r=i.multiplyByScalar(t,.5,new i);return new p({minimum:i.negate(r,new i),maximum:r,offsetAttribute:e.offsetAttribute})},p.fromAxisAlignedBoundingBox=function(e){return new p({minimum:e.minimum,maximum:e.maximum})},p.packedLength=2*i.packedLength+1,p.pack=function(e,t,r){return r=o(r,0),i.pack(e._min,t,r),i.pack(e._max,t,r+i.packedLength),t[r+2*i.packedLength]=o(e._offsetAttribute,-1),t};var m=new i,_=new i,g={minimum:m,maximum:_,offsetAttribute:void 0};return p.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,m),s=i.unpack(e,t+i.packedLength,_),l=e[t+2*i.packedLength];return a(r)?(r._min=i.clone(n,r._min),r._max=i.clone(s,r._max),r._offsetAttribute=-1===l?void 0:l,r):(g.offsetAttribute=-1===l?void 0:l,new p(g))},p.createGeometry=function(r){var o=r._min,s=r._max;if(!i.equals(o,s)){var p=new c,m=new Uint16Array(24),_=new Float64Array(24);_[0]=o.x,_[1]=o.y,_[2]=o.z,_[3]=s.x,_[4]=o.y,_[5]=o.z,_[6]=s.x,_[7]=s.y,_[8]=o.z,_[9]=o.x,_[10]=s.y,_[11]=o.z,_[12]=o.x,_[13]=o.y,_[14]=s.z,_[15]=s.x,_[16]=o.y,_[17]=s.z,_[18]=s.x,_[19]=s.y,_[20]=s.z,_[21]=o.x,_[22]=s.y,_[23]=s.z,p.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_}),m[0]=4,m[1]=5,m[2]=5,m[3]=6,m[4]=6,m[5]=7,m[6]=7,m[7]=4,m[8]=0,m[9]=1,m[10]=1,m[11]=2,m[12]=2,m[13]=3,m[14]=3,m[15]=0,m[16]=0,m[17]=4,m[18]=1,m[19]=5,m[20]=2,m[21]=6,m[22]=3,m[23]=7;var g=i.subtract(s,o,f),v=.5*i.magnitude(g);if(a(r._offsetAttribute)){var y=_.length,C=new Uint8Array(y/3),b=r._offsetAttribute===d.NONE?0:1;e(C,b),p.applyOffset=new u({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}return new l({attributes:p,indices:m,primitiveType:h.LINES,boundingSphere:new t(i.ZERO,v),offsetAttribute:r._offsetAttribute})}},p}),define("Core/CartographicGeocoderService",["../ThirdParty/when","./Cartesian3","./Check"],function(e,t,i){"use strict";function r(){}return r.prototype.geocode=function(i){var r=i.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var n=+r[0],o=+r[1],a=3===r.length?+r[2]:300;if(isNaN(n)&&isNaN(o))for(var s=/^(\d+.?\d*)([nsew])/i,l=0;l<r.length;++l){var u=r[l].match(s);s.test(r[l])&&3===u.length&&(/^[ns]/i.test(u[2])?o=/^[n]/i.test(u[2])?+u[1]:-u[1]:/^[ew]/i.test(u[2])&&(n=/^[e]/i.test(u[2])?+u[1]:-u[1]))}if(!isNaN(n)&&!isNaN(o)&&!isNaN(a)){var c={displayName:i,destination:t.fromDegrees(n,o,a)};return e.resolve([c])}}return e.resolve([])},r}),define("Core/Spline",["./Check","./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";function o(){this.times=void 0,this.points=void 0,r.throwInstantiationError()}return o.prototype.evaluate=r.throwInstantiationError,o.prototype.findTimeInterval=function(e,i){var r=this.times,n=r.length;if(i=t(i,0),e>=r[i]){if(i+1<n&&e<r[i+1])return i;if(i+2<n&&e<r[i+2])return i+1}else if(i-1>=0&&e>=r[i-1])return i-1;var o;if(e>r[i])for(o=i;o<n-1&&!(e>=r[o]&&e<r[o+1]);++o);else for(o=i-1;o>=0&&!(e>=r[o]&&e<r[o+1]);--o);return o===n-1&&(o=n-2),o},o.prototype.wrapTime=function(e){var t,i=this.times,r=i[i.length-1],n=i[0],o=r-n;return e<n&&(t=Math.floor((n-e)/o)+1,e+=t*o),e>r&&(t=Math.floor((e-r)/o)+1,e-=t*o),e},o.prototype.clampTime=function(e){var t=this.times;return n.clamp(e,t[0],t[t.length-1])},o}),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.wrapTime=o.prototype.wrapTime,a.prototype.clampTime=o.prototype.clampTime,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);return new h({times:t,points:r,inTangents:n.slice(1,n.length),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);return new h({times:t,points:r,inTangents:n.slice(1,n.length),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);return new h({times:t,points:r,inTangents:s.slice(1,s.length),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.wrapTime=l.prototype.wrapTime,h.prototype.clampTime=l.prototype.clampTime,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","./Check","./defaultValue","./defined","./defineProperties","./HermiteSpline","./Matrix4","./Spline"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){var i=t.points,r=t.times;if(i.length<3){var o=r[0],l=1/(r[1]-o),u=i[0],f=i[1];return function(t,i){n(i)||(i=new e);var r=(t-o)*l;return e.lerp(u,f,r,i)}}return function(o,l){n(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),f=(o-r[u])/(r[u+1]-r[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=r(t,r.EMPTY_OBJECT);var i=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(i.length>2&&(n(a)||(a=f,e.multiplyByScalar(i[1],2,a),e.subtract(a,i[2],a),e.subtract(a,i[0],a),e.multiplyByScalar(a,.5,a)),!n(s))){var l=i.length-1;s=m,e.multiplyByScalar(i[l-1],2,s),e.subtract(i[l],s,s),e.add(s,i[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=i,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 o(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.wrapTime=l.prototype.wrapTime,c.prototype.clampTime=l.prototype.clampTime,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),define("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError","./RuntimeError"],function(e,t,i,r){"use strict";function n(t,i,r){return i=e(i,0),r=e(r,t.byteLength-i),t=t.subarray(i,i+r),n.decode(t)}function o(e,t,i){return t<=e&&e<=i}function a(e){for(var t=0,i=0,n=0,a=128,s=191,l=[],u=e.length,c=0;c<u;++c){var d=e[c];if(0===n){if(o(d,0,127)){l.push(d);continue}if(o(d,194,223)){n=1,t=31&d;continue}if(o(d,224,239)){224===d&&(a=160),237===d&&(s=159),n=2,t=15&d;continue}if(o(d,240,244)){240===d&&(a=144),244===d&&(s=143),n=3,t=7&d;continue}throw new r("String decoding failed.")}o(d,a,s)?(a=128,s=191,t=t<<6|63&d,++i===n&&(l.push(t),t=n=i=0)):(t=n=i=0,a=128,s=191,--c)}return l}return n.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},n.decodeWithFromCharCode=function(e){for(var t="",i=a(e),r=i.length,n=0;n<r;++n){var o=i[n];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return t},"undefined"!=typeof TextDecoder?n.decode=n.decodeWithTextDecoder:n.decode=n.decodeWithFromCharCode,n}),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.fromSizeInBytes=function(e){switch(e){case 2:return o.UNSIGNED_SHORT;case 4:return o.UNSIGNED_INT;case 1:return o.UNSIGNED_BYTE}},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/Intersections2D",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";var o={};return o.clipTriangleAtAxisAlignedThreshold=function(e,t,i,n,o,a){r(a)?a.length=0:a=[];var s,l,u;t?(s=i<e,l=n<e,u=o<e):(s=i>e,l=n>e,u=o>e);var c,d,h,p,f,m,_=s+l+u;return 1===_?s?(c=(e-i)/(n-i),d=(e-i)/(o-i),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)/(i-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)/(i-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||i===e?l||n===e?u||o===e||(d=(e-i)/(o-i),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-i)/(n-i),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)/(i-n),f=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(f)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},o.computeBarycentricCoordinates=function(e,i,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),_=i-u,g=e-l,v=(p*g+h*_)*m,y=(-f*g+d*_)*m,C=1-v-y;return r(c)?(c.x=v,c.y=y,c.z=C,c):new t(v,y,C)},o.computeLineSegmentLineSegmentIntersection=function(t,i,n,o,a,s,l,u,c){var d=(l-a)*(i-s)-(u-s)*(t-a),h=(n-t)*(i-s)-(o-i)*(t-a),p=(u-s)*(n-t)-(l-a)*(o-i);if(0!==p){var f=d/p,m=h/p;return f>=0&&f<=1&&m>=0&&m<=1?(r(c)||(c=new e),c.x=t+f*(n-t),c.y=i+f*(o-i),c):void 0}},o}),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,this._credits=e.credits;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){C.length=e.length;for(var r=!1,n=0,o=e.length;n<o;++n)C[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(C.sort(t),l.createTypedArray(i,C)):e}function g(e,t,i,r,n,o,a,s){var l=Math.min(i,n,a),u=Math.max(i,n,a),c=Math.min(r,o,s),d=Math.max(r,o,s);return e>=l&&e<=u&&t>=c&&t<=d}function v(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,A),f=o.decodeTextureCoordinates(n,d,w),m=o.decodeTextureCoordinates(n,h,x);if(g(t,i,p.x,p.y,f.x,f.y,m.x,m.y)){var _=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 v=o.decodeHeight(n,c),y=o.decodeHeight(n,d),C=o.decodeHeight(n,h);return _.x*v+_.y*y+_.z*C}}}}function y(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],v=n[d],y=n[h],C=n[p];if(g(t,i,f,v,m,y,_,C)){var b=u.computeBarycentricCoordinates(t,i,f,v,m,y,_,C,E);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){var S=b.x*o[d]+b.y*o[h]+b.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,S/T)}}}}a(m.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return o(this._mesh)}}});var C=[],b=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(i,a,s,u,c){var h=i.ellipsoid,m=i.tileXYToRectangle(a,s,u);c=n(c,1);var _=b.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:m,relativeToCenter:this._boundingSphere.center,ellipsoid:h,exaggeration:c});if(o(_)){var g=this;return e(_,function(e){var i=g._quantizedVertices.length/3;i+=g._westIndices.length+g._southIndices.length+g._eastIndices.length+g._northIndices.length;var o=l.createTypedArray(i,e.indices),a=new Float32Array(e.vertices),s=e.center,u=e.minimumHeight,h=e.maximumHeight,m=n(t.clone(e.boundingSphere),g._boundingSphere),_=n(d.clone(e.orientedBoundingBox),g._orientedBoundingBox),v=r.clone(g._horizonOcclusionPoint),y=e.vertexStride,C=p.clone(e.encoding);return g._skirtIndex=e.skirtIndex,g._vertexCountWithoutSkirts=g._quantizedVertices.length/3,g._mesh=new f(s,a,o,u,h,m,v,y,_,C,c,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),g._quantizedVertices=void 0,g._encodedNormals=void 0,g._indices=void 0,g._uValues=void 0,g._vValues=void 0,g._heightValues=void 0,g._westIndices=void 0,g._southIndices=void 0,g._eastIndices=void 0,g._northIndices=void 0,g._mesh})}};var S=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=S.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 b=f?.5*C:this._westSkirtHeight,T=_?.5*C:this._southSkirtHeight,E=f?this._eastSkirtHeight:.5*C,A=_?this._northSkirtHeight:.5*C,w=this._credits;return e(y).then(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:b,southSkirtHeight:T,eastSkirtHeight:E,northSkirtHeight:A,childTileMask:0,credits:w,createdByUpsampling:!0})})}}};var T=32767,E=new r;m.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=T;var n=c.clamp((i-e.south)/e.height,0,1);return n*=T,o(this._mesh)?v(this,r,n):y(this,r,n)};var A=new i,w=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/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./AttributeCompression","./BoundingSphere","./Cartesian2","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./getStringFromTypedArray","./HeightmapTerrainData","./IndexDatatype","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Request","./RequestType","./Resource","./RuntimeError","./TerrainProvider","./TileAvailability","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A){"use strict";function w(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.availabilityPromiseCache={}}function x(e){function i(e){var n;if(!e.format)return n="The tile format is not specified in the layer.json file.",void(_=A.handleError(_,g,g._errorEvent,n,void 0,void 0,void 0,u));if(!e.tiles||0===e.tiles.length)return n="The layer.json file does not specify any tile URL templates.",void(_=A.handleError(_,g,g._errorEvent,n,void 0,void 0,void 0,u));var o=!1,a=!1,s=!1,c=!0,d=!1;if("heightmap-1.0"===e.format)d=!0,l(g._heightmapStructure)||(g._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),a=!0,g._requestWaterMask=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return n='The tile format "'+e.format+'" is invalid or not supported.',void(_=A.handleError(_,g,g._errorEvent,n,void 0,void 0,void 0,u));var h=e.tiles,p=e.maxzoom;S=Math.max(S,p);var b;l(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?o=!0:l(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(o=!0,c=!1),l(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(a=!0),l(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(s=!0);var T,x=e.metadataAvailability,P=e.available;if(l(P)&&!l(x)){T=new E(g._tilingScheme,P.length);for(var D=0;D<P.length;++D){var I=P[D],M=g._tilingScheme.getNumberOfYTilesAtLevel(D);l(C[D])||(C[D]=[]);for(var R=0;R<I.length;++R){var O=I[R],L=M-O.endY-1,N=M-O.startY-1;C[D].push([O.startX,L,O.endX,N]),T.addAvailableTileRange(D,O.startX,L,O.endX,N)}}}else l(x)&&(b=new E(g._tilingScheme,p),T=new E(g._tilingScheme,p),C[0]=[[0,0,1,0]],T.addAvailableTileRange(0,0,0,1,0));g._hasWaterMask=g._hasWaterMask||a,g._hasVertexNormals=g._hasVertexNormals||o,g._hasMetadata=g._hasMetadata||s,l(e.attribution)&&(y.length>0&&(y+=" "),y+=e.attribution),v.push(new w({resource:f,version:e.version,isHeightmap:d,tileUrlTemplates:h,availability:T,hasVertexNormals:o,hasWaterMask:a,hasMetadata:s,availabilityLevels:x,availabilityTilesLoaded:b,littleEndianExtensionSize:c}));var F=e.parentUrl;if(l(F)){if(!l(T))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),t.resolve();f=f.getDerivedResource({url:F}),f.appendForwardSlash(),m=f.getDerivedResource({url:"layer.json"});var B=m.fetchJson();return t(B,i,r)}return t.resolve()}function r(e){var t="An error occurred while accessing "+m.url+".";_=A.handleError(_,g,g._errorEvent,t,void 0,void 0,void 0,u)}function n(e){i(e).then(function(){if(!l(_)){var e=C.length;if(e>0)for(var t=g._availability=new E(g._tilingScheme,S),i=0;i<e;++i)for(var r=C[i],n=0;n<r.length;++n){var o=r[n];t.addAvailableTileRange(i,o[0],o[1],o[2],o[3])}if(y.length>0){var s=new a(y);l(g._tileCredits)?g._tileCredits.push(s):g._tileCredits=[s]}g._ready=!0,g._readyPromise.resolve(!0)}})}function o(e){if(l(e)&&404===e.statusCode)return void n({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});r(e)}function u(){t(m.fetchJson()).then(n).otherwise(o)}this._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=T.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=s(e.requestVertexNormals,!1),this._requestWaterMask=s(e.requestWaterMask,!1),this._requestMetadata=s(e.requestMetadata,!0),this._errorEvent=new d;var c=e.credit;"string"==typeof c&&(c=new a(c)),this._credit=c,this._availability=void 0;var p=t.defer();this._ready=!1,this._readyPromise=p,this._tileCredits=void 0;var f,m,_,g=this,v=this._layers=[],y="",C=[],S=0;t(e.url).then(function(e){var t=b.createIfNeeded(e);t.appendForwardSlash(),f=t,m=f.getDerivedResource({url:"layer.json"}),g._tileCredits=t.credits,u()}).otherwise(function(e){p.reject(e)})}function P(e){return l(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function D(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new f({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,credits:e._tileCredits})}function I(e,t,n,a,s,u,c){var d=c.littleEndianExtensionSize,h=0,f=3*Float64Array.BYTES_PER_ELEMENT,y=4*Float64Array.BYTES_PER_ELEMENT,C=3*Uint16Array.BYTES_PER_ELEMENT,b=Uint16Array.BYTES_PER_ELEMENT,S=3*b,T=new DataView(t),E=new o(T.getFloat64(h,!0),T.getFloat64(h+8,!0),T.getFloat64(h+16,!0));h+=f;var A=T.getFloat32(h,!0);h+=Float32Array.BYTES_PER_ELEMENT;var w=T.getFloat32(h,!0);h+=Float32Array.BYTES_PER_ELEMENT;var x=new r(new o(T.getFloat64(h,!0),T.getFloat64(h+8,!0),T.getFloat64(h+16,!0)),T.getFloat64(h+f,!0));h+=y;var P=new o(T.getFloat64(h,!0),T.getFloat64(h+8,!0),T.getFloat64(h+16,!0));h+=f;var D=T.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var I=new Uint16Array(t,h,3*D);h+=D*C,D>65536&&(b=Uint32Array.BYTES_PER_ELEMENT,S=3*b);var M=I.subarray(0,D),R=I.subarray(D,2*D),O=I.subarray(2*D,3*D);i.zigZagDeltaDecode(M,R,O),h%b!=0&&(h+=b-h%b);var N=T.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var F=m.createTypedArrayFromArrayBuffer(D,t,h,3*N);h+=N*S;for(var B=0,k=F.length,z=0;z<k;++z){var V=F[z];F[z]=B-V,0===V&&++B}var U=T.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var G=m.createTypedArrayFromArrayBuffer(D,t,h,U);h+=U*b;var H=T.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var W=m.createTypedArrayFromArrayBuffer(D,t,h,H);h+=H*b;var q=T.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var Y=m.createTypedArrayFromArrayBuffer(D,t,h,q);h+=q*b;var j=T.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var X=m.createTypedArrayFromArrayBuffer(D,t,h,j);h+=j*b;for(var Q,K;h<T.byteLength;){var Z=T.getUint8(h,!0);h+=Uint8Array.BYTES_PER_ELEMENT;var J=T.getUint32(h,d);if(h+=Uint32Array.BYTES_PER_ELEMENT,Z===L.OCT_VERTEX_NORMALS&&e._requestVertexNormals)Q=new Uint8Array(t,h,2*D);else if(Z===L.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,h,J);else if(Z===L.METADATA&&e._requestMetadata){var $=T.getUint32(h,!0);if($>0){var ee=p(new Uint8Array(t),h+Uint32Array.BYTES_PER_ELEMENT,$),te=JSON.parse(ee),ie=te.available;if(l(ie))for(var re=0;re<ie.length;++re)for(var ne=n+re+1,oe=ie[re],ae=e._tilingScheme.getNumberOfYTilesAtLevel(ne),se=0;se<oe.length;++se){var le=oe[se],ue=ae-le.endY-1,ce=ae-le.startY-1;e.availability.addAvailableTileRange(ne,le.startX,ue,le.endX,ce),c.availability.addAvailableTileRange(ne,le.startX,ue,le.endX,ce)}}c.availabilityTilesLoaded.addAvailableTileRange(n,a,s,a,s)}h+=J}var de,he=5*e.getLevelMaximumGeometricError(n),pe=e._tilingScheme.tileXYToRectangle(a,s,n);return pe.width<_.PI_OVER_TWO+_.EPSILON5&&(de=g.fromRectangle(pe,A,w,e._tilingScheme.ellipsoid)),new v({center:E,minimumHeight:A,maximumHeight:w,boundingSphere:x,orientedBoundingBox:de,horizonOcclusionPoint:P,quantizedVertices:I,encodedNormals:Q,indices:F,westIndices:G,southIndices:W,eastIndices:Y,northIndices:X,westSkirtHeight:he,southSkirtHeight:he,eastSkirtHeight:he,northSkirtHeight:he,childTileMask:e.availability.computeChildMaskForTile(n,a,s),waterMask:K,credits:e._tileCredits})}function M(e,i,r,n,o,a){if(!l(o))return t.reject(new S("Terrain tile doesn't exist"));var s=o.tileUrlTemplates;if(0!==s.length){var u=e._tilingScheme.getNumberOfYTilesAtLevel(n),c=u-r-1,d=[];e._requestVertexNormals&&o.hasVertexNormals&&d.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&d.push("watermask"),e._requestMetadata&&o.hasMetadata&&d.push("metadata");var h,p,f=s[(i+c+n)%s.length],m=o.resource;l(m._ionEndpoint)&&!l(m._ionEndpoint.externalType)?(0!==d.length&&(p={extensions:d.join("-")}),h=P(void 0)):h=P(d);var _=m.getDerivedResource({url:f,templateValues:{version:o.version,z:n,x:i,y:c},queryParameters:p,headers:h,request:a}).fetchArrayBuffer();if(l(_))return _.then(function(t){return l(e._heightmapStructure)?D(e,t,n,i,r,c):I(e,t,n,i,r,c,o)})}}function R(e,t,i,r){if(0!==r){var n=e.availabilityLevels,o=r%n==0?r-n:(r/n|0)*n,a=1<<r-o;return{level:o,x:t/a|0,y:i/a|0}}}function O(e,t,i,r,n,o){if(!l(n.availabilityLevels))return{result:!1};for(var a,s=function(){delete n.availabilityPromiseCache[a]},u=n.availabilityTilesLoaded,c=n.availability,d=R(n,t,i,r);l(d);){if(c.isTileAvailable(d.level,d.x,d.y)&&!u.isTileAvailable(d.level,d.x,d.y)){var h;if(!o&&(a=d.level+"-"+d.x+"-"+d.y,h=n.availabilityPromiseCache[a],!l(h))){var p=new y({throttle:!0,throttleByServer:!0,type:C.TERRAIN});h=M(e,d.x,d.y,d.level,n,p),l(h)&&(n.availabilityPromiseCache[a]=h,h.then(s))}return{result:!0,promise:h}}d=R(n,d.x,d.y,d.level)}return{result:!1}}var L={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};return x.prototype.requestTileGeometry=function(e,t,i,r){var n,o=this._layers,a=o.length;if(1===a)n=o[0];else for(var s=0;s<a;++s){var u=o[s];if(!l(u.availability)||u.availability.isTileAvailable(i,e,t)){n=u;break}}return M(this,e,t,i,n,r)},u(x.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}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}}),x.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},x.prototype.getTileDataAvailable=function(e,t,i){if(l(this._availability)){if(i>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var r=this._layers,n=r.length,o=0;o<n;++o){if(O(this,e,t,i,r[o],0===o).result)return}return!1}},x.prototype.loadTileDataAvailability=function(e,t,i){if(!(!l(this._availability)||i>this._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var r=this._layers,n=r.length,o=0;o<n;++o){var a=O(this,e,t,i,r[o],0===o);if(l(a.promise))return a.promise}},x._getAvailabilityTile=R,x}),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),b=C/f;return r.fromAxisAngle(a,b,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),b=e.multiplyByScalar(C,o,h);e.add(v,b,v),r&&(e.multiplyByScalar(C,a,b),e.add(y,b,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),b=e.normalize(u,f),S=e.cross(e.UNIT_Z,u,m);S=e.normalize(S,S);var T=e.cross(b,S,_),E=1+Math.ceil(t.PI_OVER_TWO/p),A=t.PI_OVER_TWO/(E-1),w=t.PI_OVER_TWO-E*A;w<0&&(E-=Math.ceil(Math.abs(w)/A));var x,P,D,I,M,R=E*(E+2)*2,O=r?new Array(3*R):void 0,L=0,N=c,F=d,B=4*E*3,k=B-1,z=0,V=o?new Array(B):void 0;for(w=t.PI_OVER_TWO,N=n(w,l,T,S,g,y,v,C,b,N),r&&(O[L++]=N.x,O[L++]=N.y,O[L++]=N.z),o&&(V[k--]=N.z,V[k--]=N.y,V[k--]=N.x),w=t.PI_OVER_TWO-A,x=1;x<E+1;++x){if(N=n(w,l,T,S,g,y,v,C,b,N),F=n(Math.PI-w,l,T,S,g,y,v,C,b,F),r){for(O[L++]=N.x,O[L++]=N.y,O[L++]=N.z,D=2*x+2,P=1;P<D-1;++P)I=P/(D-1),M=e.lerp(N,F,I,h),O[L++]=M.x,O[L++]=M.y,O[L++]=M.z;O[L++]=F.x,O[L++]=F.y,O[L++]=F.z}o&&(V[k--]=N.z,V[k--]=N.y,V[k--]=N.x,V[z++]=F.x,V[z++]=F.y,V[z++]=F.z),w=t.PI_OVER_TWO-(x+1)*A}for(x=E;x>1;--x){if(w=t.PI_OVER_TWO-(x-1)*A,N=n(-w,l,T,S,g,y,v,C,b,N),F=n(w+Math.PI,l,T,S,g,y,v,C,b,F),r){for(O[L++]=N.x,O[L++]=N.y,O[L++]=N.z,D=2*(x-1)+2,P=1;P<D-1;++P)I=P/(D-1),M=e.lerp(N,F,I,h),O[L++]=M.x,O[L++]=M.y,O[L++]=M.z;O[L++]=F.x,O[L++]=F.y,O[L++]=F.z}o&&(V[k--]=N.z,V[k--]=N.y,V[k--]=N.x,V[z++]=F.x,V[z++]=F.y,V[z++]=F.z)}w=t.PI_OVER_TWO,N=n(-w,l,T,S,g,y,v,C,b,N);var U={};return r&&(O[L++]=N.x,O[L++]=N.y,O[L++]=N.z,U.positions=O,U.numPts=E),o&&(V[k--]=N.z,V[k--]=N.y,V[k--]=N.x,U.outerPositions=V),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/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined","./Math"],function(e,t,i,r,n){"use strict";function o(i,o,u,c,d){r(d)||(d=new t);var h,p,f,m,_,g,v,y;if(r(o.z)){if(t.equalsEpsilon(i,o,n.EPSILON14))return t.clone(t.UNIT_X,d);if(t.equalsEpsilon(i,u,n.EPSILON14))return t.clone(t.UNIT_Y,d);if(t.equalsEpsilon(i,c,n.EPSILON14))return t.clone(t.UNIT_Z,d);h=t.subtract(u,o,a),p=t.subtract(c,o,s),f=t.subtract(i,o,l),m=t.dot(h,h),_=t.dot(h,p),g=t.dot(h,f),v=t.dot(p,p),y=t.dot(p,f)}else{if(e.equalsEpsilon(i,o,n.EPSILON14))return t.clone(t.UNIT_X,d);if(e.equalsEpsilon(i,u,n.EPSILON14))return t.clone(t.UNIT_Y,d);if(e.equalsEpsilon(i,c,n.EPSILON14))return t.clone(t.UNIT_Z,d);h=e.subtract(u,o,a),p=e.subtract(c,o,s),f=e.subtract(i,o,l),m=e.dot(h,h),_=e.dot(h,p),g=e.dot(h,f),v=e.dot(p,p),y=e.dot(p,f)}var C=m*v-_*_,b=1/C;return d.y=(v*g-_*y)*b,d.z=(m*y-_*g)*b,d.x=1-d.y-d.z,d}var a=new t,s=new t,l=new t;return o}),define("Core/EncodedCartesian3",["./Cartesian3","./Check","./defined"],function(e,t,i){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,t){i(t)||(t={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),t.high=r,t.low=e-r):(r=65536*Math.floor(-e/65536),t.high=-r,t.low=e+r),t};var n={high:0,low:0};r.fromCartesian=function(e,t){i(t)||(t=new r);var o=t.high,a=t.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,t};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 o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n<r;){if(e[n].numLiveTriangles>0)return++n-1;++n}return-1}i=e(i,e.EMPTY_OBJECT);var n,o=i.indices,a=i.maximumIndex,s=e(i.cacheSize,24),l=o.length,u=0,c=0,d=o[c],h=l;if(t(a))u=a+1;else{for(;c<h;)d>u&&(u=d),++c,d=o[c];if(-1===u)return 0;++u}var p,f=[];for(p=0;p<u;p++)f[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;for(var m=0;c<h;)f[o[c]].vertexTriangles.push(m),++f[o[c]].numLiveTriangles,f[o[c+1]].vertexTriangles.push(m),++f[o[c+1]].numLiveTriangles,f[o[c+2]].vertexTriangles.push(m),++f[o[c+2]].numLiveTriangles,++m,c+=3;var _=0,g=s+1;n=1;var v,y,C=[],b=[],S=0,T=[],E=l/3,A=[];for(p=0;p<E;p++)A[p]=!1;for(var w,x;-1!==_;){C=[],y=f[_],x=y.vertexTriangles.length;for(var P=0;P<x;++P)if(m=y.vertexTriangles[P],!A[m]){A[m]=!0,c=m+m+m;for(var D=0;D<3;++D)w=o[c],C.push(w),b.push(w),T[S]=w,++S,v=f[w],--v.numLiveTriangles,g-v.timeStamp>s&&(v.timeStamp=g,++g),++c}_=function(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||-1===c)&&(c=l,u=h)),++d}return-1===u?r(n,a,e,s):u}(o,s,C,f,g,b,u)}return T},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E){"use strict";function A(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function w(e){for(var t=e.length,i=t/3*6,r=_.createTypedArray(t,i),n=0,o=0;o<t;o+=3,n+=6)A(r,n,e[o],e[o+1],e[o+2]);return r}function x(e){var t=e.length;if(t>=3){var i=6*(t-2),r=_.createTypedArray(t,i);A(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)A(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)A(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 I(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values))for(var n=t[r],o=0;o<n.componentsPerAttribute;++o)e[r].values.push(n.values[i*n.componentsPerAttribute+o])}function M(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,le),b.multiplyByPoint(e,le,le),n.pack(le,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,le),C.multiplyByVector(e,le,le),le=n.normalize(le,le),n.pack(le,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 L(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:T.POINTS})),b=_.createTypedArray(C,y),S=0,E=0;for(o=0;o<h;++o){var A=e[o][t].indices,w=A.length;for(s=0;s<w;++s)b[S++]=E+A[s];E+=p.computeNumberOfVertices(e[o][t])}v=b}var x,P=new n,D=0;for(o=0;o<h;++o){if(x=e[o][t].boundingSphere,!u(x)){P=void 0;break}n.add(x.center,P,P)}if(u(P))for(n.divideByScalar(P,h,P),o=0;o<h;++o){x=e[o][t].boundingSphere;var I=n.magnitude(n.subtract(x.center,P,de))+x.radius;I>D&&(D=I)}return new p({attributes:g,indices:v,primitiveType:m,boundingSphere:u(P)?new i(P,D):void 0})}function N(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 F(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=T.TRIANGLES,e}function B(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=T.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 z(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=T.LINES,e}function V(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=T.LINES,e}function U(e){switch(e.primitiveType){case T.TRIANGLE_FAN:return F(e);case T.TRIANGLE_STRIP:return B(e);case T.TRIANGLES:return N(e);case T.LINE_STRIP:return z(e);case T.LINE_LOOP:return V(e);case T.LINES:return k(e)}return e}function G(e,t){Math.abs(e.y)<y.EPSILON6&&(e.y=t?-y.EPSILON6: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,Ee),e.y/(e.y-t.y),Ee),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=De.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(W(e,t,Ae,xe),W(e,i,we,Pe),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,i,Ae,xe),W(t,e,we,Pe),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(i,e,Ae,xe),W(i,t,we,Pe),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,Ae,xe),W(i,t,we,Pe),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,i,Ae,xe),W(t,e,we,Pe),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,Ae,xe),W(e,i,we,Pe),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=De.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=Ae,l[4]=we,l[5]=xe,l[6]=Pe,l.length=7),De}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=_.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function j(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=Y(t,r),i=Y(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Q(e,t){var i=new e,r=new e,n=new e;return function(o,a,s,l,u,c,d,h){var p=e.fromArray(u,o*t,i),f=e.fromArray(u,a*t,r),m=e.fromArray(u,s*t,n);e.multiplyByScalar(p,l.x,p),e.multiplyByScalar(f,l.y,f),e.multiplyByScalar(m,l.z,m);var _=e.add(p,f,p);e.add(_,m,_),h&&e.normalize(_,_),e.pack(_,c,d*t)}}function K(e,i,r,o,a,s,l,c,d,h,p,f,m,_,g,v){if(u(s)||u(l)||u(c)||u(d)||u(h)||0!==_){var y=n.fromArray(a,3*e,Le),C=n.fromArray(a,3*i,Ne),b=n.fromArray(a,3*r,Fe),S=t(o,y,C,b,Be);if(u(s)&&Me(e,i,r,S,s,f.normal.values,v,!0),u(h)){var T=n.fromArray(h,3*e,Le),E=n.fromArray(h,3*i,Ne),A=n.fromArray(h,3*r,Fe);n.multiplyByScalar(T,S.x,T),n.multiplyByScalar(E,S.y,E),n.multiplyByScalar(A,S.z,A);var w;n.equals(T,n.ZERO)&&n.equals(E,n.ZERO)&&n.equals(A,n.ZERO)?(w=Le,w.x=0,w.y=0,w.z=0):(w=n.add(T,E,T),n.add(w,A,w),n.normalize(w,w)),n.pack(w,f.extrudeDirection.values,3*v)}if(u(p)&&Oe(e,i,r,S,p,f.applyOffset.values,v),u(l)&&Me(e,i,r,S,l,f.tangent.values,v,!0),u(c)&&Me(e,i,r,S,c,f.bitangent.values,v,!0),u(d)&&Re(e,i,r,S,d,f.st.values,v),_>0)for(var x=0;x<_;x++){var P=m[x];Z(e,i,r,S,v,g[P],f[P])}}}function Z(e,t,i,r,n,o,a){var s=o.componentsPerAttribute,l=o.values,u=a.values;switch(s){case 4:Ie(e,t,i,r,l,u,n,!1);break;case 3:Me(e,t,i,r,l,u,n,!1);break;case 2:Re(e,t,i,r,l,u,n,!1);break;default:u[n]=l[e]*r.x+l[t]*r.y+l[i]*r.z}}function J(e,t,i,r,n,o){var a=e.position.values.length/3;if(-1!==n){var s=r[n],l=i[s];return-1===l?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function $(e){var t=e.geometry,i=t.attributes,r=i.position.values,o=u(i.normal)?i.normal.values:void 0,a=u(i.bitangent)?i.bitangent.values:void 0,s=u(i.tangent)?i.tangent.values:void 0,l=u(i.st)?i.st.values:void 0,c=u(i.extrudeDirection)?i.extrudeDirection.values:void 0,d=u(i.applyOffset)?i.applyOffset.values:void 0,h=t.indices,p=[];for(var f in i)i.hasOwnProperty(f)&&!ke[f]&&u(i[f])&&p.push(f);var m,_,g,v,y,C=p.length,b=j(t),S=j(t),T=[];T.length=r.length/3;var E=[];for(E.length=r.length/3,y=0;y<T.length;++y)T[y]=-1,E[y]=-1;var A=h.length;for(y=0;y<A;y+=3){var w=h[y],x=h[y+1],P=h[y+2],D=n.fromArray(r,3*w),I=n.fromArray(r,3*x),M=n.fromArray(r,3*P),R=q(D,I,M);if(u(R)&&R.positions.length>3)for(var O=R.positions,L=R.indices,N=L.length,F=0;F<N;++F){var B=L[F],k=O[B];k.y<0?(m=S.attributes,_=S.indices,g=T):(m=b.attributes,_=b.indices,g=E),v=J(m,_,g,h,B<3?y+B:-1,k),K(w,x,P,k,r,o,s,a,l,c,d,m,p,C,i,v)}else u(R)&&(D=R.positions[0],I=R.positions[1],M=R.positions[2]),D.y<0?(m=S.attributes,_=S.indices,g=T):(m=b.attributes,_=b.indices,g=E),v=J(m,_,g,h,y,D),K(w,x,P,D,r,o,s,a,l,c,d,m,p,C,i,v),v=J(m,_,g,h,y+1,I),K(w,x,P,I,r,o,s,a,l,c,d,m,p,C,i,v),v=J(m,_,g,h,y+2,M),K(w,x,P,M,r,o,s,a,l,c,d,m,p,C,i,v)}X(e,S,b)}function ee(e,t,i,r,o,a,s){if(u(s)){var l=n.fromArray(r,3*e,Le);n.equalsEpsilon(l,i,y.EPSILON10)?a.applyOffset.values[o]=s[e]:a.applyOffset.values[o]=s[t]}}function te(e){var t,i=e.geometry,r=i.attributes,o=r.position.values,a=u(r.applyOffset)?r.applyOffset.values:void 0,s=i.indices,l=j(i),c=j(i),d=s.length,h=[];h.length=o.length/3;var p=[];for(p.length=o.length/3,t=0;t<h.length;++t)h[t]=-1,p[t]=-1;for(t=0;t<d;t+=2){var f,m=s[t],_=s[t+1],g=n.fromArray(o,3*m,Le),C=n.fromArray(o,3*_,Ne);Math.abs(g.y)<y.EPSILON6&&(g.y<0?g.y=-y.EPSILON6:g.y=y.EPSILON6),Math.abs(C.y)<y.EPSILON6&&(C.y<0?C.y=-y.EPSILON6:C.y=y.EPSILON6);var b=l.attributes,S=l.indices,T=p,E=c.attributes,A=c.indices,w=h,x=v.lineSegmentPlane(g,C,ze,Fe);if(u(x)){var P=n.multiplyByScalar(n.UNIT_Y,5*y.EPSILON9,Ve);g.y<0&&(n.negate(P,P),b=c.attributes,S=c.indices,T=h,E=l.attributes,A=l.indices,w=p);var D=n.add(x,P,Ue);f=J(b,S,T,s,t,g),ee(m,_,g,o,f,b,a),f=J(b,S,T,s,-1,D),ee(m,_,D,o,f,b,a),n.negate(P,P),n.add(x,P,D),f=J(E,A,w,s,-1,D),ee(m,_,D,o,f,E,a),f=J(E,A,w,s,t+1,C),ee(m,_,C,o,f,E,a)}else{var I,M,R;g.y<0?(I=c.attributes,M=c.indices,R=h):(I=l.attributes,M=l.indices,R=p),f=J(I,M,R,s,t,g),ee(m,_,g,o,f,I,a),f=J(I,M,R,s,t+1,C),ee(m,_,C,o,f,I,a)}}X(e,c,l)}function ie(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,We);if(!(l.x>0)){var u=n.unpack(r,s,qe);(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,Ye);(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 re(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,_=j(s),g=j(s),C=!1,b=c.length/3;for(t=0;t<b;t+=4){var S=t,T=t+2,E=n.fromArray(c,3*S,We),A=n.fromArray(c,3*T,qe);if(Math.abs(E.y)<Je)for(E.y=Je*(A.y<0?-1:1),c[3*t+1]=E.y,c[3*(t+1)+1]=E.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(A.y)<Je)for(A.y=Je*(E.y<0?-1:1),c[3*(t+2)+1]=A.y,c[3*(t+3)+1]=A.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 w=_.attributes,x=_.indices,P=g.attributes,D=g.indices,I=v.lineSegmentPlane(E,A,ze,je);if(u(I)){C=!0;var M=n.multiplyByScalar(n.UNIT_Y,Ze,Xe);E.y<0&&(n.negate(M,M),w=g.attributes,x=g.indices,P=_.attributes,D=_.indices);var R=n.add(I,M,Qe);w.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),w.position.values.push(R.x,R.y,R.z),w.position.values.push(R.x,R.y,R.z),w.prevPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),w.prevPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]),w.prevPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),w.nextPosition.values.push(R.x,R.y,R.z),w.nextPosition.values.push(R.x,R.y,R.z),w.nextPosition.values.push(R.x,R.y,R.z),w.nextPosition.values.push(R.x,R.y,R.z),n.negate(M,M),n.add(I,M,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(A.x,A.y,A.z,A.x,A.y,A.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(A.x,A.y,A.z,A.x,A.y,A.z),P.nextPosition.values.push(h[3*T],h[3*T+1],h[3*T+2]),P.nextPosition.values.push(h[3*T+3],h[3*T+4],h[3*T+5]);var O=r.fromArray(p,2*S,Ge),L=Math.abs(O.y);w.expandAndWidth.values.push(-1,L,1,L),w.expandAndWidth.values.push(-1,-L,1,-L),P.expandAndWidth.values.push(-1,L,1,L),P.expandAndWidth.values.push(-1,-L,1,-L);var N=n.magnitudeSquared(n.subtract(I,E,Ye));if(N/=n.magnitudeSquared(n.subtract(A,E,Ye)),u(m)){var F=o.fromArray(m,4*S,Ke),B=o.fromArray(m,4*T,Ke),k=y.lerp(F.x,B.x,N),z=y.lerp(F.y,B.y,N),V=y.lerp(F.z,B.z,N),U=y.lerp(F.w,B.w,N);for(i=4*S;i<4*S+8;++i)w.color.values.push(m[i]);for(w.color.values.push(k,z,V,U),w.color.values.push(k,z,V,U),P.color.values.push(k,z,V,U),P.color.values.push(k,z,V,U),i=4*T;i<4*T+8;++i)P.color.values.push(m[i])}if(u(f)){var G=r.fromArray(f,2*S,Ge),H=r.fromArray(f,2*(t+3),He),W=y.lerp(G.x,H.x,N);for(i=2*S;i<2*S+4;++i)w.st.values.push(f[i]);for(w.st.values.push(W,G.y),w.st.values.push(W,H.y),P.st.values.push(W,G.y),P.st.values.push(W,H.y),i=2*T;i<2*T+4;++i)P.st.values.push(f[i])}a=w.position.values.length/3-4,x.push(a,a+2,a+1),x.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,Y;for(E.y<0?(q=g.attributes,Y=g.indices):(q=_.attributes,Y=_.indices),q.position.values.push(E.x,E.y,E.z),q.position.values.push(E.x,E.y,E.z),q.position.values.push(A.x,A.y,A.z),q.position.values.push(A.x,A.y,A.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,Y.push(a,a+2,a+1),Y.push(a+1,a+2,a+3)}}C&&(ie(g),ie(_)),X(e,g,_)}var ne={};ne.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case T.TRIANGLES:e.indices=w(t);break;case T.TRIANGLE_STRIP:e.indices=x(t);break;case T.TRIANGLE_FAN:e.indices=P(t)}e.primitiveType=T.LINES}return e},ne.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:T.LINES,boundingSphere:m})},ne.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},ne.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]],-1!==o?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,b=v.componentsPerAttribute,S=s.createTypedArray(v.componentDatatype,f*b);C<t;){var T=r[C];if(-1!==T)for(var E=0;E<b;E++)S[b*T+E]=y[b*C+E];++C}v.values=S}}return e},ne.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===T.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;o<r;o++)i[o]>n&&(n=i[o]);e.indices=E.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},ne.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===T.TRIANGLES?r=3:e.primitiveType===T.LINES?r=2:e.primitiveType===T.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,I(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 oe=new n,ae=new a;ne.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,oe),g=l.cartesianToCartographic(_,ae),v=o.project(g,oe);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 se={high:0,low:0};ne.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],se),l[c]=se.high,u[c]=se.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 le=new n,ue=new b,ce=new C;ne.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(b.equals(t,b.IDENTITY))return e;var r=e.geometry.attributes;M(t,r.position),M(t,r.prevPosition),M(t,r.nextPosition),(u(r.normal)||u(r.tangent)||u(r.bitangent))&&(b.inverse(t,ue),b.transpose(ue,ue),b.getRotation(ue,ce),R(ce,r.normal),R(ce,r.tangent),R(ce,r.bitangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=b.clone(b.IDENTITY),e};var de=new n;ne.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;n<r;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&i.push(o)}var a=[];return t.length>0&&a.push(L(t,"geometry")),i.length>0&&(a.push(L(i,"westHemisphereGeometry")),a.push(L(i,"eastHemisphereGeometry"))),a};var he=new n,pe=new n,fe=new n,me=new n;ne.computeNormal=function(e){var t,i=e.indices,r=e.attributes,o=r.position.values,a=r.position.values.length/3,l=i.length,u=new Array(a),c=new Array(l/3),d=new Array(l);for(t=0;t<a;t++)u[t]={indexOffset:0,count:0,currentCount:0};var h=0;for(t=0;t<l;t+=3){var p=i[t],m=i[t+1],_=i[t+2],g=3*p,v=3*m,C=3*_;pe.x=o[g],pe.y=o[g+1],pe.z=o[g+2],fe.x=o[v],fe.y=o[v+1],fe.z=o[v+2],me.x=o[C],me.y=o[C+1],me.z=o[C+2],u[p].count++,u[m].count++,u[_].count++,n.subtract(fe,pe,fe),n.subtract(me,pe,me),c[h]=n.cross(fe,me,new n),h++}var b=0;for(t=0;t<a;t++)u[t].indexOffset+=b,b+=u[t].count;h=0;var S;for(t=0;t<l;t+=3){S=u[i[t]];var T=S.indexOffset+S.currentCount;d[T]=h,S.currentCount++,S=u[i[t+1]],T=S.indexOffset+S.currentCount,d[T]=h,S.currentCount++,S=u[i[t+2]],T=S.indexOffset+S.currentCount,d[T]=h,S.currentCount++,h++}var E=new Float32Array(3*a);for(t=0;t<a;t++){var A=3*t;if(S=u[t],n.clone(n.ZERO,he),S.count>0){for(h=0;h<S.count;h++)n.add(he,c[d[S.indexOffset+h]],he);n.equalsEpsilon(n.ZERO,he,y.EPSILON10)&&n.clone(c[d[S.indexOffset]],he)}n.equalsEpsilon(n.ZERO,he,y.EPSILON10)&&(he.z=1),n.normalize(he,he),E[A]=he.x,E[A+1]=he.y,E[A+2]=he.z}return e.attributes.normal=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:E}),e};var _e=new n,ge=new n,ve=new n;ne.computeTangentAndBitangent=function(e){var t,i=(e.attributes,e.indices),r=e.attributes.position.values,o=e.attributes.normal.values,a=e.attributes.st.values,l=e.attributes.position.values.length/3,u=i.length,c=new Array(3*l);for(t=0;t<c.length;t++)c[t]=0;var d,h,p;for(t=0;t<u;t+=3){var m=i[t],_=i[t+1],g=i[t+2];d=3*m,h=3*_,p=3*g;var v=2*m,y=2*_,C=2*g,b=r[d],S=r[d+1],T=r[d+2],E=a[v],A=a[v+1],w=a[y+1]-A,x=a[C+1]-A,P=1/((a[y]-E)*x-(a[C]-E)*w),D=(x*(r[h]-b)-w*(r[p]-b))*P,I=(x*(r[h+1]-S)-w*(r[p+1]-S))*P,M=(x*(r[h+2]-T)-w*(r[p+2]-T))*P;c[d]+=D,c[d+1]+=I,c[d+2]+=M,c[h]+=D,c[h+1]+=I,c[h+2]+=M,c[p]+=D,c[p+1]+=I,c[p+2]+=M}var R=new Float32Array(3*l),O=new Float32Array(3*l);for(t=0;t<l;t++){d=3*t,h=d+1,p=d+2;var L=n.fromArray(o,d,_e),N=n.fromArray(c,d,ve),F=n.dot(L,N);n.multiplyByScalar(L,F,ge),n.normalize(n.subtract(N,ge,N),N),R[d]=N.x,R[h]=N.y,R[p]=N.z,n.normalize(n.cross(L,N,N),N),O[d]=N.x,O[h]=N.y,O[p]=N.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 ye=new r,Ce=new n,be=new n,Se=new n,Te=new r;ne.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,Ce),n.equals(Ce,n.ZERO)?d+=2:(Te=e.octEncodeInRange(Ce,65535,Te),c[d++]=Te.x,c[d++]=Te.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,b=t.attributes.tangent,S=t.attributes.bitangent,T=u(b),E=u(S);m&&(g=h.values),_&&(v=p.values),T&&(y=b.values),E&&(C=S.values),o=(m?g.length:v.length)/(m?3:2);var A=o,w=_&&m?2:1;w+=T||E?1:0,A*=w;var x=new Float32Array(A),P=0;for(i=0;i<o;++i){_&&(r.fromArray(v,2*i,ye),x[P++]=e.compressTextureCoordinates(ye));var D=3*i;m&&u(y)&&u(C)?(n.fromArray(g,D,Ce),n.fromArray(y,D,be),n.fromArray(C,D,Se),e.octPack(Ce,be,Se,ye),x[P++]=ye.x,x[P++]=ye.y):(m&&(n.fromArray(g,D,Ce),x[P++]=e.octEncodeFloat(Ce)),T&&(n.fromArray(y,D,Ce),x[P++]=e.octEncodeFloat(Ce)),E&&(n.fromArray(C,D,Ce),x[P++]=e.octEncodeFloat(Ce)))}return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:w,values:x}),m&&delete t.attributes.normal,_&&delete t.attributes.st,E&&delete t.attributes.bitangent,T&&delete t.attributes.tangent,t};var Ee=new n,Ae=new n,we=new n,xe=new n,Pe=new n,De={positions:new Array(7),indices:new Array(9)},Ie=Q(o,4),Me=Q(n,3),Re=Q(r,2),Oe=function(e,t,i,r,n,o,a){var s=n[e]*r.x,l=n[t]*r.y,u=n[i]*r.z;o[a]=s+l+u>y.EPSILON6?1:0},Le=new n,Ne=new n,Fe=new n,Be=new n,ke={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0},ze=S.fromPointNormal(n.ZERO,n.UNIT_Y),Ve=new n,Ue=new n,Ge=new r,He=new r,We=new n,qe=new n,Ye=new n,je=new n,Xe=new n,Qe=new n,Ke=new o,Ze=5*y.EPSILON9,Je=y.EPSILON6;return ne.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(u(r)){if(r.center.x-r.radius>0||i.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==g.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:re(e);break;case m.TRIANGLES:$(e);break;case m.LINES:te(e)}else U(t),t.primitiveType===T.TRIANGLES?$(e):t.primitiveType===T.LINES&&te(e);return e},ne}),define("Core/EllipseGeometry",["./arrayFill","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryOffsetAttribute","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./Rectangle","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w){"use strict";function x(t,n,o){var s=n.vertexFormat,u=n.center,c=n.semiMajorAxis,h=n.semiMinorAxis,f=n.ellipsoid,g=n.stRotation,y=o?t.length/3*2:t.length/3,C=n.shadowVolume,b=s.st?new Float32Array(2*y):void 0,T=s.normal?new Float32Array(3*y):void 0,A=s.tangent?new Float32Array(3*y):void 0,w=s.bitangent?new Float32Array(3*y):void 0,x=C?new Float32Array(3*y):void 0,P=0,D=W,I=q,M=Y,R=new p(f),O=R.project(f.cartesianToCartographic(u,j),X),L=f.scaleToGeodeticSurface(u,F);f.geodeticSurfaceNormal(L,L);var N=U,z=G;if(0!==g){var Z=E.fromAxisAngle(L,g,H);N=S.fromQuaternion(Z,N),Z=E.fromAxisAngle(L,-g,H),z=S.fromQuaternion(Z,z)}else N=S.clone(S.IDENTITY,N),z=S.clone(S.IDENTITY,z)
- ;for(var J=i.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Q),$=i.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,K),ee=t.length,te=o?ee:0,ie=te/3*2,re=0;re<ee;re+=3){var ne=re+1,oe=re+2,ae=r.fromArray(t,re,F);if(s.st){var se=S.multiplyByVector(N,ae,B),le=R.project(f.cartesianToCartographic(se,j),k);r.subtract(le,O,le),V.x=(le.x+c)/(2*c),V.y=(le.y+h)/(2*h),J.x=Math.min(V.x,J.x),J.y=Math.min(V.y,J.y),$.x=Math.max(V.x,$.x),$.y=Math.max(V.y,$.y),o&&(b[P+ie]=V.x,b[P+1+ie]=V.y),b[P++]=V.x,b[P++]=V.y}(s.normal||s.tangent||s.bitangent||C)&&(D=f.geodeticSurfaceNormal(ae,D),C&&(x[re+te]=-D.x,x[ne+te]=-D.y,x[oe+te]=-D.z),(s.normal||s.tangent||s.bitangent)&&((s.tangent||s.bitangent)&&(I=r.normalize(r.cross(r.UNIT_Z,D,I),I),S.multiplyByVector(z,I,I)),s.normal&&(T[re]=D.x,T[ne]=D.y,T[oe]=D.z,o&&(T[re+te]=-D.x,T[ne+te]=-D.y,T[oe+te]=-D.z)),s.tangent&&(A[re]=I.x,A[ne]=I.y,A[oe]=I.z,o&&(A[re+te]=-I.x,A[ne+te]=-I.y,A[oe+te]=-I.z)),s.bitangent&&(M=r.normalize(r.cross(D,I,M),M),w[re]=M.x,w[ne]=M.y,w[oe]=M.z,o&&(w[re+te]=M.x,w[ne+te]=M.y,w[oe+te]=M.z))))}if(s.st){ee=b.length;for(var ue=0;ue<ee;ue+=2)b[ue]=(b[ue]-J.x)/($.x-J.x),b[ue+1]=(b[ue+1]-J.y)/($.y-J.y)}var ce=new _;if(s.position){var de=d.raisePositionsToHeight(t,n,o);ce.position=new m({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:de})}if(s.st&&(ce.st=new m({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:b})),s.normal&&(ce.normal=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),s.tangent&&(ce.tangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),s.bitangent&&(ce.bitangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),C&&(ce.extrudeDirection=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:x})),o&&l(n.offsetAttribute)){var he=new Uint8Array(y);if(n.offsetAttribute===v.TOP)he=e(he,1,0,y/2);else{var pe=n.offsetAttribute===v.NONE?0:1;he=e(he,pe)}ce.applyOffset=new m({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:he})}return ce}function P(e){var t,i,r,n,o,a=new Array(e*(e+1)*12-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 D(e){var i=e.center;Z=r.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(i,Z),e.height,Z),Z=r.add(i,Z,Z);var n=new t(Z,e.semiMajorAxis),o=d.computeEllipsePositions(e,!0,!1),a=o.positions,s=o.numPts,l=x(a,e,!1),u=P(s);return u=C.createTypedArray(a.length/3,u),{boundingSphere:n,attributes:l,indices:u}}function I(t,n){var o=n.vertexFormat,s=n.center,u=n.semiMajorAxis,c=n.semiMinorAxis,d=n.ellipsoid,h=n.height,f=n.extrudedHeight,g=n.stRotation,y=t.length/3*2,C=new Float64Array(3*y),b=o.st?new Float32Array(2*y):void 0,T=o.normal?new Float32Array(3*y):void 0,A=o.tangent?new Float32Array(3*y):void 0,w=o.bitangent?new Float32Array(3*y):void 0,x=n.shadowVolume,P=x?new Float32Array(3*y):void 0,D=0,I=W,M=q,R=Y,O=new p(d),L=O.project(d.cartesianToCartographic(s,j),X),N=d.scaleToGeodeticSurface(s,F);d.geodeticSurfaceNormal(N,N);for(var G=E.fromAxisAngle(N,g,H),Z=S.fromQuaternion(G,U),J=i.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Q),$=i.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,K),ee=t.length,te=ee/3*2,ie=0;ie<ee;ie+=3){var re,ne=ie+1,oe=ie+2,ae=r.fromArray(t,ie,F);if(o.st){var se=S.multiplyByVector(Z,ae,B),le=O.project(d.cartesianToCartographic(se,j),k);r.subtract(le,L,le),V.x=(le.x+u)/(2*u),V.y=(le.y+c)/(2*c),J.x=Math.min(V.x,J.x),J.y=Math.min(V.y,J.y),$.x=Math.max(V.x,$.x),$.y=Math.max(V.y,$.y),b[D+te]=V.x,b[D+1+te]=V.y,b[D++]=V.x,b[D++]=V.y}ae=d.scaleToGeodeticSurface(ae,ae),re=r.clone(ae,B),I=d.geodeticSurfaceNormal(ae,I),x&&(P[ie+ee]=-I.x,P[ne+ee]=-I.y,P[oe+ee]=-I.z);var ue=r.multiplyByScalar(I,h,z);if(ae=r.add(ae,ue,ae),ue=r.multiplyByScalar(I,f,ue),re=r.add(re,ue,re),o.position&&(C[ie+ee]=re.x,C[ne+ee]=re.y,C[oe+ee]=re.z,C[ie]=ae.x,C[ne]=ae.y,C[oe]=ae.z),o.normal||o.tangent||o.bitangent){R=r.clone(I,R);var ce=r.fromArray(t,(ie+3)%ee,z);r.subtract(ce,ae,ce);var de=r.subtract(re,ae,k);I=r.normalize(r.cross(de,ce,I),I),o.normal&&(T[ie]=I.x,T[ne]=I.y,T[oe]=I.z,T[ie+ee]=I.x,T[ne+ee]=I.y,T[oe+ee]=I.z),o.tangent&&(M=r.normalize(r.cross(R,I,M),M),A[ie]=M.x,A[ne]=M.y,A[oe]=M.z,A[ie+ee]=M.x,A[ie+1+ee]=M.y,A[ie+2+ee]=M.z),o.bitangent&&(w[ie]=R.x,w[ne]=R.y,w[oe]=R.z,w[ie+ee]=R.x,w[ne+ee]=R.y,w[oe+ee]=R.z)}}if(o.st){ee=b.length;for(var he=0;he<ee;he+=2)b[he]=(b[he]-J.x)/($.x-J.x),b[he+1]=(b[he+1]-J.y)/($.y-J.y)}var pe=new _;if(o.position&&(pe.position=new m({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:C})),o.st&&(pe.st=new m({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:b})),o.normal&&(pe.normal=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),o.tangent&&(pe.tangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),o.bitangent&&(pe.bitangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),x&&(pe.extrudeDirection=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:P})),l(n.offsetAttribute)){var fe=new Uint8Array(y);if(n.offsetAttribute===v.TOP)fe=e(fe,1,0,y/2);else{var me=n.offsetAttribute===v.NONE?0:1;fe=e(fe,me)}pe.applyOffset=new m({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:fe})}return pe}function M(e){for(var t=e.length/3,i=C.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 R(e){var i=e.center,n=e.ellipsoid,o=e.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,F),e.height,F);J.center=r.add(i,a,J.center),J.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),e.extrudedHeight,a),$.center=r.add(i,a,$.center),$.radius=o;var s=d.computeEllipsePositions(e,!0,!0),l=s.positions,u=s.numPts,c=s.outerPositions,h=t.union(J,$),p=x(l,e,!0),m=P(u),_=m.length;m.length=2*_;for(var v=l.length/3,b=0;b<_;b+=3)m[b+_]=m[b+2]+v,m[b+1+_]=m[b+1]+v,m[b+2+_]=m[b]+v;var S=C.createTypedArray(2*v/3,m),E=new f({attributes:p,indices:S,primitiveType:T.TRIANGLES}),A=I(c,e);m=M(c);var w=C.createTypedArray(2*c.length/3,m),D=new f({attributes:A,indices:w,primitiveType:T.TRIANGLES}),R=y.combineInstances([new g({geometry:E}),new g({geometry:D})]);return{boundingSphere:h,attributes:R[0].attributes,indices:R[0].indices}}function O(e,t,i,n,o,a,s){for(var l=d.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:i,rotation:n,granularity:o},!1,!0),u=l.outerPositions,c=u.length/3,h=new Array(c),p=0;p<c;++p)h[p]=r.fromArray(u,3*p);var f=A.fromCartesianArray(h,a,s);return f.width>b.PI&&(f.north=f.north>0?b.PI_OVER_TWO-b.EPSILON7:f.north,f.south=f.south<0?b.EPSILON7-b.PI_OVER_TWO:f.south,f.east=b.PI,f.west=-b.PI),f}function L(e){e=s(e,s.EMPTY_OBJECT);var t=e.center,i=s(e.ellipsoid,h.WGS84),n=e.semiMajorAxis,o=e.semiMinorAxis,a=s(e.granularity,b.RADIANS_PER_DEGREE),l=s(e.vertexFormat,w.DEFAULT),u=s(e.height,0),c=s(e.extrudedHeight,u);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=o,this._ellipsoid=h.clone(i),this._rotation=s(e.rotation,0),this._stRotation=s(e.stRotation,0),this._height=Math.max(c,u),this._granularity=a,this._vertexFormat=w.clone(l),this._extrudedHeight=Math.min(c,u),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}function N(e){var t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];for(var i=d.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0),n=i.outerPositions,o=n.length/3,a=new Array(o),s=0;s<o;++s)a[s]=r.fromArray(n,3*s);var l=e._ellipsoid,u=e.rectangle;return f._textureCoordinateRotationPoints(a,t,l,u)}var F=new r,B=new r,k=new r,z=new r,V=new i,U=new S,G=new S,H=new E,W=new r,q=new r,Y=new r,j=new n,X=new r,Q=new i,K=new i,Z=new r,J=new t,$=new t;L.packedLength=r.packedLength+h.packedLength+w.packedLength+9,L.pack=function(e,t,i){return i=s(i,0),r.pack(e._center,t,i),i+=r.packedLength,h.pack(e._ellipsoid,t,i),i+=h.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=s(e._offsetAttribute,-1),t};var ee=new r,te=new h,ie=new w,re={center:ee,ellipsoid:te,vertexFormat:ie,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};return L.unpack=function(e,t,i){t=s(t,0);var n=r.unpack(e,t,ee);t+=r.packedLength;var o=h.unpack(e,t,te);t+=h.packedLength;var a=w.unpack(e,t,ie);t+=w.packedLength;var u=e[t++],c=e[t++],d=e[t++],p=e[t++],f=e[t++],m=e[t++],_=e[t++],g=1===e[t++],v=e[t];return l(i)?(i._center=r.clone(n,i._center),i._ellipsoid=h.clone(o,i._ellipsoid),i._vertexFormat=w.clone(a,i._vertexFormat),i._semiMajorAxis=u,i._semiMinorAxis=c,i._rotation=d,i._stRotation=p,i._height=f,i._granularity=m,i._extrudedHeight=_,i._shadowVolume=g,i._offsetAttribute=-1===v?void 0:v,i):(re.height=f,re.extrudedHeight=_,re.granularity=m,re.stRotation=p,re.rotation=d,re.semiMajorAxis=u,re.semiMinorAxis=c,re.shadowVolume=g,re.offsetAttribute=-1===v?void 0:v,new L(re))},L.computeRectangle=function(e,t){e=s(e,s.EMPTY_OBJECT);var i=e.center,r=s(e.ellipsoid,h.WGS84),n=e.semiMajorAxis,o=e.semiMinorAxis,a=s(e.granularity,b.RADIANS_PER_DEGREE);return O(i,n,o,s(e.rotation,0),a,r,t)},L.createGeometry=function(t){if(!(t._semiMajorAxis<=0||t._semiMinorAxis<=0)){var i=t._height,r=t._extrudedHeight,n=!b.equalsEpsilon(i,r,0,b.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);var o,s={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:i,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};if(n)s.extrudedHeight=r,s.shadowVolume=t._shadowVolume,s.offsetAttribute=t._offsetAttribute,o=R(s);else if(o=D(s),l(t._offsetAttribute)){var u=o.attributes.position.values.length,c=new Uint8Array(u/3),d=t._offsetAttribute===v.NONE?0:1;e(c,d),o.attributes.applyOffset=new m({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new f({attributes:o.attributes,indices:o.indices,primitiveType:T.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:t._offsetAttribute})}},L.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new L({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:w.POSITION_ONLY,shadowVolume:!0})},u(L.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=O(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=N(this)),this._textureCoordinateRotationPoints}}}),L}),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}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),l}),define("Core/EllipseOutlineGeometry",["./arrayFill","./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){var n=e.center;C=i.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(n,C),e.height,C),C=i.add(n,C,C);for(var o=new t(C,e.semiMajorAxis),a=s.computeEllipsePositions(e,!1,!0).outerPositions,l=new d({position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s.raisePositionsToHeight(a,e,!1)})}),u=a.length/3,h=p.createTypedArray(u,2*u),f=0,m=0;m<u;++m)h[f++]=m,h[f++]=(m+1)%u;return{boundingSphere:o,attributes:l,indices:h}}function g(a){var l=a.center,u=a.ellipsoid,m=a.semiMajorAxis,_=i.multiplyByScalar(u.geodeticSurfaceNormal(l,y),a.height,y);b.center=i.add(l,_,b.center),b.radius=m,_=i.multiplyByScalar(u.geodeticSurfaceNormal(l,_),a.extrudedHeight,_),S.center=i.add(l,_,S.center),S.radius=m;var g=s.computeEllipsePositions(a,!1,!0).outerPositions,v=new d({position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s.raisePositionsToHeight(g,a,!0)})});g=v.position.values;var C=t.union(b,S),T=g.length/3;if(o(a.offsetAttribute)){var E=new Uint8Array(T);if(a.offsetAttribute===h.TOP)E=e(E,1,0,T/2);else{var A=a.offsetAttribute===h.NONE?0:1;E=e(E,A)}v.applyOffset=new c({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}var w=n(a.numberOfVerticalLines,16);w=f.clamp(w,0,T/2);var x=p.createTypedArray(T,2*T+2*w);T/=2;var P,D=0;for(P=0;P<T;++P)x[D++]=P,x[D++]=(P+1)%T,x[D++]=P+T,x[D++]=(P+1)%T+T;var I;if(w>0){var M=Math.min(w,T);I=Math.round(T/M);var R=Math.min(I*w,T);for(P=0;P<R;P+=I)x[D++]=P,x[D++]=P+T}return{boundingSphere:C,attributes:v,indices:x}}function v(e){e=n(e,n.EMPTY_OBJECT);var t=e.center,r=n(e.ellipsoid,l.WGS84),o=e.semiMajorAxis,a=e.semiMinorAxis,s=n(e.granularity,f.RADIANS_PER_DEGREE),u=n(e.height,0),c=n(e.extrudedHeight,u);this._center=i.clone(t),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=l.clone(r),this._rotation=n(e.rotation,0),this._height=Math.max(c,u),this._granularity=s,this._extrudedHeight=Math.min(c,u),this._numberOfVerticalLines=Math.max(n(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}var y=new i,C=new i,b=new t,S=new t;v.packedLength=i.packedLength+l.packedLength+8,v.pack=function(e,t,r){return r=n(r,0),i.pack(e._center,t,r),r+=i.packedLength,l.pack(e._ellipsoid,t,r),r+=l.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._numberOfVerticalLines,t[r]=n(e._offsetAttribute,-1),t};var T=new i,E=new l,A={center:T,ellipsoid:E,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return v.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,T);t+=i.packedLength;var s=l.unpack(e,t,E);t+=l.packedLength;var u=e[t++],c=e[t++],d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],_=e[t];return o(r)?(r._center=i.clone(a,r._center),r._ellipsoid=l.clone(s,r._ellipsoid),r._semiMajorAxis=u,r._semiMinorAxis=c,r._rotation=d,r._height=h,r._granularity=p,r._extrudedHeight=f,r._numberOfVerticalLines=m,r._offsetAttribute=-1===_?void 0:_,r):(A.height=h,A.extrudedHeight=f,A.granularity=p,A.rotation=d,A.semiMajorAxis=u,A.semiMinorAxis=c,A.numberOfVerticalLines=m,A.offsetAttribute=-1===_?void 0:_,new v(A))},v.createGeometry=function(t){if(!(t._semiMajorAxis<=0||t._semiMinorAxis<=0)){var i=t._height,n=t._extrudedHeight,a=!f.equalsEpsilon(i,n,0,f.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);var s,l={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:i,granularity:t._granularity,numberOfVerticalLines:t._numberOfVerticalLines};if(a)l.extrudedHeight=n,l.offsetAttribute=t._offsetAttribute,s=g(l);else if(s=_(l),o(t._offsetAttribute)){var d=s.attributes.position.values.length,p=new Uint8Array(d/3),v=t._offsetAttribute===h.NONE?0:1;e(p,v),s.attributes.applyOffset=new c({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}return new u({attributes:s.attributes,indices:s.indices,primitiveType:m.LINES,boundingSphere:s.boundingSphere,offsetAttribute:t._offsetAttribute})}},v}),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";return e({UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2})}),define("Core/ClockStep",["./freezeObject"],function(e){"use strict";return e({TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2})}),define("Core/getTimestamp",[],function(){"use strict";return"undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(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.onStop=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.shouldAnimate=i(n.shouldAnimate,!1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER)}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),this.onStop.raiseEvent(this));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),this.onStop.raiseEvent(this)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),define("Core/Color",["./Check","./defaultValue","./defined","./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(e,i,r,n){this.red=t(e,1),this.green=t(i,1),this.blue=t(r,1),this.alpha=t(n,1)}s.fromCartesian4=function(e,t){return i(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(e,r,n,o,a){return e=s.byteToFloat(t(e,255)),r=s.byteToFloat(t(r,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),i(a)?(a.red=e,a.green=r,a.blue=n,a.alpha=o,a):new s(e,r,n,o)},s.fromAlpha=function(e,t,r){return i(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=t,r):new s(e.red,e.green,e.blue,t)};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(e,r,n,o,l){e=t(e,0)%1,r=t(r,0),n=t(n,0),o=t(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,e+1/3),c=a(p,h,e),d=a(p,h,e-1/3)}return i(l)?(l.red=u,l.green=c,l.blue=d,l.alpha=o,l):new s(u,c,d,o)},s.fromRandom=function(e,r){e=t(e,t.EMPTY_OBJECT);var n=e.red;if(!i(n)){var a=t(e.minimumRed,0),l=t(e.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=e.green;if(!i(u)){var c=t(e.minimumGreen,0),d=t(e.maximumGreen,1);u=c+o.nextRandomNumber()*(d-c)}var h=e.blue;if(!i(h)){var p=t(e.minimumBlue,0),f=t(e.maximumBlue,1);h=p+o.nextRandomNumber()*(f-p)}var m=e.alpha;if(!i(m)){var _=t(e.minimumAlpha,0),g=t(e.maximumAlpha,1);m=_+o.nextRandomNumber()*(g-_)}return i(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(e,r){i(r)||(r=new s);var n=s[e.toUpperCase()];if(i(n))return s.clone(n,r),r;var o=d.exec(e);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):null!==(o=h.exec(e))?(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):null!==(o=p.exec(e))?(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(t(o[4],"1.0")),r):null!==(o=f.exec(e))?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),r):r=void 0},s.packedLength=4,s.pack=function(e,i,r){return r=t(r,0),i[r++]=e.red,i[r++]=e.green,i[r++]=e.blue,i[r]=e.alpha,i},s.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n.red=e[r++],n.green=e[r++],n.blue=e[r++],n.alpha=e[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,t){if(i(e))return i(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.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,t){return this===e||i(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},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 t=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return i(e)?(e[0]=t,e[1]=r,e[2]=n,e[3]=o,e):[t,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/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,i,r){"use strict";function n(e,r,n){if(i(e)){n=t(n,!1);var a=e.length;if(a<2)return e;var s,l,u;for(s=1;s<a&&(l=e[s-1],u=e[s],!r(l,u,o));++s);if(s===a)return n&&r(e[0],e[e.length-1],o)?e.slice(1):e;for(var c=e.slice(0,s);s<a;++s)u=e[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/CoplanarPolygonGeometryLibrary",["./defined","./Cartesian2","./Cartesian3","./Check","./IntersectionTests","./Math","./Matrix3","./OrientedBoundingBox"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n,o,a){var s=i.subtract(e,r,c),l=i.dot(n,s),u=i.dot(o,s);return t.fromElements(l,u,a)}var u={},c=new i,d=new i,h=new i,p=new i,f=new s;return u.validOutline=function(e){var t=s.fromPoints(e,f),r=t.halfAxes,n=a.getColumn(r,0,d),o=a.getColumn(r,1,h),l=a.getColumn(r,2,p),u=i.magnitude(n),c=i.magnitude(o),m=i.magnitude(l);return!(0===u&&(0===c||0===m)||0===c&&0===m)},u.computeProjectTo2DArguments=function(e,t,r,n){var o=s.fromPoints(e,f),l=o.halfAxes,u=a.getColumn(l,0,d),c=a.getColumn(l,1,h),m=a.getColumn(l,2,p),_=i.magnitude(u),g=i.magnitude(c),v=i.magnitude(m),y=Math.min(_,g,v);if(0===_&&(0===g||0===v)||0===g&&0===v)return!1;var C,b;return y!==g&&y!==v||(C=u),y===_?C=c:y===v&&(b=c),y!==_&&y!==g||(b=m),i.normalize(C,r),i.normalize(b,n),i.clone(o.center,t),!0},u.createProjectPointsTo2DFunction=function(e,t,i){return function(r){for(var n=new Array(r.length),o=0;o<r.length;o++)n[o]=l(r[o],e,t,i);return n}},u.createProjectPointTo2DFunction=function(e,t,i){return function(r,n){return l(r,e,t,i,n)}},u}),define("Core/EllipsoidRhumbLine",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){if(0===e)return t*i;var r=e*e,n=r*r,o=n*r,a=o*r,s=a*r,l=s*r,u=i;return t*((1-r/4-3*n/64-5*o/256-175*a/16384-441*s/65536-4851*l/1048576)*u-(3*r/8+3*n/32+45*o/1024+105*a/4096+2205*s/131072+6237*l/524288)*Math.sin(2*u)+(15*n/256+45*o/1024+525*a/16384+1575*s/65536+155925*l/8388608)*Math.sin(4*u)-(35*o/3072+175*a/12288+3675*s/262144+13475*l/1048576)*Math.sin(6*u)+(315*a/131072+2205*s/524288+43659*l/8388608)*Math.sin(8*u)-(693*s/1310720+6237*l/5242880)*Math.sin(10*u)+1001*l/8388608*Math.sin(12*u))}function c(e,t,i){var r=e/i;if(0===t)return r;var n=r*r,o=n*r,a=o*r,s=t,l=s*s,u=l*l,c=u*l,d=c*l,h=d*l,p=h*l,f=Math.sin(2*r),m=Math.cos(2*r),_=Math.sin(4*r),g=Math.cos(4*r),v=Math.sin(6*r),y=Math.cos(6*r),C=Math.sin(8*r),b=Math.cos(8*r),S=Math.sin(10*r);return r+r*l/4+7*r*u/64+15*r*c/256+579*r*d/16384+1515*r*h/65536+16837*r*p/1048576+(3*r*u/16+45*r*c/256-r*(32*n-561)*d/4096-r*(232*n-1677)*h/16384+r*(399985-90560*n+512*a)*p/5242880)*m+(21*r*c/256+483*r*d/4096-r*(224*n-1969)*h/16384-r*(33152*n-112599)*p/1048576)*g+(151*r*d/4096+4681*r*h/65536+1479*r*p/16384-453*o*p/32768)*y+(1097*r*h/65536+42783*r*p/1048576)*b+8011*r*p/1048576*Math.cos(10*r)+(3*l/8+3*u/16+213*c/2048-3*n*c/64+255*d/4096-33*n*d/512+20861*h/524288-33*n*h/512+a*h/1024+28273*p/1048576-471*n*p/8192+9*a*p/4096)*f+(21*u/256+21*c/256+533*d/8192-21*n*d/512+197*h/4096-315*n*h/4096+584039*p/16777216-12517*n*p/131072+7*a*p/2048)*_+(151*c/6144+151*d/4096+5019*h/131072-453*n*h/16384+26965*p/786432-8607*n*p/131072)*v+(1097*d/131072+1097*h/65536+225797*p/10485760-1097*n*p/65536)*C+(8011*h/2621440+8011*p/1048576)*S+293393*p/251658240*Math.sin(12*r)}function d(e,t){if(0===e)return Math.log(Math.tan(.5*(l.PI_OVER_TWO+t)));var i=e*Math.sin(t);return Math.log(Math.tan(.5*(l.PI_OVER_TWO+t)))-e/2*Math.log((1+i)/(1-i))}function h(e,t,i,r,n){var o=d(e._ellipticity,i),a=d(e._ellipticity,n);return Math.atan2(l.negativePiToPi(r-t),a-o)}function p(e,t,i,r,n,o,a){var s=e._heading,c=o-r,d=0;if(l.equalsEpsilon(Math.abs(s),l.PI_OVER_TWO,l.EPSILON8))if(t===i)d=t*Math.cos(n)*l.negativePiToPi(c);else{var h=Math.sin(n);d=t*Math.cos(n)*l.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*h*h)}else{var p=u(e._ellipticity,t,n);d=(u(e._ellipticity,t,a)-p)/Math.cos(s)}return Math.abs(d)}function f(i,r,n,o){var a=(e.normalize(o.cartographicToCartesian(r,v),g),e.normalize(o.cartographicToCartesian(n,v),v),o.maximumRadius),s=o.minimumRadius,l=a*a,u=s*s;i._ellipticitySquared=(l-u)/l,i._ellipticity=Math.sqrt(i._ellipticitySquared),i._start=t.clone(r,i._start),i._start.height=0,i._end=t.clone(n,i._end),i._end.height=0,i._heading=h(i,r.longitude,r.latitude,n.longitude,n.latitude),i._distance=p(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude)}function m(e,i,r,o,a,s){var h,p,f,m=a*a;if(Math.abs(l.PI_OVER_TWO-Math.abs(i))>l.EPSILON8){p=c(u(a,o,e.latitude)+r*Math.cos(i),a,o);var _=d(a,e.latitude),g=d(a,p);f=Math.tan(i)*(g-_),h=l.negativePiToPi(e.longitude+f)}else{p=e.latitude;var v;if(0===a)v=o*Math.cos(e.latitude);else{var y=Math.sin(e.latitude);v=o*Math.cos(e.latitude)/Math.sqrt(1-m*y*y)}f=r/v,h=i>0?l.negativePiToPi(e.longitude+f):l.negativePiToPi(e.longitude-f)}return n(s)?(s.longitude=h,s.latitude=p,s.height=0,s):new t(h,p,0)}function _(e,i,o){var a=r(o,s.WGS84);this._ellipsoid=a,this._start=new t,this._end=new t,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,n(e)&&n(i)&&f(this,e,i,a)}var g=new e,v=new e;return o(_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}}),_.fromStartHeadingDistance=function(e,t,i,o,a){var u=r(o,s.WGS84),c=u.maximumRadius,d=u.minimumRadius,h=c*c,p=d*d,f=Math.sqrt((h-p)/h);t=l.negativePiToPi(t);var g=m(e,t,i,u.maximumRadius,f);return!n(a)||n(o)&&!o.equals(a.ellipsoid)?new _(e,g,u):(a.setEndPoints(e,g),a)},_.prototype.setEndPoints=function(e,t){f(this,e,t,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},_.prototype.interpolateUsingSurfaceDistance=function(e,t){return m(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},_.prototype.findIntersectionWithLongitude=function(e,i){var r=this._ellipticity,o=this._heading,a=Math.abs(o),s=this._start;if(e=l.negativePiToPi(e),l.equalsEpsilon(Math.abs(e),Math.PI,l.EPSILON14)&&(e=l.sign(s.longitude)*Math.PI),n(i)||(i=new t),Math.abs(l.PI_OVER_TWO-a)<=l.EPSILON8)return i.longitude=e,i.latitude=s.latitude,i.height=0,i;if(l.equalsEpsilon(Math.abs(l.PI_OVER_TWO-a),l.PI_OVER_TWO,l.EPSILON8)){if(l.equalsEpsilon(e,s.longitude,l.EPSILON12))return;return i.longitude=e,i.latitude=l.PI_OVER_TWO*l.sign(l.PI_OVER_TWO-o),i.height=0,i}var u,c=s.latitude,d=r*Math.sin(c),h=Math.tan(.5*(l.PI_OVER_TWO+c))*Math.exp((e-s.longitude)/Math.tan(o)),p=(1+d)/(1-d),f=s.latitude;do{u=f;var m=r*Math.sin(u),_=(1+m)/(1-m);f=2*Math.atan(h*Math.pow(_/p,r/2))-l.PI_OVER_TWO}while(!l.equalsEpsilon(f,u,l.EPSILON12));return i.longitude=e,i.latitude=f,i.height=0,i},_.prototype.findIntersectionWithLatitude=function(e,i){var r=this._ellipticity,o=this._heading,a=this._start;if(!l.equalsEpsilon(Math.abs(o),l.PI_OVER_TWO,l.EPSILON8)){var s=d(r,a.latitude),u=d(r,e),c=Math.tan(o)*(u-s),h=l.negativePiToPi(a.longitude+c);return n(i)?(i.longitude=h,i.latitude=e,i.height=0,i):new t(h,e,0)}},_}),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=A(o,e[o],e[o+1],a);else for(o=i-r;o>=t;o-=r)a=A(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(w(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(w(r),(r=t=r.prev)===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),w(e),e=m.next,_=m.next;else if((e=m)===_){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),w(r),w(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=E(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=E(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))<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);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&&!b(e,t)&&S(e,t)&&S(t,e)&&T(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 b(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 T(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 E(e,t){var i=new x(e.i,e.x,e.y),r=new x(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 A(e,t,i,r){var n=new x(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 w(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function x(e,t,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","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./EllipsoidRhumbLine","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";var m=new i,_=new i,g={};g.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},g.computeWindingOrder2D=function(e){return g.computeArea2D(e)>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},g.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var v=new i,y=new i,C=new i,b=new i,S=new i,T=new i,E=new i;g.computeSubdivision=function(e,t,r,n){n=a(n,h.RADIANS_PER_DEGREE);var l,u=r.slice(0),f=t.length,m=new Array(3*f),_=0;for(l=0;l<f;l++){var g=t[l];m[_++]=g.x,m[_++]=g.y,m[_++]=g.z}for(var A=[],w={},x=e.maximumRadius,P=h.chordLength(n,x),D=P*P;u.length>0;){var I,M,R=u.pop(),O=u.pop(),L=u.pop(),N=i.fromArray(m,3*L,v),F=i.fromArray(m,3*O,y),B=i.fromArray(m,3*R,C),k=i.multiplyByScalar(i.normalize(N,b),x,b),z=i.multiplyByScalar(i.normalize(F,S),x,S),V=i.multiplyByScalar(i.normalize(B,T),x,T),U=i.magnitudeSquared(i.subtract(k,z,E)),G=i.magnitudeSquared(i.subtract(z,V,E)),H=i.magnitudeSquared(i.subtract(V,k,E)),W=Math.max(U,G,H);W>D?U===W?(I=Math.min(L,O)+" "+Math.max(L,O),l=w[I],s(l)||(M=i.add(N,F,E),i.multiplyByScalar(M,.5,M),m.push(M.x,M.y,M.z),l=m.length/3-1,w[I]=l),u.push(L,l,R),u.push(l,O,R)):G===W?(I=Math.min(O,R)+" "+Math.max(O,R),l=w[I],s(l)||(M=i.add(F,B,E),i.multiplyByScalar(M,.5,M),m.push(M.x,M.y,M.z),l=m.length/3-1,w[I]=l),u.push(O,l,L),u.push(l,R,L)):H===W&&(I=Math.min(R,L)+" "+Math.max(R,L),l=w[I],s(l)||(M=i.add(B,N,E),i.multiplyByScalar(M,.5,M),m.push(M.x,M.y,M.z),l=m.length/3-1,w[I]=l),u.push(R,l,O),u.push(l,L,O)):(A.push(L),A.push(O),A.push(R))}return new c({attributes:{position:new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:m})},indices:A,primitiveType:p.TRIANGLES})};var A=new r,w=new r,x=new r,P=new r;return g.computeRhumbLineSubdivision=function(e,t,r,n){n=a(n,h.RADIANS_PER_DEGREE);var l,f=r.slice(0),m=t.length,_=new Array(3*m),g=0;for(l=0;l<m;l++){var b=t[l];_[g++]=b.x,_[g++]=b.y,_[g++]=b.z}for(var S=[],T={},D=e.maximumRadius,I=h.chordLength(n,D),M=new u(void 0,void 0,e),R=new u(void 0,void 0,e),O=new u(void 0,void 0,e);f.length>0;){var L=f.pop(),N=f.pop(),F=f.pop(),B=i.fromArray(_,3*F,v),k=i.fromArray(_,3*N,y),z=i.fromArray(_,3*L,C),V=e.cartesianToCartographic(B,A),U=e.cartesianToCartographic(k,w),G=e.cartesianToCartographic(z,x);M.setEndPoints(V,U);var H=M.surfaceDistance;R.setEndPoints(U,G);var W=R.surfaceDistance;O.setEndPoints(G,V);var q,Y,j,X,Q=O.surfaceDistance,K=Math.max(H,W,Q);K>I?H===K?(q=Math.min(F,N)+" "+Math.max(F,N),l=T[q],s(l)||(Y=M.interpolateUsingFraction(.5,P),j=.5*(V.height+U.height),X=i.fromRadians(Y.longitude,Y.latitude,j,e,E),_.push(X.x,X.y,X.z),l=_.length/3-1,T[q]=l),f.push(F,l,L),f.push(l,N,L)):W===K?(q=Math.min(N,L)+" "+Math.max(N,L),l=T[q],s(l)||(Y=R.interpolateUsingFraction(.5,P),j=.5*(U.height+G.height),X=i.fromRadians(Y.longitude,Y.latitude,j,e,E),_.push(X.x,X.y,X.z),l=_.length/3-1,T[q]=l),f.push(N,l,F),f.push(l,L,F)):Q===K&&(q=Math.min(L,F)+" "+Math.max(L,F),l=T[q],s(l)||(Y=O.interpolateUsingFraction(.5,P),j=.5*(G.height+V.height),X=i.fromRadians(Y.longitude,Y.latitude,j,e,E),_.push(X.x,X.y,X.z),l=_.length/3-1,T[q]=l),f.push(L,l,N),f.push(l,F,N)):(S.push(F),S.push(N),S.push(L))}return new c({attributes:{position:new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:_})},indices:S,primitiveType:p.TRIANGLES})},g.scaleToGeodeticHeight=function(e,t,r,n){r=a(r,l.WGS84);var o=m,u=_;if(t=a(t,0),n=a(n,!0),s(e))for(var c=e.length,d=0;d<c;d+=3)i.fromArray(e,d,u),n&&(u=r.scaleToGeodeticSurface(u,u)),0!==t&&(o=r.geodeticSurfaceNormal(u,o),i.multiplyByScalar(o,t,o),i.add(u,o,u)),e[d]=u.x,e[d+1]=u.y,e[d+2]=u.z;return e},g}),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-1!==this._array.indexOf(e)},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./ArcType","./arrayRemoveDuplicates","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidRhumbLine","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S){"use strict";function T(e,t,i,n){return r.subtract(t,e,A),r.multiplyByScalar(A,i/n,A),r.add(e,A,A),[A.x,A.y,A.z]}var E={};E.computeHierarchyPackedLength=function(e){for(var t=0,i=[e];i.length>0;){var n=i.pop();if(s(n)){t+=2;var o=n.positions,a=n.holes;if(s(o)&&(t+=o.length*r.packedLength),s(a))for(var l=a.length,u=0;u<l;++u)i.push(a[u])}}return t},E.packPolygonHierarchy=function(e,t,i){for(var n=[e];n.length>0;){var o=n.pop();if(s(o)){var a=o.positions,l=o.holes;if(t[i++]=s(a)?a.length:0,t[i++]=s(l)?l.length:0,s(a))for(var u=a.length,c=0;c<u;++c,i+=3)r.pack(a[c],t,i);if(s(l))for(var d=l.length,h=0;h<d;++h)n.push(l[h])}}return i},E.unpackPolygonHierarchy=function(e,t){for(var i=e[t++],n=e[t++],o=new Array(i),a=n>0?new Array(n):void 0,s=0;s<i;++s,t+=r.packedLength)o[s]=r.unpack(e,t);for(var l=0;l<n;++l)a[l]=E.unpackPolygonHierarchy(e,t),t=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:t}};var A=new r;E.subdivideLineCount=function(e,t,i){var n=r.distance(e,t),o=n/i,a=Math.max(0,Math.ceil(_.log2(o)));return Math.pow(2,a)};var w=new n,x=new n,P=new n,D=new r;E.subdivideRhumbLineCount=function(e,t,i,r){var n=e.cartesianToCartographic(t,w),o=e.cartesianToCartographic(i,x),a=new c(n,o,e),s=a.surfaceDistance/r,l=Math.max(0,Math.ceil(_.log2(s)));return Math.pow(2,l)},E.subdivideLine=function(e,t,i,n){var o=E.subdivideLineCount(e,t,i),a=r.distance(e,t),l=a/o;s(n)||(n=[]);var u=n;u.length=3*o;for(var c=0,d=0;d<o;d++){var h=T(e,t,d*l,a);u[c++]=h[0],u[c++]=h[1],u[c++]=h[2]}return u},E.subdivideRhumbLine=function(e,t,i,r,n){var o=e.cartesianToCartographic(t,w),a=e.cartesianToCartographic(i,x),l=new c(o,a,e),u=l.surfaceDistance/r,d=Math.max(0,Math.ceil(_.log2(u))),h=Math.pow(2,d),p=l.surfaceDistance/h;s(n)||(n=[]);var f=n;f.length=3*h;for(var m=0,g=0;g<h;g++){var v=l.interpolateUsingSurfaceDistance(g*p,P),y=e.cartographicToCartesian(v,D);f[m++]=y.x,f[m++]=y.y,f[m++]=y.z}return f};var I=new r,M=new r,R=new r,O=new r;E.scaleToGeodeticHeightExtruded=function(e,t,i,n,o){n=a(n,u.WGS84);var l=I,c=M,d=R,h=O;if(s(e)&&s(e.attributes)&&s(e.attributes.position))for(var p=e.attributes.position.values,f=p.length/2,m=0;m<f;m+=3)r.fromArray(p,m,d),n.geodeticSurfaceNormal(d,l),h=n.scaleToGeodeticSurface(d,h),c=r.multiplyByScalar(l,i,c),c=r.add(h,c,c),p[m+f]=c.x,p[m+1+f]=c.y,p[m+2+f]=c.z,o&&(h=r.clone(d,h)),c=r.multiplyByScalar(l,t,c),c=r.add(h,c,c),p[m]=c.x,p[m+1]=c.y,p[m+2]=c.z;return e},E.polygonOutlinesFromHierarchy=function(e,i,n){var o=[],a=new b;a.enqueue(e);for(var l,u,c;0!==a.length;){var d=a.dequeue(),h=d.positions;if(i)for(c=h.length,l=0;l<c;l++)n.scaleToGeodeticSurface(h[l],h[l]);if(h=t(h,r.equalsEpsilon,!0),!(h.length<3)){var p=d.holes?d.holes.length:0;for(l=0;l<p;l++){var f=d.holes[l],m=f.positions;if(i)for(c=m.length,u=0;u<c;++u)n.scaleToGeodeticSurface(m[u],m[u]);if(m=t(m,r.equalsEpsilon,!0),!(m.length<3)){o.push(m);var _=0;for(s(f.holes)&&(_=f.holes.length),u=0;u<_;u++)a.enqueue(f.holes[u])}}o.push(h)}}return o},E.polygonsFromHierarchy=function(e,i,n,o){var a=[],l=[],u=new b;for(u.enqueue(e);0!==u.length;){var c,d,h=u.dequeue(),p=h.positions,f=h.holes;if(n)for(d=p.length,c=0;c<d;c++)o.scaleToGeodeticSurface(p[c],p[c]);if(p=t(p,r.equalsEpsilon,!0),!(p.length<3)){var m=i(p);if(s(m)){var _=[],g=v.computeWindingOrder2D(m);g===S.CLOCKWISE&&(m.reverse(),p=p.slice().reverse());var y,C=p.slice(),T=s(f)?f.length:0,E=[];for(c=0;c<T;c++){var A=f[c],w=A.positions;if(n)for(d=w.length,y=0;y<d;++y)o.scaleToGeodeticSurface(w[y],w[y]);if(w=t(w,r.equalsEpsilon,!0),!(w.length<3)){var x=i(w);if(s(x)){g=v.computeWindingOrder2D(x),g===S.CLOCKWISE&&(x.reverse(),w=w.slice().reverse()),E.push(w),_.push(C.length),C=C.concat(w),m=m.concat(x);var P=0;for(s(A.holes)&&(P=A.holes.length),y=0;y<P;y++)u.enqueue(A.holes[y])}}}a.push({outerRing:p,holes:E}),l.push({positions:C,positions2D:m,holes:_})}}}return{hierarchy:a,polygons:l}};var L=new i,N=new r,F=new C,B=new g;E.computeBoundingRectangle=function(e,t,i,n,o){for(var a=C.fromAxisAngle(e,n,F),l=g.fromQuaternion(a,B),u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,p=i.length,f=0;f<p;++f){var m=r.clone(i[f],N);g.multiplyByVector(l,m,m);var _=t(m,L);s(_)&&(u=Math.min(u,_.x),c=Math.max(c,_.x),d=Math.min(d,_.y),h=Math.max(h,_.y))}return o.x=u,o.y=d,o.width=c-u,o.height=h-d,o},E.createGeometryFromPositions=function(t,i,r,n,a,s){var l=v.triangulate(i.positions2D,i.holes);l.length<3&&(l=[0,1,2]);var u=i.positions;if(n){for(var c=u.length,p=new Array(3*c),m=0,_=0;_<c;_++){var g=u[_];p[m++]=g.x,p[m++]=g.y,p[m++]=g.z}var C=new d({attributes:{position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:p})},indices:l,primitiveType:y.TRIANGLES});return a.normal?f.computeNormal(C):C}return s===e.GEODESIC?v.computeSubdivision(t,u,l,r):s===e.RHUMB?v.computeRhumbLineSubdivision(t,u,l,r):void 0};var k=[],z=new r,V=new r;return E.computeWallGeometry=function(t,i,n,a,s){var l,u,c,f,g,v=t.length,C=0;if(a)for(u=3*v*2,l=new Array(2*u),c=0;c<v;c++)f=t[c],g=t[(c+1)%v],l[C]=l[C+u]=f.x,++C,l[C]=l[C+u]=f.y,++C,l[C]=l[C+u]=f.z,++C,l[C]=l[C+u]=g.x,++C,l[C]=l[C+u]=g.y,++C,l[C]=l[C+u]=g.z,++C;else{var b=_.chordLength(n,i.maximumRadius),S=0;if(s===e.GEODESIC)for(c=0;c<v;c++)S+=E.subdivideLineCount(t[c],t[(c+1)%v],b);else if(s===e.RHUMB)for(c=0;c<v;c++)S+=E.subdivideRhumbLineCount(i,t[c],t[(c+1)%v],b);for(u=3*(S+v),l=new Array(2*u),c=0;c<v;c++){f=t[c],g=t[(c+1)%v];var T;s===e.GEODESIC?T=E.subdivideLine(f,g,b,k):s===e.RHUMB&&(T=E.subdivideRhumbLine(i,f,g,b,k));for(var A=T.length,w=0;w<A;++w,++C)l[C]=T[w],l[C+u]=T[w];l[C]=g.x,l[C+u]=g.x,++C,l[C]=g.y,l[C+u]=g.y,++C,l[C]=g.z,l[C+u]=g.z,++C}}v=l.length;var x=m.createTypedArray(v/3,v-6*t.length),P=0;for(v/=6,c=0;c<v;c++){var D=c,I=D+1,M=D+v,R=M+1;f=r.fromArray(l,3*D,z),g=r.fromArray(l,3*I,V),r.equalsEpsilon(f,g,_.EPSILON14,_.EPSILON6)||(x[P++]=D,x[P++]=M,x[P++]=I,x[P++]=I,x[P++]=M,x[P++]=R)}return new d({attributes:new p({position:new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:l})}),indices:x,primitiveType:y.TRIANGLES})},E}),define("Core/CoplanarPolygonGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./CoplanarPolygonGeometryLibrary","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T){"use strict";function E(e,t,i,o,s,l,u,c){var f=e.positions,m=C.triangulate(e.positions2D,e.holes);m.length<3&&(m=[0,1,2]);var y=_.createTypedArray(f.length,m.length);y.set(m);var T=B;if(0!==o){var E=S.fromAxisAngle(l,o,F);if(T=v.fromQuaternion(E,T),t.tangent||t.bitangent){E=S.fromAxisAngle(l,-o,F);var A=v.fromQuaternion(E,k);u=n.normalize(v.multiplyByVector(A,u,u),u),t.bitangent&&(c=n.normalize(n.cross(l,u,c),c))}}else T=v.clone(v.IDENTITY,T);var x=D;t.st&&(x.x=i.x,x.y=i.y);for(var I=f.length,M=3*I,R=new Float64Array(M),O=t.normal?new Float32Array(M):void 0,L=t.tangent?new Float32Array(M):void 0,N=t.bitangent?new Float32Array(M):void 0,z=t.st?new Float32Array(2*I):void 0,V=0,U=0,G=0,H=0,W=0,q=0;q<I;q++){var Y=f[q];if(R[V++]=Y.x,R[V++]=Y.y,R[V++]=Y.z,t.st){var j=v.multiplyByVector(T,Y,w),X=s(j,P);r.subtract(X,x,X);var Q=g.clamp(X.x/i.width,0,1),K=g.clamp(X.y/i.height,0,1);z[W++]=Q,z[W++]=K}t.normal&&(O[U++]=l.x,O[U++]=l.y,O[U++]=l.z),t.tangent&&(L[H++]=u.x,L[H++]=u.y,L[H++]=u.z),t.bitangent&&(N[G++]=c.x,N[G++]=c.y,N[G++]=c.z)}var Z=new p;return t.position&&(Z.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:R})),t.normal&&(Z.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:O})),t.tangent&&(Z.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:L})),t.bitangent&&(Z.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),t.st&&(Z.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:z})),new d({attributes:Z,indices:y,primitiveType:b.TRIANGLES})}function A(e){e=l(e,l.EMPTY_OBJECT);var t=e.polygonHierarchy,i=l(e.vertexFormat,T.DEFAULT);this._vertexFormat=T.clone(i),this._polygonHierarchy=t,this._stRotation=l(e.stRotation,0),this._ellipsoid=c.clone(l(e.ellipsoid,c.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=y.computeHierarchyPackedLength(t)+T.packedLength+c.packedLength+2}var w=new n,x=new t,P=new r,D=new r,I=new n,M=new n,R=new n,O=new n,L=new n,N=new n,F=new S,B=new v,k=new v,z=new n;A.fromPositions=function(e){return e=l(e,l.EMPTY_OBJECT),new A({polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},A.pack=function(e,t,i){return i=l(i,0),i=y.packPolygonHierarchy(e._polygonHierarchy,t,i),c.pack(e._ellipsoid,t,i),i+=c.packedLength,T.pack(e._vertexFormat,t,i),i+=T.packedLength,t[i++]=e._stRotation,t[i]=e.packedLength,t};var V=c.clone(c.UNIT_SPHERE),U=new T,G={
- polygonHierarchy:{}};return A.unpack=function(e,t,i){t=l(t,0);var r=y.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=c.unpack(e,t,V);t+=c.packedLength;var o=T.unpack(e,t,U);t+=T.packedLength;var a=e[t++],s=e[t];return u(i)||(i=new A(G)),i._polygonHierarchy=r,i._ellipsoid=c.clone(n,i._ellipsoid),i._vertexFormat=T.clone(o,i._vertexFormat),i._stRotation=a,i.packedLength=s,i},A.createGeometry=function(t){var r=t._vertexFormat,o=t._polygonHierarchy,a=t._stRotation,l=o.positions;if(l=e(l,n.equalsEpsilon,!0),!(l.length<3)){var u=I,c=M,h=R,p=L,v=N;if(s.computeProjectTo2DArguments(l,O,p,v)){if(u=n.cross(p,v,u),u=n.normalize(u,u),!n.equalsEpsilon(O,n.ZERO,g.EPSILON6)){var C=t._ellipsoid.geodeticSurfaceNormal(O,z);n.dot(u,C)<0&&(u=n.negate(u,u),p=n.negate(p,p))}var b=s.createProjectPointsTo2DFunction(O,p,v),S=s.createProjectPointTo2DFunction(O,p,v);r.tangent&&(c=n.clone(p,c)),r.bitangent&&(h=n.clone(v,h));var T=y.polygonsFromHierarchy(o,b,!1),A=T.hierarchy,w=T.polygons;if(0!==A.length){l=A[0].outerRing;for(var P=i.fromPoints(l),D=y.computeBoundingRectangle(u,S,l,a,x),F=[],B=0;B<w.length;B++){var k=new f({geometry:E(w[B],r,D,a,S,u,c,h)});F.push(k)}var V=m.combineInstances(F)[0];V.attributes.position.values=new Float64Array(V.attributes.position.values),V.indices=_.createTypedArray(V.attributes.position.values.length/3,V.indices);var U=V.attributes;return r.position||delete U.position,new d({attributes:U,indices:V.indices,primitiveType:V.primitiveType,boundingSphere:P})}}}},A}),define("Core/CoplanarPolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./CoplanarPolygonGeometryLibrary","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){for(var t=e.length,i=new Float64Array(3*t),r=p.createTypedArray(t,2*t),o=0,a=0,s=0;s<t;s++){var d=e[s];i[o++]=d.x,i[o++]=d.y,i[o++]=d.z,r[a++]=s,r[a++]=(s+1)%t}var h=new c({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:i})});return new l({attributes:h,indices:r,primitiveType:_.LINES})}function v(e){e=a(e,a.EMPTY_OBJECT);var t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=f.computeHierarchyPackedLength(t)+1}v.fromPositions=function(e){return e=a(e,a.EMPTY_OBJECT),new v({polygonHierarchy:{positions:e.positions}})},v.pack=function(e,t,i){return i=a(i,0),i=f.packPolygonHierarchy(e._polygonHierarchy,t,i),t[i]=e.packedLength,t};var y={polygonHierarchy:{}};return v.unpack=function(e,t,i){t=a(t,0);var r=f.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=e[t];return s(i)||(i=new v(y)),i._polygonHierarchy=r,i.packedLength=n,i},v.createGeometry=function(r){var n=r._polygonHierarchy,a=n.positions;if(a=e(a,i.equalsEpsilon,!0),!(a.length<3)){if(o.validOutline(a)){var s=f.polygonOutlinesFromHierarchy(n,!1);if(0!==s.length){for(var u=[],c=0;c<s.length;c++){var p=new d({geometry:g(s[c])});u.push(p)}var m=h.combineInstances(u)[0],_=t.fromPoints(n.positions);return new l({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:_})}}}},v}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";return e({ROUNDED:0,MITERED:1,BEVELED:2})}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./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,b=1-3*m+35*_/4,S=1-5*m,T=y*c-C*Math.sin(2*c)*m/2-b*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,E=e._constants;E.a=i,E.b=r,E.f=n,E.cosineHeading=o,E.sineHeading=a,E.tanU=s,E.cosineU=l,E.sineU=u,E.sigma=c,E.sineAlpha=d,E.sineSquaredAlpha=h,E.cosineSquaredAlpha=p,E.cosineAlpha=f,E.u2Over4=m,E.u4Over16=_,E.u6Over64=g,E.u8Over256=v,E.a0=y,E.a1=C,E.a2=b,E.a3=S,E.distanceRatio=T}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),b=Math.sin(g),S=v*C,T=v*b,E=y*b,A=y*C,w=m,x=s.TWO_PI,P=Math.cos(w),D=Math.sin(w);do{P=Math.cos(w),D=Math.sin(w);var I=T-A*P;d=Math.sqrt(C*C*D*D+I*I),u=E+S*P,l=Math.atan2(d,u);var M;0===d?(M=0,h=1):(M=S*D/d,h=1-M*M),x=w,p=u-2*E/h,isNaN(p)&&(p=0),w=m+c(f,M,h,l,d,u,p)}while(Math.abs(w-x)>s.EPSILON12);var R=h*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,L=R*(256+R*(R*(74-47*R)-128))/1024,N=p*p,F=L*d*(p+L*(u*(2*N-1)-L*p*(4*d*d-3)*(4*N-3)/6)/4),B=i*O*(l-F),k=Math.atan2(C*D,T-A*P),z=Math.atan2(v*D,T*P-A);e._distance=B,e._startHeading=k,e._endHeading=z,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,i,o){var s=r(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(e)&&n(i)&&h(this,e,i,s)}var f=new e,m=new e;return o(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 r=this._constants,o=r.distanceRatio+e/r.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,_=r.u8Over256,g=r.u2Over4,v=r.u6Over64,y=r.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,b=Math.asin(Math.sin(C)*r.cosineAlpha),S=Math.atan(r.a/r.b*Math.tan(b));C-=r.sigma;var T=Math.cos(2*r.sigma+C),E=Math.sin(C),A=Math.cos(C),w=r.cosineU*A,x=r.sineU*E,P=Math.atan2(E*r.sineHeading,w-x*r.cosineHeading),D=P-c(r.f,r.sineAlpha,r.cosineSquaredAlpha,C,E,A,T);return n(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","./EllipsoidRhumbLine","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,i){var r=w;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 f(t,i,r,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,I),c=n.scaleToGeodeticSurface(i,M),d=_.numberOfPoints(t,i,r),h=n.cartesianToCartographic(u,x),f=n.cartesianToCartographic(c,P),m=p(d,o,a);R.setEndPoints(h,f);var g=R.surfaceDistance/d,v=l;h.height=o;var y=n.cartographicToCartesian(h,D);e.pack(y,s,v),v+=3;for(var C=1;C<d;C++){var b=R.interpolateUsingSurfaceDistance(C*g,P);b.height=m[C],y=n.cartographicToCartesian(b,D),e.pack(y,s,v),v+=3}return v}function m(t,i,r,n,o,a,l,u){var c=n.scaleToGeodeticSurface(t,I),d=n.scaleToGeodeticSurface(i,M),h=n.cartesianToCartographic(c,x),f=n.cartesianToCartographic(d,P),m=_.numberOfPointsRhumbLine(h,f,r),g=p(m,o,a);O.ellipsoid.equals(n)||(O=new s(void 0,void 0,n)),O.setEndPoints(h,f);var v=O.surfaceDistance/m,y=u;h.height=o;var C=n.cartographicToCartesian(h,D);e.pack(C,l,y),y+=3;for(var b=1;b<m;b++){var S=O.interpolateUsingSurfaceDistance(b*v,P);S.height=g[b],C=n.cartographicToCartesian(S,D),e.pack(C,l,y),y+=3}return y}var _={};_.numberOfPoints=function(t,i,r){var n=e.distance(t,i);return Math.ceil(n/r)},_.numberOfPointsRhumbLine=function(e,t,i){var r=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.ceil(Math.sqrt(r/(i*i)))};var g=new t;_.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,g).height}return r};var v=new d,y=new e,C=new e,b=new h(e.UNIT_X,0),S=new e,T=new h(e.UNIT_X,0),E=new e,A=new e,w=[],x=new t,P=new t,D=new e,I=new e,M=new e,R=new a,O=new s;_.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,d.IDENTITY);var s=d.inverseTransformation(n,v),u=d.multiplyByPoint(s,e.ZERO,y),c=e.normalize(d.multiplyByPointAsVector(s,e.UNIT_Y,C),C),p=h.fromPointNormal(u,c,b),f=e.normalize(d.multiplyByPointAsVector(s,e.UNIT_X,S),S),m=h.fromPointNormal(u,f,T),_=1;o.push(e.clone(t[0]));for(var g=o[0],w=t.length,x=1;x<w;++x){var P=t[x];if(h.getPointDistance(m,g)<0||h.getPointDistance(m,P)<0){var D=l.lineSegmentPlane(g,P,p,E);if(r(D)){var I=e.multiplyByScalar(c,5e-9,A);h.getPointDistance(p,g)<0&&e.negate(I,I),o.push(e.add(D,I,new e)),a.push(_+1),e.negate(I,I),o.push(e.add(D,I,new e)),_=1}}o.push(e.clone(t[x])),_++,g=P}a.push(_)}return{positions:o,lengths:a}},_.generateArc=function(t){r(t)||(t={});var n=t.positions,a=n.length,s=i(t.ellipsoid,o.WGS84),l=i(t.height,0),d=u(l);if(a<1)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],I);if(0!==(l=d?l[0]:l)){var p=s.geodeticSurfaceNormal(h,D);e.multiplyByScalar(p,l,p),e.add(h,p,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var g=i(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(g,s.maximumRadius)}var v,y=0;for(v=0;v<a-1;v++)y+=_.numberOfPoints(n[v],n[v+1],m);var C=3*(y+1),b=new Array(C),S=0;for(v=0;v<a-1;v++){S=f(n[v],n[v+1],m,s,d?l[v]:l,d?l[v+1]:l,b,S)}w.length=0;var T=n[a-1],E=s.cartesianToCartographic(T,x);E.height=d?l[a-1]:l;var A=s.cartographicToCartesian(E,D);return e.pack(A,b,C-3),b};var L=new t,N=new t;return _.generateRhumbArc=function(n){r(n)||(n={});var a=n.positions,s=a.length,l=i(n.ellipsoid,o.WGS84),d=i(n.height,0),h=u(d);if(s<1)return[];if(1===s){var p=l.scaleToGeodeticSurface(a[0],I);if(0!==(d=h?d[0]:d)){var f=l.geodeticSurfaceNormal(p,D);e.multiplyByScalar(f,d,f),e.add(p,f,p)}return[p.x,p.y,p.z]}var g,v,y=i(n.granularity,c.RADIANS_PER_DEGREE),C=0,b=l.cartesianToCartographic(a[0],L);for(g=0;g<s-1;g++)v=l.cartesianToCartographic(a[g+1],N),C+=_.numberOfPointsRhumbLine(b,v,y),b=t.clone(v,L);var S=3*(C+1),T=new Array(S),E=0;for(g=0;g<s-1;g++){E=m(a[g],a[g+1],y,l,h?d[g]:d,h?d[g+1]:d,T,E)}w.length=0;var A=a[s-1],P=l.cartesianToCartographic(A,x);P.height=h?d[s-1]:d;var M=l.cartographicToCartesian(P,D);return e.pack(M,T,S-3),T},_.generateCartesianArc=function(t){for(var i=_.generateArc(t),r=i.length/3,n=new Array(r),o=0;o<r;o++)n[o]=e.unpack(i,3*o);return n},_.generateCartesianRhumbArc=function(t){for(var i=_.generateRhumbArc(t),r=i.length/3,n=new Array(r),o=0;o<r;o++)n[o]=e.unpack(i,3*o);return n},_}),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,L),L),u=s.projectPointOntoPlane(t.add(n,r,N),N),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=U,p=G;B=d.eastNorthUpToFixedFrame(e,o,B),h=l.multiplyByPointAsVector(B,F,h),h=t.normalize(h,h);var m=f(h,i,e,o);z=s.fromRotationZ(m,z),H.z=a,B=l.multiplyTransformation(B,l.fromRotationTranslation(z,H,k),B);var _=V;_[0]=u;for(var g=0;g<c;g++)for(var v=0;v<r.length;v+=3)p=t.fromArray(r,v,p),p=s.multiplyByVector(_,p,p),p=l.multiplyByPoint(B,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){n=m(t.fromArray(e,l,W),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,I),t.subtract(r,e,M)),v=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));_=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),g/(v+1),q),j):s.fromQuaternion(c.fromAxisAngle(e,g/(v+1),q),j);var y,C;if(i=t.clone(i,Y),v>0)for(var b=f?2:1,S=0;S<v;S++)i=s.multiplyByVector(_,i,i),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,M),d=m(C,y,h,d,u,p,1,b);else y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,M),d=m(C,y,h,d,u,p,1,1),r=t.clone(r,Y),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,M),d=m(C,y,h,d,u,p,1,1);return d}var C=[new t,new t],b=new t,S=new t,T=new t,E=new t,A=new t,w=new t,x=new t,P=new t,D=new t,I=new t,M=new t,R={},O=new r,L=new t,N=new t,F=new t(-1,0,0),B=new l,k=new l,z=new s,V=s.IDENTITY.clone(),U=new t,G=new i,H=new t,W=new t,q=new c,Y=new t,j=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},R.angleIsGreaterThanPi=function(e,i,r,n){var a=new o(r,n),s=a.projectPointOntoPlane(t.add(r,e,L),L),l=a.projectPointOntoPlane(t.add(r,i,N),N);return l.x*s.y-l.y*s.x>=0};var X=new t,Q=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,M=s?g(i,r):v(i,r),O=s?v(i,r):void 0,L=r.height/2,N=r.width/2,F=e.length,B=[],k=s?[]:void 0,z=b,V=S,U=T,G=E,H=A,W=w,q=x,Y=P,j=D,K=e[0],Z=e[1];G=l.geodeticSurfaceNormal(K,G),z=t.subtract(Z,K,z),z=t.normalize(z,z),Y=t.cross(G,z,Y),Y=t.normalize(Y,Y);var J=c[0],$=c[1];s&&(k=m(K,Y,O,k,l,J+L,1,1)),j=t.clone(K,j),K=Z,V=t.negate(z,V);for(var ee,te,ie=1;ie<F-1;ie++){var re=s?2:1;Z=e[ie+1],z=t.subtract(Z,K,z),z=t.normalize(z,z),U=t.add(z,V,U),U=t.normalize(U,U),G=l.geodeticSurfaceNormal(K,G);var ne=t.multiplyByScalar(G,t.dot(z,G),X);t.subtract(z,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(V,G),Q);t.subtract(V,oe,oe),t.normalize(oe,oe);if(!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7)){U=t.cross(U,G,U),U=t.cross(G,U,U),U=t.normalize(U,U);var ae=1/Math.max(.25,t.magnitude(t.cross(U,V,I))),se=R.angleIsGreaterThanPi(z,V,K,l);se?(H=t.add(K,t.multiplyByScalar(U,ae*N,U),H),W=t.add(H,t.multiplyByScalar(Y,N,W),W),C[0]=t.clone(j,C[0]),C[1]=t.clone(W,C[1]),ee=p(C,J+L,$+L,d),te=u.generateArc({positions:C,granularity:d,ellipsoid:l}),B=_(te,Y,M,B,l,ee,1),Y=t.cross(G,z,Y),Y=t.normalize(Y,Y),q=t.add(H,t.multiplyByScalar(Y,N,q),q),f===n.ROUNDED||f===n.BEVELED?y(H,W,q,f,se,l,B,M,$+L,s):(U=t.negate(U,U),B=m(K,U,M,B,l,$+L,ae,re)),j=t.clone(q,j)):(H=t.add(K,t.multiplyByScalar(U,ae*N,U),H),W=t.add(H,t.multiplyByScalar(Y,-N,W),W),C[0]=t.clone(j,C[0]),C[1]=t.clone(W,C[1]),ee=p(C,J+L,$+L,d),te=u.generateArc({positions:C,granularity:d,ellipsoid:l}),B=_(te,Y,M,B,l,ee,1),Y=t.cross(G,z,Y),Y=t.normalize(Y,Y),q=t.add(H,t.multiplyByScalar(Y,-N,q),q),f===n.ROUNDED||f===n.BEVELED?y(H,W,q,f,se,l,B,M,$+L,s):B=m(K,U,M,B,l,$+L,ae,re),j=t.clone(q,j)),V=t.negate(z,V)}else B=m(j,Y,M,B,l,J+L,1,1),j=K;J=$,$=c[ie+1],K=Z}C[0]=t.clone(j,C[0]),C[1]=t.clone(K,C[1]),ee=p(C,J+L,$+L,d),te=u.generateArc({positions:C,granularity:d,ellipsoid:l}),B=_(te,Y,M,B,l,ee,1),s&&(k=m(K,Y,O,k,l,$+L,1,1)),F=B.length;var le=s?F+k.length:F,ue=new Float64Array(le);return ue.set(B),s&&ue.set(k,F),ue},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,p),e.subtract(a,i,f)),d=l===t.BEVELED?1:Math.ceil(c/r.toRadians(5))+1,h=3*d,m=new Array(h);m[h-3]=a.x,m[h-2]=a.y,m[h-1]=a.z;var _;_=u?n.fromQuaternion(s.fromAxisAngle(e.negate(i,p),c/d,P),D):n.fromQuaternion(s.fromAxisAngle(i,c/d,P),D);var g=0;o=e.clone(o,p);for(var v=0;v<d;v++)o=n.multiplyByVector(_,o,o),m[g++]=o.x,m[g++]=o.y,m[g++]=o.z;return m}function u(i){var r=v,n=y,o=C,a=i[1];n=e.fromArray(i[1],a.length-3,n),o=e.fromArray(i[0],0,o),r=e.midpoint(n,o,r);var s=l(r,n,o,t.ROUNDED,!1),u=i.length-1,c=i[u-1];return a=i[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),r=e.midpoint(n,o,r),[s,l(r,n,o,t.ROUNDED,!1)]}function c(t,i,r,n){var o=p;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,p),l=e.negate(s,f),u=0,c=t.length-1,d=0;d<t.length;d+=3){var h=e.fromArray(t,d,m),g=e.add(h,l,_);o[u++]=g.x,o[u++]=g.y,o[u++]=g.z;var v=e.add(h,s,_);a[c--]=v.z,a[c--]=v.y,a[c--]=v.x}return n.push(o,a),n}var h={},p=new e,f=new e,m=new e,_=new e,g=[new e,new e],v=new e,y=new e,C=new e,b=new e,S=new e,T=new e,E=new e,A=new e,w=new e,x=new e,P=new s,D=new n;h.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,M=new e;return h.computePositions=function(i){var n=i.granularity,s=i.positions,h=i.ellipsoid,f=i.width/2,m=i.cornerType,_=i.saveAttributes,P=v,D=y,R=C,O=b,L=S,N=T,F=E,B=A,k=w,z=x,V=[],U=_?[]:void 0,G=_?[]:void 0,H=s[0],W=s[1];D=e.normalize(e.subtract(W,H,D),D),P=h.geodeticSurfaceNormal(H,P),O=e.normalize(e.cross(P,D,O),O),_&&(U.push(O.x,O.y,O.z),G.push(P.x,P.y,P.z)),F=e.clone(H,F),H=W,R=e.negate(D,R);var q,Y,j=[],X=s.length;for(Y=1;Y<X-1;Y++){P=h.geodeticSurfaceNormal(H,P),W=s[Y+1],D=e.normalize(e.subtract(W,H,D),D),L=e.normalize(e.add(D,R,L),L);var Q=e.multiplyByScalar(P,e.dot(D,P),I);e.subtract(D,Q,Q),e.normalize(Q,Q);var K=e.multiplyByScalar(P,e.dot(R,P),M);e.subtract(R,K,K),e.normalize(K,K);if(!r.equalsEpsilon(Math.abs(e.dot(Q,K)),1,r.EPSILON7)){L=e.cross(L,P,L),L=e.cross(P,L,L),L=e.normalize(L,L);var Z=f/Math.max(.25,e.magnitude(e.cross(L,R,p))),J=a.angleIsGreaterThanPi(D,R,H,h);L=e.multiplyByScalar(L,Z,L),J?(B=e.add(H,L,B),z=e.add(B,e.multiplyByScalar(O,f,z),z),k=e.add(B,e.multiplyByScalar(O,2*f,k),k),g[0]=e.clone(F,g[0]),g[1]=e.clone(z,g[1]),q=o.generateArc({positions:g,granularity:n,ellipsoid:h}),V=d(q,O,f,V),_&&(U.push(O.x,O.y,O.z),G.push(P.x,P.y,P.z)),N=e.clone(k,N),O=e.normalize(e.cross(P,D,O),O),k=e.add(B,e.multiplyByScalar(O,2*f,k),k),F=e.add(B,e.multiplyByScalar(O,f,F),F),m===t.ROUNDED||m===t.BEVELED?j.push({leftPositions:l(B,N,k,m,J)}):j.push({leftPositions:c(H,e.negate(L,L),k,J)})):(k=e.add(H,L,k),z=e.add(k,e.negate(e.multiplyByScalar(O,f,z),z),z),B=e.add(k,e.negate(e.multiplyByScalar(O,2*f,B),B),B),g[0]=e.clone(F,g[0]),g[1]=e.clone(z,g[1]),q=o.generateArc({positions:g,granularity:n,ellipsoid:h}),V=d(q,O,f,V),_&&(U.push(O.x,O.y,O.z),G.push(P.x,P.y,P.z)),N=e.clone(B,N),O=e.normalize(e.cross(P,D,O),O),B=e.add(k,e.negate(e.multiplyByScalar(O,2*f,B),B),B),F=e.add(k,e.negate(e.multiplyByScalar(O,f,F),F),F),m===t.ROUNDED||m===t.BEVELED?j.push({rightPositions:l(k,N,B,m,J)}):j.push({rightPositions:c(H,L,B,J)})),R=e.negate(D,R)}H=W}P=h.geodeticSurfaceNormal(H,P),g[0]=e.clone(F,g[0]),g[1]=e.clone(H,g[1]),q=o.generateArc({positions:g,granularity:n,ellipsoid:h}),V=d(q,O,f,V),_&&(U.push(O.x,O.y,O.z),G.push(P.x,P.y,P.z));var $;return m===t.ROUNDED&&($=u(V)),{positions:V,corners:j,lefts:U,normals:G,endPositions:$}},h}),define("Core/CorridorGeometry",["./arrayFill","./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./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,b,S){"use strict";function T(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function E(e,t,i,n,o,a){var s=e.normals,u=e.tangents,c=e.bitangents,d=r.normalize(r.cross(i,t,k),k);a.normal&&l.addAttribute(s,t,n,o),a.tangent&&l.addAttribute(u,d,n,o),a.bitangent&&l.addAttribute(c,i,n,o)}function A(e,t,i){var n,o,s,u=e.positions,d=e.corners,h=e.endPositions,p=e.lefts,_=e.normals,y=new m,C=0,b=0,S=0;for(o=0;o<u.length;o+=2)s=u[o].length-3,C+=s,S+=2*s,b+=u[o+1].length-3;for(C+=3,b+=3,o=0;o<d.length;o++){n=d[o];var T=d[o].leftPositions;c(T)?(s=T.length,C+=s,S+=s):(s=d[o].rightPositions.length,b+=s,S+=s)}var A,w=c(h);w&&(A=h[0].length-3,C+=A,b+=A,A/=3,S+=6*A);var x,P,D,I,M,F,V=C+b,U=new Float64Array(V),G=t.normal?new Float32Array(V):void 0,H=t.tangent?new Float32Array(V):void 0,W=t.bitangent?new Float32Array(V):void 0,q={normals:G,tangents:H,bitangents:W},Y=0,j=V-1,X=R,Q=O,K=A/2,Z=g.createTypedArray(V/3,S),J=0;if(w){F=L,M=N;var $=h[0];for(X=r.fromArray(_,0,X),Q=r.fromArray(p,0,Q),o=0;o<K;o++)F=r.fromArray($,3*(K-1-o),F),M=r.fromArray($,3*(K+o),M),l.addAttribute(U,M,Y),l.addAttribute(U,F,void 0,j),E(q,X,Q,Y,j,t),P=Y/3,I=P+1,x=(j-2)/3,D=x-1,Z[J++]=x,Z[J++]=P,Z[J++]=D,Z[J++]=D,Z[J++]=P,Z[J++]=I,Y+=3,j-=3}var ee=0,te=0,ie=u[ee++],re=u[ee++];U.set(ie,Y),U.set(re,j-re.length+1),Q=r.fromArray(p,te,Q);var ne,oe;for(s=re.length-3,o=0;o<s;o+=3)ne=i.geodeticSurfaceNormal(r.fromArray(ie,o,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(re,s-o,z),z),X=r.normalize(r.add(ne,oe,X),X),E(q,X,Q,Y,j,t),P=Y/3,I=P+1,x=(j-2)/3,D=x-1,Z[J++]=x,Z[J++]=P,Z[J++]=D,Z[J++]=D,Z[J++]=P,Z[J++]=I,Y+=3,j-=3;for(ne=i.geodeticSurfaceNormal(r.fromArray(ie,s,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(re,s,z),z),X=r.normalize(r.add(ne,oe,X),X),te+=3,o=0;o<d.length;o++){var ae;n=d[o];var se,le,ue=n.leftPositions,ce=n.rightPositions,de=B,he=L,pe=N;if(X=r.fromArray(_,te,X),c(ue)){for(E(q,X,Q,void 0,j,t),j-=3,se=I,le=D,ae=0;ae<ue.length/3;ae++)de=r.fromArray(ue,3*ae,de),Z[J++]=se,Z[J++]=le-ae-1,Z[J++]=le-ae,l.addAttribute(U,de,void 0,j),he=r.fromArray(U,3*(le-ae-1),he),pe=r.fromArray(U,3*se,pe),Q=r.normalize(r.subtract(he,pe,Q),Q),E(q,X,Q,void 0,j,t),j-=3;de=r.fromArray(U,3*se,de),he=r.subtract(r.fromArray(U,3*le,he),de,he),pe=r.subtract(r.fromArray(U,3*(le-ae),pe),de,pe),Q=r.normalize(r.add(he,pe,Q),Q),E(q,X,Q,Y,void 0,t),Y+=3}else{for(E(q,X,Q,Y,void 0,t),Y+=3,se=D,le=I,ae=0;ae<ce.length/3;ae++)de=r.fromArray(ce,3*ae,de),Z[J++]=se,Z[J++]=le+ae,Z[J++]=le+ae+1,l.addAttribute(U,de,Y),he=r.fromArray(U,3*se,he),pe=r.fromArray(U,3*(le+ae),pe),Q=r.normalize(r.subtract(he,pe,Q),Q),E(q,X,Q,Y,void 0,t),Y+=3;de=r.fromArray(U,3*se,de),he=r.subtract(r.fromArray(U,3*(le+ae),he),de,he),pe=r.subtract(r.fromArray(U,3*le,pe),de,pe),Q=r.normalize(r.negate(r.add(pe,he,Q),Q),Q),E(q,X,Q,void 0,j,t),j-=3}for(ie=u[ee++],re=u[ee++],ie.splice(0,3),re.splice(re.length-3,3),U.set(ie,Y),U.set(re,j-re.length+1),s=re.length-3,te+=3,Q=r.fromArray(p,te,Q),ae=0;ae<re.length;ae+=3)ne=i.geodeticSurfaceNormal(r.fromArray(ie,ae,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(re,s-ae,z),z),X=r.normalize(r.add(ne,oe,X),X),E(q,X,Q,Y,j,t),I=Y/3,P=I-1,D=(j-2)/3,x=D+1,Z[J++]=x,Z[J++]=P,Z[J++]=D,Z[J++]=D,Z[J++]=P,Z[J++]=I,Y+=3,j-=3;Y-=3,j+=3}if(X=r.fromArray(_,_.length-3,X),E(q,X,Q,Y,j,t),w){Y+=3,j-=3,F=L,M=N;var fe=h[1];for(o=0;o<K;o++)F=r.fromArray(fe,3*(A-o-1),F),M=r.fromArray(fe,3*o,M),l.addAttribute(U,F,void 0,j),l.addAttribute(U,M,Y),E(q,X,Q,Y,j,t),I=Y/3,P=I-1,D=(j-2)/3,x=D+1,Z[J++]=x,Z[J++]=P,Z[J++]=D,Z[J++]=D,Z[J++]=P,Z[J++]=I,Y+=3,j-=3}if(y.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:U}),t.st){var me,_e,ge=new Float32Array(V/3*2),ve=0;if(w){C/=3,b/=3;var ye=Math.PI/(A+1);_e=1/(C-A+1),me=1/(b-A+1);var Ce,be=A/2;for(o=be+1;o<A+1;o++)Ce=v.PI_OVER_TWO+ye*o,ge[ve++]=me*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(o=1;o<b-A+1;o++)ge[ve++]=o*me,ge[ve++]=0;for(o=A;o>be;o--)Ce=v.PI_OVER_TWO-o*ye,ge[ve++]=1-me*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(o=be;o>0;o--)Ce=v.PI_OVER_TWO-ye*o,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(o=C-A;o>0;o--)ge[ve++]=o*_e,ge[ve++]=1;for(o=1;o<be+1;o++)Ce=v.PI_OVER_TWO+ye*o,ge[ve++]=_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce))}else{for(C/=3,b/=3,_e=1/(C-1),me=1/(b-1),o=0;o<b;o++)ge[ve++]=o*me,ge[ve++]=0;for(o=C;o>0;o--)ge[ve++]=(o-1)*_e,ge[ve++]=1}y.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.bitangent&&(y.bitangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:q.bitangents})),{attributes:y,indices:Z}}function w(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,n,o=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,n=e.bitangent.values);var a,s=e.position.values.length/18,u=3*s,c=2*s,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=R,_=O,g=L,v=N,y=F,C=B,b=d;for(a=0;a<u;a+=3){var S=b+d;m=r.fromArray(o,a,m),_=r.fromArray(o,a+u,_),g=r.fromArray(o,(a+3)%u,g),_=r.subtract(_,m,_),g=r.subtract(g,m,g),v=r.normalize(r.cross(_,g,v),v),t.normal&&(l.addAttribute(h,v,S),l.addAttribute(h,v,S+3),l.addAttribute(h,v,b),l.addAttribute(h,v,b+3)),(t.tangent||t.bitangent)&&(C=r.fromArray(i,a,C),t.bitangent&&(l.addAttribute(f,C,S),l.addAttribute(f,C,S+3),l.addAttribute(f,C,b),l.addAttribute(f,C,b+3)),t.tangent&&(y=r.normalize(r.cross(C,v,y),y),l.addAttribute(p,y,S),l.addAttribute(p,y,S+3),l.addAttribute(p,y,b),l.addAttribute(p,y,b+3))),b+=6}if(t.normal){for(h.set(i),a=0;a<u;a+=3)h[a+u]=-i[a],h[a+u+1]=-i[a+1],h[a+u+2]=-i[a+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 T=e.tangent.values;p.set(T),p.set(T,u),e.tangent.values=p}}if(t.st){var E=e.st.values,A=new Float32Array(6*c);A.set(E),A.set(E,c);for(var w=2*c,x=0;x<2;x++){for(A[w++]=E[0],A[w++]=E[1],a=2;a<c;a+=2){var P=E[a],D=E[a+1];A[w++]=P,A[w++]=D,A[w++]=P,A[w++]=D}A[w++]=E[0],A[w++]=E[1]}e.st.values=A}return e}function x(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 P(t,i){var r=new S({position:i.position,normal:i.normal||i.bitangent||t.shadowVolume,tangent:i.tangent,bitangent:i.normal||i.bitangent,st:i.st}),n=t.ellipsoid,o=l.computePositions(t),s=A(o,r,n),u=t.height,d=t.extrudedHeight,h=s.attributes,p=s.indices,m=h.position.values,v=m.length,C=new Float64Array(6*v),b=new Float64Array(v);b.set(m);var T=new Float64Array(4*v);m=y.scaleToGeodeticHeight(m,u,n),T=x(m,0,T),b=y.scaleToGeodeticHeight(b,d,n),T=x(b,2*v,T),C.set(m),C.set(b,v),C.set(T,2*v),h.position.values=C,h=w(h,i);var E,P=v/3;if(t.shadowVolume){var D=h.normal.values;v=D.length;var I=new Float32Array(6*v);for(E=0;E<v;E++)D[E]=-D[E];I.set(D,v),I=x(D,4*v,I),h.extrudeDirection=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:I}),i.normal||(h.normal=void 0)}if(c(t.offsetAttribute)){var M=new Uint8Array(6*P);if(t.offsetAttribute===_.TOP)M=e(M,1,0,P),M=e(M,1,2*P,4*P);else{var R=t.offsetAttribute===_.NONE?0:1;M=e(M,R)}h.applyOffset=new f({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}var O=p.length,L=P+P,N=g.createTypedArray(C.length/3,2*O+3*L);N.set(p);var F=O;for(E=0;E<O;E+=3){var B=p[E],k=p[E+1],z=p[E+2];N[F++]=z+P,N[F++]=k+P,N[F++]=B+P}var V,U,G,H;for(E=0;E<L;E+=2)V=E+L,U=V+L,G=V+1,H=U+1,N[F++]=V,N[F++]=U,N[F++]=G,N[F++]=G,N[F++]=U,N[F++]=H;return{attributes:h,indices:N}}function D(e,t,i,n,o,a){var s=r.subtract(t,e,V);r.normalize(s,s);var l=i.geodeticSurfaceNormal(e,U),u=r.cross(s,l,V);r.multiplyByScalar(u,n,u);var c=o.latitude,d=o.longitude,h=a.latitude,p=a.longitude;r.add(e,u,U),i.cartesianToCartographic(U,G);var f=G.latitude,m=G.longitude;c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),r.subtract(e,u,U),i.cartesianToCartographic(U,G),f=G.latitude,m=G.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 I(e,i,n,o,a){e=T(e,i);var l=t(e,r.equalsEpsilon),u=l.length;if(u<2||n<=0)return new b;var d=.5*n;q.latitude=Number.POSITIVE_INFINITY,q.longitude=Number.POSITIVE_INFINITY,Y.latitude=Number.NEGATIVE_INFINITY,Y.longitude=Number.NEGATIVE_INFINITY;var h,p;if(o===s.ROUNDED){var f=l[0];r.subtract(f,l[1],H),r.normalize(H,H),r.multiplyByScalar(H,d,H),r.add(f,H,W),i.cartesianToCartographic(W,G),h=G.latitude,p=G.longitude,q.latitude=Math.min(q.latitude,h),q.longitude=Math.min(q.longitude,p),Y.latitude=Math.max(Y.latitude,h),Y.longitude=Math.max(Y.longitude,p)}for(var m=0;m<u-1;++m)D(l[m],l[m+1],i,d,q,Y);var _=l[u-1];r.subtract(_,l[u-2],H),r.normalize(H,H),r.multiplyByScalar(H,d,H),r.add(_,H,W),D(_,W,i,d,q,Y),o===s.ROUNDED&&(i.cartesianToCartographic(W,G),h=G.latitude,p=G.longitude,q.latitude=Math.min(q.latitude,h),q.longitude=Math.min(q.longitude,p),Y.latitude=Math.max(Y.latitude,h),Y.longitude=Math.max(Y.longitude,p));var g=c(a)?a:new b;return g.north=Y.latitude,g.south=q.latitude,g.east=Y.longitude,g.west=q.longitude,g}function M(e){e=u(e,u.EMPTY_OBJECT);var t=e.positions,i=e.width,n=u(e.height,0),o=u(e.extrudedHeight,n);this._positions=t,this._ellipsoid=h.clone(u(e.ellipsoid,h.WGS84)),this._vertexFormat=S.clone(u(e.vertexFormat,S.DEFAULT)),this._width=i,this._height=Math.max(n,o),this._extrudedHeight=Math.min(n,o),this._cornerType=u(e.cornerType,s.ROUNDED),this._granularity=u(e.granularity,v.RADIANS_PER_DEGREE),this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*r.packedLength+h.packedLength+S.packedLength+7}var R=new r,O=new r,L=new r,N=new r,F=new r,B=new r,k=new r,z=new r,V=new r,U=new r,G=new n,H=new r,W=new r,q=new n,Y=new n;M.pack=function(e,t,i){i=u(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return h.pack(e._ellipsoid,t,i),i+=h.packedLength,S.pack(e._vertexFormat,t,i),i+=S.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i++]=e._shadowVolume?1:0,t[i]=u(e._offsetAttribute,-1),t};var j=h.clone(h.UNIT_SPHERE),X=new S,Q={positions:void 0,ellipsoid:j,vertexFormat:X,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return M.unpack=function(e,t,i){t=u(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var s=h.unpack(e,t,j)
- ;t+=h.packedLength;var l=S.unpack(e,t,X);t+=S.packedLength;var d=e[t++],p=e[t++],f=e[t++],m=e[t++],_=e[t++],g=1===e[t++],v=e[t];return c(i)?(i._positions=o,i._ellipsoid=h.clone(s,i._ellipsoid),i._vertexFormat=S.clone(l,i._vertexFormat),i._width=d,i._height=p,i._extrudedHeight=f,i._cornerType=m,i._granularity=_,i._shadowVolume=g,i._offsetAttribute=-1===v?void 0:v,i):(Q.positions=o,Q.width=d,Q.height=p,Q.extrudedHeight=f,Q.cornerType=m,Q.granularity=_,Q.shadowVolume=g,Q.offsetAttribute=-1===v?void 0:v,new M(Q))},M.computeRectangle=function(e,t){e=u(e,u.EMPTY_OBJECT);var i=e.positions,r=e.width;return I(i,u(e.ellipsoid,h.WGS84),r,u(e.cornerType,s.ROUNDED),t)},M.createGeometry=function(n){var o=n._positions,s=n._width,u=n._ellipsoid;o=T(o,u);var d=t(o,r.equalsEpsilon);if(!(d.length<2||s<=0)){var h,m=n._height,g=n._extrudedHeight,b=!v.equalsEpsilon(m,g,0,v.EPSILON2),S=n._vertexFormat,E={ellipsoid:u,positions:d,width:s,cornerType:n._cornerType,granularity:n._granularity,saveAttributes:!0};if(b)E.height=m,E.extrudedHeight=g,E.shadowVolume=n._shadowVolume,E.offsetAttribute=n._offsetAttribute,h=P(E,S);else{if(h=A(l.computePositions(E),S,u),h.attributes.position.values=y.scaleToGeodeticHeight(h.attributes.position.values,m,u),c(n._offsetAttribute)){var w=n._offsetAttribute===_.NONE?0:1,x=h.attributes.position.values.length,D=new Uint8Array(x/3);e(D,w),h.attributes.applyOffset=new f({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}}var I=h.attributes,M=i.fromVertices(I.position.values,void 0,3);return S.position||(h.attributes.position.values=void 0),new p({attributes:I,indices:h.indices,primitiveType:C.TRIANGLES,boundingSphere:M,offsetAttribute:n._offsetAttribute})}},M.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new M({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:S.POSITION_ONLY,shadowVolume:!0})},d(M.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=I(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),M}),define("Core/CorridorOutlineGeometry",["./arrayFill","./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function C(e,t){var i,n,l,c=[],d=e.positions,f=e.corners,_=e.endPositions,g=new p,v=0,y=0,C=0;for(n=0;n<d.length;n+=2)l=d[n].length-3,v+=l,C+=l/3*4,y+=d[n+1].length-3;for(v+=3,y+=3,n=0;n<f.length;n++){i=f[n];var b=f[n].leftPositions;u(b)?(l=b.length,v+=l,C+=l/3*2):(l=f[n].rightPositions.length,y+=l,C+=l/3*2)}var S,w=u(_);w&&(S=_[0].length-3,v+=S,y+=S,S/=3,C+=4*S);var x,P,D,I,M,R,O=v+y,L=new Float64Array(O),N=0,F=O-1,B=S/2,k=m.createTypedArray(O/3,C+4),z=0;if(k[z++]=N/3,k[z++]=(F-2)/3,w){c.push(N/3),R=T,M=E;var V=_[0];for(n=0;n<B;n++)R=r.fromArray(V,3*(B-1-n),R),M=r.fromArray(V,3*(B+n),M),s.addAttribute(L,M,N),s.addAttribute(L,R,void 0,F),P=N/3,I=P+1,x=(F-2)/3,D=x-1,k[z++]=x,k[z++]=D,k[z++]=P,k[z++]=I,N+=3,F-=3}var U=0,G=d[U++],H=d[U++];for(L.set(G,N),L.set(H,F-H.length+1),l=H.length-3,c.push(N/3,(F-2)/3),n=0;n<l;n+=3)P=N/3,I=P+1,x=(F-2)/3,D=x-1,k[z++]=x,k[z++]=D,k[z++]=P,k[z++]=I,N+=3,F-=3;for(n=0;n<f.length;n++){var W;i=f[n];var q,Y=i.leftPositions,j=i.rightPositions,X=A;if(u(Y)){for(F-=3,q=D,c.push(I),W=0;W<Y.length/3;W++)X=r.fromArray(Y,3*W,X),k[z++]=q-W-1,k[z++]=q-W,s.addAttribute(L,X,void 0,F),F-=3;c.push(q-Math.floor(Y.length/6)),t===a.BEVELED&&c.push((F-2)/3+1),N+=3}else{for(N+=3,q=I,c.push(D),W=0;W<j.length/3;W++)X=r.fromArray(j,3*W,X),k[z++]=q+W,k[z++]=q+W+1,s.addAttribute(L,X,N),N+=3;c.push(q+Math.floor(j.length/6)),t===a.BEVELED&&c.push(N/3-1),F-=3}for(G=d[U++],H=d[U++],G.splice(0,3),H.splice(H.length-3,3),L.set(G,N),L.set(H,F-H.length+1),l=H.length-3,W=0;W<H.length;W+=3)I=N/3,P=I-1,D=(F-2)/3,x=D+1,k[z++]=x,k[z++]=D,k[z++]=P,k[z++]=I,N+=3,F-=3;N-=3,F+=3,c.push(N/3,(F-2)/3)}if(w){N+=3,F-=3,R=T,M=E;var Q=_[1];for(n=0;n<B;n++)R=r.fromArray(Q,3*(S-n-1),R),M=r.fromArray(Q,3*n,M),s.addAttribute(L,R,void 0,F),s.addAttribute(L,M,N),I=N/3,P=I-1,D=(F-2)/3,x=D+1,k[z++]=x,k[z++]=D,k[z++]=P,k[z++]=I,N+=3,F-=3;c.push(N/3)}else c.push(N/3,(F-2)/3);return k[z++]=N/3,k[z++]=(F-2)/3,g.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:L}),{attributes:g,indices:k,wallIndices:c}}function b(t){var i=t.ellipsoid,r=s.computePositions(t),n=C(r,t.cornerType),a=n.wallIndices,l=t.height,c=t.extrudedHeight,d=n.attributes,p=n.indices,_=d.position.values,v=_.length,y=new Float64Array(v);y.set(_);var b=new Float64Array(2*v);if(_=g.scaleToGeodeticHeight(_,l,i),y=g.scaleToGeodeticHeight(y,c,i),b.set(_),b.set(y,v),d.position.values=b,v/=3,u(t.offsetAttribute)){var S=new Uint8Array(2*v);if(t.offsetAttribute===f.TOP)S=e(S,1,0,v);else{var T=t.offsetAttribute===f.NONE?0:1;S=e(S,T)}d.applyOffset=new h({componentDatatype:o.UNSIGNED_BYTE,componentsPerAttribute:1,values:S})}var E,A=p.length,w=m.createTypedArray(b.length/3,2*(A+a.length));w.set(p);var x=A;for(E=0;E<A;E+=2){var P=p[E],D=p[E+1];w[x++]=P+v,w[x++]=D+v}var I,M;for(E=0;E<a.length;E++)I=a[E],M=I+v,w[x++]=I,w[x++]=M;return{attributes:d,indices:w}}function S(e){e=l(e,l.EMPTY_OBJECT);var t=e.positions,i=e.width,n=l(e.height,0),o=l(e.extrudedHeight,n);this._positions=t,this._ellipsoid=c.clone(l(e.ellipsoid,c.WGS84)),this._width=i,this._height=Math.max(n,o),this._extrudedHeight=Math.min(n,o),this._cornerType=l(e.cornerType,a.ROUNDED),this._granularity=l(e.granularity,_.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.packedLength+c.packedLength+6}var T=new r,E=new r,A=new r;S.pack=function(e,t,i){i=l(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=l(e._offsetAttribute,-1),t};var w=c.clone(c.UNIT_SPHERE),x={positions:void 0,ellipsoid:w,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return S.unpack=function(e,t,i){t=l(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var s=c.unpack(e,t,w);t+=c.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],_=e[t];return u(i)?(i._positions=o,i._ellipsoid=c.clone(s,i._ellipsoid),i._width=d,i._height=h,i._extrudedHeight=p,i._cornerType=f,i._granularity=m,i._offsetAttribute=-1===_?void 0:_,i):(x.positions=o,x.width=d,x.height=h,x.extrudedHeight=p,x.cornerType=f,x.granularity=m,x.offsetAttribute=-1===_?void 0:_,new S(x))},S.createGeometry=function(n){var a=n._positions,l=n._width,c=n._ellipsoid;a=y(a,c);var p=t(a,r.equalsEpsilon);if(!(p.length<2||l<=0)){var m,S=n._height,T=n._extrudedHeight,E=!_.equalsEpsilon(S,T,0,_.EPSILON2),A={ellipsoid:c,positions:p,width:l,cornerType:n._cornerType,granularity:n._granularity,saveAttributes:!1};if(E)A.height=S,A.extrudedHeight=T,A.offsetAttribute=n._offsetAttribute,m=b(A);else{if(m=C(s.computePositions(A),A.cornerType),m.attributes.position.values=g.scaleToGeodeticHeight(m.attributes.position.values,S,c),u(n._offsetAttribute)){var w=m.attributes.position.values.length,x=new Uint8Array(w/3),P=n._offsetAttribute===f.NONE?0:1;e(x,P),m.attributes.applyOffset=new h({componentDatatype:o.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}var D=m.attributes,I=i.fromVertices(D.position.values,void 0,3);return new d({attributes:D,indices:m.indices,primitiveType:v.LINES,boundingSphere:I,offsetAttribute:n._offsetAttribute})}},S}),define("Core/CullingVolume",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./Intersect","./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(1,0,0),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("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,b=g*i,S=v*i;d[p+f]=y,d[p+f+1]=C,d[p+f+2]=l,d[p+m]=b,d[p+m+1]=S,d[p+m+2]=s,p+=3,o&&(d[h++]=y,d[h++]=C,d[h++]=l,d[h++]=b,d[h++]=S,d[h++]=s)}return d},t}),define("Core/CylinderGeometry",["./arrayFill","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],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);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=a(e.vertexFormat,_.DEFAULT),o=a(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=_.clone(n),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}var v=new i,y=new r,C=new r,b=new r,S=new r;g.packedLength=_.packedLength+5,g.pack=function(e,t,i){return i=a(i,0),_.pack(e._vertexFormat,t,i),i+=_.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=a(e._offsetAttribute,-1),t};var T=new _,E={vertexFormat:T,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};g.unpack=function(e,t,i){t=a(t,0);var r=_.unpack(e,t,T);t+=_.packedLength;var n=e[t++],o=e[t++],l=e[t++],u=e[t++],c=e[t];return s(i)?(i._vertexFormat=_.clone(r,i._vertexFormat),i._length=n,i._topRadius=o,i._bottomRadius=l,i._slices=u,i._offsetAttribute=-1===c?void 0:c,i):(E.length=n,E.topRadius=o,E.bottomRadius=l,E.slices=u,E.offsetAttribute=-1===c?void 0:c,new g(E))},g.createGeometry=function(a){var l=a._length,_=a._topRadius,g=a._bottomRadius,T=a._vertexFormat,E=a._slices;if(!(l<=0||_<0||g<0||0===_&&0===g)){var A,w=E+E,x=E+w,P=w+w,D=o.computePositions(l,_,g,E,!0),I=T.st?new Float32Array(2*P):void 0,M=T.normal?new Float32Array(3*P):void 0,R=T.tangent?new Float32Array(3*P):void 0,O=T.bitangent?new Float32Array(3*P):void 0,L=T.normal||T.tangent||T.bitangent;if(L){var N=T.tangent||T.bitangent,F=0,B=0,k=0,z=Math.atan2(g-_,l),V=y;V.z=Math.sin(z);var U=Math.cos(z),G=b,H=C;for(A=0;A<E;A++){var W=A/E*f.TWO_PI,q=U*Math.cos(W),Y=U*Math.sin(W);L&&(V.x=q,V.y=Y,N&&(G=r.normalize(r.cross(r.UNIT_Z,V,G),G)),T.normal&&(M[F++]=V.x,M[F++]=V.y,M[F++]=V.z,M[F++]=V.x,M[F++]=V.y,M[F++]=V.z),T.tangent&&(R[B++]=G.x,R[B++]=G.y,R[B++]=G.z,R[B++]=G.x,R[B++]=G.y,R[B++]=G.z),T.bitangent&&(H=r.normalize(r.cross(V,G,H),H),O[k++]=H.x,O[k++]=H.y,O[k++]=H.z,O[k++]=H.x,O[k++]=H.y,O[k++]=H.z))}for(A=0;A<E;A++)T.normal&&(M[F++]=0,M[F++]=0,M[F++]=-1),T.tangent&&(R[B++]=1,R[B++]=0,R[B++]=0),T.bitangent&&(O[k++]=0,O[k++]=-1,O[k++]=0);for(A=0;A<E;A++)T.normal&&(M[F++]=0,M[F++]=0,M[F++]=1),T.tangent&&(R[B++]=1,R[B++]=0,R[B++]=0),T.bitangent&&(O[k++]=0,O[k++]=1,O[k++]=0)}var j=12*E-12,X=p.createTypedArray(P,j),Q=0,K=0;for(A=0;A<E-1;A++)X[Q++]=K,X[Q++]=K+2,X[Q++]=K+3,X[Q++]=K,X[Q++]=K+3,X[Q++]=K+1,K+=2;for(X[Q++]=w-2,X[Q++]=0,X[Q++]=1,X[Q++]=w-2,X[Q++]=1,X[Q++]=w-1,A=1;A<E-1;A++)X[Q++]=w+A+1,X[Q++]=w+A,X[Q++]=w;for(A=1;A<E-1;A++)X[Q++]=x,X[Q++]=x+A,X[Q++]=x+A+1;var Z=0;if(T.st){var J=Math.max(_,g);for(A=0;A<P;A++){var $=r.fromArray(D,3*A,S);I[Z++]=($.x+J)/(2*J),I[Z++]=($.y+J)/(2*J)}}var ee=new d;T.position&&(ee.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:D})),T.normal&&(ee.normal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:M})),T.tangent&&(ee.tangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:R})),T.bitangent&&(ee.bitangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:O})),T.st&&(ee.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:I})),v.x=.5*l,v.y=Math.max(g,_);var te=new t(r.ZERO,i.magnitude(v));if(s(a._offsetAttribute)){l=D.length;var ie=new Uint8Array(l/3),re=a._offsetAttribute===h.NONE?0:1;e(ie,re),ee.applyOffset=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:1,values:ie})}return new u({attributes:ee,indices:X,primitiveType:m.TRIANGLES,boundingSphere:te,offsetAttribute:a._offsetAttribute})}};var A;return g.getUnitCylinder=function(){return s(A)||(A=g.createGeometry(new g({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),A},g}),define("Core/CylinderOutlineGeometry",["./arrayFill","./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){e=s(e,s.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=s(e.slices,128),o=Math.max(s(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}var g=new i;_.packedLength=6,_.pack=function(e,t,i){return i=s(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i++]=e._numberOfVerticalLines,t[i]=s(e._offsetAttribute,-1),t};var v={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return _.unpack=function(e,t,i){t=s(t,0);var r=e[t++],n=e[t++],o=e[t++],a=e[t++],u=e[t++],c=e[t];return l(i)?(i._length=r,i._topRadius=n,i._bottomRadius=o,i._slices=a,i._numberOfVerticalLines=u,i._offsetAttribute=-1===c?void 0:c,i):(v.length=r,v.topRadius=n,v.bottomRadius=o,v.slices=a,v.numberOfVerticalLines=u,v.offsetAttribute=-1===c?void 0:c,new _(v))},_.createGeometry=function(n){var s=n._length,u=n._topRadius,_=n._bottomRadius,v=n._slices,y=n._numberOfVerticalLines;if(!(s<=0||u<0||_<0||0===u&&0===_)){var C,b=2*v,S=a.computePositions(s,u,_,v,!1),T=2*v;if(y>0){var E=Math.min(y,v);C=Math.round(v/E),T+=E}var A,w=f.createTypedArray(b,2*T),x=0;for(A=0;A<v-1;A++)w[x++]=A,w[x++]=A+1,w[x++]=A+v,w[x++]=A+1+v;if(w[x++]=v-1,w[x++]=0,w[x++]=v+v-1,w[x++]=v,y>0)for(A=0;A<v;A+=C)w[x++]=A,w[x++]=A+v;var P=new h;P.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:S}),g.x=.5*s,g.y=Math.max(_,u);var D=new t(r.ZERO,i.magnitude(g));if(l(n._offsetAttribute)){s=S.length;var I=new Uint8Array(s/3),M=n._offsetAttribute===p.NONE?0:1;e(I,M),P.applyOffset=new d({componentDatatype:o.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new c({attributes:P,indices:w,primitiveType:m.LINES,boundingSphere:D,offsetAttribute:n._offsetAttribute})}},_}),define("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),define("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r){"use strict";function n(t,i){t=e(t,0),this._near=t,i=e(i,Number.MAX_VALUE),this._far=i}return i(n.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}}}),n.packedLength=2,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r]=t.far,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.near=i[r++],o.far=i[r],o},n.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.far===i.far},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.near=e.near,i.far=e.far,i},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n}),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("Core/DoublyLinkedList",["./defined","./defineProperties"],function(e,t){"use strict";function i(){this.head=void 0,this.tail=void 0,this._length=0}function r(e,t,i){this.item=e,this.previous=t,this.next=i}function n(t,i){e(i.previous)&&e(i.next)?(i.previous.next=i.next,i.next.previous=i.previous):e(i.previous)?(i.previous.next=void 0,t.tail=i.previous):e(i.next)?(i.next.previous=void 0,t.head=i.next):(t.head=void 0,t.tail=void 0),i.next=void 0,i.previous=void 0}return t(i.prototype,{length:{get:function(){return this._length}}}),i.prototype.add=function(t){var i=new r(t,this.tail,void 0);return e(this.tail)?(this.tail.next=i,this.tail=i):(this.head=i,this.tail=i),++this._length,i},i.prototype.remove=function(t){e(t)&&(n(this,t),--this._length)},i.prototype.splice=function(e,t){if(e!==t){n(this,t);var i=e.next;e.next=t,this.tail===e?this.tail=t:i.previous=t,t.next=i,t.previous=e}},i}),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);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();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 b in t)r[b]=parseFloat(t[b],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;!1===g&&(null!==_&&_.call(i),g=!0);var u=(e-h)/a;u=u>1?1:u;var C=p(u);for(t in n){var b=r[t]||0,S=n[t];S instanceof Array?i[t]=f(S,C):("string"==typeof S&&(S=b+parseFloat(S,10)),"number"==typeof S&&(i[t]=b+(S-b)*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 T=o[t];o[t]=n[t],n[t]=T}r[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(i);for(var E=0,A=m.length;E<A;E++)m[E].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*(2-Math.pow(2,-10*(e-1)))}},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;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},Out:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},InOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*.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?e*e*((t+1)*e-t)*.5:.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;return(2*t-2*i+o+a)*(n*s)+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),define("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";return t({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})}),define("Core/EllipsoidGeometry",["./arrayFill","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.radii,T),i=Math.round(o(e.stackPartitions,64)),n=Math.round(o(e.slicePartitions,64)),a=o(e.vertexFormat,_.DEFAULT);this._radii=r.clone(t),this._stackPartitions=i,this._slicePartitions=n,this._vertexFormat=_.clone(a),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}var v=new r,y=new r,C=new r,b=new r,S=new r,T=new r(1,1,1),E=Math.cos,A=Math.sin;g.packedLength=r.packedLength+_.packedLength+3,g.pack=function(e,t,i){return i=o(i,0),r.pack(e._radii,t,i),i+=r.packedLength,_.pack(e._vertexFormat,t,i),i+=_.packedLength,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i]=o(e._offsetAttribute,-1),t};var w=new r,x=new _,P={radii:w,vertexFormat:x,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};g.unpack=function(e,t,i){t=o(t,0);var n=r.unpack(e,t,w);t+=r.packedLength;var s=_.unpack(e,t,x);t+=_.packedLength;var l=e[t++],u=e[t++],c=e[t];return a(i)?(i._radii=r.clone(n,i._radii),i._vertexFormat=_.clone(s,i._vertexFormat),i._stackPartitions=l,i._slicePartitions=u,i._offsetAttribute=-1===c?void 0:c,i):(P.stackPartitions=l,P.slicePartitions=u,P.offsetAttribute=-1===c?void 0:c,new g(P))},g.createGeometry=function(o){var s=o._radii;if(!(s.x<=0||s.y<=0||s.z<=0)){var _,g,T=l.fromCartesian3(s),w=o._vertexFormat,x=o._slicePartitions+1,P=o._stackPartitions+1,D=P*x,I=new Float64Array(3*D),M=6*(x-1)*(P-2),R=p.createTypedArray(D,M),O=w.normal?new Float32Array(3*D):void 0,L=w.tangent?new Float32Array(3*D):void 0,N=w.bitangent?new Float32Array(3*D):void 0,F=w.st?new Float32Array(2*D):void 0,B=new Array(x),k=new Array(x),z=0;for(_=0;_<x;_++){var V=f.TWO_PI*_/(x-1);B[_]=E(V),k[_]=A(V),I[z++]=0,I[z++]=0,I[z++]=s.z}for(_=1;_<P-1;_++){var U=Math.PI*_/(P-1),G=A(U),H=s.x*G,W=s.y*G,q=s.z*E(U);for(g=0;g<x;g++)I[z++]=B[g]*H,I[z++]=k[g]*W,I[z++]=q}for(_=0;_<x;_++)I[z++]=0,I[z++]=0,I[z++]=-s.z;var Y=new d;w.position&&(Y.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:I}));var j=0,X=0,Q=0,K=0;if(w.st||w.normal||w.tangent||w.bitangent){for(_=0;_<D;_++){var Z=r.fromArray(I,3*_,v),J=T.geodeticSurfaceNormal(Z,y);if(w.st){var $=i.negate(J,S);i.magnitude($)<f.EPSILON6&&(z=3*(_+x*Math.floor(.5*P)),z>I.length&&(z=3*(_-x*Math.floor(.5*P))),r.fromArray(I,z,$),T.geodeticSurfaceNormal($,$),i.negate($,$)),F[j++]=Math.atan2($.y,$.x)/f.TWO_PI+.5,F[j++]=Math.asin(J.z)/Math.PI+.5}if(w.normal&&(O[X++]=J.x,O[X++]=J.y,O[X++]=J.z),w.tangent||w.bitangent){var ee=C;if(_<x||_>D-x-1?(r.cross(r.UNIT_X,J,ee),r.normalize(ee,ee)):(r.cross(r.UNIT_Z,J,ee),r.normalize(ee,ee)),w.tangent&&(L[Q++]=ee.x,L[Q++]=ee.y,L[Q++]=ee.z),w.bitangent){var te=r.cross(J,ee,b);r.normalize(te,te),N[K++]=te.x,N[K++]=te.y,N[K++]=te.z}}}w.st&&(Y.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:F})),w.normal&&(Y.normal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:O})),w.tangent&&(Y.tangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),w.bitangent&&(Y.bitangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:N}))}if(a(o._offsetAttribute)){var ie=I.length,re=new Uint8Array(ie/3),ne=o._offsetAttribute===h.NONE?0:1;e(re,ne),Y.applyOffset=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:1,values:re})}for(z=0,g=0;g<x-1;g++)R[z++]=x+g,R[z++]=x+g+1,R[z++]=g+1;var oe,ae;for(_=1;_<P-2;_++)for(oe=_*x,ae=(_+1)*x,g=0;g<x-1;g++)R[z++]=ae+g,R[z++]=ae+g+1,R[z++]=oe+g+1,R[z++]=ae+g,R[z++]=oe+g+1,R[z++]=oe+g;for(_=P-2,oe=_*x,ae=(_+1)*x,g=0;g<x-1;g++)R[z++]=ae+g,R[z++]=oe+g+1,R[z++]=oe+g;return new u({attributes:Y,indices:R,primitiveType:m.TRIANGLES,boundingSphere:t.fromEllipsoid(T),offsetAttribute:o._offsetAttribute})}};var D;return g.getUnitEllipsoid=function(){return a(D)||(D=g.createGeometry(new g({radii:new r(1,1,1),vertexFormat:_.POSITION_ONLY}))),D},g}),define("Core/EllipsoidOutlineGeometry",["./arrayFill","./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./Math","./PrimitiveType"],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,_),r=Math.round(n(e.stackPartitions,10)),o=Math.round(n(e.slicePartitions,8)),a=Math.round(n(e.subdivisions,128));this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._subdivisions=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}var _=new i(1,1,1),g=Math.cos,v=Math.sin;m.packedLength=i.packedLength+4,m.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,t[r++]=e._stackPartitions,t[r++]=e._slicePartitions,t[r++]=e._subdivisions,t[r]=n(e._offsetAttribute,-1),t};var y=new i,C={radii:y,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};return m.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,y);t+=i.packedLength;var s=e[t++],l=e[t++],u=e[t++],c=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._stackPartitions=s,r._slicePartitions=l,r._subdivisions=u,r._offsetAttribute=-1===c?void 0:c,r):(C.stackPartitions=s,C.slicePartitions=l,C.subdivisions=u,C.offsetAttribute=-1===c?void 0:c,new m(C))},m.createGeometry=function(i){var n=i._radii;if(!(n.x<=0||n.y<=0||n.z<=0)){var a,m,_,y,C,b,S=s.fromCartesian3(n),T=i._stackPartitions,E=i._slicePartitions,A=i._subdivisions,w=A*(T+E-1),x=w-E+2,P=new Float64Array(3*x),D=h.createTypedArray(x,2*w),I=0,M=new Array(A),R=new Array(A);for(a=0;a<A;a++)_=p.TWO_PI*a/A,M[a]=g(_),R[a]=v(_);for(a=1;a<T;a++)for(y=Math.PI*a/T,C=g(y),b=v(y),m=0;m<A;m++)P[I++]=n.x*M[m]*b,P[I++]=n.y*R[m]*b,P[I++]=n.z*C;for(M.length=E,R.length=E,a=0;a<E;a++)_=p.TWO_PI*a/E,M[a]=g(_),R[a]=v(_);for(P[I++]=0,P[I++]=0,P[I++]=n.z,a=1;a<A;a++)for(y=Math.PI*a/A,C=g(y),b=v(y),m=0;m<E;m++)P[I++]=n.x*M[m]*b,
- P[I++]=n.y*R[m]*b,P[I++]=n.z*C;for(P[I++]=0,P[I++]=0,P[I++]=-n.z,I=0,a=0;a<T-1;++a){var O=a*A;for(m=0;m<A-1;++m)D[I++]=O+m,D[I++]=O+m+1;D[I++]=O+A-1,D[I++]=O}var L=A*(T-1);for(m=1;m<E+1;++m)D[I++]=L,D[I++]=L+m;for(a=0;a<A-2;++a){var N=a*E+1+L,F=(a+1)*E+1+L;for(m=0;m<E-1;++m)D[I++]=F+m,D[I++]=N+m;D[I++]=F+E-1,D[I++]=N+E-1}var B=P.length/3-1;for(m=B-1;m>B-E-1;--m)D[I++]=B,D[I++]=m;var k=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:P})});if(o(i._offsetAttribute)){var z=P.length,V=new Uint8Array(z/3),U=i._offsetAttribute===d.NONE?0:1;e(V,U),k.applyOffset=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new l({attributes:k,indices:D,primitiveType:f.LINES,boundingSphere:t.fromEllipsoid(S),offsetAttribute:i._offsetAttribute})}},m}),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(t,i,r,n){return e.resolve(new s({buffer:new Uint8Array(256),width:16,height:16}))},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,i){},u.prototype.loadTileDataAvailability=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";return e({NONE:0,HOLD:1,EXTRAPOLATE:2})}),define("Core/OrthographicOffCenterFrustum",["./Cartesian3","./Cartesian4","./CullingVolume","./defaultValue","./defined","./defineProperties","./DeveloperError","./Math","./Matrix4"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=r(e,r.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=r(e.near,1),this._near=this.near,this.far=r(e.far,5e8),this._far=this.far,this._cullingVolume=new i,this._orthographicMatrix=new l}function c(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=l.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}o(u.prototype,{projectionMatrix:{get:function(){return c(this),this._orthographicMatrix}}});var d=new e,h=new e,p=new e,f=new e;return u.prototype.computeCullingVolume=function(i,r,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,m=this.near,_=this.far,g=e.cross(r,o,d);e.normalize(g,g);var v=h;e.multiplyByScalar(r,m,v),e.add(i,v,v);var y=p;e.multiplyByScalar(g,c,y),e.add(v,y,y);var C=a[0];return n(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,u,y),e.add(v,y,y),C=a[1],n(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,f),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],n(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],n(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,f),y),C=a[4],n(C)||(C=a[4]=new t),C.x=r.x,C.y=r.y,C.z=r.z,C.w=-e.dot(r,v),e.multiplyByScalar(r,_,y),e.add(i,y,y),C=a[5],n(C)||(C=a[5]=new t),C.x=-r.x,C.y=-r.y,C.z=-r.z,C.w=-e.dot(e.negate(r,f),y),this._cullingVolume},u.prototype.getPixelDimensions=function(e,t,i,r){c(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},u.prototype.clone=function(e){return n(e)||(e=new u),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},u.prototype.equals=function(e){return n(e)&&e instanceof u&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},u.prototype.equalsEpsilon=function(e,t,i){return e===this||n(e)&&e instanceof u&&s.equalsEpsilon(this.right,e.right,t,i)&&s.equalsEpsilon(this.left,e.left,t,i)&&s.equalsEpsilon(this.top,e.top,t,i)&&s.equalsEpsilon(this.bottom,e.bottom,t,i)&&s.equalsEpsilon(this.near,e.near,t,i)&&s.equalsEpsilon(this.far,e.far,t,i)},u}),define("Core/OrthographicFrustum",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Math","./OrthographicOffCenterFrustum"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._offCenterFrustum=new a,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=t(e.near,1),this._near=this.near,this.far=t(e.far,5e8),this._far=this.far}function l(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;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 s.packedLength=4,s.pack=function(e,i,r){return r=t(r,0),i[r++]=e.width,i[r++]=e.aspectRatio,i[r++]=e.near,i[r]=e.far,i},s.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n.width=e[r++],n.aspectRatio=e[r++],n.near=e[r++],n.far=e[r],n},r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._offCenterFrustum.projectionMatrix}}}),s.prototype.computeCullingVolume=function(e,t,i){return l(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},s.prototype.getPixelDimensions=function(e,t,i,r){return l(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},s.prototype.clone=function(e){return i(e)||(e=new s),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},s.prototype.equals=function(e){return!!(i(e)&&e instanceof s)&&(l(this),l(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},s.prototype.equalsEpsilon=function(e,t,r){return!!(i(e)&&e instanceof s)&&(l(this),l(e),o.equalsEpsilon(this.width,e.width,t,r)&&o.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,r)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,r))},s}),define("Core/PerspectiveOffCenterFrustum",["./Cartesian3","./Cartesian4","./CullingVolume","./defaultValue","./defined","./defineProperties","./DeveloperError","./Math","./Matrix4"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=r(e,r.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=r(e.near,1),this._near=this.near,this.far=r(e.far,5e8),this._far=this.far,this._cullingVolume=new i,this._perspectiveMatrix=new l,this._infinitePerspective=new l}function c(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,o=e.near,a=e.far;t===e._top&&i===e._bottom&&n===e._left&&r===e._right&&o===e._near&&a===e._far||(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=o,e._far=a,e._perspectiveMatrix=l.computePerspectiveOffCenter(n,r,i,t,o,a,e._perspectiveMatrix),e._infinitePerspective=l.computeInfinitePerspectiveOffCenter(n,r,i,t,o,e._infinitePerspective))}o(u.prototype,{projectionMatrix:{get:function(){return c(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return c(this),this._infinitePerspective}}});var d=new e,h=new e,p=new e,f=new e;return u.prototype.computeCullingVolume=function(i,r,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,m=this.near,_=this.far,g=e.cross(r,o,d),v=h;e.multiplyByScalar(r,m,v),e.add(i,v,v);var y=p;e.multiplyByScalar(r,_,y),e.add(i,y,y);var C=f;e.multiplyByScalar(g,c,C),e.add(v,C,C),e.subtract(C,i,C),e.normalize(C,C),e.cross(C,o,C),e.normalize(C,C);var b=a[0];return n(b)||(b=a[0]=new t),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-e.dot(C,i),e.multiplyByScalar(g,u,C),e.add(v,C,C),e.subtract(C,i,C),e.cross(o,C,C),e.normalize(C,C),b=a[1],n(b)||(b=a[1]=new t),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-e.dot(C,i),e.multiplyByScalar(o,l,C),e.add(v,C,C),e.subtract(C,i,C),e.cross(g,C,C),e.normalize(C,C),b=a[2],n(b)||(b=a[2]=new t),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-e.dot(C,i),e.multiplyByScalar(o,s,C),e.add(v,C,C),e.subtract(C,i,C),e.cross(C,g,C),e.normalize(C,C),b=a[3],n(b)||(b=a[3]=new t),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-e.dot(C,i),b=a[4],n(b)||(b=a[4]=new t),b.x=r.x,b.y=r.y,b.z=r.z,b.w=-e.dot(r,v),e.negate(r,C),b=a[5],n(b)||(b=a[5]=new t),b.x=C.x,b.y=C.y,b.z=C.z,b.w=-e.dot(C,y),this._cullingVolume},u.prototype.getPixelDimensions=function(e,t,i,r){c(this);var n=1/this.near,o=this.top*n,a=2*i*o/t;o=this.right*n;var s=2*i*o/e;return r.x=s,r.y=a,r},u.prototype.clone=function(e){return n(e)||(e=new u),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},u.prototype.equals=function(e){return n(e)&&e instanceof u&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},u.prototype.equalsEpsilon=function(e,t,i){return e===this||n(e)&&e instanceof u&&s.equalsEpsilon(this.right,e.right,t,i)&&s.equalsEpsilon(this.left,e.left,t,i)&&s.equalsEpsilon(this.top,e.top,t,i)&&s.equalsEpsilon(this.bottom,e.bottom,t,i)&&s.equalsEpsilon(this.near,e.near,t,i)&&s.equalsEpsilon(this.far,e.far,t,i)},u}),define("Core/PerspectiveFrustum",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Math","./PerspectiveOffCenterFrustum"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._offCenterFrustum=new a,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=t(e.near,1),this._near=this.near,this.far=t(e.far,5e8),this._far=this.far,this.xOffset=t(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=t(e.yOffset,0),this._yOffset=this.yOffset}function l(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 s.packedLength=6,s.pack=function(e,i,r){return r=t(r,0),i[r++]=e.fov,i[r++]=e.aspectRatio,i[r++]=e.near,i[r++]=e.far,i[r++]=e.xOffset,i[r]=e.yOffset,i},s.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n.fov=e[r++],n.aspectRatio=e[r++],n.near=e[r++],n.far=e[r++],n.xOffset=e[r++],n.yOffset=e[r],n},r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return l(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return l(this),this._fovy}},sseDenominator:{get:function(){return l(this),this._sseDenominator}}}),s.prototype.computeCullingVolume=function(e,t,i){return l(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},s.prototype.getPixelDimensions=function(e,t,i,r){return l(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},s.prototype.clone=function(e){return i(e)||(e=new s),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},s.prototype.equals=function(e){return!!(i(e)&&e instanceof s)&&(l(this),l(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},s.prototype.equalsEpsilon=function(e,t,r){return!!(i(e)&&e instanceof s)&&(l(this),l(e),o.equalsEpsilon(this.fov,e.fov,t,r)&&o.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,r)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,r))},s}),define("Core/FrustumGeometry",["./BoundingSphere","./Cartesian3","./Cartesian4","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./Matrix3","./Matrix4","./OrthographicFrustum","./PerspectiveFrustum","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){var i,r,n=e.frustum,a=e.orientation,s=e.origin,l=o(e.vertexFormat,_.DEFAULT),u=o(e._drawNearPlane,!0);n instanceof p?(i=y,r=p.packedLength):n instanceof h&&(i=C,r=h.packedLength),this._frustumType=i,this._frustum=n.clone(),this._origin=t.clone(s),this._orientation=m.clone(a),this._drawNearPlane=u,this._vertexFormat=l,this._workerName="createFrustumGeometry",this.packedLength=2+r+t.packedLength+m.packedLength+_.packedLength}function v(e,t,i,r,n,o,s,l){for(var u=e/3*2,c=0;c<4;++c)a(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),a(i)&&(i[e]=s.x,i[e+1]=s.y,i[e+2]=s.z),a(r)&&(r[e]=l.x,r[e+1]=l.y,r[e+2]=l.z),e+=3;n[u]=0,n[u+1]=0,n[u+2]=1,n[u+3]=0,n[u+4]=1,n[u+5]=1,n[u+6]=0,n[u+7]=1}var y=0,C=1;g.pack=function(e,i,r){r=o(r,0);var n=e._frustumType,a=e._frustum;return i[r++]=n,n===y?(p.pack(a,i,r),r+=p.packedLength):(h.pack(a,i,r),r+=h.packedLength),t.pack(e._origin,i,r),r+=t.packedLength,m.pack(e._orientation,i,r),r+=m.packedLength,_.pack(e._vertexFormat,i,r),r+=_.packedLength,i[r]=e._drawNearPlane?1:0,i};var b=new p,S=new h,T=new m,E=new t,A=new _;g.unpack=function(e,i,r){i=o(i,0);var n,s=e[i++];s===y?(n=p.unpack(e,i,b),i+=p.packedLength):(n=h.unpack(e,i,S),i+=h.packedLength);var l=t.unpack(e,i,E);i+=t.packedLength;var u=m.unpack(e,i,T);i+=m.packedLength;var c=_.unpack(e,i,A);i+=_.packedLength;var d=1===e[i];if(!a(r))return new g({frustum:n,origin:l,orientation:u,vertexFormat:c,_drawNearPlane:d});var f=s===r._frustumType?r._frustum:void 0;return r._frustum=n.clone(f),r._frustumType=s,r._origin=t.clone(l,r._origin),r._orientation=m.clone(u,r._orientation),r._vertexFormat=_.clone(c,r._vertexFormat),r._drawNearPlane=d,r};var w=new c,x=new d,P=new d,D=new t,I=new t,M=new t,R=new t,O=new t,L=new t,N=new Array(3),F=new Array(4);F[0]=new i(-1,-1,1,1),F[1]=new i(1,-1,1,1),F[2]=new i(1,1,1,1),F[3]=new i(-1,1,1,1);for(var B=new Array(4),k=0;k<4;++k)B[k]=new i;return g._computeNearFarPlanes=function(e,r,n,s,l,u,h,p){var f=c.fromQuaternion(r,w),m=o(u,D),_=o(h,I),g=o(p,M);m=c.getColumn(f,0,m),_=c.getColumn(f,1,_),g=c.getColumn(f,2,g),t.normalize(m,m),t.normalize(_,_),t.normalize(g,g),t.negate(m,m);var v,C,b=d.computeView(e,g,_,m,x);if(n===y){var S=s.projectionMatrix,T=d.multiply(S,b,P);C=d.inverse(T,P)}else v=d.inverseTransformation(b,P);a(C)?(N[0]=s.near,N[1]=s.far):(N[0]=0,N[1]=s.near,N[2]=s.far);for(var E=0;E<2;++E)for(var A=0;A<4;++A){var R=i.clone(F[A],B[A]);if(a(C)){R=d.multiplyByVector(C,R,R);var O=1/R.w;t.multiplyByScalar(R,O,R),t.subtract(R,e,R),t.normalize(R,R);var L=t.dot(g,R);t.multiplyByScalar(R,N[E]/L,R),t.add(R,e,R)}else{a(s._offCenterFrustum)&&(s=s._offCenterFrustum);var k=N[E],z=N[E+1];R.x=.5*(R.x*(s.right-s.left)+s.left+s.right),R.y=.5*(R.y*(s.top-s.bottom)+s.bottom+s.top),R.z=.5*(R.z*(k-z)-k-z),R.w=1,d.multiplyByVector(v,R,R)}l[12*E+3*A]=R.x,l[12*E+3*A+1]=R.y,l[12*E+3*A+2]=R.z}},g.createGeometry=function(i){var r=i._frustumType,o=i._frustum,c=i._origin,d=i._orientation,h=i._drawNearPlane,p=i._vertexFormat,m=h?6:5,_=new Float64Array(72);g._computeNearFarPlanes(c,d,r,o,_);var y=24;_[y]=_[12],_[y+1]=_[13],_[y+2]=_[14],_[y+3]=_[0],_[y+4]=_[1],_[y+5]=_[2],_[y+6]=_[9],_[y+7]=_[10],_[y+8]=_[11],_[y+9]=_[21],_[y+10]=_[22],_[y+11]=_[23],y+=12,_[y]=_[15],_[y+1]=_[16],_[y+2]=_[17],_[y+3]=_[3],_[y+4]=_[4],_[y+5]=_[5],_[y+6]=_[0],_[y+7]=_[1],_[y+8]=_[2],_[y+9]=_[12],_[y+10]=_[13],_[y+11]=_[14],y+=12,_[y]=_[3],_[y+1]=_[4],_[y+2]=_[5],_[y+3]=_[15],_[y+4]=_[16],_[y+5]=_[17],_[y+6]=_[18],_[y+7]=_[19],_[y+8]=_[20],_[y+9]=_[6],_[y+10]=_[7],_[y+11]=_[8],y+=12,_[y]=_[6],_[y+1]=_[7],_[y+2]=_[8],_[y+3]=_[18],_[y+4]=_[19],_[y+5]=_[20],_[y+6]=_[21],_[y+7]=_[22],_[y+8]=_[23],_[y+9]=_[9],_[y+10]=_[10],_[y+11]=_[11],h||(_=_.subarray(12));var C=new u({position:new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){var b=a(p.normal)?new Float32Array(12*m):void 0,S=a(p.tangent)?new Float32Array(12*m):void 0,T=a(p.bitangent)?new Float32Array(12*m):void 0,E=a(p.st)?new Float32Array(8*m):void 0,A=D,w=I,x=M,P=t.negate(A,R),N=t.negate(w,O),F=t.negate(x,L);y=0,h&&(v(y,b,S,T,E,F,A,w),y+=12),v(y,b,S,T,E,x,P,w),y+=12,v(y,b,S,T,E,P,F,w),y+=12,v(y,b,S,T,E,N,F,P),y+=12,v(y,b,S,T,E,A,x,w),y+=12,v(y,b,S,T,E,w,x,P),a(b)&&(C.normal=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),a(S)&&(C.tangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),a(T)&&(C.bitangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),a(E)&&(C.st=new l({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:E}))}for(var B=new Uint16Array(6*m),k=0;k<m;++k){var z=6*k,V=4*k;B[z]=V,B[z+1]=V+1,B[z+2]=V+2,B[z+3]=V,B[z+4]=V+2,B[z+5]=V+3}return new s({attributes:C,indices:B,primitiveType:f.TRIANGLES,boundingSphere:e.fromVertices(_)})},g}),define("Core/FrustumOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./FrustumGeometry","./Geometry","./GeometryAttribute","./GeometryAttributes","./OrthographicFrustum","./PerspectiveFrustum","./PrimitiveType","./Quaternion"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){var i,r,o=e.frustum,a=e.orientation,s=e.origin,l=n(e._drawNearPlane,!0);o instanceof d?(i=m,r=d.packedLength):o instanceof c&&(i=_,r=c.packedLength),this._frustumType=i,this._frustum=o.clone(),this._origin=t.clone(s),this._orientation=p.clone(a),this._drawNearPlane=l,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+r+t.packedLength+p.packedLength}var m=0,_=1;f.pack=function(e,i,r){r=n(r,0);var o=e._frustumType,a=e._frustum;return i[r++]=o,o===m?(d.pack(a,i,r),r+=d.packedLength):(c.pack(a,i,r),r+=c.packedLength),t.pack(e._origin,i,r),r+=t.packedLength,p.pack(e._orientation,i,r),r+=p.packedLength,i[r]=e._drawNearPlane?1:0,i};var g=new d,v=new c,y=new p,C=new t;return f.unpack=function(e,i,r){i=n(i,0);var a,s=e[i++];s===m?(a=d.unpack(e,i,g),i+=d.packedLength):(a=c.unpack(e,i,v),i+=c.packedLength);var l=t.unpack(e,i,C);i+=t.packedLength;var u=p.unpack(e,i,y);i+=p.packedLength;var h=1===e[i];if(!o(r))return new f({frustum:a,origin:l,orientation:u,_drawNearPlane:h});var _=s===r._frustumType?r._frustum:void 0;return r._frustum=a.clone(_),r._frustumType=s,r._origin=t.clone(l,r._origin),r._orientation=p.clone(u,r._orientation),r._drawNearPlane=h,r},f.createGeometry=function(t){var i=t._frustumType,n=t._frustum,o=t._origin,c=t._orientation,d=t._drawNearPlane,p=new Float64Array(24);a._computeNearFarPlanes(o,c,i,n,p);for(var f,m,_=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})}),g=d?2:1,v=new Uint16Array(8*(g+1)),y=d?0:1;y<2;++y)f=d?8*y:0,m=4*y,v[f]=m,v[f+1]=m+1,v[f+2]=m+1,v[f+3]=m+2,v[f+4]=m+2,v[f+5]=m+3,v[f+6]=m+3,v[f+7]=m;for(y=0;y<2;++y)f=8*(g+y),m=4*y,v[f]=m,v[f+1]=m+4,v[f+2]=m+1,v[f+3]=m+5,v[f+4]=m+2,v[f+5]=m+6,v[f+6]=m+3,v[f+7]=m+7;return new s({attributes:_,indices:v,primitiveType:h.LINES,boundingSphere:e.fromVertices(p)})},f}),define("Core/GeocodeType",["../Core/freezeObject"],function(e){"use strict";return e({SEARCH:0,AUTOCOMPLETE:1})}),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}),function(global,undefined){"use strict";!function(e,t,i){function r(i){var n=t[i];return n||e[i][0].call(n=t[i]={exports:{}},r,n,n.exports),n.exports}var n=global.protobuf=r(i[0]);"function"==typeof define&&define.amd&&define("ThirdParty/protobuf-minimal",[],function(){return n.configure(),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}({1:[function(e,t,i){function r(e,t){for(var i=[],r=2;r<arguments.length;)i.push(arguments[r++]);var n=!0;return new Promise(function(r,o){i.push(function(e){if(n)if(n=!1,e)o(e);else{for(var t=[],i=1;i<arguments.length;)t.push(arguments[i++]);r.apply(null,t)}});try{e.apply(t||this,i)}catch(e){n&&(n=!1,o(e))}})}t.exports=r},{}],2:[function(e,t,i){var r=i;r.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var n=new Array(64),o=new Array(123),a=0;a<64;)o[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;r.encode=function(e,t,i){for(var r,o=[],a=0,s=0;t<i;){var l=e[t++];switch(s){case 0:o[a++]=n[l>>2],r=(3&l)<<4,s=1;break;case 1:o[a++]=n[r|l>>4],r=(15&l)<<2,s=2;break;case 2:o[a++]=n[r|l>>6],o[a++]=n[63&l],s=0}}return s&&(o[a++]=n[r],o[a]=61,1===s&&(o[a+1]=61)),String.fromCharCode.apply(String,o)};r.decode=function(e,t,i){for(var r,n=i,a=0,s=0;s<e.length;){var l=e.charCodeAt(s++);if(61===l&&a>1)break;if((l=o[l])===undefined)throw Error("invalid encoding");switch(a){case 0:r=l,a=1;break;case 1:t[i++]=r<<2|(48&l)>>4,r=l,a=2;break;case 2:t[i++]=(15&r)<<4|(60&l)>>2,r=l,a=3;break;case 3:t[i++]=(3&r)<<6|l,a=0}}if(1===a)throw Error("invalid encoding");return i-n},r.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)}},{}],3:[function(e,t,i){function r(){this._listeners={}}t.exports=r,r.prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},r.prototype.off=function(e,t){if(e===undefined)this._listeners={};else if(t===undefined)this._listeners[e]=[];else for(var i=this._listeners[e],r=0;r<i.length;)i[r].fn===t?i.splice(r,1):++r;return this},r.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,i)}return this}},{}],4:[function(require,module,exports){function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},{}],5:[function(e,t,i){function r(e,t,i){var r=i||8192,n=r>>>1,o=null,a=r;return function(i){if(i<1||i>n)return e(i);a+i>r&&(o=e(r),a=0);var s=t.call(o,a,a+=i);return 7&a&&(a=1+(7|a)),s}}t.exports=r},{}],6:[function(e,t,i){var r=i;r.length=function(e){for(var t=0,i=0,r=0;r<e.length;++r)i=e.charCodeAt(r),i<128?t+=1:i<2048?t+=2:55296==(64512&i)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},r.read=function(e,t,i){if(i-t<1)return"";for(var r,n=null,o=[],a=0;t<i;)r=e[t++],r<128?o[a++]=r:r>191&&r<224?o[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),a=0);return n?(a&&n.push(String.fromCharCode.apply(String,o.slice(0,a))),n.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(e,t,i){for(var r,n,o=i,a=0;a<e.length;++a)r=e.charCodeAt(a),r<128?t[i++]=r:r<2048?(t[i++]=r>>6|192,t[i++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&n),++a,t[i++]=r>>18|240,t[i++]=r>>12&63|128,t[i++]=r>>6&63|128,t[i++]=63&r|128):(t[i++]=r>>12|224,t[i++]=r>>6&63|128,t[i++]=63&r|128);return i-o}},{}],7:[function(e,t,i){function r(){n.Reader._configure(n.BufferReader),n.util._configure()}var n=i;n.build="minimal",n.roots={},n.Writer=e(14),n.BufferWriter=e(15),n.Reader=e(8),n.BufferReader=e(9),n.util=e(13),n.rpc=e(10),n.configure=r,n.Writer._configure(n.BufferWriter),r()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,i){function r(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new c(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw r(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw r(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function a(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function s(){if(this.pos+8>this.len)throw r(this,8);return new c(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}t.exports=n;var l,u=e(13),c=u.LongBits,d=u.utf8,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new n(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new n(e);throw Error("illegal buffer")};n.create=u.Buffer?function(e){return(n.create=function(e){return u.Buffer.isBuffer(e)?new l(e):h(e)})(e)}:h,n.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,n.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return e}}(),n.prototype.int32=function(){return 0|this.uint32()},n.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},n.prototype.bool=function(){return 0!==this.uint32()},n.prototype.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return a(this.buf,this.pos+=4)},n.prototype.sfixed32=function(){if(this.pos+4>this.len)throw r(this,4);return 0|a(this.buf,this.pos+=4)};var p="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(i,r){return t[0]=i[r],t[1]=i[r+1],t[2]=i[r+2],t[3]=i[r+3],e[0]}:function(i,r){return t[0]=i[r+3],t[1]=i[r+2],t[2]=i[r+1],t[3]=i[r],e[0]}}():function(e,t){var i=a(e,t+4),r=2*(i>>31)+1,n=i>>>23&255,o=8388607&i;return 255===n?o?NaN:r*(1/0):0===n?1.401298464324817e-45*r*o:r*Math.pow(2,n-150)*(o+8388608)};n.prototype.float=function(){if(this.pos+4>this.len)throw r(this,4);var e=p(this.buf,this.pos);return this.pos+=4,e};var f="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(i,r){return t[0]=i[r],t[1]=i[r+1],t[2]=i[r+2],t[3]=i[r+3],t[4]=i[r+4],t[5]=i[r+5],t[6]=i[r+6],t[7]=i[r+7],e[0]}:function(i,r){return t[0]=i[r+7],t[1]=i[r+6],t[2]=i[r+5],t[3]=i[r+4],t[4]=i[r+3],t[5]=i[r+2],t[6]=i[r+1],t[7]=i[r],e[0]}}():function(e,t){var i=a(e,t+4),r=a(e,t+8),n=2*(r>>31)+1,o=r>>>20&2047,s=4294967296*(1048575&r)+i;return 2047===o?s?NaN:n*(1/0):0===o?5e-324*n*s:n*Math.pow(2,o-1075)*(s+4503599627370496)};n.prototype.double=function(){if(this.pos+8>this.len)throw r(this,4);var e=f(this.buf,this.pos);return this.pos+=8,e},n.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw r(this,e);return this.pos+=e,t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},n.prototype.string=function(){var e=this.bytes();return d.read(e,0,e.length)},n.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw r(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw r(this)}while(128&this.buf[this.pos++]);return this},n.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},n._configure=function(e){l=e;var t=u.Long?"toLong":"toNumber";u.merge(n.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return s.call(this)[t](!0)},sfixed64:function(){return s.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,i){function r(e){n.call(this,e)}t.exports=r;var n=e(8);(r.prototype=Object.create(n.prototype)).constructor=r;var o=e(13);o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice),r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,i){i.Service=e(11)},{11:11}],11:[function(e,t,i){function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}t.exports=r;var n=e(13);(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function e(t,i,r,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,i,r,o);if(!s.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined;try{return s.rpcImpl(t,i[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,i){if(e)return s.emit("error",e,t),a(e);if(null===i)return s.end(!0),undefined;if(!(i instanceof r))try{i=r[s.responseDelimited?"decodeDelimited":"decode"](i)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",i,t),a(null,i)})}catch(e){return s.emit("error",e,t),setTimeout(function(){a(e)},0),undefined}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,i){function r(e,t){this.lo=e>>>0,this.hi=t>>>0}t.exports=r;var n=e(13),o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e)
- ;var i=e>>>0,n=(e-i)/4294967296>>>0;return t&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(e){if("number"==typeof e)return r.fromNumber(e);if(n.isString(e)){if(!n.Long)return r.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):o},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?o:new r((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},{13:13}],13:[function(e,t,i){function r(e,t,i){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]!==undefined&&i||(e[r[n]]=t[r[n]]);return e}function n(e){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&r(this,i)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}var o=i;o.asPromise=e(1),o.base64=e(2),o.EventEmitter=e(3),o.inquire=e(4),o.utf8=e(6),o.pool=e(5),o.LongBits=e(12),o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=global.dcodeIO&&global.dcodeIO.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var i=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},o.merge=r,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=n,o.ProtocolError=n("ProtocolError"),o.oneOfGetter=function(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=1;return function(){for(var e=Object.keys(this),i=e.length-1;i>-1;--i)if(1===t[e[i]]&&this[e[i]]!==undefined&&null!==this[e[i]])return e[i]}},o.oneOfSetter=function(e){return function(t){for(var i=0;i<e.length;++i)e[i]!==t&&delete this[e[i]]}},o.lazyResolve=function(e,t){for(var i=0;i<t.length;++i)for(var r=Object.keys(t[i]),n=0;n<r.length;++n){for(var o=t[i][r[n]].split("."),a=e;o.length;)a=a[o.shift()];t[i][r[n]]=a}},o.toJSONOptions={longs:String,enums:String,bytes:String},o._configure=function(){var e=o.Buffer;if(!e)return void(o._Buffer_from=o._Buffer_allocUnsafe=null);o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,i){return new e(t,i)},o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,i){function r(e,t,i){this.fn=e,this.len=t,this.next=undefined,this.val=i}function n(){}function o(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function a(){this.len=0,this.head=new r(n,0,0),this.tail=this.head,this.states=null}function s(e,t,i){t[i]=255&e}function l(e,t,i){for(;e>127;)t[i++]=127&e|128,e>>>=7;t[i]=e}function u(e,t){this.len=e,this.next=undefined,this.val=t}function c(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function d(e,t,i){t[i++]=255&e,t[i++]=e>>>8&255,t[i++]=e>>>16&255,t[i]=e>>>24}t.exports=a;var h,p=e(13),f=p.LongBits,m=p.base64,_=p.utf8;a.create=p.Buffer?function(){return(a.create=function(){return new h})()}:function(){return new a},a.alloc=function(e){return new p.Array(e)},p.Array!==Array&&(a.alloc=p.pool(a.alloc,p.Array.prototype.subarray)),a.prototype.push=function(e,t,i){return this.tail=this.tail.next=new r(e,t,i),this.len+=t,this},u.prototype=Object.create(r.prototype),u.prototype.fn=l,a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this.push(c,10,f.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=f.from(e);return this.push(c,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=f.from(e).zzEncode();return this.push(c,t.length(),t)},a.prototype.bool=function(e){return this.push(s,1,e?1:0)},a.prototype.fixed32=function(e){return this.push(d,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=f.from(e);return this.push(d,4,t.lo).push(d,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64;var g="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(i,r,n){e[0]=i,r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n]=t[3]}:function(i,r,n){e[0]=i,r[n++]=t[3],r[n++]=t[2],r[n++]=t[1],r[n]=t[0]}}():function(e,t,i){var r=e<0?1:0;if(r&&(e=-e),0===e)d(1/e>0?0:2147483648,t,i);else if(isNaN(e))d(2147483647,t,i);else if(e>3.4028234663852886e38)d((r<<31|2139095040)>>>0,t,i);else if(e<1.1754943508222875e-38)d((r<<31|Math.round(e/1.401298464324817e-45))>>>0,t,i);else{var n=Math.floor(Math.log(e)/Math.LN2),o=8388607&Math.round(e*Math.pow(2,-n)*8388608);d((r<<31|n+127<<23|o)>>>0,t,i)}};a.prototype.float=function(e){return this.push(g,4,e)};var v="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(i,r,n){e[0]=i,r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n++]=t[3],r[n++]=t[4],r[n++]=t[5],r[n++]=t[6],r[n]=t[7]}:function(i,r,n){e[0]=i,r[n++]=t[7],r[n++]=t[6],r[n++]=t[5],r[n++]=t[4],r[n++]=t[3],r[n++]=t[2],r[n++]=t[1],r[n]=t[0]}}():function(e,t,i){var r=e<0?1:0;if(r&&(e=-e),0===e)d(0,t,i),d(1/e>0?0:2147483648,t,i+4);else if(isNaN(e))d(4294967295,t,i),d(2147483647,t,i+4);else if(e>1.7976931348623157e308)d(0,t,i),d((r<<31|2146435072)>>>0,t,i+4);else{var n;if(e<2.2250738585072014e-308)n=e/5e-324,d(n>>>0,t,i),d((r<<31|n/4294967296)>>>0,t,i+4);else{var o=Math.floor(Math.log(e)/Math.LN2);1024===o&&(o=1023),n=e*Math.pow(2,-o),d(4503599627370496*n>>>0,t,i),d((r<<31|o+1023<<20|1048576*n&1048575)>>>0,t,i+4)}}};a.prototype.double=function(e){return this.push(v,8,e)};var y=p.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r<e.length;++r)t[i+r]=e[r]};a.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(s,1,0);if(p.isString(e)){var i=a.alloc(t=m.length(e));m.decode(e,i,0),e=i}return this.uint32(t).push(y,t,e)},a.prototype.string=function(e){var t=_.length(e);return t?this.uint32(t).push(_.write,t,e):this.push(s,1,0)},a.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new r(n,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new r(n,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},a._configure=function(e){h=e}},{13:13}],15:[function(e,t,i){function r(){o.call(this)}function n(e,t,i){e.length<40?a.utf8.write(e,t,i):t.utf8Write(e,i)}t.exports=r;var o=e(14);(r.prototype=Object.create(o.prototype)).constructor=r;var a=e(13),s=a.Buffer;r.alloc=function(e){return(r.alloc=a._Buffer_allocUnsafe)(e)};var l=s&&s.prototype instanceof Uint8Array&&"set"===s.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var r=0;r<e.length;)t[i++]=e[r++]};r.prototype.bytes=function(e){a.isString(e)&&(e=a._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(l,t,e),this},r.prototype.string=function(e){var t=s.byteLength(e);return this.uint32(t),t&&this.push(n,t,e),this}},{13:13,14:14}]},{},[7])}("object"==typeof window&&window||"object"==typeof self&&self||this),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!=(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function i(e,t,i,r,n,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=r,this.imageryProvider=n,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}var r=[1,2,4,8];return i.clone=function(t,r){return e(r)?(r._bits=t._bits,r.cnodeVersion=t.cnodeVersion,r.imageryVersion=t.imageryVersion,r.terrainVersion=t.terrainVersion,r.imageryProvider=t.imageryProvider,r.terrainProvider=t.terrainProvider):r=new i(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),r.ancestorHasTerrain=t.ancestorHasTerrain,r.terrainState=t.terrainState,r},i.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},i.prototype.hasSubtree=function(){return t(this._bits,16)},i.prototype.hasImagery=function(){return t(this._bits,64)},i.prototype.hasTerrain=function(){return t(this._bits,128)},i.prototype.hasChildren=function(){return t(this._bits,15)},i.prototype.hasChild=function(e){return t(this._bits,r[e])},i.prototype.getChildBitmask=function(){return 15&this._bits},i}),define("Core/GoogleEarthEnterpriseMetadata",["../ThirdParty/protobuf-minimal","../ThirdParty/when","./buildModuleUrl","./Check","./Credit","./defaultValue","./defined","./defineProperties","./GoogleEarthEnterpriseTileInformation","./isBitSet","./loadAndExecuteScript","./Math","./Request","./Resource","./RuntimeError","./TaskProcessor"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){var i=e;"string"==typeof i||i instanceof p||(i=e.url);var r=p.createIfNeeded(i);r.appendForwardSlash(),this._resource=r,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=d.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var n=this;this._readyPromise=y(this).then(function(){return n.getQuadTreePacket("",n._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var i="An error occurred while accessing "+v(n,"",1).url+".";return t.reject(new f(i))})}function g(e,i,r){var n=e._tileInfo,o=i,s=n[o];if(a(s)&&(!s.hasSubtree()||s.hasChildren()))return s;for(;void 0===s&&o.length>1;)o=o.substring(0,o.length-1),s=n[o];var l,u=e._subtreePromises,c=u[o];return a(c)?c.then(function(){return l=new h({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction}),g(e,i,l)}):a(s)&&s.hasSubtree()?(c=e.getQuadTreePacket(o,s.cnodeVersion,r),a(c)?(u[o]=c,c.then(function(){return l=new h({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction}),g(e,i,l)}).always(function(){delete u[o]})):void 0):t.reject(new f("Couldn't load metadata for tile "+i))}function v(e,t,i,r){return e._resource.getDerivedResource({url:"flatfile?q2-0"+t+"-q."+i.toString(),request:r})}function y(t){var r=t._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!a(T)){var s=i("ThirdParty/google-earth-dbroot-parser.js"),l=window.cesiumGoogleEarthDbRootParser;T=c(s).then(function(){S=window.cesiumGoogleEarthDbRootParser(e),a(l)?window.cesiumGoogleEarthDbRootParser=l:delete window.cesiumGoogleEarthDbRootParser})}return T.then(function(){return r.fetchArrayBuffer()}).then(function(e){var i=S.EncryptedDbRootProto.decode(new Uint8Array(e)),r=i.encryptionData,n=r.byteOffset,o=n+r.byteLength,a=t.key=r.buffer.slice(n,o);r=i.dbrootData,n=r.byteOffset,o=n+r.byteLength;var s=r.buffer.slice(n,o);return b.scheduleTask({buffer:s,type:"DbRoot",key:a},[s])}).then(function(e){var i=S.DbRootProto.decode(new Uint8Array(e.buffer));if(t.imageryPresent=o(i.imageryPresent,t.imageryPresent),t.protoImagery=i.protoImagery,t.terrainPresent=o(i.terrainPresent,t.terrainPresent),a(i.endSnippet)&&a(i.endSnippet.model)){var r=i.endSnippet.model;t.negativeAltitudeExponentBias=o(r.negativeAltitudeExponentBias,t.negativeAltitudeExponentBias),t.negativeAltitudeThreshold=o(r.compressedNegativeAltitudeThreshold,t.negativeAltitudeThreshold)}a(i.databaseVersion)&&(t._quadPacketVersion=o(i.databaseVersion.quadtreeVersion,t._quadPacketVersion));for(var s=t.providers,l=o(i.providerInfo,[]),u=l.length,c=0;c<u;++c){var d=l[c],h=d.copyrightString;a(h)&&(s[d.providerId]=new n(h.value))}}).otherwise(function(){console.log("Failed to retrieve "+r.url+". Using defaults."),t.key=C})}var C=function(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;n<t;++n)r[n]=e.charCodeAt(n);return i}('Eô½\vyâjE",ÍqøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðk¡½NuàA[ß@V\fÙ»r|3SîOlÔq°{ÀEVZwUe\v3*¬l5Å0sø3>mF8J´Ýð.ÝuÚDt"úa"\f3"So¯9D\v9Ù9L¹¿«\\P_"uxéqh;ÁÄð<VqH\'UfYNeu£aF}a?A\0×´4MÎF°Õ¸\'{Ü+»Mg0ÈÑö\\Pú[/Fn5/\'C.ë\n\f^¥se4ål.jC\'c#U©?q{gC}:¯ÍâTUýKÆâ/(íË\\Æ-f§;/*"N°k.Ý\r}}GºC²²+>Mª>}æÎIÆæx\fa1-¤O¥~q ì\r1èN\v\0nPh}=\b\r¦n£h$[kó#ó¶s³\r\v@ÀØQ]ú".jßI\0¹ wUÆïj¿{GLîÜÜF
©S+S4ÿYä8è1N¹XFkË-#p\x005"Ï1²&/çÃu-6,rt°#G·ÓÑ&
7râ\0DÏÚ3-Þ`i#i*|ÍKQ\rT9w.)ê¦P¢joP\\>TûïP[\vEm(w7ÛJfJo åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðB|G`°½&·q¶ÇÑ3=Ó«îcÈ+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1;µoÜl\rÑÛ?âéÚ_ÔâFaZÞUϤ\0¾ýÎgñJiæ HØ]~®q N®ÀV©<rçvì)IÖ]-ãÛ6©;fjÕ¶=P^R¹KÇsWxÉô.YoÐKW>\'\'Ç`Û;íSD>?mw¢\në?R¨ÆU^1I7
ôÅ&-©¿\'TÚÃj å*x°Öprªh½÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldI\'xtOÂÞV9\0Úw\vË-û5Oõ\bQ`Á\nZGM&30xÚÀFGâ[y`In7gS\n>éìF9²ñ4\rÆSuná\fYÙÞ)
{II¥wy¾IV.6ç\v:»Ob{ÒM1/½8{¨O!áìFpv})"x\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-ÈÜF|["');s(_.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),_.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;u(t,o)?u(e,o)&&(a|=1):(a|=2,u(e,o)||(a|=1)),r+=a}return r},_.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];u(a,2)?u(a,1)||(t|=o):(i|=o,u(a,1)&&(t|=o))}return{x:t,y:i,level:r}},_.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(a(t))return null!==t;for(var i,r=!0,n=e;n.length>1;){if(i=n.substring(n.length-1),n=n.substring(0,n.length-1),t=this.getTileInformationFromQuadKey(n),a(t)){t.hasSubtree()||t.hasChild(parseInt(i))||(r=!1);break}if(null===t){r=!1;break}}return r};var b=new m("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);_.prototype.getQuadTreePacket=function(e,t,i){t=o(t,1),e=o(e,"");var r=v(this,e,t,i),n=r.fetchArrayBuffer();if(a(n)){var s=this._tileInfo,u=this.key;return n.then(function(t){return b.scheduleTask({buffer:t,quadKey:e,type:"Metadata",key:u},[t]).then(function(t){var i,r=-1;if(""!==e){r=e.length+1;var n=t[e];i=s[e],i._bits|=n._bits,delete t[e]}var o=Object.keys(t);o.sort(function(e,t){return e.length-t.length});for(var a=o.length,u=0;u<a;++u){var c=o[u];if(null!==t[c]){var d=l.clone(t[c]),h=c.length;if(h===r)d.setParent(i);else if(h>1){var p=s[c.substring(0,c.length-1)];d.setParent(p)}s[c]=d}else s[c]=null}})})}},_.prototype.populateSubtree=function(e,t,i,r){return g(this,_.tileXYToQuadKey(e,t,i),r)},_.prototype.getTileInformation=function(e,t,i){var r=_.tileXYToQuadKey(e,t,i);return this._tileInfo[r]},_.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};var S,T;return _}),define("Core/GoogleEarthEnterpriseTerrainData",["./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){e=n(e,n.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=n(e.childTileMask,15),i=3&t;i|=4&t?8:0,i|=8&t?4:0,this._childTileMask=i,this._createdByUpsampling=n(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0,this._vertexCountWithoutSkirts=void 0,this._skirtIndex=void 0}function v(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,E),f=o.decodeTextureCoordinates(n,d,A),m=o.decodeTextureCoordinates(n,h,w),_=u.computeBarycentricCoordinates(t,i,p.x,p.y,f.x,f.y,m.x,m.y,x);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 y(e,t,i,r){var n=e._buffer,o=0,a=0,s=0;i>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);for(var l=new DataView(n),d=0,h=0;h<o;++h)d+=l.getUint32(d,!0),d+=D;d+=D,d+=2*R;var p=c.toRadians(180*l.getFloat64(d,!0));d+=R;var f=c.toRadians(180*l.getFloat64(d,!0));d+=R;var m=r.width/p/2,_=r.height/f/2,g=l.getInt32(d,!0);d+=I;var v=3*l.getInt32(d,!0);d+=I,d+=I;var y,C=new Array(g),b=new Array(g),S=new Array(g);for(y=0;y<g;++y)C[y]=a+l.getUint8(d++)*m,b[y]=s+l.getUint8(d++)*_,S[y]=6371010*l.getFloat32(d,!0),d+=M;var T=new Array(v);for(y=0;y<v;++y)T[y]=l.getUint16(d,!0),d+=P;for(y=0;y<v;y+=3){var E=T[y],A=T[y+1],w=T[y+2],O=C[E],L=C[A],N=C[w],F=b[E],B=b[A],k=b[w],z=u.computeBarycentricCoordinates(t,i,O,F,L,B,N,k,x);if(z.x>=-1e-15&&z.y>=-1e-15&&z.z>=-1e-15)return z.x*S[E]+z.y*S[A]+z.z*S[w]}}a(g.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var C=new f("createVerticesFromGoogleEarthEnterpriseBuffer"),b=new p,S=new p;g.prototype.createMesh=function(t,r,a,s,l){var u=t.ellipsoid;t.tileXYToNativeRectangle(r,a,s,b),t.tileXYToRectangle(r,a,s,S),l=n(l,1);var c=u.cartographicToCartesian(p.center(S)),h=40075.16/(1<<s);this._skirtHeight=Math.min(8*h,1e3);var f=C.scheduleTask({buffer:this._buffer,nativeRectangle:b,rectangle:S,relativeToCenter:c,ellipsoid:u,skirtHeight:this._skirtHeight,exaggeration:l,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(o(f)){var g=this;return f.then(function(t){return g._mesh=new _(c,new Float32Array(t.vertices),new Uint16Array(t.indices),t.minimumHeight,t.maximumHeight,e.clone(t.boundingSphere3D),i.clone(t.occludeePointInScaledSpace),t.numberOfAttributes,d.clone(t.orientedBoundingBox),m.clone(t.encoding),l,t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),g._vertexCountWithoutSkirts=t.vertexCountWithoutSkirts,g._skirtIndex=t.skirtIndex,g._minimumHeight=t.minimumHeight,g._maximumHeight=t.maximumHeight,g._buffer=void 0,g._mesh})}},g.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1),n=c.clamp((i-e.south)/e.height,0,1);return o(this._mesh)?v(this,r,n):y(this,r,n,e)};var T=new f("upsampleQuantizedTerrainMesh");g.prototype.upsample=function(t,r,n,a,s,u,c){var p=this._mesh;if(o(this._mesh)){var f=2*r!==s,m=2*n===u,_=t.ellipsoid,g=t.tileXYToRectangle(s,u,c),v=T.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:m,childRectangle:g,ellipsoid:_,exaggeration:p.exaggeration});if(o(v)){var y=this;return v.then(function(t){var r=new Uint16Array(t.vertices),n=l.createTypedArray(r.length/3,t.indices),o=y._skirtHeight;return new h({quantizedVertices:r,indices:n,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,boundingSphere:e.clone(t.boundingSphere),orientedBoundingBox:d.clone(t.orientedBoundingBox),horizonOcclusionPoint:i.clone(t.horizonOcclusionPoint),westIndices:t.westIndices,southIndices:t.southIndices,eastIndices:t.eastIndices,northIndices:t.northIndices,westSkirtHeight:o,southSkirtHeight:o,eastSkirtHeight:o,northSkirtHeight:o,childTileMask:0,createdByUpsampling:!0,credits:y._credits})})}}},g.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)},g.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var E=new t,A=new t,w=new t,x=new i,P=Uint16Array.BYTES_PER_ELEMENT,D=Uint32Array.BYTES_PER_ELEMENT,I=Int32Array.BYTES_PER_ELEMENT,M=Float32Array.BYTES_PER_ELEMENT,R=Float64Array.BYTES_PER_ELEMENT;return g}),define("Core/GoogleEarthEnterpriseTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./GoogleEarthEnterpriseMetadata","./GoogleEarthEnterpriseTerrainData","./HeightmapTerrainData","./JulianDate","./Math","./Rectangle","./Request","./RequestState","./RequestType","./Resource","./RuntimeError","./TaskProcessor","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function b(){this._terrainCache={},this._lastTidy=d.now()}function S(n){n=i(n,{});var o;if(r(n.metadata))o=n.metadata;else{var u=g.createIfNeeded(n.url);o=new l(u)}this._metadata=o,this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new p(-h.PI,-h.PI,h.PI,h.PI),ellipsoid:n.ellipsoid});var c=n.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new b,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new a,this._ready=!1;var d,f=this;this._readyPromise=o.readyPromise.then(function(t){if(!o.terrainPresent){var i=new v("The server "+o.url+" doesn't have terrain");return d=C.handleError(d,f,f._errorEvent,i.message,void 0,void 0,void 0,i),e.reject(i)}return C.handleSuccess(d),f._ready=t,t}).otherwise(function(t){return d=C.handleError(d,f,f._errorEvent,t.message,void 0,void 0,void 0,t),e.reject(t)})}function T(e,t,i){var n=t.getChildBitmask();if(t.terrainState===A.PARENT){n=0;for(var o=0;o<4;++o){var a=i.getTileInformationFromQuadKey(e+o.toString());r(a)&&a.hasTerrain()&&(n|=1<<o)}}return n}function E(e,t,i,n){return i=r(i)&&i>0?i:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1c-0"+t+"-t."+i.toString(),request:n})}var A={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},w=new d;b.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:d.now()}},b.prototype.get=function(e){var t=this._terrainCache,i=t[e];if(r(i))return delete this._terrainCache[e],i.buffer},b.prototype.tidy=function(){if(d.now(w),d.secondsDifference(w,this._lastTidy)>10){for(var e=this._terrainCache,t=Object.keys(e),i=t.length,r=0;r<i;++r){var n=t[r],o=e[n];d.secondsDifference(w,o.timestamp)>10&&delete e[n]}d.clone(w,this._lastTidy)}},n(S.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var x=new y("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return S.prototype.requestTileGeometry=function(t,i,n,o){var a=l.tileXYToQuadKey(t,i,n),s=this._terrainCache,d=this._metadata,h=d.getTileInformationFromQuadKey(a);if(!r(h))return e.reject(new v("Terrain tile doesn't exist"));var p=h.terrainState;r(p)||(p=h.terrainState=A.UNKNOWN);var f=s.get(a);if(r(f)){var _=d.providers[h.terrainProvider];return e.resolve(new u({buffer:f,childTileMask:T(a,h,d),credits:r(_)?[_]:void 0,negativeAltitudeExponentBias:d.negativeAltitudeExponentBias,negativeElevationThreshold:d.negativeAltitudeThreshold}))}if(s.tidy(),!h.ancestorHasTerrain)return e.resolve(new c({buffer:new Uint8Array(256),width:16,height:16}));if(p===A.NONE)return e.reject(new v("Terrain tile doesn't exist"));var g,y=a,C=-1;switch(p){case A.SELF:C=h.terrainVersion;break;case A.PARENT:y=y.substring(0,y.length-1),g=d.getTileInformationFromQuadKey(y),C=g.terrainVersion;break;case A.UNKNOWN:h.hasTerrain()?C=h.terrainVersion:(y=y.substring(0,y.length-1),g=d.getTileInformationFromQuadKey(y),r(g)&&g.hasTerrain()&&(C=g.terrainVersion))}if(C<0)return e.reject(new v("Terrain tile doesn't exist"));var b,S,w=this._terrainPromises,P=this._terrainRequests;if(r(w[y]))b=w[y],S=P[y];else{S=o;var D=E(this,y,C,S).fetchArrayBuffer();if(!r(D))return;b=D.then(function(t){return r(t)?x.scheduleTask({buffer:t,type:"Terrain",key:d.key},[t]).then(function(e){var t=d.getTileInformationFromQuadKey(y);t.terrainState=A.SELF,s.add(y,e[0]);for(var i=t.terrainProvider,n=e.length-1,o=0;o<n;++o){var a=y+o.toString(),l=d.getTileInformationFromQuadKey(a);r(l)&&(s.add(a,e[o+1]),l.terrainState=A.PARENT,0===l.terrainProvider&&(l.terrainProvider=i))}}):e.reject(new v("Failed to load terrain."))}),w[y]=b,P[y]=S,b=b.always(function(){delete w[y],delete P[y]})}return b.then(function(){var t=s.get(a);if(r(t)){var i=d.providers[h.terrainProvider];return new u({buffer:t,childTileMask:T(a,h,d),credits:r(i)?[i]:void 0,negativeAltitudeExponentBias:d.negativeAltitudeExponentBias,negativeElevationThreshold:d.negativeAltitudeThreshold})}return e.reject(new v("Failed to load terrain."))}).otherwise(function(t){return S.state===m.CANCELLED?(o.state=S.state,e.reject(t)):(h.terrainState=A.NONE,e.reject(t))})},S.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},S.prototype.getTileDataAvailable=function(e,t,i){var n=this._metadata,o=l.tileXYToQuadKey(e,t,i),a=n.getTileInformation(e,t,i);if(null===a)return!1;if(r(a)){if(!a.ancestorHasTerrain)return!0;var s=a.terrainState;if(s===A.NONE)return!1;if(!(r(s)&&s!==A.UNKNOWN||(a.terrainState=A.UNKNOWN,a.hasTerrain()))){o=o.substring(0,o.length-1);var u=n.getTileInformationFromQuadKey(o);if(!r(u)||!u.hasTerrain())return!1}return!0}if(n.isValid(o)){var c=new f({throttle:!0,throttleByServer:!0,type:_.TERRAIN});n.populateSubtree(e,t,i,c)}return!1},S.prototype.loadTileDataAvailability=function(e,t,i){},S}),define("Core/GroundPolylineGeometry",["./ApproximateTerrainHeights","./ArcType","./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./DeveloperError","./Math","./defaultValue","./defined","./defineProperties","./Ellipsoid","./EllipsoidGeodesic","./EllipsoidRhumbLine","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./IntersectionTests","./Matrix3","./Plane","./Quaternion","./Rectangle","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A){"use strict";function w(e){e=c(e,c.EMPTY_OBJECT);var i=e.positions;this.width=c(e.width,1),this._positions=i,this.granularity=c(e.granularity,9999),this.loop=c(e.loop,!1),this.arcType=c(e.arcType,t.GEODESIC),this._ellipsoid=p.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}function x(e,t,i,r,o){var a=D(r,e,0,Y),s=D(r,e,i,j),l=D(r,t,0,X),u=I(s,a,j),c=I(l,a,X);return n.cross(c,u,o),n.normalize(o,o)}function P(e,i,r,o,a,s,l,u,c,d,h){if(0!==a){var p;s===t.GEODESIC?p=new f(e,i,l):s===t.RHUMB&&(p=new m(e,i,l));var _=p.surfaceDistance;if(!(_<a))for(var g=x(e,i,o,l,J),v=Math.ceil(_/a),y=_/v,C=y,b=v-1,S=u.length,T=0;T<b;T++){var E=p.interpolateUsingSurfaceDistance(C,Q),A=D(l,E,r,K),w=D(l,E,o,Z);n.pack(g,u,S),n.pack(A,c,S),n.pack(w,d,S),h.push(E.latitude),h.push(E.longitude),S+=3,C+=y}}}function D(e,t,i,r){return o.clone(t,$),$.height=i,o.toCartesian($,e,r)}function I(e,t,i){return n.subtract(e,t,i),n.normalize(i,i),i}function M(e,t,i,r){return r=I(e,t,r),r=n.cross(r,i,r),r=n.normalize(r,r),r=n.cross(i,r,r)}function R(e,t,i,r,o){var a=I(i,t,re),s=M(e,t,a,ee),l=M(r,t,a,te);if(u.equalsEpsilon(n.dot(s,l),oe,u.EPSILON5))return o=n.cross(a,s,o),o=n.normalize(o,o);o=n.add(l,s,o),o=n.normalize(o,o);var c=n.cross(a,o,ie);return n.dot(l,c)<ne&&(o=n.negate(o,o)),o}function O(e,t,i,r){var o=I(i,t,_e),a=n.dot(o,e);if(a>G||a<H){var s=I(r,i,re),l=a<H?u.PI_OVER_TWO:-u.PI_OVER_TWO,c=T.fromAxisAngle(s,l,ve),d=b.fromQuaternion(c,ge);return b.multiplyByVector(d,e,e),!0}return!1}function L(e,t,i,r,a){var s=o.toCartesian(t,e._ellipsoid,Ce),l=n.add(s,i,be),c=!1,d=e._ellipsoid,h=d.cartesianToCartographic(l,ye);Math.abs(t.longitude-h.longitude)>u.PI_OVER_TWO&&(c=!0,l=n.subtract(s,i,be),h=d.cartesianToCartographic(l,ye)),h.height=0;var p=e.project(h,a);return a=n.subtract(p,r,a),a.z=0,a=n.normalize(a,a),c&&n.negate(a,a),a}function N(e,t,i,r,o,a){var s=n.subtract(t,e,Se);n.normalize(s,s);var l=i-W,u=n.multiplyByScalar(s,l,Te);n.add(e,u,o);var c=r-q;u=n.multiplyByScalar(s,c,Te),n.add(t,u,a)}function F(e,t){var i=S.getPointDistance(ae,e),r=S.getPointDistance(ae,t),o=Ee;u.equalsEpsilon(i,0,u.EPSILON2)?(o=I(t,e,o),n.multiplyByScalar(o,u.EPSILON2,o),n.add(e,o,e)):u.equalsEpsilon(r,0,u.EPSILON2)&&(o=I(e,t,o),n.multiplyByScalar(o,u.EPSILON2,o),n.add(t,o,t))}function B(e,t){var i=Math.abs(e.longitude),r=Math.abs(t.longitude);if(u.equalsEpsilon(i,u.PI,u.EPSILON11)){var n=u.sign(t.longitude);return e.longitude=n*(i-u.EPSILON11),1}if(u.equalsEpsilon(r,u.PI,u.EPSILON11)){var o=u.sign(e.longitude);return t.longitude=o*(r-u.EPSILON11),2}return 0}function k(t,i,o,a,l,c,d){var h,p,f,m,g,C,b=i._ellipsoid,S=o.length/3-1,T=8*S,A=4*T,w=36*S,x=T>65535?new Uint32Array(w):new Uint16Array(w),P=new Float64Array(3*T),D=new Float32Array(A),M=new Float32Array(A),R=new Float32Array(A),k=new Float32Array(A),V=new Float32Array(A);d&&(f=new Float32Array(A),m=new Float32Array(A),g=new Float32Array(A),C=new Float32Array(2*T));var U=c.length/2,H=0,W=Ae;W.height=0;var q=we;q.height=0;var Y=xe,j=Pe;if(d)for(p=0,h=1;h<U;h++)W.latitude=c[p],W.longitude=c[p+1],q.latitude=c[p+2],q.longitude=c[p+3],Y=i.project(W,Y),j=i.project(q,j),H+=n.distance(Y,j),p+=2;var X=a.length/3
- ;j=n.unpack(a,0,j);var Q=0;for(p=3,h=1;h<X;h++)Y=n.clone(j,Y),j=n.unpack(a,p,j),Q+=n.distance(Y,j),p+=3;var K;p=3;var Z=0,J=0,$=0,ee=0,te=!1,ie=n.unpack(o,0,Ie),re=n.unpack(a,0,Pe),ne=n.unpack(l,0,Re);if(t){O(ne,n.unpack(o,o.length-6,De),ie,re)&&(ne=n.negate(ne,ne))}var oe=0,ae=0,se=0;for(h=0;h<S;h++){var le=n.clone(ie,De),ue=n.clone(re,xe),ce=n.clone(ne,Me);te&&(ce=n.negate(ce,ce)),ie=n.unpack(o,p,Ie),re=n.unpack(a,p,Pe),ne=n.unpack(l,p,Re),te=O(ne,le,ie,re),W.latitude=c[Z],W.longitude=c[Z+1],q.latitude=c[Z+2],q.longitude=c[Z+3];var de,he,pe,fe;if(d){var me=B(W,q);de=i.project(W,ze),he=i.project(q,Ve);var _e=I(he,de,Ze);_e.y=Math.abs(_e.y),pe=Ue,fe=Ge,0===me||n.dot(_e,n.UNIT_Y)>G?(pe=L(i,W,ce,de,Ue),fe=L(i,q,ne,he,Ge)):1===me?(fe=L(i,q,ne,he,Ge),pe.x=0,pe.y=u.sign(W.longitude-Math.abs(q.longitude)),pe.z=0):(pe=L(i,W,ce,de,Ue),fe.x=0,fe.y=u.sign(W.longitude-q.longitude),fe.z=0)}var ge=n.distance(ue,re),ve=_.fromCartesian(le,Qe),ye=n.subtract(ie,le,He),Ce=n.normalize(ye,Ye),be=n.subtract(ue,le,We);be=n.normalize(be,be);var Se=n.cross(Ce,be,Ye);Se=n.normalize(Se,Se);var Te=n.cross(be,ce,je);Te=n.normalize(Te,Te);var Ee=n.subtract(re,ie,qe);Ee=n.normalize(Ee,Ee);var rt=n.cross(ne,Ee,Xe);rt=n.normalize(rt,rt);var nt,ot,at,st=ge/Q,lt=oe/Q,ut=0,ct=0,dt=0;if(d){ut=n.distance(de,he),nt=_.fromCartesian(de,Ke),ot=n.subtract(he,de,Ze),at=n.normalize(ot,Je);var ht=at.x;at.x=at.y,at.y=-ht,ct=ut/H,dt=ae/H}for(K=0;K<8;K++){var pt=ee+4*K,ft=J+2*K,mt=pt+3,_t=K<4?1:-1,gt=2===K||3===K||6===K||7===K?1:-1;n.pack(ve.high,D,pt),D[mt]=ye.x,n.pack(ve.low,M,pt),M[mt]=ye.y,n.pack(Te,R,pt),R[mt]=ye.z,n.pack(rt,k,pt),k[mt]=st*_t,n.pack(Se,V,pt);var vt=lt*gt;0===vt&><0&&(vt=9),V[mt]=vt,d&&(f[pt]=nt.high.x,f[pt+1]=nt.high.y,f[pt+2]=nt.low.x,f[pt+3]=nt.low.y,g[pt]=-pe.y,g[pt+1]=pe.x,g[pt+2]=fe.y,g[pt+3]=-fe.x,m[pt]=ot.x,m[pt+1]=ot.y,m[pt+2]=at.x,m[pt+3]=at.y,C[ft]=ct*_t,vt=dt*gt,0===vt&><0&&(vt=9),C[ft+1]=vt)}var yt=Be,Ct=ke,bt=Ne,St=Fe,Tt=E.fromCartographicArray(Oe,Le),Et=e.getMinimumMaximumHeights(Tt,b),At=Et.minimumTerrainHeight,wt=Et.maximumTerrainHeight;se+=At,se+=wt,N(le,ue,At,wt,yt,bt),N(ie,re,At,wt,Ct,St);var xt=n.multiplyByScalar(Se,u.EPSILON5,$e);n.add(yt,xt,yt),n.add(Ct,xt,Ct),n.add(bt,xt,bt),n.add(St,xt,St),F(yt,Ct),F(bt,St),n.pack(yt,P,$),n.pack(Ct,P,$+3),n.pack(St,P,$+6),n.pack(bt,P,$+9),xt=n.multiplyByScalar(Se,-2*u.EPSILON5,$e),n.add(yt,xt,yt),n.add(Ct,xt,Ct),n.add(bt,xt,bt),n.add(St,xt,St),F(yt,Ct),F(bt,St),n.pack(yt,P,$+12),n.pack(Ct,P,$+15),n.pack(St,P,$+18),n.pack(bt,P,$+21),Z+=2,p+=3,J+=16,$+=24,ee+=32,oe+=ge,ae+=ut}p=0;var Pt=0;for(h=0;h<S;h++){for(K=0;K<it;K++)x[p+K]=tt[K]+Pt;Pt+=8,p+=it}var Dt=et;r.fromVertices(o,n.ZERO,3,Dt[0]),r.fromVertices(a,n.ZERO,3,Dt[1]);var It=r.fromBoundingSpheres(Dt);It.radius+=se/(2*S);var Mt={position:new y({componentDatatype:s.DOUBLE,componentsPerAttribute:3,normalize:!1,values:P}),startHiAndForwardOffsetX:z(D),startLoAndForwardOffsetY:z(M),startNormalAndForwardOffsetZ:z(R),endNormalAndTextureCoordinateNormalizationX:z(k),rightNormalAndTextureCoordinateNormalizationY:z(V)};return d&&(Mt.startHiLo2D=z(f),Mt.offsetAndRight2D=z(m),Mt.startEndNormals2D=z(g),Mt.texcoordNormalization2D=new y({componentDatatype:s.FLOAT,componentsPerAttribute:2,normalize:!1,values:C})),new v({attributes:Mt,indices:x,boundingSphere:It})}function z(e){return new y({componentDatatype:s.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}var V=[g,A],U=V.length,G=Math.cos(u.toRadians(30)),H=Math.cos(u.toRadians(150)),W=0,q=1e3;h(w.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+p.packedLength+1+1}}}),w.setProjectionAndEllipsoid=function(e,t){for(var i=0,r=0;r<U;r++)if(t instanceof V[r]){i=r;break}e._projectionIndex=i,e._ellipsoid=t.ellipsoid};var Y=new n,j=new n,X=new n,Q=new o,K=new n,Z=new n,J=new n,$=new o;w.pack=function(e,t,i){var r=c(i,0),o=e._positions,a=o.length;t[r++]=a;for(var s=0;s<a;++s){var l=o[s];n.pack(l,t,r),r+=3}return t[r++]=e.granularity,t[r++]=e.loop?1:0,t[r++]=e.arcType,p.pack(e._ellipsoid,t,r),r+=p.packedLength,t[r++]=e._projectionIndex,t[r++]=e._scene3DOnly?1:0,t},w.unpack=function(e,t,i){for(var r=c(t,0),o=e[r++],a=new Array(o),s=0;s<o;s++)a[s]=n.unpack(e,r),r+=3;var l=e[r++],u=1===e[r++],h=e[r++],f=p.unpack(e,r);r+=p.packedLength;var m=e[r++],_=1===e[r++];return d(i)||(i=new w({positions:a})),i._positions=a,i.granularity=l,i.loop=u,i.arcType=h,i._ellipsoid=f,i._projectionIndex=m,i._scene3DOnly=_,i};var ee=new n,te=new n,ie=new n,re=new n,ne=0,oe=-1,ae=S.fromPointNormal(n.ZERO,n.UNIT_Y),se=new n,le=new n,ue=new n,ce=new n,de=new n,he=new n,pe=new o,fe=new o,me=new o;w.createGeometry=function(e){var r,a,s=!e._scene3DOnly,l=e.loop,c=e._ellipsoid,h=e.granularity,p=e.arcType,f=new V[e._projectionIndex](c),_=W,g=q,v=e._positions,y=v.length;2===y&&(l=!1);var b,S,T,E,A,w,I,M=new m(void 0,void 0,c),O=[v[0]];for(a=0;a<y-1;a++)b=v[a],S=v[a+1],A=C.lineSegmentPlane(b,S,ae,he),!d(A)||n.equalsEpsilon(A,b,u.EPSILON7)||n.equalsEpsilon(A,S,u.EPSILON7)||(e.arcType===t.GEODESIC?O.push(n.clone(A)):e.arcType===t.RHUMB&&(I=c.cartesianToCartographic(A,pe).longitude,T=c.cartesianToCartographic(b,pe),E=c.cartesianToCartographic(S,fe),M.setEndPoints(T,E),w=M.findIntersectionWithLongitude(I,me),A=c.cartographicToCartesian(w,he),!d(A)||n.equalsEpsilon(A,b,u.EPSILON7)||n.equalsEpsilon(A,S,u.EPSILON7)||O.push(n.clone(A)))),O.push(S);l&&(b=v[y-1],S=v[0],A=C.lineSegmentPlane(b,S,ae,he),!d(A)||n.equalsEpsilon(A,b,u.EPSILON7)||n.equalsEpsilon(A,S,u.EPSILON7)||(e.arcType===t.GEODESIC?O.push(n.clone(A)):e.arcType===t.RHUMB&&(I=c.cartesianToCartographic(A,pe).longitude,T=c.cartesianToCartographic(b,pe),E=c.cartesianToCartographic(S,fe),M.setEndPoints(T,E),w=M.findIntersectionWithLongitude(I,me),A=c.cartographicToCartesian(w,he),!d(A)||n.equalsEpsilon(A,b,u.EPSILON7)||n.equalsEpsilon(A,S,u.EPSILON7)||O.push(n.clone(A)))));var L=O.length,N=new Array(L);for(a=0;a<L;a++){var F=o.fromCartesian(O[a],c);F.height=0,N[a]=F}if(N=i(N,o.equalsEpsilon),!((L=N.length)<2)){var B=[],z=[],U=[],G=[],H=se,Y=le,j=ue,X=ce,Q=de,K=N[0],Z=N[1],J=N[L-1];for(H=D(c,J,_,H),X=D(c,Z,_,X),Y=D(c,K,_,Y),j=D(c,K,g,j),Q=l?R(H,Y,j,X,Q):x(K,Z,g,c,Q),n.pack(Q,z,0),n.pack(Y,U,0),n.pack(j,G,0),B.push(K.latitude),B.push(K.longitude),P(K,Z,_,g,h,p,c,z,U,G,B),a=1;a<L-1;++a){H=n.clone(Y,H),Y=n.clone(X,Y);var $=N[a];D(c,$,g,j),D(c,N[a+1],_,X),R(H,Y,j,X,Q),r=z.length,n.pack(Q,z,r),n.pack(Y,U,r),n.pack(j,G,r),B.push($.latitude),B.push($.longitude),P(N[a],N[a+1],_,g,h,p,c,z,U,G,B)}var ee=N[L-1],te=N[L-2];if(Y=D(c,ee,_,Y),j=D(c,ee,g,j),l){var ie=N[0];H=D(c,te,_,H),X=D(c,ie,_,X),Q=R(H,Y,j,X,Q)}else Q=x(te,ee,g,c,Q);if(r=z.length,n.pack(Q,z,r),n.pack(Y,U,r),n.pack(j,G,r),B.push(ee.latitude),B.push(ee.longitude),l){for(P(ee,K,_,g,h,p,c,z,U,G,B),r=z.length,a=0;a<3;++a)z[r+a]=z[a],U[r+a]=U[a],G[r+a]=G[a];B.push(K.latitude),B.push(K.longitude)}return k(l,f,U,G,z,B,s)}};var _e=new n,ge=new b,ve=new T,ye=new o,Ce=new n,be=new n,Se=new n,Te=new n,Ee=new n,Ae=new o,we=new o,xe=new n,Pe=new n,De=new n,Ie=new n,Me=new n,Re=new n,Oe=[Ae,we],Le=new E,Ne=new n,Fe=new n,Be=new n,ke=new n,ze=new n,Ve=new n,Ue=new n,Ge=new n,He=new n,We=new n,qe=new n,Ye=new n,je=new n,Xe=new n,Qe=new _,Ke=new _,Ze=new n,Je=new n,$e=new n,et=[new r,new r],tt=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],it=tt.length;return w._projectNormal=L,w}),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]],b=i[t[s+f]];if(b-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/(b-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 b,S=i[v[u]],T=i[v[u+l]];T-S<=0?(p=v[u]*o+o*l+d,b=r[p],m[d][l].push(b/a(l))):(b=m[d][l-1][u+1]-m[d][l-1][u],m[d][l].push(b/(T-S))),C=C||0!==b}C||(y=l-1)}}for(c=0,h=0;c<=h;c++)for(l=c;l<=y;l++){var E=n(e,v,i,c,l,[]);for(d=0;d<o;d++){var A=m[d][l][0];s[d+c*o]+=A*E}}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;var p,f=i.length,m=new Array(f*(s+1));for(p=0;p<f;p++)for(var _=0;_<s+1;_++)m[p*(s+1)+_]=p;for(var g=m.length,v=l,y=o(v,m,i,r,a,s),C=[],b=g*(g+1)/2,S=Math.min(y,u),T=0;T<=S;T++)for(p=T;p<=y;p++){C.length=0;for(var E=n(e,m,i,T,p,C),A=Math.floor(p*(1-p)/2)+g*p,w=0;w<a;w++){var x=Math.floor(w*b),P=v[x+A];c[w+T*a]+=P*E}}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=-.0529921,s=-.1059842,l=13.0120009,u=13.3407154,c=26.4057084,d=13.064993,h=1.7484877,p=new i;return o.ComputeMoon=function(o,f){e(o)||(o=i.now()),p=i.addSeconds(o,32.184,p);var m=i.totalDays(p)-2451545,_=m/n.DAYS_PER_JULIAN_CENTURY,g=(125.045+a*m)*r.RADIANS_PER_DEGREE,v=(250.089+s*m)*r.RADIANS_PER_DEGREE,y=(260.008+l*m)*r.RADIANS_PER_DEGREE,C=(176.625+u*m)*r.RADIANS_PER_DEGREE,b=(357.529+.9856003*m)*r.RADIANS_PER_DEGREE,S=(311.589+c*m)*r.RADIANS_PER_DEGREE,T=(134.963+d*m)*r.RADIANS_PER_DEGREE,E=(276.617+.3287146*m)*r.RADIANS_PER_DEGREE,A=(34.226+h*m)*r.RADIANS_PER_DEGREE,w=(15.134+-.1589763*m)*r.RADIANS_PER_DEGREE,x=(119.743+.0036096*m)*r.RADIANS_PER_DEGREE,P=(239.961+.1643573*m)*r.RADIANS_PER_DEGREE,D=(25.053+12.9590088*m)*r.RADIANS_PER_DEGREE,I=Math.sin(g),M=Math.sin(v),R=Math.sin(y),O=Math.sin(C),L=Math.sin(b),N=Math.sin(S),F=Math.sin(T),B=Math.sin(E),k=Math.sin(A),z=Math.sin(w),V=Math.sin(x),U=Math.sin(P),G=Math.sin(D),H=Math.cos(g),W=Math.cos(v),q=Math.cos(y),Y=Math.cos(C),j=Math.cos(b),X=Math.cos(S),Q=Math.cos(T),K=Math.cos(E),Z=Math.cos(A),J=Math.cos(w),$=Math.cos(x),ee=Math.cos(P),te=Math.cos(D),ie=(269.9949+.0031*_-3.8787*I-.1204*M+.07*R-.0172*O+.0072*N-.0052*z+.0043*G)*r.RADIANS_PER_DEGREE,re=(66.5392+.013*_+1.5419*H+.0239*W-.0278*q+.0068*Y-.0029*X+9e-4*Q+8e-4*J-9e-4*te)*r.RADIANS_PER_DEGREE,ne=(38.3213+13.17635815*m-1.4e-12*m*m+3.561*I+.1208*M-.0642*R+.0158*O+.0252*L-.0066*N-.0047*F-.0046*B+.0028*k+.0052*z+.004*V+.0019*U-.0044*G)*r.RADIANS_PER_DEGREE,oe=(13.17635815-2*m*1.4e-12+3.561*H*a+.1208*W*s-.0642*q*l+.0158*Y*u+.0252*j*.9856003-.0066*X*c-.0047*Q*d-.0046*K*.3287146+.0028*Z*h+.0052*J*-.1589763+.004*$*.0036096+.0019*ee*.1643573-.0044*te*12.9590088)/86400*r.RADIANS_PER_DEGREE;return e(f)||(f=new t),f.rightAscension=ie,f.declination=re,f.rotation=ne,f.rotationRate=oe,f},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);return o.multiply(m,c,c)},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/Ion",["./Credit","./defined","./Resource"],function(e,t,i){"use strict";var r,n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwNDU2NmUwYi05ZTAxLTQ2MTgtODk3NC1kNTIyYjRmZTAwMzciLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTY0NjI0Mzg4fQ.avNK2ld_7qZPwG3ofB74a3TdmiB0sTzz6fx8YKw3NzE",o={};return o.defaultAccessToken=n,o.defaultServer=new i({url:"https://api.cesium.com/"}),o.getDefaultTokenCredit=function(i){if(i===n){if(!t(r)){r=new e('<b> This application is using Cesium\'s default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>',!0)}return r}},o}),define("Core/PeliasGeocoderService",["./Cartesian3","./Check","./defined","./defineProperties","./GeocodeType","./Rectangle","./Resource"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._url=a.createIfNeeded(e),this._url.appendForwardSlash()}return r(s.prototype,{url:{get:function(){return this._url}}}),s.prototype.geocode=function(t,r){return this._url.getDerivedResource({url:r===n.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:t}}).fetchJson().then(function(t){return t.features.map(function(t){var r,n=t.bbox;if(i(n))r=o.fromDegrees(n[0],n[1],n[2],n[3]);else{var a=t.geometry.coordinates[0],s=t.geometry.coordinates[1];r=e.fromDegrees(a,s)}return{displayName:t.properties.label,destination:r}})})},s}),define("Core/IonGeocoderService",["./Check","./Credit","./defaultValue","./defined","./defineProperties","./Ion","./PeliasGeocoderService","./Rectangle","./Resource"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=i(e,i.EMPTY_OBJECT);var n=i(e.accessToken,o.defaultAccessToken),s=l.createIfNeeded(i(e.server,o.defaultServer));s.appendForwardSlash();var u=o.getDefaultTokenCredit(n);r(u)&&e.scene.frameState.creditDisplay.addDefaultCredit(t.clone(u));var c=s.getDerivedResource({url:"v1/geocode"});r(n)&&c.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=s,this._pelias=new a(c)}return u.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)},u}),define("Core/IonResource",["../ThirdParty/Uri","../ThirdParty/when","./Check","./Credit","./defaultValue","./defined","./defineProperties","./Ion","./Resource","./RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i){var r,n=t.externalType,a=o(n);if(a){if("3DTILES"!==n&&"STK_TERRAIN_SERVER"!==n)throw new u("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");r={url:t.options.url}}else r={url:t.url,retryAttempts:1,retryCallback:d};l.call(this,r),this._ionEndpoint=t,this._ionEndpointDomain=a?void 0:new e(t.url).authority,this._ionEndpointResource=i,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=a}function d(e,i){var r=n(e._ionRoot,e),a=r._ionEndpointResource;return o(i)&&(401===i.statusCode||i.target instanceof Image)?(o(r._pendingPromise)||(r._pendingPromise=a.fetchJson().then(function(e){return r._ionEndpoint=e,e}).always(function(e){return r._pendingPromise=void 0,e})),r._pendingPromise.then(function(t){return e._ionEndpoint=t,!0})):t.resolve(!1)}return o(Object.create)&&(c.prototype=Object.create(l.prototype),c.prototype.constructor=c),c.fromAssetId=function(e,t){var i=c._createEndpointResource(e,t);return i.fetchJson().then(function(e){return new c(e,i)})},a(c.prototype,{credits:{get:function(){return o(this._ionRoot)?this._ionRoot.credits:o(this._credits)?this._credits:(this._credits=c.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}}),c.getCreditsFromEndpoint=function(e,t){var i=e.attributions.map(r.getIonCredit),n=s.getDefaultTokenCredit(t.queryParameters.access_token);return o(n)&&i.push(r.clone(n)),i},c.prototype.clone=function(e){var t=n(this._ionRoot,this);return o(e)||(e=new c(t._ionEndpoint,t._ionEndpointResource)),e=l.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e},c.prototype.fetchImage=function(e){if(!this._isExternal){var t=e;e={preferBlob:!0},o(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return l.prototype.fetchImage.call(this,e)},c.prototype._makeRequest=function(t){if(this._isExternal||new e(this.url).authority!==this._ionEndpointDomain)return l.prototype._makeRequest.call(this,t);var i="*/*;access_token="+this._ionEndpoint.accessToken,r=i,n=this.headers;return o(n)&&o(n.Accept)&&(r=n.Accept+","+i),o(t.headers)?o(t.headers.Accept)?t.headers.Accept=t.headers.Accept+","+i:t.headers.Accept=r:t.headers={Accept:r},l.prototype._makeRequest.call(this,t)},c._createEndpointResource=function(e,t){t=n(t,n.EMPTY_OBJECT);var i=n(t.server,s.defaultServer),r=n(t.accessToken,s.defaultAccessToken);i=l.createIfNeeded(i);var a={url:"v1/assets/"+e+"/endpoint"};return o(r)&&(a.queryParameters={access_token:r}),i.getDerivedResource(a)},c});define("Core/TimeInterval",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this.start=i(e.start)?a.clone(e.start):new a,this.stop=i(e.stop)?a.clone(e.stop):new a,this.data=e.data,this.isStartIncluded=t(e.isStartIncluded,!0),this.isStopIncluded=t(e.isStopIncluded,!0)}r(s.prototype,{isEmpty:{get:function(){var e=a.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var l={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return s.fromIso8601=function(e,r){var o=e.iso8601.split("/");if(2!==o.length)throw new n("options.iso8601 is an invalid ISO 8601 interval.");var u=a.fromIso8601(o[0]),c=a.fromIso8601(o[1]),d=t(e.isStartIncluded,!0),h=t(e.isStopIncluded,!0),p=e.data;return i(r)?(r.start=u,r.stop=c,r.isStartIncluded=d,r.isStopIncluded=h,r.data=p,r):(l.start=u,l.stop=c,l.isStartIncluded=d,l.isStopIncluded=h,l.data=p,new s(l))},s.toIso8601=function(e,t){return a.toIso8601(e.start,t)+"/"+a.toIso8601(e.stop,t)},s.clone=function(e,t){if(i(e))return i(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new s(e)},s.equals=function(e,t,r){return e===t||i(e)&&i(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&a.equals(e.start,t.start)&&a.equals(e.stop,t.stop)&&(e.data===t.data||i(r)&&r(e.data,t.data)))},s.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&a.equalsEpsilon(e.start,t.start,r)&&a.equalsEpsilon(e.stop,t.stop,r)&&(e.data===t.data||i(n)&&n(e.data,t.data)))},s.intersect=function(e,t,r,n){if(!i(t))return s.clone(s.EMPTY,r);var o=e.start,l=e.stop,u=t.start,c=t.stop,d=a.greaterThanOrEquals(u,o)&&a.greaterThanOrEquals(l,u),h=!d&&a.lessThanOrEquals(u,o)&&a.lessThanOrEquals(o,c);if(!d&&!h)return s.clone(s.EMPTY,r);var p=e.isStartIncluded,f=e.isStopIncluded,m=t.isStartIncluded,_=t.isStopIncluded,g=a.lessThan(l,c);return r.start=d?u:o,r.isStartIncluded=p&&m||!a.equals(u,o)&&(d&&m||h&&p),r.stop=g?l:c,r.isStopIncluded=g?f:f&&_||!a.equals(c,l)&&_,r.data=i(n)?n(e.data,t.data):e.data,r},s.contains=function(e,t){if(e.isEmpty)return!1;var i=a.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=a.compare(t,e.stop);return 0===r?e.isStopIncluded:i<0&&r<0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e,t){return s.equals(this,e,t)},s.prototype.equalsEpsilon=function(e,t,i){return s.equalsEpsilon(this,e,t,i)},s.prototype.toString=function(){return s.toIso8601(this)},s.EMPTY=o(new s({start:new a,stop:new a,isStartIncluded:!1,isStopIncluded:!1})),s}),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"));return{MINIMUM_VALUE:r,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:e(new i({start:r,stop:n}))}}),define("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";return e({SHIFT:0,CTRL:1,ALT:2})}),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/ManagedArray",["./Check","./defaultValue","./defineProperties"],function(e,t,i){"use strict";function r(e){e=t(e,0),this._array=new Array(e),this._length=e}return i(r.prototype,{length:{get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},values:{get:function(){return this._array}}}),r.prototype.get=function(e){return this._array[e]},r.prototype.set=function(e,t){e>=this.length&&(this.length=e+1),this._array[e]=t},r.prototype.peek=function(){return this._array[this._length-1]},r.prototype.push=function(e){var t=this.length++;this._array[t]=e},r.prototype.pop=function(){return this._array[--this.length]},r.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},r.prototype.resize=function(e){this.length=e},r.prototype.trim=function(e){e=t(e,this.length),this._array.length=e},r}),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/MapboxApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultAccessToken=void 0;var r,n=!1,o="<b>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 <a href=https://www.mapbox.com/account/apps/>https://www.mapbox.com/account/apps/</a>, 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.</b>";return i.getAccessToken=function(e){return t(e)?e:t(i.defaultAccessToken)?i.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultAccessToken))return t(r)||(r=new e(o,!0)),r},i}),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";return e({NONE:-1,PARTIAL:0,FULL:1})}),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)>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+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)>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)>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])))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);if(t.magnitude(l)>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,b=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,b),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),T=Math.sqrt(h-g*g),E=this._rotationVector(s,i,r,a,n),A=t.fromElements(E.x*E.x*u.x+(E.x*E.y-E.z)*u.y+(E.x*E.z+E.y)*u.z,(E.x*E.y+E.z)*u.x+E.y*E.y*u.y+(E.y*E.z-E.x)*u.z,(E.x*E.z-E.y)*u.x+(E.y*E.z+E.x)*u.y+E.z*E.z*u.z,y);A=t.normalize(A,A);var w=t.multiplyByScalar(A,T,y);E=t.normalize(t.subtract(t.add(v,w,b),s,b),b);var x=t.dot(i,E);E=t.normalize(t.subtract(t.subtract(v,w,E),s,E),E);var P=t.dot(i,E);return x<P?x:P},c}),define("Core/OffsetGeometryInstanceAttribute",["./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties"],function(e,t,i,r,n){"use strict";function o(e,t,r){e=i(e,0),t=i(t,0),r=i(r,0),this.value=new Float32Array([e,t,r])}return n(o.prototype,{componentDatatype:{get:function(){return t.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),o.fromCartesian3=function(e){return new o(e.x,e.y,e.z)},o.toValue=function(e,t){return r(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t},o}),define("Core/OpenCageGeocoderService",["./Cartesian3","./Check","./combine","./defaultValue","./defined","./defineProperties","./GeocodeType","./Rectangle","./Resource"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){e=l.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=r(i,{})}return o(u.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}}}),u.prototype.geocode=function(t){return this._url.getDerivedResource({url:"json",queryParameters:i(this._params,{q:t})}).fetchJson().then(function(t){return t.results.map(function(t){var i,r=t.bounds;if(n(r))i=s.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{var o=t.geometry.lat,a=t.geometry.lng;i=e.fromDegrees(o,a)}return{displayName:t.formatted,destination:i}})})},u}),define("Core/Packable",["./DeveloperError"],function(e){"use strict";return{packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError}}),define("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";return{packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError}}),define("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)};return 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");p.width=o.width+100,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var f=p.getContext("2d");f.font=l+" "+u+" "+s+"px "+a;var m=p.width,_=p.height,g=_/2;f.fillStyle="white",f.fillRect(-1,-1,m+2,_+2),r&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(i,50,g)),n&&(f.fillStyle="black",f.fillText(i,50,g));for(var v=f.getImageData(0,0,m,_).data,y=0,C=4*m,b=v.length;++y<b&&255===v[y];);var S=y/C|0;for(y=b-1;--y>0&&255===v[y];);var T=y/C|0;for(y=0;y<b&&255===v[y];)(y+=C)>=b&&(y=y-b+4);var E=y%C/4|0,A=1;for(y=b-3;y>=0&&255===v[y];)(y-=C)<0&&(y=b-3-4*A++);var w=y%C/4+1|0;o.ascent=g-S,o.descent=T-g,o.bounds={minx:E-50,maxx:w-50,miny:0,maxy:T-S},o.height=T-S+1}return o}}),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+h,b=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,b)}if(u){var T=i(o.fillColor,t.WHITE);m.fillStyle=T.toCssColorString(),m.fillText(n,g+h,b)}return f}}var a;return o}),define("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./Resource","./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.createIfNeeded(e),_=m.fetchImage().then(function(e){return l(f,e,a),u[c]=p,p});return u[c]=_,_}if(i(t)){var g=o(t,{font:"bold "+a+"px sans-serif"});l(f,g,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("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,HALF_FLOAT:t.HALF_FLOAT_OES,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,isPacked:function(e){return 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},sizeInBytes:function(e){switch(e){case i.UNSIGNED_BYTE:return 1;case i.UNSIGNED_SHORT:case i.UNSIGNED_SHORT_4_4_4_4:case i.UNSIGNED_SHORT_5_5_5_1:case i.UNSIGNED_SHORT_5_6_5:case i.HALF_FLOAT:return 2;case i.UNSIGNED_INT:case i.FLOAT:case i.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.HALF_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("Core/PixelFormat",["../Renderer/PixelDatatype","./freezeObject","./WebGLConstants"],function(e,t,i){"use strict";var r={DEPTH_COMPONENT:i.DEPTH_COMPONENT,DEPTH_STENCIL:i.DEPTH_STENCIL,ALPHA:i.ALPHA,RGB:i.RGB,RGBA:i.RGBA,LUMINANCE:i.LUMINANCE,LUMINANCE_ALPHA:i.LUMINANCE_ALPHA,RGB_DXT1:i.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:i.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:i.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:i.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:i.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case r.RGB:return 3;case r.RGBA:return 4;case r.LUMINANCE_ALPHA:return 2;case r.ALPHA:case r.LUMINANCE:default:return 1}},validate:function(e){return e===r.DEPTH_COMPONENT||e===r.DEPTH_STENCIL||e===r.ALPHA||e===r.RGB||e===r.RGBA||e===r.LUMINANCE||e===r.LUMINANCE_ALPHA||e===r.RGB_DXT1||e===r.RGBA_DXT1||e===r.RGBA_DXT3||e===r.RGBA_DXT5||e===r.RGB_PVRTC_4BPPV1||e===r.RGB_PVRTC_2BPPV1||e===r.RGBA_PVRTC_4BPPV1||e===r.RGBA_PVRTC_2BPPV1||e===r.RGB_ETC1},isColorFormat:function(e){return e===r.ALPHA||e===r.RGB||e===r.RGBA||e===r.LUMINANCE||e===r.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===r.DEPTH_COMPONENT||e===r.DEPTH_STENCIL},isCompressedFormat:function(e){return e===r.RGB_DXT1||e===r.RGBA_DXT1||e===r.RGBA_DXT3||e===r.RGBA_DXT5||e===r.RGB_PVRTC_4BPPV1||e===r.RGB_PVRTC_2BPPV1||e===r.RGBA_PVRTC_4BPPV1||e===r.RGBA_PVRTC_2BPPV1||e===r.RGB_ETC1},isDXTFormat:function(e){return e===r.RGB_DXT1||e===r.RGBA_DXT1||e===r.RGBA_DXT3||e===r.RGBA_DXT5},isPVRTCFormat:function(e){return e===r.RGB_PVRTC_4BPPV1||e===r.RGB_PVRTC_2BPPV1||e===r.RGBA_PVRTC_4BPPV1||e===r.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===r.RGB_ETC1},compressedTextureSizeInBytes:function(e,t,i){switch(e){case r.RGB_DXT1:case r.RGBA_DXT1:case r.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*8;case r.RGBA_DXT3:case r.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*16;case r.RGB_PVRTC_4BPPV1:case r.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case r.RGB_PVRTC_2BPPV1:case r.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(t,i,n,o){var a=r.componentsLength(t);return e.isPacked(i)&&(a=1),a*e.sizeInBytes(i)*n*o},alignmentInBytes:function(e,t,i){var n=r.textureSizeInBytes(e,t,i,1)%4;return 0===n?4:2===n?2:1},createTypedArray:function(t,i,n,o){var a=e.sizeInBytes(i);return new(a===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:a===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:a===Float32Array.BYTES_PER_ELEMENT&&i===e.FLOAT?Float32Array:Uint32Array)(r.componentsLength(t)*n*o)},flipY:function(e,t,i,n,o){if(1===o)return e;for(var a=r.createTypedArray(t,i,n,o),s=r.componentsLength(t),l=n*s,u=0;u<o;++u)for(var c=u*o*s,d=(o-u-1)*o*s,h=0;h<l;++h)a[d+h]=e[c+h];return a}};return t(r)}),define("Core/PlaneGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.vertexFormat,c.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}d.packedLength=c.packedLength,d.pack=function(e,t,i){return i=n(i,0),c.pack(e._vertexFormat,t,i),t};var h=new c,p={vertexFormat:h};d.unpack=function(e,t,i){t=n(t,0);var r=c.unpack(e,t,h);return o(i)?(i._vertexFormat=c.clone(r,i._vertexFormat),i):new d(p)};var f=new t(-.5,-.5,0),m=new t(.5,.5,0);return d.createGeometry=function(i){var n,o,c=i._vertexFormat,d=new l;if(c.position){if(o=new Float64Array(12),o[0]=f.x,o[1]=f.y,o[2]=0,o[3]=m.x,o[4]=f.y,o[5]=0,o[6]=m.x,o[7]=m.y,o[8]=0,o[9]=f.x,o[10]=m.y,o[11]=0,d.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),c.normal){var h=new Float32Array(12);h[0]=0,h[1]=0,h[2]=1,h[3]=0,h[4]=0,h[5]=1,h[6]=0,h[7]=0,h[8]=1,h[9]=0,h[10]=0,h[11]=1,d.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:h})}if(c.st){var p=new Float32Array(8);p[0]=0,p[1]=0,p[2]=1,p[3]=0,p[4]=1,p[5]=1,p[6]=0,p[7]=1,d.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:p})}if(c.tangent){var _=new Float32Array(12);_[0]=1,_[1]=0,_[2]=0,_[3]=1,_[4]=0,_[5]=0,_[6]=1,_[7]=0,_[8]=0,_[9]=1,_[10]=0,_[11]=0,d.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:_})}if(c.bitangent){var g=new Float32Array(12);g[0]=0,g[1]=1,g[2]=0,g[3]=0,g[4]=1,g[5]=0,g[6]=0,g[7]=1,g[8]=0,g[9]=0,g[10]=1,g[11]=0,d.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:g})}n=new Uint16Array(6),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3}return new a({attributes:d,indices:n,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,Math.sqrt(2))})},d}),define("Core/PlaneOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this._workerName="createPlaneOutlineGeometry"}u.packedLength=0,u.pack=function(e,t){return t},u.unpack=function(e,t,i){return n(i)?i:new u};var c=new t(-.5,-.5,0),d=new t(.5,.5,0);return u.createGeometry=function(){var i=new s,n=new Uint16Array(8),u=new Float64Array(12);return u[0]=c.x,u[1]=c.y,u[2]=c.z,u[3]=d.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=c.z,u[9]=c.x,u[10]=d.y,u[11]=c.z,i.position=new a({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:u}),n[0]=0,n[1]=1,n[2]=1,n[3]=2,n[4]=2,n[5]=3,n[6]=3,n[7]=0,new o({attributes:i,indices:n,primitiveType:l.LINES,boundingSphere:new e(t.ZERO,Math.sqrt(2))})},u}),define("Core/PolygonGeometry",["./ArcType","./arrayFill","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./EllipsoidRhumbLine","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryOffsetAttribute","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./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,b,S,T,E,A,w,x,P,D,I,M){"use strict";function R(e,t,i,r){var n=r.cartesianToCartographic(e,z),o=n.height,a=r.cartesianToCartographic(t,V);a.height=o,r.cartographicToCartesian(a,t);var s=r.cartesianToCartographic(i,V);s.height=o-100,r.cartographicToCartesian(s,i)}function O(e){var i=e.vertexFormat,r=e.geometry,a=e.shadowVolume,s=r.attributes.position.values,u=s.length,d=e.wall,h=e.top||d,p=e.bottom||d;if(i.st||i.normal||i.tangent||i.bitangent||a){var f=e.boundingRectangle,m=e.tangentPlane,_=e.ellipsoid,g=e.stRotation,y=e.perPositionHeight,b=Z;b.x=f.x,b.y=f.y;var S,E=i.st?new Float32Array(u/3*2):void 0;i.normal&&(S=y&&h&&!d?r.attributes.normal.values:new Float32Array(u));var w=i.tangent?new Float32Array(u):void 0,x=i.bitangent?new Float32Array(u):void 0,D=a?new Float32Array(u):void 0,I=0,M=0,O=H,L=W,N=q,F=!0,B=te,k=ie;if(0!==g){var z=P.fromAxisAngle(m._plane.normal,g,ee);B=A.fromQuaternion(z,B),z=P.fromAxisAngle(m._plane.normal,-g,ee),k=A.fromQuaternion(z,k)}else B=A.clone(A.IDENTITY,B),k=A.clone(A.IDENTITY,k);var V=0,U=0;h&&p&&(V=u/2,U=u/3,u/=2);for(var re=0;re<u;re+=3){var ne=o.fromArray(s,re,$);if(i.st){var oe=A.multiplyByVector(B,ne,G);oe=_.scaleToGeodeticSurface(oe,oe);var ae=m.projectPointOntoPlane(oe,J);n.subtract(ae,b,ae);var se=T.clamp(ae.x/f.width,0,1),le=T.clamp(ae.y/f.height,0,1);p&&(E[I+U]=se,E[I+1+U]=le),h&&(E[I]=se,E[I+1]=le),I+=2}if(i.normal||i.tangent||i.bitangent||a){var ue=M+1,ce=M+2;if(d){if(re+3<u){var de=o.fromArray(s,re+3,Y);if(F){var he=o.fromArray(s,re+u,j);y&&R(ne,de,he,_),o.subtract(de,ne,de),o.subtract(he,ne,he),O=o.normalize(o.cross(he,de,O),O),F=!1}o.equalsEpsilon(de,ne,T.EPSILON10)&&(F=!0)}(i.tangent||i.bitangent)&&(N=_.geodeticSurfaceNormal(ne,N),i.tangent&&(L=o.normalize(o.cross(N,O,L),L)))}else O=_.geodeticSurfaceNormal(ne,O),(i.tangent||i.bitangent)&&(y&&(X=o.fromArray(S,M,X),Q=o.cross(o.UNIT_Z,X,Q),Q=o.normalize(A.multiplyByVector(k,Q,Q),Q),i.bitangent&&(K=o.normalize(o.cross(X,Q,K),K))),L=o.cross(o.UNIT_Z,O,L),L=o.normalize(A.multiplyByVector(k,L,L),L),i.bitangent&&(N=o.normalize(o.cross(O,L,N),N)));i.normal&&(e.wall?(S[M+V]=O.x,S[ue+V]=O.y,S[ce+V]=O.z):p&&(S[M+V]=-O.x,S[ue+V]=-O.y,S[ce+V]=-O.z),(h&&!y||d)&&(S[M]=O.x,S[ue]=O.y,S[ce]=O.z)),a&&(d&&(O=_.geodeticSurfaceNormal(ne,O)),D[M+V]=-O.x,D[ue+V]=-O.y,D[ce+V]=-O.z),i.tangent&&(e.wall?(w[M+V]=L.x,w[ue+V]=L.y,w[ce+V]=L.z):p&&(w[M+V]=-L.x,w[ue+V]=-L.y,w[ce+V]=-L.z),h&&(y?(w[M]=Q.x,w[ue]=Q.y,w[ce]=Q.z):(w[M]=L.x,w[ue]=L.y,w[ce]=L.z))),i.bitangent&&(p&&(x[M+V]=N.x,x[ue+V]=N.y,x[ce+V]=N.z),h&&(y?(x[M]=K.x,x[ue]=K.y,x[ce]=K.z):(x[M]=N.x,x[ue]=N.y,x[ce]=N.z))),M+=3}}i.st&&(r.attributes.st=new v({componentDatatype:l.FLOAT,componentsPerAttribute:2,values:E})),i.normal&&(r.attributes.normal=new v({componentDatatype:l.FLOAT,componentsPerAttribute:3,values:S})),i.tangent&&(r.attributes.tangent=new v({componentDatatype:l.FLOAT,componentsPerAttribute:3,values:w})),i.bitangent&&(r.attributes.bitangent=new v({componentDatatype:l.FLOAT,componentsPerAttribute:3,values:x})),a&&(r.attributes.extrudeDirection=new v({componentDatatype:l.FLOAT,componentsPerAttribute:3,values:D}))}if(e.extrude&&c(e.offsetAttribute)){var pe=s.length/3,fe=new Uint8Array(pe);if(e.offsetAttribute===C.TOP)h&&p||d?fe=t(fe,1,0,pe/2):h&&(fe=t(fe,1));else{var me=e.offsetAttribute===C.NONE?0:1;fe=t(fe,me)}r.attributes.applyOffset=new v({componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:1,values:fe})}return r}function L(t,i,r,n,o){if(o=u(o,new D),!c(t)||t.length<3)return o.west=0,o.north=0,o.south=0,o.east=0,o;if(r===e.RHUMB)return D.fromCartesianArray(t,i,o);ae.ellipsoid.equals(i)||(ae=new f(void 0,void 0,i)),o.west=Number.POSITIVE_INFINITY,o.east=Number.NEGATIVE_INFINITY,o.south=Number.POSITIVE_INFINITY,o.north=Number.NEGATIVE_INFINITY,oe.westOverIDL=Number.POSITIVE_INFINITY,oe.eastOverIDL=Number.NEGATIVE_INFINITY;for(var a,s=1/T.chordLength(n,i.maximumRadius),l=t.length,d=i.cartesianToCartographic(t[0],ne),h=re,p=1;p<l;p++)a=h,h=d,d=i.cartesianToCartographic(t[p],a),ae.setEndPoints(h,d),N(ae,s,o,oe);return a=h,h=d,d=i.cartesianToCartographic(t[0],a),ae.setEndPoints(h,d),N(ae,s,o,oe),o.east-o.west>oe.eastOverIDL-oe.westOverIDL&&(o.west=oe.westOverIDL,o.east=oe.eastOverIDL,o.east>T.PI&&(o.east=o.east-T.TWO_PI),o.west>T.PI&&(o.west=o.west-T.TWO_PI)),o}function N(e,t,i,r){for(var n=e.surfaceDistance,o=Math.ceil(n*t),a=o>0?n/(o-1):Number.POSITIVE_INFINITY,s=0,l=0;l<o;l++){var u=e.interpolateUsingSurfaceDistance(s,se);s+=a;var c=u.longitude,d=u.latitude;i.west=Math.min(i.west,c),i.east=Math.max(i.east,c),i.south=Math.min(i.south,d),i.north=Math.max(i.north,d);var h=c>=0?c:c+T.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,h),r.eastOverIDL=Math.max(r.eastOverIDL,h)}}function F(e,t,i,r,n,o,a,s,l){var u,c={walls:[]};if(o||a){var d,h,p=w.createGeometryFromPositions(e,t,i,n,s,l),f=p.attributes.position.values,m=p.indices;if(o&&a){var g=f.concat(f);d=g.length/3,h=S.createTypedArray(d,2*m.length),h.set(m);var v=m.length,C=d/2;for(u=0;u<v;u+=3){var b=h[u]+C,T=h[u+1]+C,E=h[u+2]+C;h[u+v]=E,h[u+1+v]=T,h[u+2+v]=b}if(p.attributes.position.values=g,n&&s.normal){var A=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(g.length),p.attributes.normal.values.set(A)}p.indices=h}else if(a){for(d=f.length/3,h=S.createTypedArray(d,m.length),u=0;u<m.length;u+=3)h[u]=m[u+2],h[u+1]=m[u+1],h[u+2]=m[u];p.indices=h}c.topAndBottom=new y({geometry:p})}var P=r.outerRing,D=_.fromPoints(P,e),I=D.projectPointsOntoPlane(P,le),R=x.computeWindingOrder2D(I);R===M.CLOCKWISE&&(P=P.slice().reverse());var O=w.computeWallGeometry(P,e,i,n,l);c.walls.push(new y({geometry:O}));var L=r.holes;for(u=0;u<L.length;u++){var N=L[u];D=_.fromPoints(N,e),I=D.projectPointsOntoPlane(N,le),R=x.computeWindingOrder2D(I),R===M.COUNTER_CLOCKWISE&&(N=N.slice().reverse()),O=w.computeWallGeometry(N,e,i,n,l),c.walls.push(new y({geometry:O}))}return c}function B(t){var i=t.polygonHierarchy,r=u(t.vertexFormat,I.DEFAULT),n=u(t.ellipsoid,p.WGS84),o=u(t.granularity,T.RADIANS_PER_DEGREE),a=u(t.stRotation,0),s=u(t.perPositionHeight,!1),l=s&&c(t.extrudedHeight),d=u(t.height,0),h=u(t.extrudedHeight,d);if(!l){var f=Math.max(d,h);h=Math.min(d,h),d=f}this._vertexFormat=I.clone(r),this._ellipsoid=p.clone(n),this._granularity=o,this._stRotation=a,this._height=d,this._extrudedHeight=h,this._closeTop=u(t.closeTop,!0),this._closeBottom=u(t.closeBottom,!0),this._polygonHierarchy=i,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._shadowVolume=u(t.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=u(t.arcType,e.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=w.computeHierarchyPackedLength(i)+p.packedLength+I.packedLength+12}function k(e){var t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];var i=e._ellipsoid,r=e._polygonHierarchy.positions,n=e.rectangle;return g._textureCoordinateRotationPoints(r,t,i,n)}var z=new a,V=new a,U=new i,G=new o,H=new o,W=new o,q=new o,Y=new o,j=new o,X=new o,Q=new o,K=new o,Z=new n,J=new n,$=new o,ee=new P,te=new A,ie=new A,re=new a,ne=new a,oe={westOverIDL:0,eastOverIDL:0},ae=new f,se=new a,le=[];B.fromPositions=function(e){return e=u(e,u.EMPTY_OBJECT),new B({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,offsetAttribute:e.offsetAttribute,arcType:e.arcType})},B.pack=function(e,t,i){return i=u(i,0),i=w.packPolygonHierarchy(e._polygonHierarchy,t,i),p.pack(e._ellipsoid,t,i),i+=p.packedLength,I.pack(e._vertexFormat,t,i),i+=I.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._perPositionHeightExtrude?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++]=u(e._offsetAttribute,-1),t[i++]=e._arcType,t[i]=e.packedLength,t};var ue=p.clone(p.UNIT_SPHERE),ce=new I,de={polygonHierarchy:{}};return B.unpack=function(e,t,i){t=u(t,0);var r=w.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=p.unpack(e,t,ue);t+=p.packedLength;var o=I.unpack(e,t,ce);t+=I.packedLength;var a=e[t++],s=e[t++],l=e[t++],d=e[t++],h=1===e[t++],f=1===e[t++],m=1===e[t++],_=1===e[t++],g=1===e[t++],v=e[t++],y=e[t++],C=e[t];return c(i)||(i=new B(de)),i._polygonHierarchy=r,i._ellipsoid=p.clone(n,i._ellipsoid),i._vertexFormat=I.clone(o,i._vertexFormat),i._height=a,i._extrudedHeight=s,i._granularity=l,i._stRotation=d,i._perPositionHeightExtrude=h,i._perPositionHeight=f,i._closeTop=m,i._closeBottom=_,i._shadowVolume=g,i._offsetAttribute=-1===v?void 0:v,i._arcType=y,i.packedLength=C,i},B.computeRectangle=function(t,i){var r=u(t.granularity,T.RADIANS_PER_DEGREE),n=u(t.arcType,e.GEODESIC),o=t.polygonHierarchy,a=u(t.ellipsoid,p.WGS84);return L(o.positions,a,n,r,i)},B.createGeometry=function(e){var i=e._vertexFormat,n=e._ellipsoid,o=e._granularity,a=e._stRotation,s=e._polygonHierarchy,u=e._perPositionHeight,d=e._closeTop,h=e._closeBottom,p=e._arcType,f=s.positions;if(!(f.length<3)){var m=_.fromPoints(f,n),E=w.polygonsFromHierarchy(s,m.projectPointsOntoPlane.bind(m),!u,n),A=E.hierarchy,P=E.polygons;if(0!==A.length){f=A[0].outerRing;var D,I=w.computeBoundingRectangle(m.plane.normal,m.projectPointOntoPlane.bind(m),f,a,U),M=[],R=e._height,L=e._extrudedHeight,N=e._perPositionHeightExtrude||!T.equalsEpsilon(R,L,0,T.EPSILON2),B={perPositionHeight:u,vertexFormat:i,geometry:void 0,tangentPlane:m,boundingRectangle:I,ellipsoid:n,stRotation:a,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p};if(N)for(B.extrude=!0,B.top=d,B.bottom=h,B.shadowVolume=e._shadowVolume,B.offsetAttribute=e._offsetAttribute,D=0;D<P.length;D++){var k,z=F(n,P[D],o,A[D],u,d,h,i,p);d&&h?(k=z.topAndBottom,B.geometry=w.scaleToGeodeticHeightExtruded(k.geometry,R,L,n,u)):d?(k=z.topAndBottom,k.geometry.attributes.position.values=x.scaleToGeodeticHeight(k.geometry.attributes.position.values,R,n,!u),B.geometry=k.geometry):h&&(k=z.topAndBottom,k.geometry.attributes.position.values=x.scaleToGeodeticHeight(k.geometry.attributes.position.values,L,n,!0),B.geometry=k.geometry),(d||h)&&(B.wall=!1,k.geometry=O(B),M.push(k));var V=z.walls;B.wall=!0;for(var G=0;G<V.length;G++){var H=V[G];B.geometry=w.scaleToGeodeticHeightExtruded(H.geometry,R,L,n,u),H.geometry=O(B),M.push(H)}}else for(D=0;D<P.length;D++){var W=new y({geometry:w.createGeometryFromPositions(n,P[D],o,u,i,p)});if(W.geometry.attributes.position.values=x.scaleToGeodeticHeight(W.geometry.attributes.position.values,R,n,!u),B.geometry=W.geometry,W.geometry=O(B),c(e._offsetAttribute)){var q=W.geometry.attributes.position.values.length,Y=new Uint8Array(q/3),j=e._offsetAttribute===C.NONE?0:1;t(Y,j),W.geometry.attributes.applyOffset=new v({componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}M.push(W)}var X=b.combineInstances(M)[0];X.attributes.position.values=new Float64Array(X.attributes.position.values),X.indices=S.createTypedArray(X.attributes.position.values.length/3,X.indices);var Q=X.attributes,K=r.fromVertices(Q.position.values);return i.position||delete Q.position,new g({attributes:Q,indices:X.indices,primitiveType:X.primitiveType,boundingSphere:K,offsetAttribute:e._offsetAttribute})}}},B.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new B({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:I.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},d(B.prototype,{rectangle:{get:function(){if(!c(this._rectangle)){var e=this._polygonHierarchy.positions;this._rectangle=L(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=k(this)),this._textureCoordinateRotationPoints}}}),B}),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",["./ArcType","./arrayFill","./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryOffsetAttribute","./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,b,S,T,E){"use strict";function A(t,i,r,n,o){var s=d.fromPoints(i,t),l=s.projectPointsOntoPlane(i,P);b.computeWindingOrder2D(l)===E.CLOCKWISE&&(l.reverse(),i=i.slice().reverse());var u,c,_=i.length,g=0;if(n)for(u=new Float64Array(2*_*3),c=0;c<_;c++){var y=i[c],T=i[(c+1)%_];u[g++]=y.x,u[g++]=y.y,u[g++]=y.z,u[g++]=T.x,u[g++]=T.y,u[g++]=T.z}else{var A=0;if(o===e.GEODESIC)for(c=0;c<_;c++)A+=C.subdivideLineCount(i[c],i[(c+1)%_],r);else if(o===e.RHUMB)for(c=0;c<_;c++)A+=C.subdivideRhumbLineCount(t,i[c],i[(c+1)%_],r);for(u=new Float64Array(3*A),c=0;c<_;c++){var w;o===e.GEODESIC?w=C.subdivideLine(i[c],i[(c+1)%_],r,D):o===e.RHUMB&&(w=C.subdivideRhumbLine(t,i[c],i[(c+1)%_],r,D));for(var x=w.length,I=0;I<x;++I)u[g++]=w[I]}}_=u.length/3;var M=2*_,R=v.createTypedArray(_,M);for(g=0,c=0;c<_-1;c++)R[g++]=c,R[g++]=c+1;return R[g++]=_-1,R[g++]=0,new m({geometry:new h({attributes:new f({position:new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:u})}),indices:R,primitiveType:S.LINES})})}function w(t,i,r,n,o){var s=d.fromPoints(i,t),l=s.projectPointsOntoPlane(i,P);b.computeWindingOrder2D(l)===E.CLOCKWISE&&(l.reverse(),i=i.slice().reverse());var u,c,_=i.length,g=new Array(_),y=0;if(n)for(u=new Float64Array(2*_*3*2),c=0;c<_;++c){g[c]=y/3;var T=i[c],A=i[(c+1)%_];u[y++]=T.x,u[y++]=T.y,u[y++]=T.z,u[y++]=A.x,u[y++]=A.y,u[y++]=A.z}else{var w=0;if(o===e.GEODESIC)for(c=0;c<_;c++)w+=C.subdivideLineCount(i[c],i[(c+1)%_],r);else if(o===e.RHUMB)for(c=0;c<_;c++)w+=C.subdivideRhumbLineCount(t,i[c],i[(c+1)%_],r);for(u=new Float64Array(3*w*2),c=0;c<_;++c){g[c]=y/3;var x;o===e.GEODESIC?x=C.subdivideLine(i[c],i[(c+1)%_],r,D):o===e.RHUMB&&(x=C.subdivideRhumbLine(t,i[c],i[(c+1)%_],r,D));for(var I=x.length,M=0;M<I;++M)u[y++]=x[M]}}_=u.length/6;var R=g.length,O=2*(2*_+R),L=v.createTypedArray(_+R,O);for(y=0,c=0;c<_;++c)L[y++]=c,L[y++]=(c+1)%_,L[y++]=c+_,L[y++]=(c+1)%_+_;for(c=0;c<R;c++){var N=g[c];L[y++]=N,L[y++]=N+_}return new m({geometry:new h({attributes:new f({position:new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:u})}),indices:L,primitiveType:S.LINES})})}function x(t){var i=t.polygonHierarchy,r=s(t.ellipsoid,c.WGS84),n=s(t.granularity,y.RADIANS_PER_DEGREE),o=s(t.perPositionHeight,!1),a=o&&l(t.extrudedHeight),u=s(t.arcType,e.GEODESIC),d=s(t.height,0),h=s(t.extrudedHeight,d);if(!a){var p=Math.max(d,h);h=Math.min(d,h),d=p}this._ellipsoid=c.clone(r),this._granularity=n,this._height=d,this._extrudedHeight=h,this._arcType=u,this._polygonHierarchy=i,this._perPositionHeight=o,this._perPositionHeightExtrude=a,this._offsetAttribute=t.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=C.computeHierarchyPackedLength(i)+c.packedLength+8}var P=[],D=[];x.pack=function(e,t,i){return i=s(i,0),i=C.packPolygonHierarchy(e._polygonHierarchy,t,i),c.pack(e._ellipsoid,t,i),i+=c.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=s(e._offsetAttribute,-1),t[i]=e.packedLength,t};var I=c.clone(c.UNIT_SPHERE),M={polygonHierarchy:{}};return x.unpack=function(e,t,i){t=s(t,0);var r=C.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=c.unpack(e,t,I);t+=c.packedLength;var o=e[t++],a=e[t++],u=e[t++],d=1===e[t++],h=1===e[t++],p=e[t++],f=e[t++],m=e[t];return l(i)||(i=new x(M)),i._polygonHierarchy=r,i._ellipsoid=c.clone(n,i._ellipsoid),i._height=o,i._extrudedHeight=a,i._granularity=u,i._perPositionHeight=h,i._perPositionHeightExtrude=d,i._arcType=p,i._offsetAttribute=-1===f?void 0:f,i.packedLength=m,i},x.fromPositions=function(e){return e=s(e,s.EMPTY_OBJECT),new x({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},x.createGeometry=function(e){var i=e._ellipsoid,n=e._granularity,o=e._polygonHierarchy,s=e._perPositionHeight,u=e._arcType,c=C.polygonOutlinesFromHierarchy(o,!s,i);if(0!==c.length){var d,f,m,v=[],S=y.chordLength(n,i.maximumRadius),T=e._height,E=e._extrudedHeight,x=e._perPositionHeightExtrude||!y.equalsEpsilon(T,E,0,y.EPSILON2);if(x)for(m=0;m<c.length;m++){if(d=w(i,c[m],S,s,u),d.geometry=C.scaleToGeodeticHeightExtruded(d.geometry,T,E,i,s),l(e._offsetAttribute)){var P=d.geometry.attributes.position.values.length/3,D=new Uint8Array(P);e._offsetAttribute===_.TOP?D=t(D,1,0,P/2):(f=e._offsetAttribute===_.NONE?0:1,D=t(D,f)),d.geometry.attributes.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}v.push(d)}else for(m=0;m<c.length;m++){if(d=A(i,c[m],S,s,u),d.geometry.attributes.position.values=b.scaleToGeodeticHeight(d.geometry.attributes.position.values,T,i,!s),l(e._offsetAttribute)){var I=d.geometry.attributes.position.values.length,M=new Uint8Array(I/3);f=e._offsetAttribute===_.NONE?0:1,t(M,f),d.geometry.attributes.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}v.push(d)}var R=g.combineInstances(v)[0],O=r.fromVertices(R.attributes.position.values);return new h({attributes:R.attributes,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:O,offsetAttribute:e._offsetAttribute})}},x}),define("Core/PolylineGeometry",["./ArcType","./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,v){"use strict";function y(e,t,i,r,o){var a=b;a.length=o;var s,l=i.red,u=i.green,c=i.blue,d=i.alpha,h=r.red,p=r.green,f=r.blue,m=r.alpha;if(n.equals(i,r)){for(s=0;s<o;s++)a[s]=n.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 n(l+s*_,u+s*g,c+s*v,d+s*y);return a}function C(t){t=a(t,a.EMPTY_OBJECT);var i=t.positions,o=t.colors,l=a(t.width,1),c=a(t.colorsPerVertex,!1);this._positions=i,this._colors=o,this._width=l,this._colorsPerVertex=c,this._vertexFormat=v.clone(a(t.vertexFormat,v.DEFAULT)),this._arcType=a(t.arcType,e.GEODESIC),this._granularity=a(t.granularity,m.RADIANS_PER_DEGREE),this._ellipsoid=u.clone(a(t.ellipsoid,u.WGS84)),this._workerName="createPolylineGeometry";var d=1+i.length*r.packedLength;d+=s(o)?1+o.length*n.packedLength:1,this.packedLength=d+u.packedLength+v.packedLength+4}var b=[];C.pack=function(e,t,i){i=a(i,0);var o,l=e._positions,c=l.length;for(t[i++]=c,o=0;o<c;++o,i+=r.packedLength)r.pack(l[o],t,i);var d=e._colors;for(c=s(d)?d.length:0,t[i++]=c,o=0;o<c;++o,i+=n.packedLength)n.pack(d[o],t,i);return u.pack(e._ellipsoid,t,i),i+=u.packedLength,v.pack(e._vertexFormat,t,i),i+=v.packedLength,t[i++]=e._width,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t};var S=u.clone(u.UNIT_SPHERE),T=new v,E={positions:void 0,colors:void 0,ellipsoid:S,vertexFormat:T,width:void 0,
- colorsPerVertex:void 0,arcType:void 0,granularity:void 0};C.unpack=function(e,t,i){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;o<l;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var d=l>0?new Array(l):void 0;for(o=0;o<l;++o,t+=n.packedLength)d[o]=n.unpack(e,t);var h=u.unpack(e,t,S);t+=u.packedLength;var p=v.unpack(e,t,T);t+=v.packedLength;var f=e[t++],m=1===e[t++],_=e[t++],g=e[t];return s(i)?(i._positions=c,i._colors=d,i._ellipsoid=u.clone(h,i._ellipsoid),i._vertexFormat=v.clone(p,i._vertexFormat),i._width=f,i._colorsPerVertex=m,i._arcType=_,i._granularity=g,i):(E.positions=c,E.colors=d,E.width=f,E.colorsPerVertex=m,E.arcType=_,E.granularity=g,new C(E))};var A=new r,w=new r,x=new r,P=new r;return C.createGeometry=function(a){var l,u,v,C=a._width,S=a._vertexFormat,T=a._colors,E=a._colorsPerVertex,D=a._arcType,I=a._granularity,M=a._ellipsoid,R=t(a._positions,r.equalsEpsilon),O=R.length;if(!(O<2||C<=0)){if(D===e.GEODESIC||D===e.RHUMB){var L,N;D===e.GEODESIC?(L=m.chordLength(I,M.maximumRadius),N=_.numberOfPoints):(L=I,N=_.numberOfPointsRhumbLine);var F=_.extractHeights(R,M);if(s(T)){var B=1;for(l=0;l<O-1;++l)B+=N(R[l],R[l+1],L);var k=new Array(B),z=0;for(l=0;l<O-1;++l){var V=R[l],U=R[l+1],G=T[l],H=N(V,U,L);if(E&&l<B){var W=T[l+1],q=y(V,U,G,W,H),Y=q.length;for(u=0;u<Y;++u)k[z++]=q[u]}else for(u=0;u<H;++u)k[z++]=n.clone(G)}k[z]=n.clone(T[T.length-1]),T=k,b.length=0}R=D===e.GEODESIC?_.generateCartesianArc({positions:R,minDistance:L,ellipsoid:M,height:F}):_.generateCartesianRhumbArc({positions:R,granularity:L,ellipsoid:M,height:F})}O=R.length;var j,X=4*O-4,Q=new Float64Array(3*X),K=new Float64Array(3*X),Z=new Float64Array(3*X),J=new Float32Array(2*X),$=S.st?new Float32Array(2*X):void 0,ee=s(T)?new Uint8Array(4*X):void 0,te=0,ie=0,re=0,ne=0;for(u=0;u<O;++u){0===u?(j=A,r.subtract(R[0],R[1],j),r.add(R[0],j,j)):j=R[u-1],r.clone(j,x),r.clone(R[u],w),u===O-1?(j=A,r.subtract(R[O-1],R[O-2],j),r.add(R[O-1],j,j)):j=R[u+1],r.clone(j,P);var oe,ae;s(ee)&&(oe=0===u||E?T[u]:T[u-1],u!==O-1&&(ae=T[u]));var se=0===u?2:0,le=u===O-1?2:4;for(v=se;v<le;++v){r.pack(w,Q,te),r.pack(x,K,te),r.pack(P,Z,te),te+=3;var ue=v-2<0?-1:1;if(J[ie++]=v%2*2-1,J[ie++]=ue*C,S.st&&($[re++]=u/(O-1),$[re++]=Math.max(J[ie-2],0)),s(ee)){var ce=v<2?oe:ae;ee[ne++]=n.floatToByte(ce.red),ee[ne++]=n.floatToByte(ce.green),ee[ne++]=n.floatToByte(ce.blue),ee[ne++]=n.floatToByte(ce.alpha)}}}var de=new h;de.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:Q}),de.prevPosition=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:K}),de.nextPosition=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:Z}),de.expandAndWidth=new d({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:J}),S.st&&(de.st=new d({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:$})),s(ee)&&(de.color=new d({componentDatatype:o.UNSIGNED_BYTE,componentsPerAttribute:4,values:ee,normalize:!0}));var he=f.createTypedArray(X,6*O-6),pe=0,fe=0,me=O-1;for(u=0;u<me;++u)he[fe++]=pe,he[fe++]=pe+2,he[fe++]=pe+1,he[fe++]=pe+1,he[fe++]=pe+2,he[fe++]=pe+3,pe+=4;return new c({attributes:de,indices:he,primitiveType:g.TRIANGLES,boundingSphere:i.fromPoints(R),geometryType:p.POLYLINES})}},C}),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.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",r.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",r.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",r}),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,b,S){"use strict";function T(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,b=t.length,S=e.length/3,T=(S-2*b)/(2*b),E=v.triangulate(t),A=(T-1)*b*6+2*E.length,w=m.createTypedArray(S,A),x=2*b,P=0;for(s=0;s<T-1;s++){for(l=0;l<b-1;l++)u=2*l+s*b*2,y=u+x,c=u+1,_=c+x,w[P++]=c,w[P++]=u,w[P++]=_,w[P++]=_,w[P++]=u,w[P++]=y;u=2*b-2+s*b*2,c=u+1,_=c+x,y=u+x,w[P++]=c,w[P++]=u,w[P++]=_,w[P++]=_,w[P++]=u,w[P++]=y}if(n.st||n.tangent||n.bitangent){var D,I,M=new Float32Array(2*S),R=1/(T-1),O=1/r.height,L=r.height/2,N=0;for(s=0;s<T;s++){for(D=s*R,I=O*(t[0].y+L),M[N++]=D,M[N++]=I,l=1;l<b;l++)I=O*(t[l].y+L),M[N++]=D,M[N++]=I,M[N++]=D,M[N++]=I;I=O*(t[0].y+L),M[N++]=D,M[N++]=I}for(l=0;l<b;l++)D=0,I=O*(t[l].y+L),M[N++]=D,M[N++]=I;for(l=0;l<b;l++)D=(T-1)*R,I=O*(t[l].y+L),M[N++]=D,M[N++]=I;a.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var F=S-2*b;for(s=0;s<E.length;s+=3){var B=E[s]+F,k=E[s+1]+F,z=E[s+2]+F;w[P++]=B,w[P++]=k,w[P++]=z,w[P++]=z+b,w[P++]=k+b,w[P++]=B+b}var V=new d({attributes:a,indices:w,boundingSphere:i.fromVertices(e),primitiveType:C.TRIANGLES});if(n.normal&&(V=f.computeNormal(V)),n.tangent||n.bitangent){try{V=f.computeTangentAndBitangent(V)}catch(e){g("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(V.attributes.tangent=void 0),n.bitangent||(V.attributes.bitangent=void 0),n.st||(V.attributes.st=void 0)}return V}function E(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=b.clone(s(e.vertexFormat,b.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+b.packedLength+2}E.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,b.pack(e._vertexFormat,t,i),i+=b.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var A=c.clone(c.UNIT_SPHERE),w=new b,x={polylinePositions:void 0,shapePositions:void 0,ellipsoid:A,vertexFormat:w,cornerType:void 0,granularity:void 0};E.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,A);t+=c.packedLength;var p=b.unpack(e,t,w);t+=b.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=b.clone(p,i._vertexFormat),i._cornerType=f,i._granularity=m,i):(x.polylinePositions=u,x.shapePositions=d,x.cornerType=f,x.granularity=m,new E(x))};var P=new t;return E.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);return T(y.computePositions(o,a,s,i,!0),a,s,i._vertexFormat)}},E}),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}return new d({attributes:r,indices:f.createTypedArray(l,m),boundingSphere:i.fromVertices(e),primitiveType:v.LINES})}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._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}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,t[i++]=e._cornerType,t[i]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),T={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,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,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):(T.polylinePositions=u,T.shapePositions=d,T.cornerType=p,T.granularity=f,new b(T))};var E=new t;return b.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,E);return C(g.computePositions(o,a,s,i,!1),a)}},b}),define("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e){var i=e.points,r=e.times;return function(o,a){t(a)||(a=new n);var s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),l=(o-r[s])/(r[s+1]-r[s]),u=i[s],c=i[s+1];return n.fastSlerp(u,c,l,a)}}function s(t){t=e(t,e.EMPTY_OBJECT);var i=t.points,r=t.times;this._times=r,this._points=i,this._evaluateFunction=a(this),this._lastTimeIndex=0}return i(s.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),s.prototype.findTimeInterval=o.prototype.findTimeInterval,s.prototype.wrapTime=o.prototype.wrapTime,s.prototype.clampTime=o.prototype.clampTime,s.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},s}),define("ThirdParty/quickselect",[],function(){"use strict";function e(e,i,n,o,a){t(e,i,n||0,o||e.length-1,a||r)}function t(e,r,n,o,a){for(;o>n;){if(o-n>600){var s=o-n+1,l=r-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-l*c/s+d)),Math.min(o,Math.floor(r+(s-l)*c/s+d)),a)}var h=e[r],p=n,f=o;for(i(e,n,r),a(e[o],h)>0&&i(e,n,o);p<f;){for(i(e,p,f),p++,f--;a(e[p],h)<0;)p++;for(;a(e[f],h)>0;)f--}0===a(e[n],h)?i(e,n,f):(f++,i(e,f,o)),f<=r&&(n=f+1),r<=f&&(o=f-1)}}function i(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function r(e,t){return e<t?-1:e>t?1:0}return e}),define("ThirdParty/rbush",["./quickselect"],function(e){"use strict";function t(e,i){if(!(this instanceof t))return new t(e,i);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&this._initFormat(i),this.clear()}function i(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function r(e,t){n(e,0,e.children.length,t,e)}function n(e,t,i,r,n){n||(n=f(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a,s=t;s<i;s++)a=e.children[s],o(n,e.leaf?r(a):a);return n}function o(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function a(e,t){return e.minX-t.minX}function s(e,t){return e.minY-t.minY}function l(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function u(e){return e.maxX-e.minX+(e.maxY-e.minY)}function c(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function d(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,o-r)}function h(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function p(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function f(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,i,r,n,o){for(var a,s=[i,r];s.length;)r=s.pop(),i=s.pop(),r-i<=n||(a=i+Math.ceil((r-i)/n/2)*n,e(t,a,i,r,o),s.push(i,a,a,r))}return t.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!p(e,t))return i;for(var n,o,a,s,l=[];t;){for(n=0,o=t.children.length;n<o;n++)a=t.children[n],s=t.leaf?r(a):a,p(e,s)&&(t.leaf?i.push(a):h(e,s)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!p(e,t))return!1;for(var r,n,o,a,s=[];t;){for(r=0,n=t.children.length;r<n;r++)if(o=t.children[r],a=t.leaf?i(o):o,p(e,a)){if(t.leaf||h(e,a))return!0;s.push(o)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=f([]),this},remove:function(e,t){if(!e)return this;for(var r,n,o,a,s=this.data,l=this.toBBox(e),u=[],c=[];s||u.length;){if(s||(s=u.pop(),n=u[u.length-1],r=c.pop(),a=!0),s.leaf&&-1!==(o=i(e,s.children,t)))return s.children.splice(o,1),u.push(s),this._condense(u),this;a||s.leaf||!h(s,l)?n?(r++,s=n.children[r],a=!1):s=null:(u.push(s),c.push(r),r=0,n=s,s=s.children[0])}return this},toBBox:function(e){return e},compareMinX:a,compareMinY:s,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,n){var o,a=i-t+1,s=this._maxEntries;if(a<=s)return o=f(e.slice(t,i+1)),r(o,this.toBBox),o;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),o=f([]),o.leaf=!1,o.height=n;var l,u,c,d,h=Math.ceil(a/s),p=h*Math.ceil(Math.sqrt(s));for(m(e,t,i,p,this.compareMinX),l=t;l<=i;l+=p)for(c=Math.min(l+p-1,i),m(e,l,c,h,this.compareMinY),u=l;u<=c;u+=h)d=Math.min(u+h-1,c),o.children.push(this._build(e,u,d,n-1));return r(o,this.toBBox),o},_chooseSubtree:function(e,t,i,r){for(var n,o,a,s,u,d,h,p;;){if(r.push(t),t.leaf||r.length-1===i)break;for(h=p=1/0,n=0,o=t.children.length;n<o;n++)a=t.children[n],u=l(a),d=c(e,a)-u,d<p?(p=d,h=u<h?u:h,s=a):d===p&&u<h&&(h=u,s=a);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,n=i?e:r(e),a=[],s=this._chooseSubtree(n,this.data,t,a);for(s.children.push(e),o(s,n);t>=0&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(n,a,t)},_split:function(e,t){var i=e[t],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var a=this._chooseSplitIndex(i,o,n),s=f(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,r(i,this.toBBox),r(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(i,s)},_splitRoot:function(e,t){this.data=f([e,t]),this.data.height=e.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,o,a,s,u,c,h,p;for(c=h=1/0,r=t;r<=i-t;r++)o=n(e,0,r,this.toBBox),a=n(e,r,i,this.toBBox),s=d(o,a),u=l(o)+l(a),s<c?(c=s,p=r,h=u<h?u:h):s===c&&u<h&&(h=u,p=r);return p},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:a,n=e.leaf?this.compareMinY:s;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var a,s,l=this.toBBox,c=n(e,0,t,l),d=n(e,i-t,i,l),h=u(c)+u(d);for(a=t;a<i-t;a++)s=e.children[a],o(c,e.leaf?l(s):s),h+=u(c);for(a=i-t-1;a>=t;a--)s=e.children[a],o(d,e.leaf?l(s):s),h+=u(d);return h},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)o(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children,t.splice(t.indexOf(e[i]),1)):this.clear():r(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}},t}),define("Core/RectangleCollisionChecker",["../ThirdParty/rbush","./Check"],function(e,t){"use strict";function i(){this._tree=e()}function r(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function n(e,t){return e.id===t.id}r.fromRectangleAndId=function(e,t,i){return i.minX=t.west,i.minY=t.south,i.maxX=t.east,i.maxY=t.north,i.id=e,i},i.prototype.insert=function(e,t){var i=r.fromRectangleAndId(e,t,new r);this._tree.insert(i)};var o=new r;i.prototype.remove=function(e,t){var i=r.fromRectangleAndId(e,t,o);this._tree.remove(i,n)};var a=new r;return i.prototype.collides=function(e){var t=r.fromRectangleAndId("",e,a);return this._tree.collides(t)},i}),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,b=C+s*v,S=C-c*l,T=C-c*l+s*v,E=Math.max(C,b,S,T),A=Math.min(C,b,S,T),w=t.longitude,x=w+s*d,P=w+l*m,D=w+l*m+s*d;return{north:E,south:A,east:Math.max(w,x,P,D),west:Math.min(w,x,P,D),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,a,s){var l=t.radiiSquared,h=e.nwCorner,p=e.boundingRectangle,f=h.latitude-e.granYCos*n+o*e.granXSin,m=u(f),_=c(f),g=l.z*_,v=h.longitude+n*e.granYSin+o*e.granXCos,y=m*u(v),C=m*c(v),b=l.x*y,S=l.y*C,T=d(b*y+S*C+g*_);if(a.x=b/T,a.y=S/T,a.z=g/T,r){var E=e.stNwCorner;i(E)?(f=E.latitude-e.stGranYCos*n+o*e.stGranXSin,v=E.longitude+n*e.stGranYSin+o*e.stGranXCos,s.x=(v-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(v-p.west)*e.lonScalar,s.y=(f-p.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,n,a,u){var c=e.east,d=e.west,h=e.north,p=e.south,f=!1,v=!1;h===o.PI_OVER_TWO&&(f=!0),p===-o.PI_OVER_TWO&&(v=!0);var y,C,b,S,T,E=h-p;T=d>c?o.TWO_PI-d+c:c-d,y=Math.ceil(T/t)+1,C=Math.ceil(E/t)+1,b=T/(y-1),S=E/(C-1);var A=s.northwest(e,a),w=s.center(e,m);0===i&&0===r||(w.longitude<A.longitude&&(w.longitude+=o.TWO_PI),_=g.project(w,_));var x=S,P=b,D=s.clone(e,n),I={granYCos:x,granYSin:0,granXCos:P,granXSin:0,nwCorner:A,boundingRectangle:D,width:y,height:C,northCap:f,southCap:v};if(0!==i){var M=l(A,i,b,S,w,y,C);h=M.north,p=M.south,c=M.east,d=M.west,I.granYCos=M.granYCos,I.granYSin=M.granYSin,I.granXCos=M.granXCos,I.granXSin=M.granXSin,D.north=h,D.south=p,D.east=c,D.west=d}if(0!==r){i-=r;var R=s.northwest(D,u),O=l(R,i,b,S,w,y,C);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",["./arrayFill","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryOffsetAttribute","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./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,b,S,T,E,A,w,x){"use strict";function P(e,t){var i=new h({attributes:new f,primitiveType:T.TRIANGLES});return i.attributes.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}function D(e,t,i,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=U,d=V,h=z;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<o;p+=3){var f=r.fromArray(e,p,k),m=u+1,_=u+2;h=i.geodeticSurfaceNormal(f,h),(t.tangent||t.bitangent)&&(r.cross(r.UNIT_Z,h,d),b.multiplyByVector(n,d,d),r.normalize(d,d),t.bitangent&&r.normalize(r.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 P(t,{positions:e,normals:a,tangents:s,bitangents:l})}function I(e,t,i){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=U,p=V,f=z;if(t.normal||t.tangent||t.bitangent)for(var m=0;m<n;m+=6){var _=r.fromArray(e,m,k),g=r.fromArray(e,(m+6)%n,Y);if(d){var v=r.fromArray(e,(m+3)%n,j);r.subtract(g,_,g),r.subtract(v,_,v),f=r.normalize(r.cross(v,g,f),f),d=!1}r.equalsEpsilon(g,_,y.EPSILON10)&&(d=!0),(t.tangent||t.bitangent)&&(h=i.geodeticSurfaceNormal(_,h),t.tangent&&(p=r.normalize(r.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 P(t,{positions:e,normals:o,tangents:a,bitangents:s})}function M(e,t){var i=e._vertexFormat,r=e._ellipsoid,n=t.height,o=t.width,s=t.northCap,l=t.southCap,u=0,c=n,d=n,h=0;s&&(u=1,d-=1,h+=1),l&&(c-=1,d-=1,h+=1),h+=o*d;for(var f=i.position?new Float64Array(3*h):void 0,m=i.st?new Float32Array(2*h):void 0,_=0,g=0,y=k,C=H,b=Number.MAX_VALUE,S=Number.MAX_VALUE,T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,A=u;A<c;++A)for(var x=0;x<o;++x)w.computePosition(t,r,i.st,A,x,y,C),f[_++]=y.x,f[_++]=y.y,f[_++]=y.z,i.st&&(m[g++]=C.x,m[g++]=C.y,b=Math.min(b,C.x),S=Math.min(S,C.y),T=Math.max(T,C.x),E=Math.max(E,C.y));if(s&&(w.computePosition(t,r,i.st,0,0,y,C),f[_++]=y.x,f[_++]=y.y,f[_++]=y.z,i.st&&(m[g++]=C.x,m[g++]=C.y,b=C.x,S=C.y,T=C.x,E=C.y)),l&&(w.computePosition(t,r,i.st,n-1,0,y,C),f[_++]=y.x,f[_++]=y.y,f[_]=y.z,i.st&&(m[g++]=C.x,m[g]=C.y,b=Math.min(b,C.x),S=Math.min(S,C.y),T=Math.max(T,C.x),E=Math.max(E,C.y))),i.st&&(b<0||S<0||T>1||E>1))for(var P=0;P<m.length;P+=2)m[P]=(m[P]-b)/(T-b),m[P+1]=(m[P+1]-S)/(E-S);var I=D(f,i,r,t.tangentRotationMatrix),M=6*(o-1)*(d-1);s&&(M+=3*(o-1)),l&&(M+=3*(o-1));var R,O=v.createTypedArray(h,M),L=0,N=0;for(R=0;R<d-1;++R){for(var F=0;F<o-1;++F){var B=L,z=B+o,V=z+1,U=B+1;O[N++]=B,O[N++]=z,O[N++]=U,O[N++]=U,O[N++]=z,O[N++]=V,++L}++L}if(s||l){var G=h-1,W=h-1;s&&l&&(G=h-2);var q,Y;if(L=0,s)for(R=0;R<o-1;R++)q=L,Y=q+1,O[N++]=G,O[N++]=q,O[N++]=Y,++L;if(l)for(L=(d-1)*o,R=0;R<o-1;R++)q=L,Y=q+1,O[N++]=q,O[N++]=W,O[N++]=Y,++L}return I.indices=O,i.st&&(I.attributes.st=new p({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:m})),I}function R(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 O(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 L(t,i){var n,o=t._shadowVolume,s=t._offsetAttribute,u=t._vertexFormat,c=t._extrudedHeight,d=t._surfaceHeight,h=t._ellipsoid,f=i.height,C=i.width;if(o){var b=x.clone(u,X);b.normal=!0,t._vertexFormat=b}var T=M(t,i);o&&(t._vertexFormat=u);var E=S.scaleToGeodeticHeight(T.attributes.position.values,d,h,!1);E=new Float64Array(E);var A=E.length,w=2*A,P=new Float64Array(w);P.set(E);var D=S.scaleToGeodeticHeight(T.attributes.position.values,c,h);P.set(D,A),T.attributes.position.values=P;var L,N,F=u.normal?new Float32Array(w):void 0,B=u.tangent?new Float32Array(w):void 0,k=u.bitangent?new Float32Array(w):void 0,z=u.st?new Float32Array(w/3*2):void 0;if(u.normal){for(N=T.attributes.normal.values,F.set(N),n=0;n<A;n++)N[n]=-N[n];F.set(N,A),T.attributes.normal.values=F}if(o){N=T.attributes.normal.values,u.normal||(T.attributes.normal=void 0);var V=new Float32Array(w);for(n=0;n<A;n++)N[n]=-N[n];V.set(N,A),T.attributes.extrudeDirection=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:V})}var U,G=l(s);if(G){var H=A/3*2,W=new Uint8Array(H);s===_.TOP?W=e(W,1,0,H/2):(U=s===_.NONE?0:1,W=e(W,U)),T.attributes.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:W})}if(u.tangent){var q=T.attributes.tangent.values;for(B.set(q),n=0;n<A;n++)q[n]=-q[n];B.set(q,A),T.attributes.tangent.values=B}if(u.bitangent){var Q=T.attributes.bitangent.values;k.set(Q),k.set(Q,A),T.attributes.bitangent.values=k}u.st&&(L=T.attributes.st.values,z.set(L),z.set(L,A/3*2),T.attributes.st.values=z);var K=T.indices,Z=K.length,J=A/3,$=v.createTypedArray(w/3,2*Z);for($.set(K),n=0;n<Z;n+=3)$[n+Z]=K[n+2]+J,$[n+1+Z]=K[n+1]+J,$[n+2+Z]=K[n]+J;T.indices=$;var ee=i.northCap,te=i.southCap,ie=f,re=2,ne=0,oe=4,ae=4;ee&&(re-=1,ie-=1,ne+=1,oe-=2,ae-=1),te&&(re-=1,ie-=1,ne+=1,oe-=2,ae-=1),ne+=re*C+2*ie-oe;var se=2*(ne+ae),le=new Float64Array(3*se),ue=o?new Float32Array(3*se):void 0,ce=G?new Uint8Array(se):void 0,de=u.st?new Float32Array(2*se):void 0,he=s===_.TOP;G&&!he&&(U=s===_.ALL?1:0,ce=e(ce,U));var pe,fe=0,me=0,_e=0,ge=0,ve=C*ie;for(n=0;n<ve;n+=C)pe=3*n,le=R(le,fe,pe,E,D),fe+=6,u.st&&(de=O(de,me,2*n,L),me+=4),o&&(_e+=3,ue[_e++]=N[pe],ue[_e++]=N[pe+1],ue[_e++]=N[pe+2]),he&&(ce[ge++]=1,ge+=1);if(te){var ye=ee?ve+1:ve;for(pe=3*ye,n=0;n<2;n++)le=R(le,fe,pe,E,D),fe+=6,u.st&&(de=O(de,me,2*ye,L),me+=4),o&&(_e+=3,ue[_e++]=N[pe],ue[_e++]=N[pe+1],ue[_e++]=N[pe+2]),he&&(ce[ge++]=1,ge+=1)}else for(n=ve-C;n<ve;n++)pe=3*n,le=R(le,fe,pe,E,D),fe+=6,u.st&&(de=O(de,me,2*n,L),me+=4),o&&(_e+=3,ue[_e++]=N[pe],ue[_e++]=N[pe+1],ue[_e++]=N[pe+2]),he&&(ce[ge++]=1,ge+=1);for(n=ve-1;n>0;n-=C)pe=3*n,le=R(le,fe,pe,E,D),fe+=6,u.st&&(de=O(de,me,2*n,L),me+=4),o&&(_e+=3,ue[_e++]=N[pe],ue[_e++]=N[pe+1],ue[_e++]=N[pe+2]),he&&(ce[ge++]=1,ge+=1);if(ee){var Ce=ve;for(pe=3*Ce,n=0;n<2;n++)le=R(le,fe,pe,E,D),fe+=6,u.st&&(de=O(de,me,2*Ce,L),me+=4),o&&(_e+=3,ue[_e++]=N[pe],ue[_e++]=N[pe+1],ue[_e++]=N[pe+2]),he&&(ce[ge++]=1,ge+=1)}else for(n=C-1;n>=0;n--)pe=3*n,le=R(le,fe,pe,E,D),fe+=6,u.st&&(de=O(de,me,2*n,L),me+=4),o&&(_e+=3,ue[_e++]=N[pe],ue[_e++]=N[pe+1],ue[_e++]=N[pe+2]),he&&(ce[ge++]=1,ge+=1);var be=I(le,u,h);u.st&&(be.attributes.st=new p({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:de})),o&&(be.attributes.extrudeDirection=new p({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:ue})),G&&(be.attributes.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:ce}));var Se,Te,Ee,Ae,we=v.createTypedArray(se,6*ne);A=le.length/3;var xe=0;for(n=0;n<A-1;n+=2){Se=n,Ae=(Se+2)%A;var Pe=r.fromArray(le,3*Se,Y),De=r.fromArray(le,3*Ae,j);r.equalsEpsilon(Pe,De,y.EPSILON10)||(Te=(Se+1)%A,Ee=(Te+2)%A,we[xe++]=Se,we[xe++]=Te,we[xe++]=Ae,we[xe++]=Ae,we[xe++]=Te,we[xe++]=Ee)}return be.indices=we,be=g.combineInstances([new m({geometry:T}),new m({geometry:be})]),be[0]}function N(e,t,i,r,n){if(0===i)return A.clone(e,n);var o=w.computeOptions(e,t,i,0,G,K),a=o.height,s=o.width,l=Q;return w.computePosition(o,r,!1,0,0,l[0]),w.computePosition(o,r,!1,0,s-1,l[1]),w.computePosition(o,r,!1,a-1,0,l[2]),w.computePosition(o,r,!1,a-1,s-1,l[3]),A.fromCartesianArray(l,r,n)}function F(e){e=s(e,s.EMPTY_OBJECT);var t=e.rectangle,i=s(e.height,0),r=s(e.extrudedHeight,i);this._rectangle=A.clone(t),this._granularity=s(e.granularity,y.RADIANS_PER_DEGREE),this._ellipsoid=d.clone(s(e.ellipsoid,d.WGS84)),this._surfaceHeight=Math.max(i,r),this._rotation=s(e.rotation,0),this._stRotation=s(e.stRotation,0),this._vertexFormat=x.clone(s(e.vertexFormat,x.DEFAULT)),this._extrudedHeight=Math.min(i,r),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}function B(e){if(0===e._stRotation)return[0,0,0,1,1,0];var t=A.clone(e._rectangle,ne),r=e._granularity,n=e._ellipsoid,o=e._rotation-e._stRotation,a=N(t,r,o,n,ne),s=oe;s[0].x=a.west,s[0].y=a.south,s[1].x=a.west,s[1].y=a.north,s[2].x=a.east,s[2].y=a.south;for(var l=e.rectangle,u=C.fromRotation(e._stRotation,ae),c=A.center(l,se),d=0;d<3;++d){var h=s[d];h.x-=c.longitude,h.y-=c.latitude,C.multiplyByVector(u,h,h),h.x+=c.longitude,h.y+=c.latitude,h.x=(h.x-l.west)/l.width,h.y=(h.y-l.south)/l.height}var p=s[0],f=s[1],m=s[2],_=new Array(6);return i.pack(p,_),i.pack(f,_,2),i.pack(m,_,4),_}var k=new r,z=new r,V=new r,U=new r,G=new A,H=new i,W=new t,q=new t,Y=new r,j=new r,X=new x,Q=[new r,new r,new r,new r],K=new n,Z=new n;F.packedLength=A.packedLength+d.packedLength+x.packedLength+7,F.pack=function(e,t,i){return i=s(i,0),A.pack(e._rectangle,t,i),i+=A.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,x.pack(e._vertexFormat,t,i),i+=x.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=s(e._offsetAttribute,-1),t};var J=new A,$=d.clone(d.UNIT_SPHERE),ee={rectangle:J,ellipsoid:$,vertexFormat:X,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};F.unpack=function(e,t,i){t=s(t,0);var r=A.unpack(e,t,J);t+=A.packedLength;var n=d.unpack(e,t,$);t+=d.packedLength;var o=x.unpack(e,t,X);t+=x.packedLength;var a=e[t++],u=e[t++],c=e[t++],h=e[t++],p=e[t++],f=1===e[t++],m=e[t];return l(i)?(i._rectangle=A.clone(r,i._rectangle),i._ellipsoid=d.clone(n,i._ellipsoid),i._vertexFormat=x.clone(o,i._vertexFormat),i._granularity=a,i._surfaceHeight=u,i._rotation=c,i._stRotation=h,i._extrudedHeight=p,i._shadowVolume=f,i._offsetAttribute=-1===m?void 0:m,i):(ee.granularity=a,ee.height=u,ee.rotation=c,ee.stRotation=h,ee.extrudedHeight=p,ee.shadowVolume=f,ee.offsetAttribute=-1===m?void 0:m,new F(ee))},F.computeRectangle=function(e,t){e=s(e,s.EMPTY_OBJECT);var i=e.rectangle,r=s(e.granularity,y.RADIANS_PER_DEGREE),n=s(e.ellipsoid,d.WGS84);return N(i,r,s(e.rotation,0),n,t)};var te=new b,ie=new E,re=new n;F.createGeometry=function(i){
- if(!y.equalsEpsilon(i._rectangle.north,i._rectangle.south,y.EPSILON10)&&!y.equalsEpsilon(i._rectangle.east,i._rectangle.west,y.EPSILON10)){var r=i._rectangle,n=i._ellipsoid,o=i._rotation,s=i._stRotation,u=i._vertexFormat,c=w.computeOptions(r,i._granularity,o,s,G,K,Z),d=te;if(0!==s||0!==o){var f=A.center(r,re),m=n.geodeticSurfaceNormalCartographic(f,Y);E.fromAxisAngle(m,-s,ie),b.fromQuaternion(ie,d)}else b.clone(b.IDENTITY,d);var g=i._surfaceHeight,v=i._extrudedHeight,C=!y.equalsEpsilon(g,v,0,y.EPSILON2);c.lonScalar=1/i._rectangle.width,c.latScalar=1/i._rectangle.height,c.tangentRotationMatrix=d;var T,x;if(r=i._rectangle,C){T=L(i,c);var P=t.fromRectangle3D(r,n,g,q),D=t.fromRectangle3D(r,n,v,W);x=t.union(P,D)}else{if(T=M(i,c),T.attributes.position.values=S.scaleToGeodeticHeight(T.attributes.position.values,g,n,!1),l(i._offsetAttribute)){var I=T.attributes.position.values.length,R=new Uint8Array(I/3),O=i._offsetAttribute===_.NONE?0:1;e(R,O),T.attributes.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}x=t.fromRectangle3D(r,n,g)}return u.position||delete T.attributes.position,new h({attributes:T.attributes,indices:T.indices,primitiveType:T.primitiveType,boundingSphere:x,offsetAttribute:i._offsetAttribute})}},F.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new F({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,vertexFormat:x.POSITION_ONLY,shadowVolume:!0})};var ne=new A,oe=[new i,new i,new i],ae=new C,se=new n;return u(F.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=N(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=B(this)),this._textureCoordinateRotationPoints}}}),F}),define("Core/RectangleOutlineGeometry",["./arrayFill","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryOffsetAttribute","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(e,t){var i=e._ellipsoid,r=t.height,o=t.width,a=t.northCap,s=t.southCap,l=r,h=2,f=0,m=4;a&&(h-=1,l-=1,f+=1,m-=2),s&&(h-=1,l-=1,f+=1,m-=2),f+=h*o+2*l-m;var g,y=new Float64Array(3*f),C=0,b=0,S=E;if(a)v.computePosition(t,i,!1,b,0,S),y[C++]=S.x,y[C++]=S.y,y[C++]=S.z;else for(g=0;g<o;g++)v.computePosition(t,i,!1,b,g,S),y[C++]=S.x,y[C++]=S.y,y[C++]=S.z;for(g=o-1,b=1;b<r;b++)v.computePosition(t,i,!1,b,g,S),y[C++]=S.x,y[C++]=S.y,y[C++]=S.z;if(b=r-1,!s)for(g=o-2;g>=0;g--)v.computePosition(t,i,!1,b,g,S),y[C++]=S.x,y[C++]=S.y,y[C++]=S.z;for(g=0,b=r-2;b>0;b--)v.computePosition(t,i,!1,b,g,S),y[C++]=S.x,y[C++]=S.y,y[C++]=S.z;for(var T=y.length/3*2,A=p.createTypedArray(y.length/3,T),w=0,x=0;x<y.length/3-1;x++)A[w++]=x,A[w++]=x+1;A[w++]=y.length/3-1,A[w++]=0;var P=new u({attributes:new d,primitiveType:_.LINES});return P.attributes.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y}),P.indices=A,P}function C(e,t){var i=e._surfaceHeight,r=e._extrudedHeight,n=e._ellipsoid,o=r,a=i,s=y(e,t),l=t.height,u=t.width,c=m.scaleToGeodeticHeight(s.attributes.position.values,a,n,!1),d=c.length,h=new Float64Array(2*d);h.set(c);var f=m.scaleToGeodeticHeight(s.attributes.position.values,o,n);h.set(f,d),s.attributes.position.values=h;var _=t.northCap,g=t.southCap,v=4;_&&(v-=1),g&&(v-=1);var C=2*(h.length/3+v),b=p.createTypedArray(h.length/3,C);d=h.length/6;for(var S=0,T=0;T<d-1;T++)b[S++]=T,b[S++]=T+1,b[S++]=T+d,b[S++]=T+d+1;b[S++]=d-1,b[S++]=0,b[S++]=d+d-1,b[S++]=d,b[S++]=0,b[S++]=d;var E;if(_)E=l-1;else{var A=u-1;b[S++]=A,b[S++]=A+d,E=u+l-2}if(b[S++]=E,b[S++]=E+d,!g){var w=u+E-1;b[S++]=w,b[S]=w+d}return s.indices=b,s}function b(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,i=o(e.granularity,f.RADIANS_PER_DEGREE),r=o(e.ellipsoid,l.WGS84),n=o(e.rotation,0),a=o(e.height,0),s=o(e.extrudedHeight,a);this._rectangle=g.clone(t),this._granularity=i,this._ellipsoid=r,this._surfaceHeight=Math.max(a,s),this._rotation=n,this._extrudedHeight=Math.min(a,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}var S=new t,T=new t,E=new i,A=new g;b.packedLength=g.packedLength+l.packedLength+5,b.pack=function(e,t,i){return i=o(i,0),g.pack(e._rectangle,t,i),i+=g.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=o(e._offsetAttribute,-1),t};var w=new g,x=l.clone(l.UNIT_SPHERE),P={rectangle:w,ellipsoid:x,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};b.unpack=function(e,t,i){t=o(t,0);var r=g.unpack(e,t,w);t+=g.packedLength;var n=l.unpack(e,t,x);t+=l.packedLength;var s=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return a(i)?(i._rectangle=g.clone(r,i._rectangle),i._ellipsoid=l.clone(n,i._ellipsoid),i._surfaceHeight=u,i._rotation=c,i._extrudedHeight=d,i._offsetAttribute=-1===h?void 0:h,i):(P.granularity=s,P.height=u,P.rotation=c,P.extrudedHeight=d,P.offsetAttribute=-1===h?void 0:h,new b(P))};var D=new r;return b.createGeometry=function(i){var r,o,s=i._rectangle,l=i._ellipsoid,d=v.computeOptions(s,i._granularity,i._rotation,0,A,D);if(!f.equalsEpsilon(s.north,s.south,f.EPSILON10)&&!f.equalsEpsilon(s.east,s.west,f.EPSILON10)){var p,g=i._surfaceHeight,b=i._extrudedHeight,E=!f.equalsEpsilon(g,b,0,f.EPSILON2);if(E){if(r=C(i,d),a(i._offsetAttribute)){var w=r.attributes.position.values.length/3,x=new Uint8Array(w);i._offsetAttribute===h.TOP?x=e(x,1,0,w/2):(p=i._offsetAttribute===h.NONE?0:1,x=e(x,p)),r.attributes.applyOffset=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}var P=t.fromRectangle3D(s,l,g,T),I=t.fromRectangle3D(s,l,b,S);o=t.union(P,I)}else{if(r=y(i,d),r.attributes.position.values=m.scaleToGeodeticHeight(r.attributes.position.values,g,l,!1),a(i._offsetAttribute)){var M=r.attributes.position.values.length,R=new Uint8Array(M/3);p=i._offsetAttribute===h.NONE?0:1,e(R,p),r.attributes.applyOffset=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}o=t.fromRectangle3D(s,l,g)}return new u({attributes:r.attributes,indices:r.indices,primitiveType:_.LINES,boundingSphere:o,offsetAttribute:i._offsetAttribute})}},b}),define("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";return e({FIXED:0,INERTIAL:1})}),define("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";return e({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})}),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,I),p(e,"pointerup",t,M),p(e,"pointermove",t,R),p(e,"pointercancel",t,M)):(p(e,"mousedown",t,y),p(e,"mouseup",i,b),p(e,"mousemove",i,S),p(e,"touchstart",t,A),p(e,"touchend",i,w),p(e,"touchmove",i,P),p(e,"touchcancel",i,w)),p(e,"dblclick",t,T);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",p(e,n,t,E)}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>O.mouseEmulationIgnoreMilliseconds}function v(e,t,i){var r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)<i}function y(e,i){if(g(e)){var n=i.button;e._buttonDown[n]=!0;var o;if(n===L.LEFT)o=u.LEFT_DOWN;else if(n===L.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==L.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,N.position),l(N),i.preventDefault())}}function C(e,i,n,o){var a=h(o),s=e.getInputAction(i,a),l=e.getInputAction(n,a);if(r(s)||r(l)){var u=c(e,o,e._primaryPosition);if(r(s)&&(t.clone(u,F.position),s(F)),r(l)){v(e._primaryStartPosition,u,e._clickPixelTolerance)&&(t.clone(u,B.position),l(B))}}}function b(e,t){if(g(e)){var i=t.button;i!==L.LEFT&&i!==L.MIDDLE&&i!==L.RIGHT||(e._buttonDown[L.LEFT]&&(C(e,u.LEFT_UP,u.LEFT_CLICK,t),e._buttonDown[L.LEFT]=!1),e._buttonDown[L.MIDDLE]&&(C(e,u.MIDDLE_UP,u.MIDDLE_CLICK,t),e._buttonDown[L.MIDDLE]=!1),e._buttonDown[L.RIGHT]&&(C(e,u.RIGHT_UP,u.RIGHT_CLICK,t),e._buttonDown[L.RIGHT]=!1))}}function S(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,k.startPosition),t.clone(o,k.endPosition),s(k)),t.clone(o,a),(e._buttonDown[L.LEFT]||e._buttonDown[L.MIDDLE]||e._buttonDown[L.RIGHT])&&i.preventDefault()}}function T(e,t){var i,n=t.button;if(n===L.LEFT){i=u.LEFT_DOUBLE_CLICK;var o=h(t),a=e.getInputAction(i,o);r(a)&&(c(e,t,z.position),a(z))}}function E(e,t){var i;if(r(t.deltaY)){var n=t.deltaMode;i=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=t.detail>0?-120*t.detail:t.wheelDelta;if(r(i)){var o=h(t),a=e.getInputAction(u.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function A(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));x(e,i);var u=e._previousPositions;for(r=0;r<s;++r)n=a[r],o=n.identifier,u.set(o,t.clone(l.get(o)))}function w(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);x(e,t);var l=e._previousPositions;for(i=0;i<a;++i)r=o[i],n=r.identifier,l.remove(n)}function x(e,i){var n,o,a=h(i),s=e._positions,l=s.length,c=e._isPinching;if(1!==l&&e._buttonDown[L.LEFT]){if(e._buttonDown[L.LEFT]=!1,r(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),n=e.getInputAction(u.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,G.position),n(G)),0===l&&!e._isTouchHolding&&(o=e.getInputAction(u.LEFT_CLICK,a),r(o))){v(e._primaryStartPosition,e._previousPositions.values[0],e._clickPixelTolerance)&&(t.clone(e._primaryPosition,H.position),o(H))}e._isTouchHolding=!1}if(0===l&&c&&(e._isPinching=!1,n=e.getInputAction(u.PINCH_END,a),r(n)&&n()),1===l&&!c){var d=s.values[0];t.clone(d,e._primaryPosition),t.clone(d,e._primaryStartPosition),t.clone(d,e._primaryPreviousPosition),e._buttonDown[L.LEFT]=!0,n=e.getInputAction(u.LEFT_DOWN,a),r(n)&&(t.clone(d,V.position),n(V)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,o=e.getInputAction(u.RIGHT_CLICK,a),r(o))){v(e._primaryStartPosition,e._previousPositions.values[0],e._holdPixelTolerance)&&(t.clone(e._primaryPosition,W.position),o(W))}},O.touchHoldDelayMilliseconds),i.preventDefault()}2!==l||c||(e._isPinching=!0,n=e.getInputAction(u.PINCH_START,a),r(n)&&(t.clone(s.values[0],U.position1),t.clone(s.values[1],U.position2),n(U),i.preventDefault()))}function P(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)}D(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 D(e,i){var n,o=h(i),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown[L.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,q.startPosition),t.clone(c,q.endPosition),n(q)),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,b=_.y-m.y,S=.25*Math.sqrt(C*C+b*b),T=.125*(f.y+p.y),E=.125*(_.y+m.y),A=Math.atan2(v,g),w=Math.atan2(b,C);t.fromElements(0,S,Y.distance.startPosition),t.fromElements(0,y,Y.distance.endPosition),t.fromElements(w,E,Y.angleAndHeight.startPosition),t.fromElements(A,T,Y.angleAndHeight.endPosition),n(Y)}}function I(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)),x(e,i);e._previousPositions.set(n,t.clone(r.get(n)))}else y(e,i)}function M(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),x(e,t);e._previousPositions.remove(r)}else b(e,t)}function R(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),D(e,i);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else S(e,i)}function O(r){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-O.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=i(r,document),f(this)}var L={LEFT:0,MIDDLE:1,RIGHT:2},N={position:new t},F={position:new t},B={position:new t},k={startPosition:new t,endPosition:new t},z={position:new t},V={position:new t},U={position1:new t,position2:new t},G={position:new t},H={position:new t},W={position:new t},q={startPosition:new t,endPosition:new t},Y={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return O.prototype.setInputAction=function(e,t,i){var r=d(t,i);this._inputEvents[r]=e},O.prototype.getInputAction=function(e,t){var i=d(e,t);return this._inputEvents[i]},O.prototype.removeInputAction=function(e,t){var i=d(e,t);delete this._inputEvents[i]},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return m(this),n(this)},O.mouseEmulationIgnoreMilliseconds=800,O.touchHoldDelayMilliseconds=1500,O}),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)-b;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,_,w);var v=p*(1+r),y=Math.cos(g),C=Math.sin(g),b=1+r*y,S=v/b;return t(c)?(c.x=S*y,c.y=S*C,c.z=0):c=new e(S*y,S*C,0),o.multiplyByVector(w,c,c)}function d(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function h(e,t){return f(p(e,t),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<x&&Math.abs(a-o)>P;++r){a=o;o=a-(a-t*Math.sin(a)-e)/(1-t*Math.cos(a))}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,we);var i=we.dayNumber-S.dayNumber+(we.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=D+V*Math.cos(R*n)+X*Math.sin(R*n)+U*Math.cos(O*n)+Q*Math.sin(O*n)+G*Math.cos(L*n)+K*Math.sin(L*n)+H*Math.cos(N*n)+Z*Math.sin(N*n)+W*Math.cos(F*n)+J*Math.sin(F*n)+q*Math.cos(B*n)+$*Math.sin(B*n)+Y*Math.cos(k*n)+ee*Math.sin(k*n)+j*Math.cos(z*n)+te*Math.sin(z*n),s=I+M*r+ce*Math.cos(ie*n)+ve*Math.sin(ie*n)+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)+be*Math.sin(oe*n)+fe*Math.cos(ae*n)+Se*Math.sin(ae*n)+me*Math.cos(se*n)+Te*Math.sin(se*n)+_e*Math.cos(le*n)+Ee*Math.sin(le*n)+ge*Math.cos(ue*n)+Ae*Math.sin(ue*n);return c(o,.0167086342-.0004203654*r,469.97289*A*r,102.93734808*E+11612.3529*A*r,174.87317577*E-8679.27034*A*r,s,t)}function g(e,t){u(e,we);var i=we.dayNumber-S.dayNumber+(we.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*E,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,f=83.35324312*E,m=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*E,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*E,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*E+A*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),b=93.27209062*E+A*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),w=134.96340251*E+A*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),x=357.52910918*E+A*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*E-A*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),D=2*C,I=4*C,M=6*C,R=2*w,O=3*w,L=4*w,N=2*b;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-w)-235.6*Math.cos(w)+218.1*Math.cos(D-x)+181*Math.cos(D+w),d+=.014216*Math.cos(D-w)+.008551*Math.cos(D-R)-.001383*Math.cos(w)+.001356*Math.cos(D+w)-.001147*Math.cos(I-O)-914e-6*Math.cos(I-R)+869e-6*Math.cos(D-x-w)-627e-6*Math.cos(D)-394e-6*Math.cos(I-L)+282e-6*Math.cos(D-x-R)-279e-6*Math.cos(C-w)-236e-6*Math.cos(R)+231e-6*Math.cos(I)+229e-6*Math.cos(M-L)-201e-6*Math.cos(R-N),p+=486.26*Math.cos(D-N)-40.13*Math.cos(D)+37.51*Math.cos(N)+25.73*Math.cos(R-N)+19.97*Math.cos(D-x-N),m+=-55609*Math.sin(D-w)-34711*Math.sin(D-R)-9792*Math.sin(w)+9385*Math.sin(I-O)+7505*Math.sin(I-R)+5318*Math.sin(D+w)+3484*Math.sin(I-L)-3417*Math.sin(D-x-w)-2530*Math.sin(M-L)-2376*Math.sin(D)-2075*Math.sin(D-O)-1883*Math.sin(R)-1736*Math.sin(M-5*w)+1626*Math.sin(x)-1370*Math.sin(M-O),g+=-5392*Math.sin(D-N)-540*Math.sin(x)-441*Math.sin(D)+423*Math.sin(N)-288*Math.sin(R-N),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-w)-662.5*Math.sin(x)+396.3*Math.sin(w)-218*Math.sin(D-x);var F=2*P,B=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(D-N+P)*r+.614*Math.cos(D-N-P)*r-.0297*Math.cos(F)*n-.0335*Math.cos(P)*n+.0012*Math.cos(D-N+F)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(B)*o+4e-5*Math.cos(F)*o;var k=2.116*Math.sin(P)*r-.111*Math.sin(D-N-P)*r-.0015*Math.sin(P)*n;return m+=k,y+=k,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(D-N+P)*r+1.12*Math.sin(D-P)*r-1.06*Math.sin(N-P)*r+.66*Math.sin(F)*n+.371*Math.sin(P)*n-.035*Math.sin(D-N+F)*n-.015*Math.sin(D-N+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(B)*o-9e-4*Math.sin(F)*o,l*=T,c(l,d,h+p*A,f+m*A,_+g*A,v+y*A,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,xe,i)}var y={},C=32.184,b=2451545,S=new r(2451545,0,s.TAI),T=1e3,E=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,w=new o,x=50,P=n.EPSILON8,D=149598022260.7121,I=100.46645683*E,M=1295977422.83429*A,R=16002,O=21863,L=32004,N=10931,F=14529,B=16368,k=15318,z=32794,V=64e-7*14959787e4,U=-2273887.624,G=927506.794,H=14959787e4*-8e-7,W=32e-7*14959787e4,q=-613351.267,Y=284235.953,j=-164557.657,X=-2243968.05,Q=-688150.202,K=1017265.516,Z=807828.498,J=14e-7*14959787e4,$=359034.888,ee=14959787e4*-28e-7,te=329115.314,ie=10,re=16002,ne=21863,oe=10931,ae=1473,se=32004,le=4387,ue=73,ce=-325e-7,de=-322e-7,he=1e-7*-79,pe=232*1e-7,fe=1e-7*-52,me=97e-7,_e=55e-7,ge=-41e-7,ve=-105e-7,ye=-137e-7,Ce=258e-7,be=35e-7,Se=1e-7*-116,Te=-88e-7,Ee=-112e-7,Ae=-8e-6,we=new r(0,0,s.TAI),xe=-.01215058143522694,Pe=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),De=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),De=_(i,De),n=e.negate(De,n),v(i,De),e.subtract(n,De,n),o.multiplyByVector(Pe,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Pe,i,i),i},y}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,i){"use strict";function r(e,t){i(e,t)}return r}),define("Core/SimplePolylineGeometry",["./ArcType","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./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,m,_){"use strict";function g(e,t,i,n,o,a,s){var l,u=m.numberOfPoints(e,t,o),c=i.red,d=i.green,h=i.blue,p=i.alpha,f=n.red,_=n.green,g=n.blue,v=n.alpha;if(r.equals(i,n)){for(l=0;l<u;l++)a[s++]=r.floatToByte(c),a[s++]=r.floatToByte(d),a[s++]=r.floatToByte(h),a[s++]=r.floatToByte(p);return s}var y=(f-c)/u,C=(_-d)/u,b=(g-h)/u,S=(v-p)/u,T=s;for(l=0;l<u;l++)a[T++]=r.floatToByte(c+l*y),a[T++]=r.floatToByte(d+l*C),a[T++]=r.floatToByte(h+l*b),a[T++]=r.floatToByte(p+l*S);return T}function v(t){t=o(t,o.EMPTY_OBJECT);var n=t.positions,s=t.colors,l=o(t.colorsPerVertex,!1);this._positions=n,this._colors=s,this._colorsPerVertex=l,this._arcType=o(t.arcType,e.GEODESIC),this._granularity=o(t.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=o(t.ellipsoid,u.WGS84),this._workerName="createSimplePolylineGeometry";var c=1+n.length*i.packedLength;c+=a(s)?1+s.length*r.packedLength:1,this.packedLength=c+u.packedLength+3}v.pack=function(e,t,n){n=o(n,0);var s,l=e._positions,c=l.length;for(t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(l[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 u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t},v.unpack=function(e,t,n){t=o(t,0);var s,l=e[t++],c=new Array(l);for(s=0;s<l;++s,t+=i.packedLength)c[s]=i.unpack(e,t);l=e[t++];var d=l>0?new Array(l):void 0;for(s=0;s<l;++s,t+=r.packedLength)d[s]=r.unpack(e,t);var h=u.unpack(e,t);t+=u.packedLength;var p=1===e[t++],f=e[t++],m=e[t];return a(n)?(n._positions=c,n._colors=d,n._ellipsoid=h,n._colorsPerVertex=p,n._arcType=f,n._granularity=m,n):new v({positions:c,colors:d,ellipsoid:h,colorsPerVertex:p,arcType:f,granularity:m})};var y=new Array(2),C=new Array(2),b={positions:y,height:C,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return v.createGeometry=function(o){var s,l,u,v,S,T=o._positions,E=o._colors,A=o._colorsPerVertex,w=o._arcType,x=o._granularity,P=o._ellipsoid,D=f.chordLength(x,P.maximumRadius),I=a(E)&&!A,M=T.length,R=0;if(w===e.GEODESIC||w===e.RHUMB){var O,L,N;w===e.GEODESIC?(O=f.chordLength(x,P.maximumRadius),L=m.numberOfPoints,N=m.generateArc):(O=x,L=m.numberOfPointsRhumbLine,N=m.generateRhumbArc);var F=m.extractHeights(T,P),B=b;if(w===e.GEODESIC?B.minDistance=D:B.granularity=x,B.ellipsoid=P,I){var k=0;for(s=0;s<M-1;s++)k+=L(T[s],T[s+1],O)+1;l=new Float64Array(3*k),v=new Uint8Array(4*k),B.positions=y,B.height=C;var z=0;for(s=0;s<M-1;++s){y[0]=T[s],y[1]=T[s+1],C[0]=F[s],C[1]=F[s+1];var V=N(B);if(a(E)){var U=V.length/3;S=E[s];for(var G=0;G<U;++G)v[z++]=r.floatToByte(S.red),v[z++]=r.floatToByte(S.green),v[z++]=r.floatToByte(S.blue),v[z++]=r.floatToByte(S.alpha)}l.set(V,R),R+=V.length}}else if(B.positions=T,B.height=F,l=new Float64Array(N(B)),a(E)){for(v=new Uint8Array(l.length/3*4),s=0;s<M-1;++s){var H=T[s],W=T[s+1],q=E[s],Y=E[s+1];R=g(H,W,q,Y,D,v,R)}var j=E[M-1];v[R++]=r.floatToByte(j.red),v[R++]=r.floatToByte(j.green),v[R++]=r.floatToByte(j.blue),v[R++]=r.floatToByte(j.alpha)}}else{u=I?2*M-2:M,l=new Float64Array(3*u),v=a(E)?new Uint8Array(4*u):void 0;var X=0,Q=0;for(s=0;s<M;++s){var K=T[s];if(I&&s>0&&(i.pack(K,l,X),X+=3,S=E[s-1],v[Q++]=r.floatToByte(S.red),v[Q++]=r.floatToByte(S.green),v[Q++]=r.floatToByte(S.blue),v[Q++]=r.floatToByte(S.alpha)),I&&s===M-1)break;i.pack(K,l,X),X+=3,a(E)&&(S=E[s],v[Q++]=r.floatToByte(S.red),v[Q++]=r.floatToByte(S.green),v[Q++]=r.floatToByte(S.blue),v[Q++]=r.floatToByte(S.alpha))}}var Z=new h;Z.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l}),a(E)&&(Z.color=new d({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:v,normalize:!0})),u=l.length/3;var J=2*(u-1),$=p.createTypedArray(u,J),ee=0;for(s=0;s<u-1;++s)$[ee++]=s,$[ee++]=s+1;return new c({attributes:Z,indices:$,primitiveType:_.LINES,boundingSphere:t.fromPoints(T)})},v}),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/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{credits:{get:t.throwInstantiationError},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/TileEdge",[],function(){"use strict";return{WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7}}),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","./GregorianDate","./isLeapYear","./Iso8601","./JulianDate","./TimeInterval"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t){return u.compare(e.start,t.start)}function h(e){if(this._intervals=[],this._changedEvent=new o,i(e))for(var t=e.length,r=0;r<t;r++)this.addInterval(e[r])}function p(e,t,r){i(r)||(r=new u),u.toGregorianDate(e,_);var n=_.millisecond+t.millisecond,o=_.second+t.second,a=_.minute+t.minute,l=_.hour+t.hour,c=_.day+t.day,d=_.month+t.month,h=_.year+t.year;for(n>=1e3&&(o+=Math.floor(n/1e3),n%=1e3),o>=60&&(a+=Math.floor(o/60),o%=60),a>=60&&(l+=Math.floor(a/60),a%=60),l>=24&&(c+=Math.floor(l/24),l%=24),g[2]=s(h)?29:28;c>g[d]||d>=13;)c>g[d]&&(c-=g[d],++d),d>=13&&(--d,h+=Math.floor(d/12),d%=12,++d),g[2]=s(h)?29:28;return _.millisecond=n,_.second=o,_.minute=a,_.hour=l,_.day=c,_.month=d,_.year=h,u.fromGregorianDate(_,r)}function f(e,t){if(!i(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,"P"===e[0]){var r=e.match(y);if(!i(r))return!1;if(i(r[1])&&(t.year=Number(r[1].replace(",","."))),i(r[2])&&(t.month=Number(r[2].replace(",","."))),i(r[3])&&(t.day=7*Number(r[3].replace(",","."))),i(r[4])&&(t.day+=Number(r[4].replace(",","."))),i(r[5])&&(t.hour=Number(r[5].replace(",","."))),i(r[6])&&(t.minute=Number(r[6].replace(",","."))),i(r[7])){var n=Number(r[7].replace(",","."));t.second=Math.floor(n),t.millisecond=n%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),u.toGregorianDate(u.fromIso8601(e,v),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}r(h.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}}}),h.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof h))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(!c.equals(i[o],r[o],t))return!1;return!0},h.prototype.get=function(e){return this._intervals[e]},h.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},h.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},h.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},h.prototype.contains=function(e){return this.indexOf(e)>=0};var m=new c;h.prototype.indexOf=function(t){var i=this._intervals;m.start=t,m.stop=t;var r=e(i,m,d);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&&c.contains(i[r-1],t)?r-1:~r)},h.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]}},h.prototype.addInterval=function(t,r){if(!t.isEmpty){var n=this._intervals;if(0===n.length||u.greaterThan(t.start,n[n.length-1].stop))return n.push(t),void this._changedEvent.raiseEvent(this);var o=e(n,t,d);o<0?o=~o:o>0&&t.isStartIncluded&&n[o-1].isStartIncluded&&n[o-1].start.equals(t.start)?--o:o<n.length&&!t.isStartIncluded&&n[o].isStartIncluded&&n[o].start.equals(t.start)&&++o;var a;for(o>0&&((a=u.compare(n[o-1].stop,t.start))>0||0===a&&(n[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(n[o-1].data,t.data):n[o-1].data===t.data)?(t=new c(u.greaterThan(t.stop,n[o-1].stop)?{start:n[o-1].start,stop:t.stop,isStartIncluded:n[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:n[o-1].start,stop:n[o-1].stop,isStartIncluded:n[o-1].isStartIncluded,isStopIncluded:n[o-1].isStopIncluded||t.stop.equals(n[o-1].stop)&&t.isStopIncluded,data:t.data}),n.splice(o-1,1),--o):(a=u.compare(n[o-1].stop,t.stop),(a>0||0===a&&n[o-1].isStopIncluded&&!t.isStopIncluded)&&n.splice(o,0,new c({start:t.stop,stop:n[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:n[o-1].isStopIncluded,data:n[o-1].data})),n[o-1]=new c({start:n[o-1].start,stop:t.start,isStartIncluded:n[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:n[o-1].data})));o<n.length&&((a=u.compare(t.stop,n[o].start))>0||0===a&&(t.isStopIncluded||n[o].isStartIncluded));)if(i(r)?r(n[o].data,t.data):n[o].data===t.data)t=new c({start:t.start,stop:u.greaterThan(n[o].stop,t.stop)?n[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:u.greaterThan(n[o].stop,t.stop)?n[o].isStopIncluded:t.isStopIncluded,data:t.data}),n.splice(o,1);else{if(n[o]=new c({start:t.stop,stop:n[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:n[o].isStopIncluded,data:n[o].data}),!n[o].isEmpty)break;n.splice(o,1)}n.splice(o,0,t),this._changedEvent.raiseEvent(this)}},h.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=this._intervals,r=e(i,t,d);r<0&&(r=~r);var n=!1;for(r>0&&(u.greaterThan(i[r-1].stop,t.start)||i[r-1].stop.equals(t.start)&&i[r-1].isStopIncluded&&t.isStartIncluded)&&(n=!0,(u.greaterThan(i[r-1].stop,t.stop)||i[r-1].isStopIncluded&&!t.isStopIncluded&&i[r-1].stop.equals(t.stop))&&i.splice(r,0,new c({start:t.stop,stop:i[r-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:i[r-1].isStopIncluded,data:i[r-1].data})),i[r-1]=new c({start:i[r-1].start,stop:t.start,isStartIncluded:i[r-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:i[r-1].data})),r<i.length&&!t.isStartIncluded&&i[r].isStartIncluded&&t.start.equals(i[r].start)&&(n=!0,i.splice(r,0,new c({start:i[r].start,stop:i[r].start,isStartIncluded:!0,isStopIncluded:!0,data:i[r].data})),++r);r<i.length&&u.greaterThan(t.stop,i[r].stop);)n=!0,i.splice(r,1);return r<i.length&&t.stop.equals(i[r].stop)&&(n=!0,!t.isStopIncluded&&i[r].isStopIncluded?r+1<i.length&&i[r+1].start.equals(t.stop)&&i[r].data===i[r+1].data?(i.splice(r,1),i[r]=new c({start:i[r].start,stop:i[r].stop,isStartIncluded:!0,isStopIncluded:i[r].isStopIncluded,data:i[r].data})):i[r]=new c({start:t.stop,stop:t.stop,isStartIncluded:!0,isStopIncluded:!0,data:i[r].data}):i.splice(r,1)),r<i.length&&(u.greaterThan(t.stop,i[r].start)||t.stop.equals(i[r].start)&&t.isStopIncluded&&i[r].isStartIncluded)&&(n=!0,i[r]=new c({start:t.stop,stop:i[r].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:i[r].isStopIncluded,data:i[r].data})),n&&this._changedEvent.raiseEvent(this),n},h.prototype.intersect=function(e,t,r){for(var n=new h,o=0,a=0,s=this._intervals,l=e._intervals;o<s.length&&a<l.length;){var d=s[o],p=l[a];if(u.lessThan(d.stop,p.start))++o;else if(u.lessThan(p.stop,d.start))++a;else{if(i(r)||i(t)&&t(d.data,p.data)||!i(t)&&p.data===d.data){var f=c.intersect(d,p,new c,r);f.isEmpty||n.addInterval(f,t)}u.lessThan(d.stop,p.stop)||d.stop.equals(p.stop)&&!d.isStopIncluded&&p.isStopIncluded?++o:++a}}return n},h.fromJulianDateArray=function(e,r){i(r)||(r=new h);var n,o=e.julianDates,a=o.length,s=e.dataCallback,u=t(e.isStartIncluded,!0),d=t(e.isStopIncluded,!0),p=t(e.leadingInterval,!1),f=t(e.trailingInterval,!1),m=0;p&&(++m,n=new c({start:l.MINIMUM_VALUE,stop:o[0],isStartIncluded:!0,isStopIncluded:!u}),n.data=i(s)?s(n,r.length):r.length,r.addInterval(n));for(var _=0;_<a-1;++_){var g=o[_],v=o[_+1];n=new c({start:g,stop:v,isStartIncluded:r.length!==m||u,isStopIncluded:_===a-2&&d}),n.data=i(s)?s(n,r.length):r.length,r.addInterval(n),g=v}return f&&(n=new c({start:o[a-1],stop:l.MAXIMUM_VALUE,isStartIncluded:!d,isStopIncluded:!0}),n.data=i(s)?s(n,r.length):r.length,r.addInterval(n)),r};var _=new a,g=[0,31,28,31,30,31,30,31,31,30,31,30,31],v=new u,y=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/,C=new a;return h.fromIso8601=function(e,t){var i=e.iso8601.split("/"),r=u.fromIso8601(i[0]),n=u.fromIso8601(i[1]),o=[];if(f(i[2],C)){var a=u.clone(r);for(o.push(a);u.compare(a,n)<0;){a=p(a,C);u.compare(n,a)<=0&&u.clone(n,a),o.push(a)}}else o.push(r,n);return h.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},h.fromIso8601DateArray=function(e,t){return h.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return u.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},h.fromIso8601DurationArray=function(e,r){for(var n,o,a=e.epoch,s=e.iso8601Durations,l=t(e.relativeToPrevious,!1),u=[],c=s.length,d=0;d<c;++d)(f(s[d],C)||0===d)&&(n=l&&i(o)?p(o,C):p(a,C),u.push(n),o=n);return h.fromJulianDateArray({julianDates:u,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},r)},h}),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/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/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./Math","./Rectangle","./Resource","./TerrainProvider","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e,t){this.rectangle=e,this.maxLevel=t}function g(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");y._tilingScheme=new l({ellipsoid:C});var i=e.getElementsByTagName("TileFormat")[0];y._heightmapWidth=parseInt(i.getAttribute("width"),10),y._heightmapHeight=parseInt(i.getAttribute("height"),10),y._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(C,Math.min(y._heightmapWidth,y._heightmapHeight),y._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var a=r[n],s=d.toRadians(parseFloat(a.getAttribute("minx"))),u=d.toRadians(parseFloat(a.getAttribute("miny"))),c=d.toRadians(parseFloat(a.getAttribute("maxx"))),p=d.toRadians(parseFloat(a.getAttribute("maxy"))),m=parseInt(a.getAttribute("maxlevel"),10);y._rectangles.push(new _(new h(s,u,c,p),m))}y._ready=!0,y._readyPromise.resolve(!0)}function o(e){var t=i(e,"An error occurred while accessing "+y._resource.url+".");v=m.handleError(v,y,y._errorEvent,t,void 0,void 0,void 0,u)}function u(){e(y._resource.fetchXML(),n,o)}r=i(r,i.EMPTY_OBJECT);var c=p.createIfNeeded(r.url);this._resource=c,this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var g=r.credit;"string"==typeof g&&(g=new t(g)),this._credit=g,this._tilingScheme=void 0,this._rectangles=[];var v,y=this,C=i(r.ellipsoid,a.WGS84);u()}function v(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,p=h.intersection(d,s,C);r(p)&&(y(o,d,2*t,2*i,n+1)&&(l|=4),y(o,d,2*t+1,2*i,n+1)&&(l|=8),y(o,d,2*t,2*i+1,n+1)&&(l|=1),y(o,d,2*t+1,2*i+1,n+1)&&(l|=2))}}return l}function y(e,t,i,n,o){var a=e.tileXYToRectangle(i,n,o);return r(h.intersection(a,t,C))}n(g.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}}}),g.prototype.requestTileGeometry=function(t,i,n,o){var a=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:n+"/"+t+"/"+(a-i-1)+".tif",queryParameters:{cesium:!0},request:o}),l=s.fetchImage({preferImageBitmap:!0});if(r(l)){var d=this;return e(l).then(function(e){return new c({buffer:u(e),width:d._heightmapWidth,height:d._heightmapHeight,childTileMask:v(d,t,i,n),structure:d._terrainDataStructure})})}},g.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var C=new h;return g.prototype.getTileDataAvailable=function(e,t,i){},g.prototype.loadTileDataAvailability=function(e,t,i){},g}),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._lastPlaybackRate=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._trySetPlaybackRate=function(e){if(this._lastPlaybackRate!==e.multiplier){var t=this._element;try{t.playbackRate=e.multiplier}catch(e){t.playbackRate=0}this._lastPlaybackRate=e.multiplier}},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);this._trySetPlaybackRate(i);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/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,m[0]=l?o[0]:0;for(var v=1,y=1;y<a;++y){var C=r[y],b=i.cartesianToCartographic(C,d);u&&(b.height=n[y]),h=h&&b.height<=0,s(g,b)?g.height<b.height&&(f[v-1]=b.height):(p[v]=C,f[v]=b.height,m[v]=l?o[y]:0,e.clone(b,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,b=s.length,S=b-2,T=r.chordLength(d,e.maximumRadius),E=f;if(E.minDistance=T,E.ellipsoid=e,m){var A,w=0;for(A=0;A<b-1;A++)w+=o.numberOfPoints(s[A],s[A+1],T)+1;y=new Float64Array(3*w),C=new Float64Array(3*w);var x=h,P=p;E.positions=x,E.height=P;var D=0;for(A=0;A<b-1;A++){x[0]=s[A],x[1]=s[A+1],P[0]=u[A],P[1]=u[A+1];var I=o.generateArc(E);y.set(I,D),P[0]=c[A],P[1]=c[A+1],C.set(o.generateArc(E),D),D+=I.length}}else E.positions=s,E.height=u,y=new Float64Array(o.generateArc(E)),E.height=c,C=new Float64Array(o.generateArc(E));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,b=new t,S=new t,T=new t;m.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var 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 E=a.clone(a.UNIT_SPHERE),A=new p,w={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:E,vertexFormat:A,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,E);i+=a.packedLength;var f=p.unpack(e,i,A);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):(w.positions=u,w.minimumHeights=c,w.maximumHeights=d,w.granularity=_,new m(w))},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)}return new m({positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},m.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,p=r._maximumHeights,m=r._vertexFormat,E=r._granularity,A=r._ellipsoid,w=f.computePositions(A,o,p,a,E,!0);if(n(w)){var x=w.bottomPositions,P=w.topPositions,D=w.numCorners,I=P.length,M=2*I,R=m.position?new Float64Array(M):void 0,O=m.normal?new Float32Array(M):void 0,L=m.tangent?new Float32Array(M):void 0,N=m.bitangent?new Float32Array(M):void 0,F=m.st?new Float32Array(M/3*2):void 0,B=0,k=0,z=0,V=0,U=0,G=T,H=S,W=b,q=!0;I/=3;var Y,j=0,X=1/(I-o.length+1);for(Y=0;Y<I;++Y){var Q=3*Y,K=t.fromArray(P,Q,_),Z=t.fromArray(x,Q,g);if(m.position&&(R[B++]=Z.x,R[B++]=Z.y,R[B++]=Z.z,R[B++]=K.x,R[B++]=K.y,R[B++]=K.z),m.st&&(F[U++]=j,F[U++]=0,F[U++]=j,F[U++]=1),m.normal||m.tangent||m.bitangent){var J,$=t.clone(t.ZERO,C),ee=A.scaleToGeodeticSurface(t.fromArray(P,Q,g),g);if(Y+1<I&&(J=A.scaleToGeodeticSurface(t.fromArray(P,Q+3,v),v),$=t.fromArray(P,Q+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:(j+=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&&(L[V++]=H.x,L[V++]=H.y,L[V++]=H.z,L[V++]=H.x,L[V++]=H.y,L[V++]=H.z),m.bitangent&&(N[z++]=W.x,N[z++]=W.y,N[z++]=W.z,N[z++]=W.x,N[z++]=W.y,N[z++]=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:L})),m.bitangent&&(re.bitangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),m.st&&(re.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:F}));var ne=M/3;M-=6*(D+1);var oe=c.createTypedArray(ne,M),ae=0;for(Y=0;Y<ne-2;Y+=2){var se=Y,le=Y+2,ue=t.fromArray(R,3*se,_),ce=t.fromArray(R,3*le,g);if(!t.equalsEpsilon(ue,ce,d.EPSILON10)){var de=Y+1,he=Y+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)}return new f({positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid})},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,b=y.topPositions,S=b.length,T=2*S,E=new Float64Array(T),A=0;S/=3;var w;for(w=0;w<S;++w){var x=3*w,P=t.fromArray(b,x,m),D=t.fromArray(C,x,_);E[A++]=D.x,E[A++]=D.y,E[A++]=D.z,E[A++]=P.x,E[A++]=P.y,E[A++]=P.z}var I=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:E})}),M=T/3;T=2*M-4+M;var R=c.createTypedArray(M,T),O=0;for(w=0;w<M-2;w+=2){var L=w,N=w+2,F=t.fromArray(E,3*L,m),B=t.fromArray(E,3*N,_);if(!t.equalsEpsilon(F,B,d.EPSILON10)){var k=w+1,z=w+3;R[O++]=k,R[O++]=L,R[O++]=k,R[O++]=z,R[O++]=L,R[O++]=N}}return R[O++]=M-2,R[O++]=M-1,new s({attributes:I,indices:R,primitiveType:h.LINES,boundingSphere:new e.fromVertices(E)})}},f}),define("Core/WeightSpline",["./Check","./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.weights,r=e.times;this._times=r,this._weights=i,this._count=i.length/r.length,this._lastTimeIndex=0}return r(a.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.wrapTime=o.prototype.wrapTime,a.prototype.clampTime=o.prototype.clampTime,a.prototype.evaluate=function(e,t){var r=this.weights,n=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),a=(e-n[o])/(n[o+1]-n[o]);i(t)||(t=new Array(this._count));for(var s=0;s<this._count;s++){var l=o*this._count+s;t[s]=r[l]*(1-a)+r[l+this._count]*a}return t},a}),define("Core/arraySlice",["./Check","./defined","./FeatureDetection"],function(e,t,i){"use strict";function r(e,t,r){if("function"==typeof e.slice)return e.slice(t,r);for(var n=Array.prototype.slice.call(e,t,r),o=i.typedArrayTypes,a=o.length,s=0;s<a;++s)if(e instanceof o[s]){n=new o[s](n);break}return n}return r}),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/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}return e}),define("Core/createWorldTerrain",["./CesiumTerrainProvider","./defaultValue","./IonResource"],function(e,t,i){"use strict";function r(r){return r=t(r,t.EMPTY_OBJECT),new e({url:i.fromAssetId(1),requestVertexNormals:t(r.requestVertexNormals,!1),requestWaterMask:t(r.requestWaterMask,!1)})}return r}),define("Core/decodeGoogleEarthEnterpriseData",["./Check","./RuntimeError"],function(e,t){"use strict";function i(e,o){if(i.passThroughDataForTesting)return o;var a=e.byteLength;if(0===a||a%4!=0)throw new t("The length of key must be greater than 0 and a multiple of 4.");var s=new DataView(o),l=s.getUint32(0,!0);if(l===r||l===n)return o;for(var u,c=new DataView(e),d=0,h=o.byteLength,p=h-h%8,f=a,m=8;d<p;)for(m=(m+8)%24,u=m;d<p&&u<f;)s.setUint32(d,s.getUint32(d,!0)^c.getUint32(u,!0),!0),s.setUint32(d+4,s.getUint32(d+4,!0)^c.getUint32(u+4,!0),!0),d+=8,u+=24;if(d<h)for(u>=f&&(m=(m+8)%24,u=m);d<h;)s.setUint8(d,s.getUint8(d)^c.getUint8(u)),d++,u++}var r=1953029805,n=2917034100;return i.passThroughDataForTesting=!1,i}),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-1!==n&&(r=r.substr(n+1)),r}return 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/loadCRN",["../ThirdParty/when","./CompressedTextureBuffer","./defined","./DeveloperError","./Resource","./TaskProcessor"],function(e,t,i,r,n,o){"use strict";function a(r){var o;if(r instanceof ArrayBuffer||ArrayBuffer.isView(r))o=e.resolve(r);else{o=n.createIfNeeded(r).fetchArrayBuffer()}if(i(o))return o.then(function(e){if(i(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(e){return t.clone(e)})}var s=new o("transcodeCRNToDXT",Number.POSITIVE_INFINITY);return a}),define("Core/loadImageFromTypedArray",["../ThirdParty/when","./Check","./defined","./defaultValue","./FeatureDetection","./Resource"],function(e,t,i,r,n,o){"use strict";function a(t){var n,a=t.uint8Array,s=t.format,l=t.request,u=r(t.flipY,!1),c=new Blob([a],{type:s});return o.supportsImageBitmapOptions().then(function(t){return t?e(o.createImageBitmapFromBlob(c,{flipY:u,premultiplyAlpha:!1})):(n=window.URL.createObjectURL(c),new o({url:n,request:l}).fetchImage({flipY:u}))}).then(function(e){return i(n)&&window.URL.revokeObjectURL(n),e}).otherwise(function(t){return i(n)&&window.URL.revokeObjectURL(n),e.reject(t)})}return a}),define("Core/loadKTX",["../ThirdParty/when","./Check","./CompressedTextureBuffer","./defined","./PixelFormat","./Resource","./RuntimeError","./WebGLConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))i=e.resolve(t);else{i=o.createIfNeeded(t).fetchArrayBuffer()}if(r(i))return i.then(function(e){if(r(e))return u(e)})}function u(e){var t,o=new Uint8Array(e),l=!0;for(t=0;t<c.length;++t)if(c[t]!==o[t]){l=!1;break}if(!l)throw new a("Invalid KTX file.");var u,f;r(e.buffer)?(u=new DataView(e.buffer),f=e.byteOffset):(u=new DataView(e),f=0),f+=12;var m=u.getUint32(f,!0);if(f+=p,m!==d)throw new a("File is the wrong endianness.");var _=u.getUint32(f,!0);f+=p;var g=u.getUint32(f,!0);f+=p;var v=u.getUint32(f,!0);f+=p;var y=u.getUint32(f,!0);f+=p;var C=u.getUint32(f,!0);f+=p;var b=u.getUint32(f,!0);f+=p;var S=u.getUint32(f,!0);f+=p;var T=u.getUint32(f,!0);f+=p;var E=u.getUint32(f,!0);f+=p;var A=u.getUint32(f,!0);f+=p;var w=u.getUint32(f,!0);f+=p;var x=u.getUint32(f,!0);f+=p,f+=x;var P=u.getUint32(f,!0);f+=p;var D;if(D=r(e.buffer)?new Uint8Array(e.buffer,f,P):new Uint8Array(e,f,P),y===s.RGB8?y=n.RGB:y===s.RGBA8&&(y=n.RGBA),!n.validate(y))throw new a("glInternalFormat is not a valid format.");if(n.isCompressedFormat(y)){if(0!==_)throw new a("glType must be zero when the texture is compressed.");if(1!==g)throw new a("The type size for compressed textures must be 1.");if(0!==v)throw new a("glFormat must be zero when the texture is compressed.")}else{if(_!==s.UNSIGNED_BYTE)throw new a("Only unsigned byte buffers are supported.");if(C!==v)throw new a("The base internal format must be the same as the format for uncompressed textures.")}if(0!==T)throw new a("3D textures are unsupported.");if(0!==E)throw new a("Texture arrays are unsupported.");var I=D.byteOffset,M=new Array(w);for(t=0;t<w;++t){for(var R=M[t]={},O=0;O<A;++O){var L=b>>t,N=S>>t,F=n.isCompressedFormat(y)?n.compressedTextureSizeInBytes(y,L,N):n.textureSizeInBytes(y,_,L,N),B=new Uint8Array(D.buffer,I,F);R[h[O]]=new i(y,L,N,B),I+=F}I+=3-(I+3)%4+4}var k=M;if(1===A)for(t=0;t<w;++t)k[t]=k[t][h[0]];return 1===w&&(k=k[0]),k}var c=[171,75,84,88,32,49,49,187,13,10,26,10],d=67305985,h=["positiveX","negativeX","positiveY","negativeY","positiveZ","negativeZ"],p=4;return l}),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/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/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=0;r=function(e){var i=t(),r=Math.max(1e3/60-(i-a),0);return a=i+r,setTimeout(function(){e(a)},r)}}}(),i}}),define("Core/sampleTerrain",["../ThirdParty/when","./Check"],function(e,t){"use strict";function i(e,t,i){return e.readyPromise.then(function(){return r(e,t,i)})}function r(t,i,r){var a,s=t.tilingScheme,l=[],u={};for(a=0;a<r.length;++a){var c=s.positionToTileXY(r[a],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[a])}var p=[];for(a=0;a<l.length;++a){var f=l[a],m=f.terrainProvider.requestTileGeometry(f.x,f.y,f.level),_=m.then(n(f)).otherwise(o(f));p.push(_)}return e.all(p,function(){return r})}function n(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 o(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){t[e].height=void 0}}}return i}),
- define("Core/sampleTerrainMostDetailed",["../ThirdParty/when","./Cartesian2","./defined","./DeveloperError","./sampleTerrain"],function(e,t,i,r,n){"use strict";function o(t,r){return t.readyPromise.then(function(){for(var s=[],l=[],u=t.availability,c=[],d=0;d<r.length;++d){var h=r[d],p=u.computeMaximumLevelAtPosition(h);if(l[d]=p,0===p){t.tilingScheme.positionToTileXY(h,1,a);var f=t.loadTileDataAvailability(a.x,a.y,1);i(f)&&c.push(f)}var m=s[p];i(m)||(s[p]=m=[]),m.push(h)}return e.all(c).then(function(){return e.all(s.map(function(e,r){if(i(e))return n(t,r,e)}))}).then(function(){for(var e=[],i=0;i<r.length;++i){var n=r[i];u.computeMaximumLevelAtPosition(n)!==l[i]&&e.push(n)}if(e.length>0)return o(t,e)}).then(function(){return r})})}var a=new t;return o}),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/webGLConstantToGlslType",["./WebGLConstants"],function(e){"use strict";function t(t){switch(t){case e.FLOAT:return"float";case e.FLOAT_VEC2:return"vec2";case e.FLOAT_VEC3:return"vec3";case e.FLOAT_VEC4:return"vec4";case e.FLOAT_MAT2:return"mat2";case e.FLOAT_MAT3:return"mat3";case e.FLOAT_MAT4:return"mat4";case e.SAMPLER_2D:return"sampler2D";case e.BOOL:return"bool"}}return t}),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;(!o||!t.equals(i))&&(this._hasClone=n,this._hasEquals=o,this._value=n?t.clone(this._value):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),!(void 0!==n)||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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=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._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),image:o("image"),scale:o("scale"),pixelOffset:o("pixelOffset"),eyeOffset:o("eyeOffset"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),heightReference:o("heightReference"),color:o("color"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),sizeInMeters:o("sizeInMeters"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),imageSubRegion:o("imageSubRegion"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.show=e(this._show,t.show),this.image=e(this._image,t.image),this.scale=e(this._scale,t.scale),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.heightReference=e(this._heightReference,t.heightReference),this.color=e(this._color,t.color),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),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.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this._disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2})}),define("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";return e({CENTER:0,LEFT:1,RIGHT:-1})}),define("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";return e({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1})}),define("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";return e({DONE:0,PENDING:1,FAILED:2})}),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,b=i.ZERO,S=r.ZERO,T=d.CENTER,E=h.CENTER,A=new r,w=new n,x=new r,P=new i,D=new u,I=new u,M=new u,R=new t,O=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,l=t[r],u=l.entity,c=u._billboard,d=l.billboard,h=u.isShowing&&u.isAvailable(e)&&f.getValueOrDefault(c._show,e,!0);if(h&&(s=f.getValueOrUndefined(u._position,e,A),a=f.getValueOrUndefined(c._image,e),h=o(s)&&o(a)),h){f.isConstant(u._position)||(i._clusterDirty=!0),o(d)||(d=i.getBillboard(u),d.id=u,d.image=void 0,l.billboard=d),d.show=h,o(d.image)&&l.textureValue===a||(d.image=a,l.textureValue=a),d.position=s,d.color=f.getValueOrDefault(c._color,e,v,w),d.eyeOffset=f.getValueOrDefault(c._eyeOffset,e,y,x),d.heightReference=f.getValueOrDefault(c._heightReference,e,C),d.pixelOffset=f.getValueOrDefault(c._pixelOffset,e,b,P),d.scale=f.getValueOrDefault(c._scale,e,1),d.rotation=f.getValueOrDefault(c._rotation,e,0),d.alignedAxis=f.getValueOrDefault(c._alignedAxis,e,S),d.horizontalOrigin=f.getValueOrDefault(c._horizontalOrigin,e,T),d.verticalOrigin=f.getValueOrDefault(c._verticalOrigin,e,E),d.width=f.getValueOrUndefined(c._width,e),d.height=f.getValueOrUndefined(c._height,e),d.scaleByDistance=f.getValueOrUndefined(c._scaleByDistance,e,D),d.translucencyByDistance=f.getValueOrUndefined(c._translucencyByDistance,e,I),d.pixelOffsetScaleByDistance=f.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,M),d.sizeInMeters=f.getValueOrDefault(c._sizeInMeters,e,!1),d.distanceDisplayCondition=f.getValueOrUndefined(c._distanceDisplayCondition,e,O),d.disableDepthTestDistance=f.getValueOrUndefined(c._disableDepthTestDistance,e);var p=f.getValueOrUndefined(c._imageSubRegion,e,R);o(p)&&d.setImageSubRegion(d._imageId,p)}else g(l,u,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";return e({ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT,MIN:t.MIN,MAX:t.MAX})}),define("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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_COLOR,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE})}),define("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";return e({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})})}),define("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK})}),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/CubeMapFace",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/PixelFormat","./PixelDatatype"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i,r,n,o,a,s,l,u){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,this._initialized=u}return r(s.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),s.prototype.copyFrom=function(e,r,n){r=t(r,0),n=t(n,0);var a=this._gl,s=this._textureTarget,l=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);var u=e.width,c=e.height,d=e.arrayBufferView,h=this._size,p=this._pixelFormat,f=this._pixelDatatype,m=this._preMultiplyAlpha,_=this._flipY,g=4;i(d)&&(g=o.alignmentInBytes(p,f,u)),a.pixelStorei(a.UNPACK_ALIGNMENT,g);var v=!1;if(!this._initialized){if(0===r&&0===n&&u===h&&c===h)i(d)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(d=o.flipY(d,p,f,h,h)),a.texImage2D(l,0,p,h,h,0,p,f,d)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texImage2D(l,0,p,p,f,e)),v=!0;else{a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);var y=o.createTypedArray(p,f,h,h);a.texImage2D(l,0,p,h,h,0,p,f,y)}this._initialized=!0}v||(i(d)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(d=o.flipY(d,p,f,u,c)),a.texSubImage2D(l,0,r,n,u,c,p,f,d)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(l,0,r,n,p,f,e))),a.bindTexture(s,null)},s.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._size),a=t(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,i,r,n,o,a),s.bindTexture(l,null),this._initialized=!0},s}),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/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var r=t(e.wrapS,s.CLAMP_TO_EDGE),n=t(e.wrapT,s.CLAMP_TO_EDGE),l=t(e.minificationFilter,a.LINEAR),u=t(e.magnificationFilter,o.LINEAR),c=i(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=r,this._wrapT=n,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return r(l.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}}}),l.equals=function(e,t){return e===t||i(e)&&i(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},l}),define("Renderer/CubeMap",["../Core/Check","../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,f){"use strict";function m(e){function r(e,t,r,o){var a=t.arrayBufferView;i(a)||(a=t.bufferView);var l=4;i(a)&&(l=s.alignmentInBytes(p,f,n)),v.pixelStorei(v.UNPACK_ALIGNMENT,l),i(a)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,!1),o&&(a=s.flipY(a,p,f,c,c)),v.texImage2D(e,0,p,c,c,0,p,f,a)):(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,o),v.texImage2D(e,0,p,p,f,t))}e=t(e,t.EMPTY_OBJECT);var n,o=e.context,a=e.source;if(i(a)){var l=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];n=l[0].width,l[0].height}else n=e.width,e.height;var c=n,p=t(e.pixelFormat,s.RGBA),f=t(e.pixelDatatype,d.UNSIGNED_BYTE),m=6*s.textureSizeInBytes(p,f,c,c),_=e.preMultiplyAlpha||p===s.RGB||p===s.LUMINANCE,g=t(e.flipY,!0),v=o._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),i(a)?(r(v.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX,_,g),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX,_,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY,_,g),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY,_,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ,_,g),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ,_,g)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,p,c,c,0,p,f,null)),v.bindTexture(y,null),this._context=o,this._textureFilterAnisotropic=o._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=p,this._pixelDatatype=f,this._size=c,this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0;var b=i(a);this._positiveX=new u(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,p,f,c,_,g,b),this._negativeX=new u(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,p,f,c,_,g,b),this._positiveY=new u(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,p,f,c,_,g,b),this._negativeY=new u(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,p,f,c,_,g,b),this._positiveZ=new u(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,p,f,c,_,g,b),this._negativeZ=new u(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,p,f,c,_,g,b),this.sampler=i(e.sampler)?e.sampler:new h}return r(m.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var 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,o=this._context,a=this._pixelDatatype;(a===d.FLOAT&&!o.textureFloatLinear||a===d.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(t=n?f.NEAREST_MIPMAP_NEAREST:f.NEAREST,r=p.NEAREST);var s=o._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.texParameteri(l,s.TEXTURE_MIN_FILTER,t),s.texParameteri(l,s.TEXTURE_MAG_FILTER,r),s.texParameteri(l,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(l,s.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&s.texParameteri(l,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(l,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}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE),this._hasMipmap=!0;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),this._positiveX=n(this._positiveX),this._negativeX=n(this._negativeX),this._positiveY=n(this._positiveY),this._negativeY=n(this._negativeY),this._positiveZ=n(this._positiveZ),this._negativeZ=n(this._negativeZ),n(this)},m}),
- define("Renderer/Texture",["../Core/Cartesian2","../Core/Check","../Core/createGuid","../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,m,_){"use strict";function g(t){t=r(t,r.EMPTY_OBJECT);var o=t.context,a=t.width,s=t.height,l=t.source;n(l)&&(n(a)||(a=r(l.videoWidth,l.width)),n(s)||(s=r(l.videoHeight,l.height)));var d=r(t.pixelFormat,u.RGBA),h=r(t.pixelDatatype,p.UNSIGNED_BYTE),m=d,_=u.isCompressedFormat(m);if(o.webgl2)if(d===u.DEPTH_STENCIL?m=c.DEPTH24_STENCIL8:d===u.DEPTH_COMPONENT&&(h===p.UNSIGNED_SHORT?m=c.DEPTH_COMPONENT16:h===p.UNSIGNED_INT&&(m=c.DEPTH_COMPONENT24)),h===p.FLOAT)switch(d){case u.RGBA:m=c.RGBA32F;break;case u.RGB:m=c.RGB32F;break;case u.RG:m=c.RG32F;break;case u.R:m=c.R32F}else if(h===p.HALF_FLOAT)switch(d){case u.RGBA:m=c.RGBA16F;break;case u.RGB:m=c.RGB16F;break;case u.RG:m=c.RG16F;break;case u.R:m=c.R16F}var g=t.preMultiplyAlpha||d===u.RGB||d===u.LUMINANCE,v=r(t.flipY,!0),y=!0,C=o._gl,b=C.TEXTURE_2D,S=C.createTexture();C.activeTexture(C.TEXTURE0),C.bindTexture(b,S);var T=4;if(n(l)&&n(l.arrayBufferView)&&!_&&(T=u.alignmentInBytes(d,h,a)),C.pixelStorei(C.UNPACK_ALIGNMENT,T),n(l))if(n(l.arrayBufferView)){C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,!1);var E=l.arrayBufferView;_?C.compressedTexImage2D(b,0,m,a,s,0,E):(v&&(E=u.flipY(E,d,h,a,s)),C.texImage2D(b,0,m,a,s,0,d,h,E))}else n(l.framebuffer)?(C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,!1),l.framebuffer!==o.defaultFramebuffer&&l.framebuffer._bind(),C.copyTexImage2D(b,0,m,l.xOffset,l.yOffset,a,s,0),l.framebuffer!==o.defaultFramebuffer&&l.framebuffer._unBind()):(C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,v),C.texImage2D(b,0,m,d,h,l));else C.texImage2D(b,0,m,a,s,0,d,h,null),y=!1;C.bindTexture(b,null);var A;A=_?u.compressedTextureSizeInBytes(d,a,s):u.textureSizeInBytes(d,h,a,s),this._id=i(),this._context=o,this._textureFilterAnisotropic=o._textureFilterAnisotropic,this._textureTarget=b,this._texture=S,this._pixelFormat=d,this._pixelDatatype=h,this._width=a,this._height=s,this._dimensions=new e(a,s),this._hasMipmap=!1,this._sizeInBytes=A,this._preMultiplyAlpha=g,this._flipY=v,this._initialized=y,this._sampler=void 0,this.sampler=n(t.sampler)?t.sampler:new f}return g.create=function(e){return new g(e)},g.fromFramebuffer=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.context,i=t._gl,o=r(e.pixelFormat,u.RGB),a=r(e.framebufferXOffset,0),s=r(e.framebufferYOffset,0),l=r(e.width,i.drawingBufferWidth),c=r(e.height,i.drawingBufferHeight),d=e.framebuffer;return new g({context:t,width:l,height:c,pixelFormat:o,source:{framebuffer:n(d)?d:t.defaultFramebuffer,xOffset:a,yOffset:s,width:l,height:c}})},o(g.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,i=e.magnificationFilter,r=t===_.NEAREST_MIPMAP_NEAREST||t===_.NEAREST_MIPMAP_LINEAR||t===_.LINEAR_MIPMAP_NEAREST||t===_.LINEAR_MIPMAP_LINEAR,o=this._context,a=this._pixelDatatype;(a===p.FLOAT&&!o.textureFloatLinear||a===p.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(t=r?_.NEAREST_MIPMAP_NEAREST:_.NEAREST,i=m.NEAREST);var s=o._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.texParameteri(l,s.TEXTURE_MIN_FILTER,t),s.texParameteri(l,s.TEXTURE_MAG_FILTER,i),s.texParameteri(l,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(l,s.TEXTURE_WRAP_T,e.wrapT),n(this._textureFilterAnisotropic)&&s.texParameteri(l,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(l,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}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),g.prototype.copyFrom=function(e,t,i){t=r(t,0),i=r(i,0);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture);var s=e.width,l=e.height,c=e.arrayBufferView,d=this._width,h=this._height,p=this._pixelFormat,f=this._pixelDatatype,m=this._preMultiplyAlpha,_=this._flipY,g=4;n(c)&&(g=u.alignmentInBytes(p,f,s)),o.pixelStorei(o.UNPACK_ALIGNMENT,g);var v=!1;if(!this._initialized){if(0===t&&0===i&&s===d&&l===h)n(c)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),_&&(c=u.flipY(c,p,f,d,h)),o.texImage2D(a,0,p,d,h,0,p,f,c)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,_),o.texImage2D(a,0,p,p,f,e)),v=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);var y=u.createTypedArray(p,f,d,h);o.texImage2D(a,0,p,d,h,0,p,f,y)}this._initialized=!0}v||(n(c)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),_&&(c=u.flipY(c,p,f,s,l)),o.texSubImage2D(a,0,t,i,s,l,p,f,c)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,_),o.texSubImage2D(a,0,t,i,p,f,e))),o.bindTexture(a,null)},g.prototype.copyFromFramebuffer=function(e,t,i,n,o,a){e=r(e,0),t=r(t,0),i=r(i,0),n=r(n,0),o=r(o,this._width),a=r(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,t,i,n,o,a),s.bindTexture(l,null),this._initialized=!0},g.prototype.generateMipmap=function(e){e=r(e,h.DONT_CARE),this._hasMipmap=!0;var t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),a(this)},g}),define("Shaders/Materials/AspectRampMaterial",[],function(){"use strict";return"uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n"}),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);\ncolor = czm_gammaCorrect(color);\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);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/ElevationContourMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float spacing;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat distanceToContour = mod(materialInput.height, spacing);\n#ifdef GL_OES_standard_derivatives\nfloat dxc = abs(dFdx(materialInput.height));\nfloat dyc = abs(dFdy(materialInput.height));\nfloat dF = max(dxc, dyc) * width;\nfloat alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\nfloat alpha = (distanceToContour < (czm_resolutionScale * width)) ? 1.0 : 0.0;\n#endif\nvec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha));\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/ElevationRampMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\nvec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.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);\ncolor = czm_gammaCorrect(color);\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);\nvec4 halfColor;\nhalfColor.rgb = color.rgb * 0.5;\nhalfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nhalfColor = czm_gammaCorrect(halfColor);\nmaterial.diffuse = halfColor.rgb;\nmaterial.emission = halfColor.rgb;\nmaterial.alpha = halfColor.a;\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);\noutColor = czm_gammaCorrect(outColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineDashMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\nconst float maskLength = 16.0;\nmat2 rotate(float rad) {\nfloat c = cos(rad);\nfloat s = sin(rad);\nreturn mat2(\nc, s,\n-s, c\n);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\nfloat dashPosition = fract(pos.x / dashLength);\nfloat maskIndex = floor(dashPosition * maskLength);\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\nif (fragColor.a < 0.005) {\ndiscard;\n}\nfragColor = czm_gammaCorrect(fragColor);\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nuniform float taperPower;\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);\nif (taperPower <= 0.99999) {\nglow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n}\nvec4 fragColor;\nfragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nfragColor.a = clamp(0.0, 1.0, glow) * color.a;\nfragColor = czm_gammaCorrect(fragColor);\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.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);\noutColor = czm_gammaCorrect(outColor);\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);\nvec4 outColor = czm_gammaCorrect(color);\nvec4 outRimColor = czm_gammaCorrect(rimColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.emission = outRimColor.rgb * s;\nmaterial.alpha = mix(outColor.a, outRimColor.a, s);\nreturn material;\n}\n"}),define("Shaders/Materials/SlopeRampMaterial",[],function(){"use strict";return"uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\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);\ncolor = czm_gammaCorrect(color);\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.diffuse = material.diffuse;\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/loadKTX","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/Resource","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/AspectRampMaterial","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/ElevationContourMaterial","../Shaders/Materials/ElevationRampMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineDashMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/SlopeRampMaterial","../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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F){"use strict";function B(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,k(e,this),s(this,{type:{value:this.type,writable:!1}}),a(B._uniformList[this.type])||(B._uniformList[this.type]=Object.keys(this._uniforms))}function k(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=B._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}G(i),a(l)||B._materialCache.addMaterial(i.type,i),H(i),Y(i),Q(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 z(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(r&&!o||!r&&o)&&i(n,t)}}function V(e,t){}function U(e,t){}function G(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;z(t,J,V,!0),z(n,$,V,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);z(i,o,U,!1)}function H(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+="diffuse"===r||"emission"===r?"material."+r+" = czm_gammaCorrect("+t[r]+"); \n":"alpha"===r?"material.alpha = czm_gammaCorrect(vec4(vec3(0.0), "+t.alpha+")).a; \n":"material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function W(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 p=i._textures[e];return p!==i._defaultTexture&&p.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!==B.DefaultImageId){var f=o instanceof _;if(!a(i._texturePaths[e])||f&&o.url!==i._texturePaths[e].url||!f&&o!==i._texturePaths[e]){if("string"==typeof o||f){var m,g=f?o:_.createIfNeeded(o);m=te.test(o)?h(g):ie.test(o)?d(g):g.fetchImage(),F(m,function(t){i._loadedImages.push({id:e,image:t})})}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&i._loadedImages.push({id:e,image:o});i._texturePaths[e]=o}}}}}function q(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!==B.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[_.createIfNeeded(r.positiveX).fetchImage(),_.createIfNeeded(r.negativeX).fetchImage(),_.createIfNeeded(r.positiveY).fetchImage(),_.createIfNeeded(r.negativeY).fetchImage(),_.createIfNeeded(r.positiveZ).fetchImage(),_.createIfNeeded(r.negativeZ).fetchImage()];F.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function Y(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&j(e,i)}function j(e,t){var i=(e._strict,e._template.uniforms),r=i[t],n=X(r);if("channels"===n)K(e,t,r,!1);else{if("sampler2D"===n){var o=t+"Dimensions";Z(e,o)>0&&(i[o]={type:"ivec3",x:1,y:1},j(e,o))}if(!new RegExp("uniform\\s+"+n+"\\s+"+t+"\\s*;").test(e.shaderSource)){var a="uniform "+n+" "+t+";";e.shaderSource=a+e.shaderSource}var s=t+"_"+e._count++;if(K(e,t,s),e.uniforms[t]=r,"sampler2D"===n)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(W(t));else if("samplerCube"===n)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(q(t));else if(-1!==n.indexOf("mat")){var l=new ee[n];e._uniforms[s]=function(){return ee[n].fromColumnMajorArray(e.uniforms[t],l)}}else e._uniforms[s]=function(){return e.uniforms[t]}}}function X(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 _||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===B.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 Q(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new B({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_"+e._count++;K(o,"czm_getMaterial",a),e.shaderSource=o.shaderSource+e.shaderSource;var s=a+"(materialInput)";K(e,n,s)}}function K(e,t,i,r){r=o(r,!0);var n=0,a="([\\w"+(r?".":"")+"])?",s=new RegExp(a+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(s,function(e,t,r){return t||r?e:(n+=1,i)}),n}function Z(e,t,i){return K(e,t,t,i)}B._uniformList={},B.fromType=function(e,t){var i=new B({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},B.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))break}return e},B.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)},B.prototype.isDestroyed=function(){return!1},B.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 J=["type","materials","uniforms","components","source"],$=["diffuse","specular","shininess","normal","emission","alpha"],ee={mat2:p,mat3:f,mat4:m},te=/\.ktx$/i,ie=/\.crn$/i;return B._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},B.DefaultImageId="czm_defaultImage",B.DefaultCubeMapId="czm_defaultCubeMap",B.ColorType="Color",B._materialCache.addMaterial(B.ColorType,{fabric:{type:B.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}}),B.ImageType="Image",B._materialCache.addMaterial(B.ImageType,{fabric:{type:B.ImageType,uniforms:{image:B.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}}),B.DiffuseMapType="DiffuseMap",B._materialCache.addMaterial(B.DiffuseMapType,{fabric:{type:B.DiffuseMapType,uniforms:{image:B.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{
- diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),B.AlphaMapType="AlphaMap",B._materialCache.addMaterial(B.AlphaMapType,{fabric:{type:B.AlphaMapType,uniforms:{image:B.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),B.SpecularMapType="SpecularMap",B._materialCache.addMaterial(B.SpecularMapType,{fabric:{type:B.SpecularMapType,uniforms:{image:B.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),B.EmissionMapType="EmissionMap",B._materialCache.addMaterial(B.EmissionMapType,{fabric:{type:B.EmissionMapType,uniforms:{image:B.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),B.BumpMapType="BumpMap",B._materialCache.addMaterial(B.BumpMapType,{fabric:{type:B.BumpMapType,uniforms:{image:B.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:C},translucent:!1}),B.NormalMapType="NormalMap",B._materialCache.addMaterial(B.NormalMapType,{fabric:{type:B.NormalMapType,uniforms:{image:B.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:x},translucent:!1}),B.GridType="Grid",B._materialCache.addMaterial(B.GridType,{fabric:{type:B.GridType,uniforms:{color:new i(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:w},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),B.StripeType="Stripe",B._materialCache.addMaterial(B.StripeType,{fabric:{type:B.StripeType,uniforms:{horizontal:!0,evenColor:new i(1,1,1,.5),oddColor:new i(0,0,1,.5),offset:0,repeat:5},source:L},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),B.CheckerboardType="Checkerboard",B._materialCache.addMaterial(B.CheckerboardType,{fabric:{type:B.CheckerboardType,uniforms:{lightColor:new i(1,1,1,.5),darkColor:new i(0,0,0,.5),repeat:new e(5,5)},source:b},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),B.DotType="Dot",B._materialCache.addMaterial(B.DotType,{fabric:{type:B.DotType,uniforms:{lightColor:new i(1,1,0,.75),darkColor:new i(0,1,1,.75),repeat:new e(5,5)},source:S},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),B.WaterType="Water",B._materialCache.addMaterial(B.WaterType,{fabric:{type:B.WaterType,uniforms:{baseWaterColor:new i(.2,.3,.6,1),blendColor:new i(0,1,.699,1),specularMap:B.DefaultImageId,normalMap:B.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:N},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),B.RimLightingType="RimLighting",B._materialCache.addMaterial(B.RimLightingType,{fabric:{type:B.RimLightingType,uniforms:{color:new i(1,0,0,.7),rimColor:new i(1,1,1,.4),width:.3},source:R},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),B.FadeType="Fade",B._materialCache.addMaterial(B.FadeType,{fabric:{type:B.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:A},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),B.PolylineArrowType="PolylineArrow",B._materialCache.addMaterial(B.PolylineArrowType,{fabric:{type:B.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:P},translucent:!0}),B.PolylineDashType="PolylineDash",B._materialCache.addMaterial(B.PolylineDashType,{fabric:{type:B.PolylineDashType,uniforms:{color:new i(1,0,1,1),gapColor:new i(0,0,0,0),dashLength:16,dashPattern:255},source:D},translucent:!0}),B.PolylineGlowType="PolylineGlow",B._materialCache.addMaterial(B.PolylineGlowType,{fabric:{type:B.PolylineGlowType,uniforms:{color:new i(0,.5,1,1),glowPower:.25,taperPower:1},source:I},translucent:!0}),B.PolylineOutlineType="PolylineOutline",B._materialCache.addMaterial(B.PolylineOutlineType,{fabric:{type:B.PolylineOutlineType,uniforms:{color:new i(1,1,1,1),outlineColor:new i(1,0,0,1),outlineWidth:1},source:M},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),B.ElevationContourType="ElevationContour",B._materialCache.addMaterial(B.ElevationContourType,{fabric:{type:B.ElevationContourType,uniforms:{spacing:100,color:new i(1,0,0,1),width:1},source:T},translucent:!1}),B.ElevationRampType="ElevationRamp",B._materialCache.addMaterial(B.ElevationRampType,{fabric:{type:B.ElevationRampType,uniforms:{image:B.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:E},translucent:!1}),B.SlopeRampMaterialType="SlopeRamp",B._materialCache.addMaterial(B.SlopeRampMaterialType,{fabric:{type:B.SlopeRampMaterialType,uniforms:{image:B.DefaultImageId},source:O},translucent:!1}),B.AspectRampMaterialType="AspectRamp",B._materialCache.addMaterial(B.AspectRampMaterialType,{fabric:{type:B.AspectRampMaterialType,uniforms:{image:B.DefaultImageId},source:y},translucent:!1}),B}),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\nvec4 color = czm_gammaCorrect(v_color);\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = 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 = czm_gammaCorrect(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("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("Scene/ClassificationType",["../Core/freezeObject"],function(e){"use strict";return e({TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2,NUMBER_OF_CLASSIFICATION_TYPES:3})}),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("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("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._occlude=e(t.occlude,!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._pickId=t.pickId,this._pickOnly=e(t.pickOnly,!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)}},occlude:{get:function(){return this._occlude},set:function(e){this._occlude!==e&&(this._occlude=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)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return this._pickOnly},set:function(e){this._pickOnly!==e&&(this._pickOnly=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._occlude=e._occlude,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._pickId=e._pickId,i._pickOnly=e._pickOnly,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";return e({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,OVERLAY:9,NUMBER_OF_PASSES:10})}),define("Renderer/freezeRenderState",["../Core/freezeObject"],function(e){"use strict";function t(i){if("object"!=typeof i||null===i)return i;for(var r,n=Object.keys(i),o=0;o<n.length;o++)r=n[o],i.hasOwnProperty(r)&&"_applyFunctions"!==r&&(i[r]=t(i[r]));return e(i)}return t}),define("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits","./freezeRenderState"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(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,{}),b=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(b)?new e(b.x,b.y,b.width,b.height):void 0,this.id=0,this._applyFunctions=[]}function c(e,t,i){i?e.enable(t):e.disable(t)}function d(e,t){e.frontFace(t.frontFace)}function h(e,t){var i=t.cull,r=i.enabled;c(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function p(e,t){e.lineWidth(t.lineWidth)}function f(e,t){var i=t.polygonOffset,r=i.enabled;c(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function m(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(c(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function _(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function g(e,t){var i=t.depthTest,r=i.enabled;c(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function v(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function y(e,t){e.depthMask(t.depthMask)}function C(e,t){e.stencilMask(t.stencilMask)}function b(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function S(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;c(e,e.BLEND,o),o&&(b(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function T(e,t){var i=t.stencilTest,r=i.enabled;if(c(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,u=l.fail,d=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,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;c(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function A(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=D,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 w(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(d),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||i.push(h),e.lineWidth!==t.lineWidth&&i.push(p),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||i.push(f),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||i.push(_),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||i.push(g),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||i.push(v),e.depthMask!==t.depthMask&&i.push(y),e.stencilMask!==t.stencilMask&&i.push(C),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||i.push(T),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,P={};u.fromCache=function(e){var t=JSON.stringify(e),i=P[t];if(r(i))return++i.referenceCount,i.state;var n=new u(e),o=JSON.stringify(n);return i=P[o],r(i)||(n.id=x++,i={referenceCount:0,state:n},P[o]=i),++i.referenceCount,P[t]={referenceCount:1,state:i.state},i.state},u.removeFromCache=function(e){var t=new u(e),i=JSON.stringify(t),n=P[i],o=JSON.stringify(e),a=P[o];r(a)&&0===--a.referenceCount&&(delete P[o],r(n)&&--n.referenceCount),r(n)&&0===n.referenceCount&&delete P[i]},u.getCache=function(){return P},u.clearCache=function(){P={}};var D=new e;return u.apply=function(e,t,i){d(e,t),h(e,t),p(e,t),f(e,t),_(e,t),g(e,t),v(e,t),y(e,t),C(e,t),T(e,t),E(e,t),m(e,t,i),S(e,t,i),A(e,t,i)},u.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=w(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,i)}((r(n.scissorTest)?n.scissorTest:t.scissorTest)!==(r(o.scissorTest)?o.scissorTest:i.scissorTest)||a)&&m(e,i,o);var c=r(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,d=r(o.blendingEnabled)?o.blendingEnabled:i.blending.enabled;(c!==d||d&&t.blending!==i.blending)&&S(e,i,o),t===i&&n===o&&n.context===o.context||A(e,i,o)},u.getState=function(i){return{frontFace:i.frontFace,cull:{enabled:i.cull.enabled,face:i.cull.face},lineWidth:i.lineWidth,polygonOffset:{enabled:i.polygonOffset.enabled,factor:i.polygonOffset.factor,units:i.polygonOffset.units},scissorTest:{enabled:i.scissorTest.enabled,rectangle:e.clone(i.scissorTest.rectangle)},depthRange:{near:i.depthRange.near,far:i.depthRange.far},depthTest:{enabled:i.depthTest.enabled,func:i.depthTest.func},colorMask:{red:i.colorMask.red,green:i.colorMask.green,blue:i.colorMask.blue,alpha:i.colorMask.alpha},depthMask:i.depthMask,stencilMask:i.stencilMask,blending:{enabled:i.blending.enabled,color:t.clone(i.blending.color),equationRgb:i.blending.equationRgb,equationAlpha:i.blending.equationAlpha,functionSourceRgb:i.blending.functionSourceRgb,functionSourceAlpha:i.blending.functionSourceAlpha,functionDestinationRgb:i.blending.functionDestinationRgb,functionDestinationAlpha:i.blending.functionDestinationAlpha},stencilTest:{enabled:i.stencilTest.enabled,frontFunction:i.stencilTest.frontFunction,backFunction:i.stencilTest.backFunction,reference:i.stencilTest.reference,mask:i.stencilTest.mask,frontOperation:{fail:i.stencilTest.frontOperation.fail,zFail:i.stencilTest.frontOperation.zFail,zPass:i.stencilTest.frontOperation.zPass},backOperation:{fail:i.stencilTest.backOperation.fail,zFail:i.stencilTest.backOperation.zFail,zPass:i.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:i.sampleCoverage.enabled,value:i.sampleCoverage.value,invert:i.sampleCoverage.invert},viewport:r(i.viewport)?e.clone(i.viewport):void 0}},u}),define("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Math","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,i,r){"use strict";function n(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var o=new e;if("undefined"==typeof WebGLRenderingContext)return{};var a={};return a[r.FLOAT]="float",a[r.FLOAT_VEC2]="vec2",a[r.FLOAT_VEC3]="vec3",a[r.FLOAT_VEC4]="vec4",a[r.INT]="int",a[r.INT_VEC2]="ivec2",a[r.INT_VEC3]="ivec3",a[r.INT_VEC4]="ivec4",a[r.BOOL]="bool",a[r.BOOL_VEC2]="bvec2",a[r.BOOL_VEC3]="bvec3",a[r.BOOL_VEC4]="bvec4",a[r.FLOAT_MAT2]="mat2",a[r.FLOAT_MAT3]="mat3",a[r.FLOAT_MAT4]="mat4",a[r.SAMPLER_2D]="sampler2D",a[r.SAMPLER_CUBE]="samplerCube",n.prototype.getDeclaration=function(e){var t="uniform "+a[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"},{czm_viewport:new n({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new n({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new n({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new n({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new n({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new n({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new n({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_log2FarDistance:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.log2FarDistance}}),czm_log2FarPlusOne:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.log2FarPlusOne}}),czm_log2NearDistance:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.log2NearDistance}}),czm_sunPositionWC:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){
- return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return i.getTranslation(e.inverseView,o)}}),czm_frameNumber:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new n({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new n({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new n({size:1,datatype:r.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new n({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new n({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new n({size:9,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new n({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new n({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new n({size:1,datatype:r.FLOAT,getValue:function(e){return e.gamma}}),czm_sunColor:new n({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunColor}})}}),define("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/FeatureDetection","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new p(e,t,i,r);case e.FLOAT_VEC3:return new f(e,t,i,r);case e.FLOAT_VEC4:return new m(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new _(e,t,i,r);case e.INT:case e.BOOL:return new g(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new v(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new y(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new C(e,t,i,r);case e.FLOAT_MAT2:return new b(e,t,i,r);case e.FLOAT_MAT3:return new S(e,t,i,r);case e.FLOAT_MAT4:return new T(e,t,i,r);default:throw new c("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function p(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}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._value=void 0,this._gl=e,this._location=r}function _(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function g(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function v(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function y(e,i,r,n){this.name=r,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function C(e,t,r,n){this.name=r,this.value=void 0,this._value=new i,this._gl=e,this._location=n}function b(e,t,i,r){this.name=i,this.value=void 0,this._value=new s,this._gl=e,this._location=r}function S(e,t,i,r){this.name=i,this.value=void 0,this._value=new l,this._gl=e,this._location=r}function T(e,t,i,r){this.name=i,this.value=void 0,this._value=new u,this._gl=e,this._location=r}if(!a.supportsTypedArrays())return{};h.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},p.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))},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.uniform3f(this._location,e.red,e.green,e.blue)):n(e.x)&&(t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},m.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},_.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},_.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},g.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},v.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},y.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},C.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))};var E=new Float32Array(4);b.prototype.set=function(){if(!s.equalsArray(this.value,this._value,0)){s.clone(this.value,this._value);var e=s.toArray(this.value,E);this._gl.uniformMatrix2fv(this._location,!1,e)}};var A=new Float32Array(9);S.prototype.set=function(){if(!l.equalsArray(this.value,this._value,0)){l.clone(this.value,this._value);var e=l.toArray(this.value,A);this._gl.uniformMatrix3fv(this._location,!1,e)}};var w=new Float32Array(16);return T.prototype.set=function(){if(!u.equalsArray(this.value,this._value,0)){u.clone(this.value,this._value);var e=u.toArray(this.value,w);this._gl.uniformMatrix4fv(this._location,!1,e)}},d}),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 b(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 b(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)},b.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/Check","../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,c){"use strict";function d(e){var t=p(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=C++}function h(e){var t=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(i(r))for(var n=r.length,o=0;o<n;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);t.push(s)}return t}function p(e,t){var i={};if(!l.highpFloatSupported||!l.highpIntSupported){var r,n,o,a,s=h(e),u=h(t),c=s.length,d=u.length;for(r=0;r<c;r++)for(n=0;n<d;n++)if(s[r]===u[n]){o=s[r],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}function f(e,t){var r=t._vertexShaderText,n=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,r),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,o),e.attachShader(l,s),e.deleteShader(o),e.deleteShader(s);var u=t._attributeLocations;if(i(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=t._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(s),console.error(b+"Fragment shader compile log: "+d),i(h)){var p=h.getTranslatedShaderSource(s);""!==p?console.error(b+"Translated fragment shader source:\n"+p):console.error(b+"Fragment shader translation failed.")}throw e.deleteProgram(l),new a("Fragment shader failed to compile. Compile log: "+d)}if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(o),console.error(b+"Vertex shader compile log: "+d),i(h)){var f=h.getTranslatedShaderSource(o);""!==f?console.error(b+"Translated vertex shader source:\n"+f):console.error(b+"Vertex shader translation failed.")}throw e.deleteProgram(l),new a("Vertex shader failed to compile. Compile log: "+d)}throw d=e.getProgramInfoLog(l),console.error(b+"Shader program link log: "+d),i(h)&&(console.error(b+"Translated vertex shader source:\n"+h.getTranslatedShaderSource(o)),console.error(b+"Translated fragment shader source:\n"+h.getTranslatedShaderSource(s))),e.deleteProgram(l),new a("Program failed to link. Link log: "+d)}var m=t._logShaderCompilation;return m&&(d=e.getShaderInfoLog(o),i(d)&&d.length>0&&console.log(b+"Vertex shader compile log: "+d)),m&&(d=e.getShaderInfoLog(s),i(d)&&d.length>0&&console.log(b+"Fragment shader compile log: "+d)),m&&(d=e.getProgramInfoLog(l),i(d)&&d.length>0&&console.log(b+"Shader program link log: "+d)),l}function m(e,t,i){for(var r={},n=0;n<i;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function _(e,t){for(var r={},n=[],o=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var l=e.getActiveUniform(t,s),d=-1!==l.name.indexOf("[0]",l.name.length-"[0]".length)?l.name.slice(0,l.name.length-3):l.name;if(0!==d.indexOf("gl_"))if(l.name.indexOf("[")<0){var h=e.getUniformLocation(t,d);if(null!==h){var p=u(e,l,d,h);r[d]=p,n.push(p),p._setSampler&&o.push(p)}}else{var f,m,_,g,v=d.indexOf("[");if(v>=0){if(f=r[d.slice(0,v)],!i(f))continue;m=f._locations,m.length<=1&&(_=f.value,null!==(g=e.getUniformLocation(t,d))&&(m.push(g),_.push(e.getUniform(t,g))))}else{m=[];for(var y=0;y<l.size;++y)null!==(g=e.getUniformLocation(t,d+"["+y+"]"))&&m.push(g);f=c(e,l,d,m),r[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:r,uniforms:n,samplerUniforms:o}}function g(e,t){var r=[],n=[];for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],l=o,u=e._duplicateUniformNames[l];i(u)&&(a.name=u,l=u);var c=s[l];i(c)?r.push({uniform:a,automaticUniform:c}):n.push(a)}return{automaticUniforms:r,manualUniforms:n}}function v(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 y(e){if(!i(e._program)){var t=e._gl,r=f(t,e,e._debugShaders),n=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),o=_(t,r),a=g(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=m(t,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=v(t,r,o.samplerUniforms)}}var C=0;d.fromCache=function(e){return e=t(e,t.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)},d.replaceCache=function(e){return e=t(e,t.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)},r(d.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return y(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return y(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return y(this),this._uniformsByName}}});var b="[Cesium WebGL] ";return d.prototype._bind=function(){y(this),this._gl.useProgram(this._program)},d.prototype._setUniforms=function(e,t,r){var n,o;if(i(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(t)}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)}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},d.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),n(this)},d}),define("Renderer/modernizeShader",["../Core/defined","../Core/DeveloperError"],function(e,t){"use strict";function i(e,i){var n=/#define OUTPUT_DECLARATION/,c=e.split("\n");if(/#version 300 es/g.test(e))return e;var d,h,p=-1;for(d=0;d<c.length;++d)if(h=c[d],n.test(h)){p=d;break}if(-1===p)throw new t("Could not find a #define OUTPUT_DECLARATION!");var f=[];for(d=0;d<10;d++){var m="gl_FragData\\["+d+"\\]",_="czm_out"+d;new RegExp(m,"g").test(e)&&(s(_,f),r(m,_,c),c.splice(p,0,"layout(location = "+d+") out vec4 "+_+";"),p+=1)}o("gl_FragColor",c)&&(s("czm_fragColor",f),r("gl_FragColor","czm_fragColor",c),c.splice(p,0,"layout(location = 0) out vec4 czm_fragColor;"),p+=1);var g=l(f,c),v={};for(d=0;d<c.length;d++){h=c[d];for(var y in g)if(g.hasOwnProperty(y)){var C=new RegExp("(layout)[^]+(out)[^]+("+y+")[^]+","g");C.test(h)&&(v[h]=y)}}for(var b in v)if(v.hasOwnProperty(b)){var S,T=v[b],E=c.indexOf(b),A=g[T],w=A.length;for(S=0;S<w;S++)c.splice(E,0,A[S]);for(E+=w+1,S=w-1;S>=0;S--)c.splice(E,0,"#endif //"+A[S])}var x=!1;for(d=0;d<c.length;d++)/#version/.test(c[d])&&(c[d]="#version 300 es",x=!0);return x||c.splice(0,0,"#version 300 es"),u("EXT_draw_buffers",c),u("EXT_frag_depth",c),r("texture2D","texture",c),r("texture3D","texture",c),r("textureCube","texture",c),r("gl_FragDepthEXT","gl_FragDepth",c),i?r("varying","in",c):(r("attribute","in",c),r("varying","out",c)),a(c)}function r(e,t,i){for(var r="(^|[^\\w])("+e+")($|[^\\w])",n=new RegExp(r,"g"),o=i.length,a=0;a<o;++a){var s=i[a];i[a]=s.replace(n,"$1"+t+"$3")}}function n(e,t,i){for(var r=i.length,n=0;n<r;++n){var o=i[n];i[n]=o.replace(e,t)}}function o(e,t){for(var i="(^|[^\\w])("+e+")($|[^\\w])",r=new RegExp(i,"g"),n=t.length,o=0;o<n;++o){var a=t[o];if(r.test(a))return!0}return!1}function a(e){for(var t="",i=e.length,r=0;r<i;++r)t+=e[r]+"\n";return t}function s(e,t){-1===t.indexOf(e)&&t.push(e)}function l(t,i){for(var r={},n=t.length,o=[],a=0;a<i.length;++a){var s=i[a],l=/(#ifdef|#if)/g.test(s),u=/#else/g.test(s),c=/#endif/g.test(s);if(l)o.push(s);else if(u){var d=o[o.length-1],h=d.replace("ifdef","ifndef");/if/g.test(h)&&(h=h.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),o.pop(),o.push(h)}else if(c)o.pop();else if(!/layout/g.test(s))for(var p=0;p<n;++p){var f=t[p];-1!==s.indexOf(f)&&(e(r[f])?r[f]=r[f].filter(function(e){return o.indexOf(e)>=0}):r[f]=o.slice())}}return r}function u(e,t){var i="#extension\\s+GL_"+e+"\\s+:\\s+[a-zA-Z0-9]+\\s*$";n(new RegExp(i,"g"),"",t)}return i}),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/ellipsoidInverseRadii",[],function(){"use strict";return"const vec3 czm_ellipsoidInverseRadii = vec3(1.0 / 6378137.0, 1.0 / 6378137.0, 1.0 / 6356752.314245);\n"}),define("Shaders/Builtin/Constants/ellipsoidRadii",[],function(){"use strict";return"const vec3 czm_ellipsoidRadii = vec3(6378137.0, 6378137.0, 6356752.314245);\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/passCesium3DTile",[],function(){"use strict";return"const float czm_passCesium3DTile = 4.0;\n"}),define("Shaders/Builtin/Constants/passCesium3DTileClassification",[],function(){"use strict";return"const float czm_passCesium3DTileClassification = 5.0;\n"}),define("Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow",[],function(){"use strict";return"const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n"}),define("Shaders/Builtin/Constants/passClassification",[],function(){"use strict";return"const float czm_passClassification = 7.0;\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/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 7.0;\n"}),define("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 9.0;\n"}),define("Shaders/Builtin/Constants/passTerrainClassification",[],function(){"use strict";return"const float czm_passTerrainClassification = 3.0;\n"}),define("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 8.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/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;\nfloat height;\nfloat slope;\nfloat aspect;\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/HSBToRGB",[],function(){"use strict";return"const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 czm_HSBToRGB(vec3 hsb)\n{\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n"}),define("Shaders/Builtin/Functions/HSLToRGB",[],function(){"use strict";return"vec3 hueToRGB(float hue)\n{\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\nvec3 czm_HSLToRGB(vec3 hsl)\n{\nvec3 rgb = hueToRGB(hsl.x);\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nreturn (rgb - 0.5) * c + hsl.z;\n}\n"}),define("Shaders/Builtin/Functions/RGBToHSB",[],function(){"use strict";return"const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec3 czm_RGBToHSB(vec3 rgb)\n{\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.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}\n"}),define("Shaders/Builtin/Functions/RGBToHSL",[],function(){"use strict";return"vec3 RGBtoHCV(vec3 rgb)\n{\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\nfloat c = q.x - min(q.w, q.y);\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\nreturn vec3(h, c, q.x);\n}\nvec3 czm_RGBToHSL(vec3 rgb)\n{\nvec3 hcv = RGBtoHCV(rgb);\nfloat l = hcv.z - hcv.y * 0.5;\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\nreturn vec3(hcv.x, s, l);\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/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/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.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/approximateSphericalCoordinates",[],function(){"use strict";return"vec2 czm_approximateSphericalCoordinates(vec3 normal) {\nfloat latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\nfloat longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\nreturn vec2(latitudeApproximation, longitudeApproximation);\n}\n"}),define("Shaders/Builtin/Functions/branchFreeTernary",[],function(){"use strict"
- ;return"float czm_branchFreeTernary(bool comparison, float a, float b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\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/depthClampFarPlane",[],function(){"use strict";return"#ifndef LOG_DEPTH\nvarying float v_WindowZ;\n#endif\nvec4 czm_depthClampFarPlane(vec4 coords)\n{\n#ifndef LOG_DEPTH\nv_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\ncoords.z = min(coords.z, coords.w);\n#endif\nreturn coords;\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(vec3 ellipsoid_inverseRadii, 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/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/fastApproximateAtan",[],function(){"use strict";return"float czm_fastApproximateAtan(float x) {\nreturn x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n}\nfloat czm_fastApproximateAtan(float x, float y) {\nfloat t = abs(x);\nfloat opposite = abs(y);\nfloat adjacent = max(t, opposite);\nopposite = min(t, opposite);\nt = czm_fastApproximateAtan(opposite / adjacent);\nt = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\nt = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\nt = czm_branchFreeTernary(y < 0.0, -t, t);\nreturn t;\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}\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\nreturn mix(color, fogColor, fog);\n}\n"}),define("Shaders/Builtin/Functions/gammaCorrect",[],function(){"use strict";return"vec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\ncolor = pow(color, vec3(czm_gamma));\n#endif\nreturn color;\n}\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\ncolor.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\nreturn color;\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/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/inverseGamma",[],function(){"use strict";return"vec3 czm_inverseGamma(vec3 color) {\nreturn pow(color, vec3(1.0 / czm_gamma));\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/lineDistance",[],function(){"use strict";return"float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\nreturn abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\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 || czm_orthographicIn3D == 1.0)\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;\n#ifdef HDR\nfloat sunDiffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\ncolor += materialDiffuse * sunDiffuse * czm_sunColor;\n#endif\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/planeDistance",[],function(){"use strict";return"float czm_planeDistance(vec4 plane, vec3 point) {\nreturn (dot(plane.xyz, point) + plane.w);\n}\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\nreturn (dot(planeNormal, point) + planeDistance);\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, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\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/readDepth",[],function(){"use strict";return"float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\nreturn czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\n}\n"}),define("Shaders/Builtin/Functions/reverseLogDepth",[],function(){"use strict";return"float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nlogZ = pow(2.0, logZ * czm_log2FarPlusOne) - 1.0;\nlogZ = far * (1.0 - near / logZ) / (far - near);\n#endif\nreturn logZ;\n}\n"}),define("Shaders/Builtin/Functions/sampleOctahedralProjection",[],function(){"use strict";return"vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\ndirection /= dot(vec3(1.0), abs(direction));\nvec2 rev = abs(direction.zx) - vec2(1.0);\nvec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\ndirection.z < 0.0 ? rev.y : -rev.y);\nvec2 uv = direction.y < 0.0 ? neg : direction.xz;\nvec2 coord = 0.5 * uv + vec2(0.5);\nvec2 pixel = 1.0 / textureSize;\nif (lod > 0.0)\n{\nfloat scale = 1.0 / pow(2.0, lod);\nfloat offset = ((textureSize.y + 1.0) / textureSize.x);\ncoord.x *= offset;\ncoord *= scale;\ncoord.x += offset + pixel.x;\ncoord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n}\nelse\n{\ncoord.x *= (textureSize.y / textureSize.x);\n}\n#ifndef OES_texture_float_linear\nvec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\nvec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\nvec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\nvec3 color4 = texture2D(projectedMap, coord).rgb;\nvec2 texturePosition = coord * textureSize;\nfloat fu = fract(texturePosition.x);\nfloat fv = fract(texturePosition.y);\nvec3 average1 = mix(color4, color2, fu);\nvec3 average2 = mix(color1, color3, fu);\nvec3 color = mix(average1, average2, fv);\n#else\nvec3 color = texture2D(projectedMap, coord).rgb;\n#endif\nreturn color;\n}\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\nfloat currentLod = floor(lod + 0.5);\nfloat nextLod = min(currentLod + 1.0, maxLod);\nvec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\nvec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\nreturn mix(colorNextLod, colorCurrentLod, nextLod - lod);\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/sphericalHarmonics",[],function(){"use strict";return"vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\nconst float c1 = 0.429043;\nconst float c2 = 0.511664;\nconst float c3 = 0.743125;\nconst float c4 = 0.886227;\nconst float c5 = 0.247708;\nvec3 L00 = coefficients[0];\nvec3 L1_1 = coefficients[1];\nvec3 L10 = coefficients[2];\nvec3 L11 = coefficients[3];\nvec3 L2_2 = coefficients[4];\nvec3 L2_1 = coefficients[5];\nvec3 L20 = coefficients[6];\nvec3 L21 = coefficients[7];\nvec3 L22 = coefficients[8];\nfloat x = normal.x;\nfloat y = normal.y;\nfloat z = normal.z;\nreturn c1 * L22 * (x * x - y * y) + c3 * L20 * z * z + c4 * L00 - c5 * L20 +\n2.0 * c1 * (L2_2 * x * y + L21 * x * z + L2_1 * y * z) +\n2.0 * c2 * (L11 * x + L1_1 * y + L10 * z);\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/transformPlane",[],function(){"use strict";return"vec4 czm_transformPlane(vec4 clippingPlane, mat4 transform) {\nvec3 transformedDirection = normalize((transform * vec4(clippingPlane.xyz, 0.0)).xyz);\nvec3 transformedPosition = (transform * vec4(clippingPlane.xyz * -clippingPlane.w, 1.0)).xyz;\nvec4 transformedPlane;\ntransformedPlane.xyz = transformedDirection;\ntransformedPlane.w = -dot(transformedDirection, transformedPosition);\nreturn transformedPlane;\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/unpackFloat",[],function(){"use strict";return"#define SHIFT_RIGHT_8 0.00390625 //1.0 / 256.0\n#define SHIFT_RIGHT_16 0.00001525878 //1.0 / 65536.0\n#define SHIFT_RIGHT_24 5.960464477539063e-8//1.0 / 16777216.0\n#define BIAS 38.0\nfloat czm_unpackFloat(vec4 packedFloat)\n{\npackedFloat *= 255.0;\nfloat temp = packedFloat.w / 2.0;\nfloat exponent = floor(temp);\nfloat sign = (temp - exponent) * 2.0;\nexponent = exponent - float(BIAS);\nsign = sign * 2.0 - 1.0;\nsign = -sign;\nfloat unpacked = sign * packedFloat.x * float(SHIFT_RIGHT_8);\nunpacked += sign * packedFloat.y * float(SHIFT_RIGHT_16);\nunpacked += sign * packedFloat.z * float(SHIFT_RIGHT_24);\nreturn unpacked * pow(10.0, exponent);\n}\n"}),define("Shaders/Builtin/Functions/vertexLogDepth",[],function(){"use strict";return"#ifdef LOG_DEPTH\nvarying float v_logZ;\n#ifdef SHADOW_MAP\nvarying vec3 v_logPositionEC;\n#endif\n#endif\nvoid czm_updatePositionDepth() {\n#if defined(LOG_DEPTH) && !defined(DISABLE_GL_POSITION_LOG_DEPTH)\nvec3 logPositionEC = (czm_inverseProjection * gl_Position).xyz;\n#ifdef SHADOW_MAP\nv_logPositionEC = logPositionEC;\n#endif\n#ifdef ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT\nif (length(logPositionEC) < 2.0e6)\n{\nreturn;\n}\n#endif\ngl_Position.z = log2(max(1e-6, 1.0 + gl_Position.w)) * czm_log2FarDistance - 1.0;\ngl_Position.z *= gl_Position.w;\n#endif\n}\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\nv_logZ = 1.0 + gl_Position.w;\nczm_updatePositionDepth();\n#endif\n}\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\nv_logZ = 1.0 + clipCoords.w;\nczm_updatePositionDepth();\n#endif\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)))\n{\nq = czm_inverseProjection * q;\n}\nelse\n{\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}\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n#ifdef LOG_DEPTH\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nfloat unscaledDepth = pow(2.0, depthOrLogDepth * czm_log2FarPlusOne) - 1.0;\nvec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / unscaledDepth) / (far - near), 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\neyeCoordinate.w = 1.0 / unscaledDepth;\n#else\nvec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\nreturn eyeCoordinate;\n}\n"}),define("Shaders/Builtin/Functions/writeDepthClampedToFarPlane",[],function(){"use strict";return"#ifndef LOG_DEPTH\nvarying float v_WindowZ;\n#endif\nvoid czm_writeDepthClampedToFarPlane()\n{\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n"}),define("Shaders/Builtin/Functions/writeLogDepth",[],function(){"use strict";return"#ifdef LOG_DEPTH\nvarying float v_logZ;\n#endif\nvoid czm_writeLogDepth(float logZ)\n{\n#if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH) && !defined(DISABLE_LOG_DEPTH_FRAGMENT_WRITE)\nfloat halfLogFarDistance = czm_log2FarDistance * 0.5;\nfloat depth = log2(logZ);\nif (depth < czm_log2NearDistance) {\ndiscard;\n}\ngl_FragDepthEXT = depth * halfLogFarDistance;\n#endif\n}\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\nczm_writeLogDepth(v_logZ);\n#endif\n}\n"}),define("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/ellipsoidInverseRadii","./Constants/ellipsoidRadii","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCesium3DTile","./Constants/passCesium3DTileClassification","./Constants/passCesium3DTileClassificationIgnoreShow","./Constants/passClassification","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTerrainClassification","./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/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/HSBToRGB","./Functions/HSLToRGB","./Functions/RGBToHSB","./Functions/RGBToHSL","./Functions/RGBToXYZ","./Functions/XYZToRGB","./Functions/alphaWeight","./Functions/antialias","./Functions/approximateSphericalCoordinates","./Functions/branchFreeTernary","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/depthClampFarPlane","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fastApproximateAtan","./Functions/fog","./Functions/gammaCorrect","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/hue","./Functions/inverseGamma","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/lineDistance","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/planeDistance","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/readDepth","./Functions/reverseLogDepth","./Functions/sampleOctahedralProjection","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/sphericalHarmonics","./Functions/tangentToEyeSpaceMatrix","./Functions/transformPlane","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/unpackFloat","./Functions/vertexLogDepth","./Functions/windowToEyeCoordinates","./Functions/writeDepthClampedToFarPlane","./Functions/writeLogDepth"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,be,Se,Te,Ee,Ae,we,xe,Pe,De,Ie,Me,Re,Oe,Le,Ne,Fe,Be,ke,ze,Ve,Ue,Ge,He,We,qe,Ye,je,Xe,Qe,Ke,Ze,Je,$e,et,tt,it,rt,nt,ot){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_ellipsoidInverseRadii:i,czm_ellipsoidRadii:r,czm_epsilon1:n,czm_epsilon2:o,czm_epsilon3:a,czm_epsilon4:s,czm_epsilon5:l,czm_epsilon6:u,czm_epsilon7:c,czm_infinity:d,czm_oneOverPi:h,czm_oneOverTwoPi:p,czm_passCesium3DTile:f,czm_passCesium3DTileClassification:m,czm_passCesium3DTileClassificationIgnoreShow:_,czm_passClassification:g,czm_passCompute:v,czm_passEnvironment:y,czm_passGlobe:C,czm_passOpaque:b,czm_passOverlay:S,czm_passTerrainClassification:T,czm_passTranslucent:E,czm_pi:A,czm_piOverFour:w,czm_piOverSix:x,czm_piOverThree:P,czm_piOverTwo:D,czm_radiansPerDegree:I,czm_sceneMode2D:M,czm_sceneMode3D:R,czm_sceneModeColumbusView:O,czm_sceneModeMorphing:L,czm_solarRadius:N,czm_threePiOver2:F,czm_twoPi:B,czm_webMercatorMaxLatitude:k,czm_depthRangeStruct:z,czm_material:V,czm_materialInput:U,czm_ray:G,czm_raySegment:H,czm_shadowParameters:W,czm_HSBToRGB:q,czm_HSLToRGB:Y,czm_RGBToHSB:j,czm_RGBToHSL:X,czm_RGBToXYZ:Q,czm_XYZToRGB:K,czm_alphaWeight:Z,czm_antialias:J,czm_approximateSphericalCoordinates:$,czm_branchFreeTernary:ee,czm_cascadeColor:te,czm_cascadeDistance:ie,czm_cascadeMatrix:re,czm_cascadeWeights:ne,czm_columbusViewMorph:oe,czm_computePosition:ae,czm_cosineAndSine:se,czm_decompressTextureCoordinates:le,czm_depthClampFarPlane:ue,czm_eastNorthUpToEyeCoordinates:ce,czm_ellipsoidContainsPoint:de,czm_ellipsoidWgs84TextureCoordinates:he,czm_equalsEpsilon:pe,czm_eyeOffset:fe,czm_eyeToWindowCoordinates:me,czm_fastApproximateAtan:_e,czm_fog:ge,czm_gammaCorrect:ve,czm_geodeticSurfaceNormal:ye,czm_getDefaultMaterial:Ce,czm_getLambertDiffuse:be,czm_getSpecular:Se,czm_getWaterNoise:Te,czm_hue:Ee,czm_inverseGamma:Ae,czm_isEmpty:we,czm_isFull:xe,czm_latitudeToWebMercatorFraction:Pe,czm_lineDistance:De,czm_luminance:Ie,czm_metersPerPixel:Me,czm_modelToWindowCoordinates:Re,czm_multiplyWithColorBalance:Oe,czm_nearFarScalar:Le,czm_octDecode:Ne,czm_packDepth:Fe,czm_phong:Be,czm_planeDistance:ke,czm_pointAlongRay:ze,czm_rayEllipsoidIntersectionInterval:Ve,czm_readDepth:Ue,czm_reverseLogDepth:Ge,czm_sampleOctahedralProjection:He,czm_saturation:We,czm_shadowDepthCompare:qe,czm_shadowVisibility:Ye,czm_signNotZero:je,czm_sphericalHarmonics:Xe,czm_tangentToEyeSpaceMatrix:Qe,czm_transformPlane:Ke,czm_translateRelativeToEye:Ze,czm_translucentPhong:Je,czm_transpose:$e,czm_unpackDepth:et,czm_unpackFloat:tt,czm_vertexLogDepth:it,czm_windowToEyeCoordinates:rt,czm_writeDepthClampedToFarPlane:nt,czm_writeLogDepth:ot}}),define("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Renderer/modernizeShader","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n,o){"use strict";function a(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 s(e,i,r){for(var n,o=0;o<r.length;++o)r[o].name===e&&(n=r[o]);return t(n)||(i=a(i),n={name:e,glslSource:i,dependsOn:[],requiredBy:[],evaluated:!1},r.push(n)),n}function l(e,i){if(!e.evaluated){e.evaluated=!0;var r=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(r)&&null!==r&&(r=r.filter(function(e,t){return r.indexOf(e)===t}),r.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var r=s(t,h._czmBuiltinsAndUniforms[t],i);e.dependsOn.push(r),r.requiredBy.push(e),l(r,i)}}))}}function u(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 c(e){var t=[],i=s("main",e,t);l(i,t),u(t);for(var r="",n=t.length-1;n>=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function d(e,i,n){var o,s,l="",u=e.sources;if(t(u))for(o=0,s=u.length;o<s;++o)l+="\n#line 0\n"+u[o];l=a(l);var d;l=l.replace(/#version\s+(.*?)\n/gm,function(e,t){return d=t,"\n"});var p=[];l=l.replace(/#extension.*\n/gm,function(e){return p.push(e),"\n"}),l=l.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var f=e.pickColorQualifier;t(f)&&(l=h.createPickFragmentShaderSource(l,f));var m="";t(d)&&(m="#version "+d+"\n");var _=p.length;for(o=0;o<_;o++)m+=p[o];i&&(m+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var g=e.defines;if(t(g))for(o=0,s=g.length;o<s;++o){var v=g[o];0!==v.length&&(m+="#define "+v+"\n")}return n.webgl2&&(m+="#define OUTPUT_DECLARATION\n\n"),n.textureFloatLinear&&(m+="#define OES_texture_float_linear\n\n"),e.includeBuiltIns&&(m+=c(l)),m+="\n#line 0\n",m+=l,n.webgl2&&(m=r(m,i,!0)),m}function h(i){i=e(i,e.EMPTY_OBJECT);var r=i.pickColorQualifier;this.defines=t(i.defines)?i.defines.slice(0):[],this.sources=t(i.sources)?i.sources.slice(0):[],this.pickColorQualifier=r,this.includeBuiltIns=e(i.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},h.prototype.createCombinedVertexShader=function(e){return d(this,!1,e)},h.prototype.createCombinedFragmentShader=function(e){return d(this,!0,e)},h._czmBuiltinsAndUniforms={};for(var p in n)n.hasOwnProperty(p)&&(h._czmBuiltinsAndUniforms[p]=n[p]);for(var f in o)if(o.hasOwnProperty(f)){var m=o[f];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[f]=m.getDeclaration(f))}h.createPickVertexShaderSource=function(e){return h.replaceMain(e,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}"},h.createPickFragmentShaderSource=function(e,t){return h.replaceMain(e,"czm_old_main")+"\n"+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}"},h.findVarying=function(e,t){for(var i=e.sources,r=t.length,n=0;n<r;++n)for(var o=t[n],a=i.length,s=0;s<a;++s)if(-1!==i[s].indexOf(o))return o};var _=["v_normalEC","v_normal"];h.findNormalVarying=function(e){return h.findVarying(e,_)};var g=["v_positionEC"];return h.findPositionVarying=function(e){return h.findVarying(e,g)},h}),define("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvoid main(void)\n{\n#ifdef VECTOR_TILE\ngl_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\ngl_FragColor = vec4(1.0);\n#endif\nczm_writeDepthClampedToFarPlane();\n}\n"}),define("Shaders/ShadowVolumeAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\nvoid main()\n{\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\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);\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nv_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\nv_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\nvec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\nvec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\nvec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\nbool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\nplanes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\nplanes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\nidlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\nidlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\nplanes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\nplanes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\nvec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\nvec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\nvec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\nvec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // COLUMBUS_VIEW_2D\nvec3 eastWard = southEastCorner - southWestCorner;\nfloat eastExtent = length(eastWard);\neastWard /= eastExtent;\nvec3 northWard = northWestCorner - southWestCorner;\nfloat northExtent = length(northWard);\nnorthWard /= northExtent;\nv_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\nv_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\nv_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\nvec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\nvec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\nv_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\nv_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\nv_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif\ngl_Position = czm_depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),define("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),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/Buffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,t.EMPTY_OBJECT);var r=e.context._gl,n=e.bufferTarget,o=e.typedArray,a=e.sizeInBytes,s=e.usage,l=i(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._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return u.createVertexBuffer=function(e){return new u({context:e.context,bufferTarget:s.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},u.createIndexBuffer=function(e){var t=e.context,i=e.indexDatatype,n=a.getSizeInBytes(i),o=new u({context:t,bufferTarget:s.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),l=o.sizeInBytes/n;return r(o,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return l}}}),o},r(u.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),u.prototype._getBuffer=function(){return this._buffer},u.prototype.copyFromArrayView=function(e,i){i=t(i,0);var r=this._gl,n=this._bufferTarget;r.bindBuffer(n,this._buffer),r.bufferSubData(n,i,e),r.bindBuffer(n,null)},u.prototype.copyFromBuffer=function(e,t,i,r){var n=s.COPY_READ_BUFFER,o=s.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(n,e._buffer),a.copyBufferSubData(n,o,t,i,r),a.bindBuffer(o,null),a.bindBuffer(n,null)},u.prototype.getBufferData=function(e,i,r,n){i=t(i,0),r=t(r,0);var o=this._gl,a=s.COPY_READ_BUFFER;o.bindBuffer(a,this._buffer),o.getBufferSubData(a,i,e,r,n),o.bindBuffer(a,null)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),n(this)},u}),define("Renderer/VertexArray",["../Core/Check","../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,p){"use strict";function f(e,n,o,a){var s=r(n.vertexBuffer),l=r(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:i(n.index,o),enabled:i(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:i(n.componentDatatype,t.FLOAT),normalize:i(n.normalize,!1),offsetInBytes:i(n.offsetInBytes,0),strideInBytes:i(n.strideInBytes,0),instanceDivisor:i(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){}}e.push(c)}function m(e,t,i){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}r(i)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i._getBuffer())}function _(e){e=i(e,i.EMPTY_OBJECT);var n,o=e.context,a=o._gl,s=e.attributes,l=e.indexBuffer,u=[],c=1,d=!1,h=!1,p=s.length;for(n=0;n<p;++n)f(u,s[n],n,o);for(p=u.length,n=0;n<p;++n){var _=u[n];if(r(_.vertexBuffer)&&0===_.instanceDivisor){var g=_.strideInBytes||_.componentsPerAttribute*t.getSizeInBytes(_.componentDatatype);c=_.vertexBuffer.sizeInBytes/g;break}}for(n=0;n<p;++n)u[n].instanceDivisor>0&&(d=!0),r(u[n].value)&&(h=!0);var v;o.vertexArrayObject&&(v=o.glCreateVertexArray(),o.glBindVertexArray(v),m(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 g(e){return e.values.length/e.componentsPerAttribute}function v(e){return t.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function y(e){var i,n,o,a=[];for(n in e)e.hasOwnProperty(n)&&r(e[n])&&r(e[n].values)&&(a.push(n),e[n].componentDatatype===t.DOUBLE&&(e[n].componentDatatype=t.FLOAT,e[n].values=t.createTypedArray(t.FLOAT,e[n].values)));var s,l=a.length;if(l>0)for(s=g(e[a[0]]),i=1;i<l;++i){var u=g(e[a[i]]);if(u!==s)throw new c("Each attribute list must have the same number of vertices. Attribute "+a[i]+" has a different number of vertices ("+u.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(i,r){return t.getSizeInBytes(e[r].componentDatatype)-t.getSizeInBytes(e[i].componentDatatype)});var d=0,h={};for(i=0;i<l;++i)n=a[i],o=e[n],h[n]=d,d+=v(o);if(d>0){var p=t.getSizeInBytes(e[a[0]].componentDatatype),f=d%p;0!==f&&(d+=p-f);var m=s*d,_=new ArrayBuffer(m),y={};for(i=0;i<l;++i){n=a[i];var C=t.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:t.createTypedArray(e[n].componentDatatype,_),index:h[n]/C,strideInComponentType:d/C}}for(i=0;i<s;++i)for(var b=0;b<l;++b){n=a[b],o=e[n];for(var S=o.values,T=y[n],E=T.pointer,A=o.componentsPerAttribute,w=0;w<A;++w)E[T.index+w]=S[i*A+w];T.index+=T.strideInComponentType}return{buffer:_,offsetsInBytes:h,vertexSizeInBytes:d}}}function C(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=p.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 b(e,t){for(var i=e._attributes,n=i.length,o=0;o<n;++o){var a=i[o];a.enabled&&r(a.value)&&a.vertexAttrib(t)}}return _.fromGeometry=function(e){e=i(e,i.EMPTY_OBJECT);var n,o,a,c=e.context,p=i(e.geometry,i.EMPTY_OBJECT),f=i(e.bufferUsage,h.DYNAMIC_DRAW),m=i(e.attributeLocations,i.EMPTY_OBJECT),g=i(e.interleave,!1),v=e.vertexArrayAttributes,C=r(v)?v:[],b=p.attributes;if(g){var S=y(b);if(r(S)){a=d.createVertexBuffer({context:c,typedArray:S.buffer,usage:f});var T=S.offsetsInBytes,E=S.vertexSizeInBytes;for(n in b)b.hasOwnProperty(n)&&r(b[n])&&(o=b[n],r(o.values)?C.push({index:m[n],vertexBuffer:a,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:T[n],strideInBytes:E}):C.push({index:m[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in b)if(b.hasOwnProperty(n)&&r(b[n])){o=b[n];var A=o.componentDatatype;A===t.DOUBLE&&(A=t.FLOAT),a=void 0,r(o.values)&&(a=d.createVertexBuffer({context:c,typedArray:t.createTypedArray(A,o.values),usage:f})),C.push({index:m[n],vertexBuffer:a,value:o.value,componentDatatype:A,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var w,x=p.indices;return r(x)&&(w=s.computeNumberOfVertices(p)>=u.SIXTY_FOUR_KILOBYTES&&c.elementIndexUint?d.createIndexBuffer({context:c,typedArray:new Uint32Array(x),usage:f,indexDatatype:l.UNSIGNED_INT}):d.createIndexBuffer({context:c,typedArray:new Uint16Array(x),usage:f,indexDatatype:l.UNSIGNED_SHORT})),new _({context:c,attributes:C,indexBuffer:w})},n(_.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),_.prototype.getAttribute=function(e){return this._attributes[e]},_.prototype._bind=function(){r(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&C(this),this._hasConstantAttributes&&b(this,this._gl)):m(this._gl,this._attributes,this._indexBuffer)},_.prototype._unBind=function(){if(r(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;i<e.length;++i){var n=e[i];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var i=e[t].vertexBuffer;r(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}var n=this._indexBuffer;return r(n)&&!n.isDestroyed()&&n.vertexArrayDestroyable&&n.destroy(),r(this._vao)&&this._context.glDeleteVertexArray(this._vao),o(this)},_}),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=b(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 T=4*f*m;this._batchValues=o!==p.FLOAT||s?new Uint8Array(T):new Float32Array(T),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 b(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];return t[r-1].componentDatatype!==n.UNSIGNED_BYTE&&i?o+4:o+1}function T(e,t,r){var n=i.unpack(e,t,M),o=i.unpackFloat(n);n=i.unpack(e,t+4,M);var a=i.unpackFloat(n);n=i.unpack(e,t+8,M);var s=i.unpackFloat(n);n=i.unpack(e,t+12,M);var l=i.unpackFloat(n);return i.fromElements(o,a,s,l,r)}function E(e,t,r){var n=i.packFloat(e.x,M);i.pack(n,t,r),n=i.packFloat(e.y,n),i.pack(n,t,r+4),n=i.packFloat(e.z,n),i.pack(n,t,r+8),n=i.packFloat(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}),flipY:!1})}function w(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function x(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), centerY + (yId * stepY)); \n} \n"}function P(e){return 1===e?"float":"vec"+e}function D(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function I(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=P(o),l=D(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 e._packFloats&&r.componentDatatype!==p.UNSIGNED_BYTE?c+="vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":c+=" 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 M=new i;if(u.supportsTypedArrays()){var R=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?T(this._batchValues,u,R):i.unpack(this._batchValues,u,R);var c=C(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var O=[void 0,void 0,new e,new t,new i],L=new i;return v.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=O[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=C(this._attributes,t);if(!(o(l.equals)?l.equals(s,r):s===r)){var u=L;u.x=o(r.x)?r.x:r,u.y=o(r.y)?r.y:0,u.z=o(r.z)?r.z:0,u.w=o(r.w)?r.w:0;var c=this._offsets[t],d=this._stride,h=4*d*e+4*c;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?E(u,this._batchValues,h):i.pack(u,this._batchValues,h),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),w(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){return 0===e._attributes.length?t:r(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=x(this)+"\n";for(var i=e.length,r=0;r<i;++r)t+=I(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/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/OffsetGeometryInstanceAttribute","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e,t,i){var n,o=!i,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!p.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)r(e[n].geometry)&&d.transformToWorldCoordinates(e[n]);else p.multiplyTransformation(t,e[0].modelMatrix,t)}function g(e,i){var r=e.attributes,n=r.position,o=n.values.length/n.componentsPerAttribute;r.batchId=new u({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=r.batchId.values,s=0;s<o;++s)a[s]=i}function v(e){for(var t=e.length,i=0;i<t;++i){var n=e[i];r(n.geometry)?g(n.geometry,i):r(n.westHemisphereGeometry)&&r(n.eastHemisphereGeometry)&&(g(n.westHemisphereGeometry,i),g(n.eastHemisphereGeometry,i))}}function y(i){var n,o,a=i.instances,s=i.projection,l=i.elementIndexUintSupported,u=i.scene3DOnly,c=i.vertexCacheOptimize,h=i.compressVertices,p=i.modelMatrix,f=a.length;for(n=0;n<f;++n)if(r(a[n].geometry)){a[n].geometry.primitiveType;break}if(_(a,p,u),!u)for(n=0;n<f;++n)r(a[n].geometry)&&d.splitLongitude(a[n]);if(v(a),c)for(n=0;n<f;++n){var m=a[n];r(m.geometry)?(d.reorderForPostVertexCache(m.geometry),d.reorderForPreVertexCache(m.geometry)):r(m.westHemisphereGeometry)&&r(m.eastHemisphereGeometry)&&(d.reorderForPostVertexCache(m.westHemisphereGeometry),d.reorderForPreVertexCache(m.westHemisphereGeometry),d.reorderForPostVertexCache(m.eastHemisphereGeometry),d.reorderForPreVertexCache(m.eastHemisphereGeometry))}var g=d.combineInstances(a);for(f=g.length,n=0;n<f;++n){o=g[n];var y,C=o.attributes;if(u)for(y in C)C.hasOwnProperty(y)&&C[y].componentDatatype===t.DOUBLE&&d.encodeAttribute(o,y,y+"3DHigh",y+"3DLow");else for(y in C)if(C.hasOwnProperty(y)&&C[y].componentDatatype===t.DOUBLE){var b=y+"3D",S=y+"2D";d.projectTo2D(o,y,b,S,s),r(o.boundingSphere)&&"position"===y&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),d.encodeAttribute(o,b,b+"High",b+"Low"),d.encodeAttribute(o,S,S+"High",S+"Low")}h&&d.compressVertices(o)}if(!l){var T=[];for(f=g.length,n=0;n<f;++n)o=g[n],T=T.concat(d.fitToUnsignedShortIndices(o));g=T}return g}function C(e,t,i,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=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,d=0;d<c;++d){var h=e[d],p=h[t];if(r(p)){var f=p.indices.length;o+f>a&&(o=0,a=i[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function b(e,t){var i=[];return C(e,"geometry",t,i),C(e,"westHemisphereGeometry",t,i),C(e,"eastHemisphereGeometry",t,i),i}function S(e,t){var i=e.attributes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o)&&r(o.values)&&t.push(o.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function T(e,t){for(var i=e.length,r=0;r<i;++r)S(e[r],t)}function E(t){for(var i=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++i,r(a)){var s=a.attributes;i+=7+2*e.packedLength+(r(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&r(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function A(e,t){var i=e.length,n=new Float64Array(1+19*i),o=0;n[o++]=i;for(var a=0;a<i;a++){var s=e[a];if(p.pack(s.modelMatrix,n,o),o+=p.packedLength,r(s.attributes)&&r(s.attributes.offset)){var l=s.attributes.offset.value;n[o]=l[0],n[o+1]=l[1],n[o+2]=l[2]}o+=3}return t.push(n.buffer),n}function w(e){for(var t=e,i=new Array(t[0]),n=0,o=1;o<t.length;){var a,s=p.unpack(t,o);o+=p.packedLength,r(t[o])&&(a={offset:new f(t[o],t[o+1],t[o+2])}),o+=3,i[n++]={modelMatrix:s,attributes:a}}return i}function x(t){var i=t.length,n=1+(e.packedLength+1)*i,o=new Float32Array(n),a=0;o[a++]=i;for(var s=0;s<i;++s){var l=t[s];r(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function P(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(!a.supportsTypedArrays())return{};var D={};return D.combineGeometry=function(t){var i,n,o,a,s=t.instances,l=s.length,u=!1;l>0&&(i=y(t),i.length>0&&(n=d.createAttributeLocations(i[0]),t.createPickOffsets&&(o=b(s,i))),r(s[0].attributes)&&r(s[0].attributes.offset)&&(a=new Array(l),u=!0));for(var c=new Array(l),h=new Array(l),p=0;p<l;++p){var f=s[p],m=f.geometry;r(m)&&(c[p]=m.boundingSphere,h[p]=m.boundingSphereCV,u&&(a[p]=f.geometry.offsetAttribute));var _=f.eastHemisphereGeometry,g=f.westHemisphereGeometry;r(_)&&r(g)&&(r(_.boundingSphere)&&r(g.boundingSphere)&&(c[p]=e.union(_.boundingSphere,g.boundingSphere)),r(_.boundingSphereCV)&&r(g.boundingSphereCV)&&(h[p]=e.union(_.boundingSphereCV,g.boundingSphereCV)))}return{geometries:i,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:a,boundingSpheres:c,boundingSpheresCV:h}},D.packCreateGeometryResults=function(t,n){var o=new Float64Array(E(t)),a=[],s={},l=t.length,u=0;o[u++]=l;for(var c=0;c<l;c++){var d=t[c],h=r(d);if(o[u++]=h?1:0,h){o[u++]=d.primitiveType,o[u++]=d.geometryType,o[u++]=i(d.offsetAttribute,-1);var p=r(d.boundingSphere)?1:0;o[u++]=p,p&&e.pack(d.boundingSphere,o,u),u+=e.packedLength;var f=r(d.boundingSphereCV)?1:0;o[u++]=f,f&&e.pack(d.boundingSphereCV,o,u),u+=e.packedLength;var m=d.attributes,_=[];for(var g in m)m.hasOwnProperty(g)&&r(m[g])&&(_.push(g),r(s[g])||(s[g]=a.length,a.push(g)));o[u++]=_.length;for(var v=0;v<_.length;v++){var y=_[v],C=m[y];o[u++]=s[y],o[u++]=C.componentDatatype,o[u++]=C.componentsPerAttribute,o[u++]=C.normalize?1:0,o[u++]=C.values.length,o.set(C.values,u),u+=C.values.length}var b=r(d.indices)?d.indices.length:0;o[u++]=b,b>0&&(o.set(d.indices,u),u+=b)}}return n.push(o.buffer),{stringTable:a,packedData:o}},D.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),s=0,d=1;d<o.length;){if(1===o[d++]){var p=o[d++],f=o[d++],m=o[d++];-1===m&&(m=void 0);var _,g;1===o[d++]&&(_=e.unpack(o,d)),d+=e.packedLength;1===o[d++]&&(g=e.unpack(o,d)),d+=e.packedLength;var v,y,C,b=new c,S=o[d++];for(r=0;r<S;r++){var T=n[o[d++]],E=o[d++];C=o[d++];var A=0!==o[d++];v=o[d++],y=t.createTypedArray(E,v);for(var w=0;w<v;w++)y[w]=o[d++];b[T]=new u({componentDatatype:E,componentsPerAttribute:C,normalize:A,values:y})}var x;if((v=o[d++])>0){var P=y.length/C;for(x=h.createTypedArray(P,v),r=0;r<v;r++)x[r]=o[d++]}a[s++]=new l({primitiveType:p,geometryType:f,boundingSphere:_,boundingSphereCV:g,indices:x,attributes:b,offsetAttribute:m})}else a[s++]=void 0}return a},D.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:A(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},D.unpackCombineGeometryParameters=function(e){for(var t=w(e.packedInstances),i=e.createGeometryResults,r=i.length,n=0,a=0;a<r;a++)for(var l=D.unpackCreateGeometryResults(i[a]),u=l.length,c=0;c<u;c++){var d=l[c],h=t[n];h.geometry=d,++n}var f=o.clone(e.ellipsoid);return{instances:t,ellipsoid:f,projection:e.isGeographic?new s(f):new m(f),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:p.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},D.packCombineGeometryResults=function(e,t){r(e.geometries)&&T(e.geometries,t);var i=x(e.boundingSpheres),n=x(e.boundingSpheresCV);return t.push(i.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:i,boundingSpheresCV:n}},D.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:P(e.boundingSpheres),boundingSpheresCV:P(e.boundingSpheresCV)}},D}),define("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";return e({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6})}),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/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/GeometryOffsetAttribute","../Core/Intersect","../Core/isArray","../Core/Matrix4","../Core/Plane","../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","./DepthFunction","./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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G){"use strict";function H(e){e=u(e,u.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=S.clone(u(e.modelMatrix,S.IDENTITY)),this._modelMatrix=new S,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,G.DISABLED),this._translucent=void 0,this._state=V.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._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=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=N.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}function W(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)&&c(n[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 q(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,Ce):3===n?i.unpack(e,0,be):4===n?r.unpack(e,0,Se):void 0}function Y(e,t){var i=e.geometryInstances,r=b(i)?i:[i],n=r.length;if(0!==n){var o,s,d,h,p=W(r),f=p.length,m=[],_={},g={},v=r[0],y=v.attributes;for(s=0;s<f;++s)d=p[s],h=y[d],_[d]=s,m.push({functionName:"czm_batchTable_"+d,componentDatatype:h.componentDatatype,componentsPerAttribute:h.componentsPerAttribute,normalize:h.normalize});-1!==p.indexOf("distanceDisplayCondition")&&(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),-1!==p.indexOf("offset")&&(m.push({functionName:"czm_batchTable_offset2D",componentDatatype:l.FLOAT,componentsPerAttribute:3}),o=m.length-1),m.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var C=m.length,S=new F(t,m,n);for(s=0;s<n;++s){var T=r[s];y=T.attributes;for(var E=0;E<f;++E){d=p[E],h=y[d];var A=q(h.value),w=_[d];S.setBatchedAttribute(s,w,A)}var x={primitive:u(T.pickPrimitive,e)};c(T.id)&&(x.id=T.id);var P=t.createPickId(x);e._pickIds.push(P);var D=P.color,I=Se;I.x=a.floatToByte(D.red),I.y=a.floatToByte(D.green),I.z=a.floatToByte(D.blue),I.w=a.floatToByte(D.alpha),S.setBatchedAttribute(s,C-1,I)}e._batchTable=S,e._batchTableAttributeIndices=_,e._batchTableBoundingSphereAttributeIndices=g,e._batchTableOffsetAttribute2DIndex=o}}function j(e){var t;return t=b(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 X(t){var i=t.attributes,r=new v;for(var n in i)i.hasOwnProperty(n)&&c(i[n])&&(r[n]=j(i[n]));var o;if(c(t.indices)){var a=t.indices;o=b(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,attributes:e.attributes,modelMatrix:S.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function K(e){return O.replaceMain(e,"czm_non_pick_main")+"\nvarying vec4 v_pickColor; \nvoid main() \n{ \n czm_non_pick_main(); \n v_pickColor = czm_batchTable_pickColor(batchId); \n}"}function Z(e){return"varying vec4 v_pickColor;\n"+e}function J(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+bitangent;/g),a=r&&i?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(r){c+="vec2 st;\n";d+=" st = czm_decompressTextureCoordinates("+(a>1?l+".x":l)+");\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 h=t;return h=h.replace(/attribute\s+vec3\s+normal;/g,""),h=h.replace(/attribute\s+vec2\s+st;/g,""),h=h.replace(/attribute\s+vec3\s+tangent;/g,""),h=h.replace(/attribute\s+vec3\s+bitangent;/g,""),h=O.replaceMain(h,"czm_non_compressed_main"),[u,c,h,"void main() \n{ \n"+d+" czm_non_compressed_main(); \n}"].join("\n")}function $(e){var t=O.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n vec4 position = gl_Position;\n v_WindowZ = (0.5 * (position.z / position.w) + 0.5) * position.w;\n position.z = min(position.z, position.w);\n gl_Position = position;\n}\n"}function ee(e){var t=O.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\n gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n",t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+t}function te(e,t){e.vertexAttributes}function ie(e,t){return function(){return e[t]}}function re(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===V.READY){i=b(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(Ee))for(Ee=new Array(Ae),n=0;n<Ae;n++)Ee[n]=new w("createGeometry",Number.POSITIVE_INFINITY);var h;for(d=A(d,Ae),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(Ee[n].scheduleTask({subTasks:d[n]},_))}e._state=V.CREATING,N.all(l,function(t){e._createGeometryResults=t,e._state=V.CREATED}).otherwise(function(i){ye(e,t,V.FAILED,i)})}else if(e._state===V.CREATED){var v=[];i=b(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var y=t.scene3DOnly,C=t.mapProjection,T=we.scheduleTask(z.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,ellipsoid:C.ellipsoid,projection:C,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:y,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},v),v);e._createGeometryResults=void 0,e._state=V.COMBINING,N(T,function(i){var r=z.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e.modelMatrix=S.clone(r.modelMatrix,e.modelMatrix),e._pickOffsets=r.pickOffsets,e._offsetInstanceExtend=r.offsetInstanceExtend,e._instanceBoundingSpheres=r.boundingSpheres,e._instanceBoundingSpheresCV=r.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=V.COMBINED):ye(e,t,V.FAILED,void 0)}).otherwise(function(i){ye(e,t,V.FAILED,i)})}}function ne(e,t){var i,r,n=b(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)?X(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=z.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=S.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._offsetInstanceExtend=f.offsetInstanceExtend,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=V.COMBINED):ye(e,t,V.FAILED,void 0)}function oe(t,r){var n=t._batchTableAttributeIndices.offset;if(!t._recomputeBoundingSpheres||!c(n))return void(t._recomputeBoundingSpheres=!1);var o,a=t._offsetInstanceExtend,s=t._instanceBoundingSpheres,l=s.length,u=t._tempBoundingSpheres;if(!c(u)){for(u=new Array(l),o=0;o<l;o++)u[o]=new e;t._tempBoundingSpheres=u}for(o=0;o<l;++o){var d=u[o],h=t._batchTable.getBatchedAttribute(o,n,new i);d=s[o].clone(d),fe(d,h,a[o])}var p=[],f=[],m=[];for(o=0;o<l;++o){var _=u[o];_.center.x-_.radius>0||e.intersectPlane(_,T.ORIGIN_ZX_PLANE)!==C.INTERSECTING?p.push(_):(f.push(_),m.push(_))}var g=p[0],v=m[0],y=f[0];for(o=1;o<p.length;o++)g=e.union(g,p[o]);for(o=1;o<m.length;o++)v=e.union(v,m[o]);for(o=1;o<f.length;o++)y=e.union(y,f[o]);var b=[];for(c(g)&&b.push(g),c(v)&&b.push(v),c(y)&&b.push(y),o=0;o<b.length;o++){var S=b[o].clone(t._boundingSpheres[o]);t._boundingSpheres[o]=S,t._boundingSphereCV[o]=e.projectTo2D(S,r.mapProjection,t._boundingSphereCV[o])}H._updateBoundingVolumes(t,r,t.modelMatrix,!0),t._recomputeBoundingSpheres=!1}function ae(t,i){if(c(t._batchTableAttributeIndices.distanceDisplayCondition)&&!t._batchTableBoundingSpheresUpdated){for(var r=t._batchTableBoundingSphereAttributeIndices,n=r.center3DHigh,o=r.center3DLow,a=r.center2DHigh,s=r.center2DLow,l=r.radius,u=i.mapProjection,d=u.ellipsoid,h=t._batchTable,p=t._instanceBoundingSpheres,m=p.length,_=0;_<m;++_){var g=p[_];if(c(g)){var v=t.modelMatrix;c(v)&&(g=e.transform(g,v,Ie));var y=g.center,C=g.radius,b=f.fromCartesian(y,xe);if(h.setBatchedAttribute(_,n,b.high),h.setBatchedAttribute(_,o,b.low),!i.scene3DOnly){var S=d.cartesianToCartographic(y,Pe),T=u.project(S,De);b=f.fromCartesian(T,xe),h.setBatchedAttribute(_,a,b.high),h.setBatchedAttribute(_,s,b.low)}h.setBatchedAttribute(_,l,C)}}t._batchTableBoundingSpheresUpdated=!0}}function se(t,r){if(c(t._batchTableAttributeIndices.offset)&&!t._batchTableOffsetsUpdated&&!r.scene3DOnly){for(var n=t._batchTableOffsetAttribute2DIndex,o=r.mapProjection,a=o.ellipsoid,s=t._batchTable,l=t._instanceBoundingSpheres,u=l.length,d=0;d<u;++d){var h=l[d];if(c(h)){var p=s.getBatchedAttribute(d,t._batchTableAttributeIndices.offset);if(i.equals(p,i.ZERO))s.setBatchedAttribute(d,n,i.ZERO);else{var f=t.modelMatrix;c(f)&&(h=e.transform(h,f,Ie));var m=h.center;m=a.scaleToGeodeticSurface(m,Re);var _=a.cartesianToCartographic(m,Pe),g=o.project(_,De),v=i.add(p,m,Me);_=a.cartesianToCartographic(v,_);var y=o.project(_,Me),C=i.subtract(y,g,Me),b=C.x;C.x=C.z,C.z=C.y,C.y=b,s.setBatchedAttribute(d,n,C)}}}t._batchTableOffsetsUpdated=!0}}function le(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(L.fromGeometry({context:a,geometry:d,attributeLocations:r,bufferUsage:x.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,ye(t,i,V.COMPLETE,void 0)}function ue(e,t,i,r){var n,a=i.getRenderState();r?(n=o(a,!1),n.cull={enabled:!0,face:B.BACK},e._frontFaceRS=M.fromCache(n),n.cull.face=B.FRONT,e._backFaceRS=M.fromCache(n)):(e._frontFaceRS=M.fromCache(a),e._backFaceRS=e._frontFaceRS),n=o(a,!1),c(e._depthFailAppearance)&&(n.depthTest.enabled=!1),c(e._depthFailAppearance)&&(a=e._depthFailAppearance.getRenderState(),n=o(a,!1),n.depthTest.func=k.GREATER,r?(n.cull={enabled:!0,face:B.BACK},e._frontFaceDepthFailRS=M.fromCache(n),n.cull.face=B.FRONT,e._backFaceDepthFailRS=M.fromCache(n)):(e._frontFaceDepthFailRS=M.fromCache(n),e._backFaceDepthFailRS=e._frontFaceRS))}function ce(e,t,i){var r=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);o=H._appendOffsetToShader(e,o),o=H._appendShowToShader(e,o),o=H._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=K(o),o=H._updateColorAttribute(e,o,!1),o=J(e,o),o=H._modifyShaderPosition(e,o,t.scene3DOnly);var a=i.getFragmentShaderSource();a=Z(a),e._sp=R.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),te(e._sp,n),c(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=H._appendShowToShader(e,o),o=H._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=K(o),o=H._updateColorAttribute(e,o,!0),o=J(e,o),o=H._modifyShaderPosition(e,o,t.scene3DOnly),o=$(o),a=e._depthFailAppearance.getFragmentShaderSource(),a=Z(a),a=ee(a),e._spDepthFail=R.replaceCache({context:r,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),te(e._spDepthFail,n))}function de(e,t,i,r){var n=c(i)?i._uniforms:void 0,o={},a=t.uniforms;if(c(a))for(var l in a)a.hasOwnProperty(l)&&(o[l]=ie(a,l));var u=s(o,n);return u=e._batchTable.getUniformMapCallback()(u),c(e.rtcCenter)&&(u.u_modifiedModelView=function(){var t=r.context.uniformState.view;return S.multiply(t,e._modelMatrix,Oe),S.multiplyByPoint(Oe,e.rtcCenter,Le),S.setTranslation(Oe,Le,Oe),Oe}),u}function he(e,t,i,r,n,o,a,s){var l,u=de(e,t,i,s);c(e._depthFailAppearance)&&(l=de(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var d=r?I.TRANSLUCENT:I.OPAQUE,h=n?2:1;h*=c(e._depthFailAppearance)?2:1,o.length=e._va.length*h;for(var p=o.length,f=0,m=0;m<p;++m){var _;n&&(_=o[m],c(_)||(_=o[m]=new D({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._backFaceRS,_.shaderProgram=e._sp,_.uniformMap=u,_.pass=d,++m),_=o[m],c(_)||(_=o[m]=new D({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._frontFaceRS,_.shaderProgram=e._sp,_.uniformMap=u,_.pass=d,c(e._depthFailAppearance)&&(n&&(++m,_=o[m],c(_)||(_=o[m]=new D({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._backFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=l,_.pass=d),++m,_=o[m],c(_)||(_=o[m]=new D({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._frontFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=l,_.pass=d),++f}}function pe(e,t,i,r,n,o,a,s){H._updateBoundingVolumes(e,t,n);var l;t.mode===U.SCENE3D?l=e._boundingSphereWC:t.mode===U.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===U.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);var u=t.commandList,d=t.passes;if(d.render||d.pick){var h=e.allowPicking,p=G.castShadows(e.shadows),f=G.receiveShadows(e.shadows),m=i.length,_=s?2:1;_*=c(e._depthFailAppearance)?2:1;for(var g=0;g<m;++g){var v=Math.floor(g/_),y=i[g];y.modelMatrix=n,y.boundingVolume=l[v],y.cull=o,y.debugShowBoundingVolume=a,y.castShadows=p,y.receiveShadows=f,y.pickId=h?"v_pickColor":void 0,u.push(y)}}}function fe(t,r,n){if(n===y.TOP){
- var o=e.clone(t,Ne),a=e.clone(t,Fe);a.center=i.add(a.center,r,a.center),t=e.union(o,a,t)}else n===y.ALL&&(t.center=i.add(t.center,r,t.center));return t}function me(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 _e(e,t,i,r,n){return function(o){var a=q(o);e.setBatchedAttribute(t,i,a),"offset"===n&&(r._recomputeBoundingSpheres=!0,r._batchTableOffsetsUpdated=!1)}}function ge(t,r,n){r.boundingSphere={get:function(){var o=t._instanceBoundingSpheres[n];if(c(o)){o=o.clone();var a=t.modelMatrix,s=r.offset;c(s)&&fe(o,i.fromArray(s.get(),0,Be),t._offsetInstanceExtend[n]),c(a)&&(o=e.transform(o,a))}return o}},r.boundingSphereCV={get:function(){return t._instanceBoundingSpheresCV[n]}}}function ve(e,t,i){t.pickId={get:function(){return e._pickIds[i]}}}function ye(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===V.COMPLETE||e._state===V.FAILED,c(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}d(H.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 Ce=new t,be=new i,Se=new r,Te=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;H._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=Te.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")},H._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;return O.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}"},H._updateColorAttribute=function(e,t,i){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor))return t;if(-1===t.search(/attribute\s+vec4\s+color;/g))return t;var r=t;return r=r.replace(/attribute\s+vec4\s+color;/g,""),r=i?r.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):r.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},H._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")},H._appendOffsetToShader=function(e,t){if(!c(e._batchTableAttributeIndices.offset))return t;var i="attribute float batchId;\n";i+="attribute float applyOffset;";var r=t.replace(/attribute\s+float\s+batchId;/g,i),n="vec4 $1 = czm_computePosition();\n";return n+=" if (czm_sceneMode == czm_sceneMode3D)\n",n+=" {\n",n+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",n+=" }\n",n+=" else\n",n+=" {\n",n+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",n+=" }\n",r=r.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,n)},H._appendDistanceDisplayConditionToShader=function(e,t,i){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var r=O.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 float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return n+=i?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":" vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\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 Ee,Ae=Math.max(m.hardwareConcurrency-1,1),we=new w("combineGeometry",Number.POSITIVE_INFINITY),xe=new f,Pe=new n,De=new i,Ie=new e,Me=new i,Re=new i,Oe=new S,Le=new i;H._updateBoundingVolumes=function(t,i,r,n){var o,a,s;if(n||!S.equals(r,t._modelMatrix))for(S.clone(r,t._modelMatrix),a=t._boundingSpheres.length,o=0;o<a;++o)s=t._boundingSpheres[o],c(s)&&(t._boundingSphereWC[o]=e.transform(s,r,t._boundingSphereWC[o]),i.scene3DOnly||(t._boundingSphere2D[o]=e.clone(t._boundingSphereCV[o],t._boundingSphere2D[o]),t._boundingSphere2D[o].center.x=0,t._boundingSphereMorph[o]=e.union(t._boundingSphereWC[o],t._boundingSphereCV[o])));var l=t.appearance.pixelSize;if(c(l))for(a=t._boundingSpheres.length,o=0;o<a;++o){s=t._boundingSpheres[o];var u=t._boundingSphereWC[o],d=i.camera.getPixelSize(s,i.context.drawingBufferWidth,i.context.drawingBufferHeight),h=d*l;u.radius=s.radius+h}},H.prototype.update=function(e){if(!(!c(this.geometryInstances)&&0===this._va.length||c(this.geometryInstances)&&b(this.geometryInstances)&&0===this.geometryInstances.length||!c(this.appearance)||e.mode!==U.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==V.FAILED){var t=e.context;if(c(this._batchTable)||Y(this,t),this._batchTable.attributes.length>0){if(0===P.maximumVertexTextureImageUnits)throw new E("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!==V.COMPLETE&&this._state!==V.COMBINED&&(this.asynchronous?re(this,e):ne(this,e)),this._state===V.COMBINED&&(ae(this,e),se(this,e),le(this,e)),this.show&&this._state===V.COMPLETE){this._batchTableOffsetsUpdated||se(this,e),this._recomputeBoundingSpheres&&oe(this,e);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.depthFailAppearance,s=c(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,n=!0,o=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,o=!0);var l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,n=!0),c(this._material)&&this._material.update(t);var d=i.closed&&l;if(n){u(this._createRenderStatesFunction,ue)(this,t,i,d)}if(o){u(this._createShaderProgramFunction,ce)(this,e,i)}if(n||o){u(this._createCommandsFunction,he)(this,i,r,l,d,this._colorCommands,this._pickCommands,e)}u(this._updateAndQueueCommandsFunction,pe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)}}}};var Ne=new e,Fe=new e,Be=new i;return H.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(-1!==t){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:me(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=_e(l,t,f,this,p))}return ge(this,h,t),ve(this,h,t),d(s,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},H.prototype.isDestroyed=function(){return!1},H.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)},H}),define("Shaders/ShadowVolumeAppearanceFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\nreturn eyeCoordinate.xyz / eyeCoordinate.w;\n}\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\nvec2 glFragCoordXY = gl_FragCoord.xy;\nfloat upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\nfloat downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\nbvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\nfloat useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\nfloat useDownOrLeft = float(useUpOrRight == 0.0);\nvec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\nvec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\nreturn (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\nvoid main(void)\n{\n#ifdef REQUIRES_EC\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n#ifdef REQUIRES_WC\nvec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\nvec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n#ifdef TEXTURE_COORDINATES\nvec2 uv;\n#ifdef SPHERICAL\nvec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\nsphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\nsphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\nuv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\nuv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\nuv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\nuv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\nif (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0) {\ngl_FragColor.a = 1.0;\nczm_writeDepthClampedToFarPlane();\n}\n#else // CULL_FRAGMENTS\ngl_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n#ifdef CULL_FRAGMENTS\nif (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y) {\ndiscard;\n}\n#endif\n#ifdef NORMAL_EC\nvec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\nvec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\nvec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n#ifdef PER_INSTANCE_COLOR\nvec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\ngl_FragColor = color;\n#else // FLAT\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material);\n#endif // FLAT\n#else // PER_INSTANCE_COLOR\nczm_materialInput materialInput;\n#ifdef USES_NORMAL_EC\nmaterialInput.normalEC = normalEC;\n#endif\n#ifdef USES_POSITION_TO_EYE_EC\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n#ifdef USES_TANGENT_TO_EYE\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n#ifdef USES_ST\nmaterialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\nmaterialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material);\n#endif // FLAT\n#endif // PER_INSTANCE_COLOR\nczm_writeDepthClampedToFarPlane();\n#endif // PICK\n}\n"}),define("Scene/ShadowVolumeAppearance",["../Core/Cartographic","../Core/Cartesian2","../Core/Cartesian3","../Core/Math","../Core/Check","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/GeometryInstanceAttribute","../Core/Matrix4","../Core/Rectangle","../Core/Transforms","../Renderer/ShaderSource","../Scene/PerInstanceColorAppearance","../Shaders/ShadowVolumeAppearanceFS"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e,t,i){var r=new y;r.requiresTextureCoordinates=e,r.requiresEC=!i.flat;var n=new y;if(n.requiresTextureCoordinates=e,i instanceof m)r.requiresNormalEC=!i.flat;else{var o=i.material.shaderSource+"\n"+i.fragmentShaderSource;r.normalEC=-1!==o.indexOf("materialInput.normalEC")||-1!==o.indexOf("czm_getDefaultMaterial"),r.positionToEyeEC=-1!==o.indexOf("materialInput.positionToEyeEC"),r.tangentToEyeMatrix=-1!==o.indexOf("materialInput.tangentToEyeMatrix"),r.st=-1!==o.indexOf("materialInput.st")}this._colorShaderDependencies=r,this._pickShaderDependencies=n,this._appearance=i,this._extentsCulling=e,this._planarExtents=t}function v(e,t,i,n,o,a,l){var c=n.slice();if(""===w.eastMostYhighDefine){var d=P;d.longitude=r.PI,d.latitude=0,d.height=0;var h=l.project(d,x),p=u.encode(h.x,D);w.eastMostYhighDefine="EAST_MOST_X_HIGH "+p.high.toFixed((p.high+"").length+1),w.eastMostYlowDefine="EAST_MOST_X_LOW "+p.low.toFixed((p.low+"").length+1);var _=P;_.longitude=-r.PI,_.latitude=0,_.height=0;var g=l.project(_,x);p=u.encode(g.x,D),w.westMostYhighDefine="WEST_MOST_X_HIGH "+p.high.toFixed((p.high+"").length+1),w.westMostYlowDefine="WEST_MOST_X_LOW "+p.low.toFixed((p.low+"").length+1)}return i&&(c.push(w.eastMostYhighDefine),c.push(w.eastMostYlowDefine),c.push(w.westMostYhighDefine),c.push(w.westMostYlowDefine)),s(a)&&a instanceof m&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||i||c.push("SPHERICAL"),i&&c.push("COLUMBUS_VIEW_2D")),new f({defines:c,sources:[o]})}function y(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function C(e,i,r){return Math.abs((i.y-e.y)*r.x-(i.x-e.x)*r.y+i.x*e.y-i.y*e.x)/t.distance(i,e)}function b(e,i){var r=I,n=t.unpack(i,0,r[0]),a=t.unpack(i,2,r[1]),s=t.unpack(i,4,r[2]);e.uMaxVmax=new c({componentDatatype:o.FLOAT,componentsPerAttribute:4,normalize:!1,value:[a.x,a.y,s.x,s.y]});var l=1/C(n,a,s),u=1/C(n,s,a);e.uvMinAndExtents=new c({componentDatatype:o.FLOAT,componentsPerAttribute:4,normalize:!1,value:[n.x,n.y,l,u]})}function S(e,t,i){var r=M;r.height=0,r.longitude=e.west,r.latitude=e.south;var n=t.project(r,R);r.latitude=e.north;var a=t.project(r,O);r.longitude=e.east,r.latitude=e.south;var s=t.project(r,L),l=[0,0,0,0],d=[0,0,0,0],h=u.encode(n.x,N);l[0]=h.high,d[0]=h.low,h=u.encode(n.y,N),l[1]=h.high,d[1]=h.low,h=u.encode(a.y,N),l[2]=h.high,d[2]=h.low,h=u.encode(s.x,N),l[3]=h.high,d[3]=h.low,i.planes2D_HIGH=new c({componentDatatype:o.FLOAT,componentsPerAttribute:4,normalize:!1,value:l}),i.planes2D_LOW=new c({componentDatatype:o.FLOAT,componentsPerAttribute:4,normalize:!1,value:d})}function T(t,r,n,o,a,s){var l=h.center(t,z);l.height=n;var u=e.toCartesian(l,r,k),c=p.eastNorthUpToFixedFrame(u,r,F),f=d.inverse(c,B),m=t.west,_=t.east,g=t.north,v=t.south,y=V;y[0].latitude=v,y[0].longitude=m,y[1].latitude=g,y[1].longitude=m,y[2].latitude=g,y[2].longitude=_,y[3].latitude=v,y[3].longitude=_;var C=.5*(m+_),b=.5*(g+v);y[4].latitude=v,y[4].longitude=C,y[5].latitude=g,y[5].longitude=C,y[6].latitude=b,y[6].longitude=m,y[7].latitude=b,y[7].longitude=_;for(var S=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,w=0;w<8;w++){y[w].height=n;var x=e.toCartesian(y[w],r,k);d.multiplyByPoint(f,x,x),x.z=0,S=Math.min(S,x.x),T=Math.max(T,x.x),E=Math.min(E,x.y),A=Math.max(A,x.y)}var P=o;P.x=S,P.y=E,P.z=0,d.multiplyByPoint(c,P,P);var D=a;D.x=T,D.y=E,D.z=0,d.multiplyByPoint(c,D,D),i.subtract(D,P,a);var I=s;I.x=S,I.y=A,I.z=0,d.multiplyByPoint(c,I,I),i.subtract(I,P,s)}function E(t,i,n,o){var a=M;a.latitude=t,a.longitude=i,a.height=0;var s=e.toCartesian(a,n,W),l=Math.sqrt(s.x*s.x+s.y*s.y),u=r.fastApproximateAtan2(l,s.z),c=r.fastApproximateAtan2(s.x,s.y);return o.x=u,o.y=c,o}function A(e){return Math.max(e.width,e.height)>g.MAX_WIDTH_FOR_PLANAR_EXTENTS}var w={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};g.prototype.createFragmentShader=function(e){var t=this._appearance,i=this._colorShaderDependencies,r=[];e||this._planarExtents||r.push("SPHERICAL"),i.requiresEC&&r.push("REQUIRES_EC"),i.requiresWC&&r.push("REQUIRES_WC"),i.requiresTextureCoordinates&&r.push("TEXTURE_COORDINATES"),this._extentsCulling&&r.push("CULL_FRAGMENTS"),i.requiresNormalEC&&r.push("NORMAL_EC"),t instanceof m&&r.push("PER_INSTANCE_COLOR"),i.normalEC&&r.push("USES_NORMAL_EC"),i.positionToEyeEC&&r.push("USES_POSITION_TO_EYE_EC"),i.tangentToEyeMatrix&&r.push("USES_TANGENT_TO_EYE"),i.st&&r.push("USES_ST"),t.flat&&r.push("FLAT");var n="";return t instanceof m||(n=t.material.shaderSource),new f({defines:r,sources:[n,_]})},g.prototype.createPickFragmentShader=function(e){var t=this._pickShaderDependencies,i=["PICK"];return e||this._planarExtents||i.push("SPHERICAL"),t.requiresEC&&i.push("REQUIRES_EC"),t.requiresWC&&i.push("REQUIRES_WC"),t.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),new f({defines:i,sources:[_],pickColorQualifier:"varying"})},g.prototype.createVertexShader=function(e,t,i,r){return v(this._colorShaderDependencies,this._planarExtents,i,e,t,this._appearance,r)},g.prototype.createPickVertexShader=function(e,t,i,r){return v(this._pickShaderDependencies,this._planarExtents,i,e,t,void 0,r)};var x=new i,P=new e,D={high:0,low:0};l(y.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});var I=[new t,new t,new t,new t],M=new e,R=new i,O=new i,L=new i,N={high:0,low:0},F=new d,B=new d,k=new i,z=new e,V=[new e,new e,new e,new e,new e,new e,new e,new e],U=new i,G=new i,H=new u;g.getPlanarTextureCoordinateAttributes=function(e,t,r,n,s){var l=R,d=U,h=G;T(e,r,a(s,0),l,d,h);var p={};b(p,t);var f=u.fromCartesian(l,H);return p.southWest_HIGH=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,normalize:!1,value:i.pack(f.high,[0,0,0])}),p.southWest_LOW=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,normalize:!1,value:i.pack(f.low,[0,0,0])}),p.eastward=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,normalize:!1,value:i.pack(d,[0,0,0])}),p.northward=new c({componentDatatype:o.FLOAT,componentsPerAttribute:3,normalize:!1,value:i.pack(h,[0,0,0])}),S(e,n,p),p};var W=new i,q=new t;return g.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,n){var a=E(e.south,e.west,i,q),s=a.x,l=a.y,u=E(e.north,e.east,i,q),d=u.x,h=u.y,p=0;l>h&&(p=r.PI-l,l=-r.PI,h+=p),s-=r.EPSILON5,l-=r.EPSILON5,d+=r.EPSILON5,h+=r.EPSILON5;var f=1/(h-l),m=1/(d-s),_={sphericalExtents:new c({componentDatatype:o.FLOAT,componentsPerAttribute:4,normalize:!1,value:[s,l,m,f]}),longitudeRotation:new c({componentDatatype:o.FLOAT,componentsPerAttribute:1,normalize:!1,value:[p]})};return b(_,t),S(e,n,_),_},g.hasAttributesForTextureCoordinatePlanes=function(e){return s(e.southWest_HIGH)&&s(e.southWest_LOW)&&s(e.northward)&&s(e.eastward)&&s(e.planes2D_HIGH)&&s(e.planes2D_LOW)&&s(e.uMaxVmax)&&s(e.uvMinAndExtents)},g.hasAttributesForSphericalExtents=function(e){return s(e.sphericalExtents)&&s(e.longitudeRotation)&&s(e.planes2D_HIGH)&&s(e.planes2D_LOW)&&s(e.uMaxVmax)&&s(e.uvMinAndExtents)},g.shouldUseSphericalCoordinates=function(e){return A(e)},g.MAX_WIDTH_FOR_PLANAR_EXTENTS=r.toRadians(1),g}),define("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Scene/StencilConstants",["../Core/freezeObject","./StencilFunction","./StencilOperation"],function(e,t,i){"use strict";var r={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};return r.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:t.ALWAYS,frontOperation:{fail:i.KEEP,zFail:i.KEEP,zPass:i.REPLACE},backFunction:t.ALWAYS,backOperation:{fail:i.KEEP,zFail:i.KEEP,zPass:i.REPLACE},reference:r.CESIUM_3D_TILE_MASK,mask:r.CESIUM_3D_TILE_MASK}},e(r)}),define("Scene/ClassificationPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/isArray","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeAppearanceVS","../ThirdParty/when","./BlendingState","./ClassificationType","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./ShadowVolumeAppearance","./StencilConstants","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w){"use strict";function x(e){e=i(e,i.EMPTY_OBJECT);var t=e.geometryInstances;this.geometryInstances=t,this.show=i(e.show,!0),this.classificationType=i(e.classificationType,v.BOTH),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=i(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=i(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilPreloadPass3DTiles=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._readyPromise=_.defer(),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance;var n;r(t)&&l(t)&&t.length>1&&(n=U),this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:i(e.vertexCacheOptimize,!1),interleave:i(e.interleave,!1),releaseGeometryInstances:i(e.releaseGeometryInstances,!0),allowPicking:i(e.allowPicking,!0),asynchronous:i(e.asynchronous,!0),compressVertices:i(e.compressVertices,!0),_readOnlyInstanceAttributes:n,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}function P(e,t){var i=t?A.EQUAL:A.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:w.KEEP,zFail:w.DECREMENT_WRAP,zPass:w.DECREMENT_WRAP},backFunction:i,backOperation:{fail:w.KEEP,zFail:w.INCREMENT_WRAP,zPass:w.INCREMENT_WRAP},reference:E.CESIUM_3D_TILE_MASK,mask:E.CESIUM_3D_TILE_MASK},stencilMask:E.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1}}function D(e,t){var i=t?A.EQUAL:A.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:w.KEEP,zFail:w.KEEP,zPass:w.INCREMENT_WRAP},backFunction:i,backOperation:{fail:w.KEEP,zFail:w.KEEP,zPass:w.DECREMENT_WRAP},reference:E.CESIUM_3D_TILE_MASK,mask:E.CESIUM_3D_TILE_MASK},stencilMask:E.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:y.LESS_OR_EQUAL},depthMask:!1}}function I(e){return{stencilTest:{enabled:e,frontFunction:A.NOT_EQUAL,frontOperation:{fail:w.KEEP,zFail:w.KEEP,zPass:w.DECREMENT_WRAP},backFunction:A.NOT_EQUAL,backOperation:{fail:w.KEEP,zFail:w.KEEP,zPass:w.DECREMENT_WRAP},reference:0,mask:E.CLASSIFICATION_MASK},stencilMask:E.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:g.ALPHA_BLEND}}function M(e,t,i,n){if(!r(e._rsStencilPreloadPass)){var o=!e.debugShowShadowVolume;e._rsStencilPreloadPass=d.fromCache(P(o,!1)),e._rsStencilPreloadPass3DTiles=d.fromCache(P(o,!0)),e._rsStencilDepthPass=d.fromCache(D(o,!1)),e._rsStencilDepthPass3DTiles=d.fromCache(D(o,!0)),e._rsColorPass=d.fromCache(I(o,!1)),e._rsPickPass=d.fromCache(G)}}function R(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/attribute\s+vec3\s+extrudeDirection;/g)){var i=t;i=i.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),i=p.replaceMain(i,"czm_non_compressed_main");return["attribute vec2 compressedAttributes;","vec3 extrudeDirection;\n",i,"void main() \n{ \n extrudeDirection = czm_octDecode(compressedAttributes, 65535.0);\n czm_non_compressed_main(); \n}"].join("\n")}}function O(e,t){var i=t.context,n=e._primitive,o=m;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=b._appendDistanceDisplayConditionToShader(n,o),o=b._modifyShaderPosition(e,o,t.scene3DOnly),o=b._updateColorAttribute(n,o);var a=e._hasPlanarExtentsAttributes,s=a||e._hasSphericalExtentsAttribute;e._extruded&&(o=R(n,o));var l=e._extruded?"EXTRUDED_GEOMETRY":"",u="ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT",c=new p({defines:[l,u],sources:[o]}),d=new p({sources:[f]}),_=e._primitive._attributeLocations,g=new T(s,a,e.appearance);if(e._spStencil=h.replaceCache({context:i,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:_}),e._primitive.allowPicking){var v=p.createPickVertexShaderSource(o);v=b._appendShowToShader(n,v),v=b._updatePickColorAttribute(v);var y=g.createPickFragmentShader(!1),C=g.createPickVertexShader([l,u],v,!1,t.mapProjection);if(e._spPick=h.replaceCache({context:i,shaderProgram:e._spPick,vertexShaderSource:C,fragmentShaderSource:y,attributeLocations:_}),s){var S=i.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!r(S)){var E=g.createPickFragmentShader(!0),A=g.createPickVertexShader([l,u],v,!0,t.mapProjection);S=i.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:_})}e._spPick2D=S}}else e._spPick=h.fromCache({context:i,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:_});o=b._appendShowToShader(n,o),c=new p({defines:[l,u],sources:[o]}),e._sp=h.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:_});var w=g.createFragmentShader(!1),x=g.createVertexShader([l,u],o,!1,t.mapProjection);if(e._spColor=h.replaceCache({context:i,shaderProgram:e._spColor,vertexShaderSource:x,fragmentShaderSource:w,attributeLocations:_}),s){var P=i.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!r(P)){var D=g.createFragmentShader(!0),I=g.createVertexShader([l,u],o,!0,t.mapProjection);P=i.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:I,
- fragmentShaderSource:D,attributeLocations:_})}e._spColor2D=P}}function L(e,i){var n=e._primitive,o=3*n._va.length;i.length=o;var a,s,l,d=0,h=n._batchTable.getUniformMapCallback()(e._uniformMap),p=e._needs2DShader;for(a=0;a<o;a+=3){var f=n._va[d++];s=i[a],r(s)||(s=i[a]=new u({owner:e,primitiveType:n._primitiveType})),s.vertexArray=f,s.renderState=e._rsStencilPreloadPass,s.shaderProgram=e._sp,s.uniformMap=h,s.pass=c.TERRAIN_CLASSIFICATION,l=u.shallowClone(s,s.derivedCommands.tileset),l.renderState=e._rsStencilPreloadPass3DTiles,l.pass=c.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=l,s=i[a+1],r(s)||(s=i[a+1]=new u({owner:e,primitiveType:n._primitiveType})),s.vertexArray=f,s.renderState=e._rsStencilDepthPass,s.shaderProgram=e._sp,s.uniformMap=h,s.pass=c.TERRAIN_CLASSIFICATION,l=u.shallowClone(s,s.derivedCommands.tileset),l.renderState=e._rsStencilDepthPass3DTiles,l.pass=c.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=l,s=i[a+2],r(s)||(s=i[a+2]=new u({owner:e,primitiveType:n._primitiveType})),s.vertexArray=f,s.renderState=e._rsColorPass,s.shaderProgram=e._spColor,s.pass=c.TERRAIN_CLASSIFICATION;var m=e.appearance,_=m.material;if(r(_)&&(h=t(h,_._uniforms)),s.uniformMap=h,l=u.shallowClone(s,s.derivedCommands.tileset),l.pass=c.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=l,p){var g=u.shallowClone(s,s.derivedCommands.appearance2D);g.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=g,g=u.shallowClone(l,l.derivedCommands.appearance2D),g.shaderProgram=e._spColor2D,l.derivedCommands.appearance2D=g}}var v=e._commandsIgnoreShow,y=e._spStencil,C=0;o=v.length=o/3*2;for(var b=0;b<o;b+=2){var S=v[b]=u.shallowClone(i[C],v[b]);S.shaderProgram=y,S.pass=c.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,S=v[b+1]=u.shallowClone(i[C+1],v[b+1]),S.shaderProgram=y,S.pass=c.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,C+=3}}function N(e,t){var i,n,o=e._usePickOffsets,a=e._primitive,s=3*a._va.length,l=0;o&&(i=a._pickOffsets,s=3*i.length),t.length=s;var d,h,p,f=0,m=a._batchTable.getUniformMapCallback()(e._uniformMap),_=e._needs2DShader;for(d=0;d<s;d+=3){var g=a._va[f++];if(o&&(n=i[l++],g=a._va[n.index]),h=t[d],r(h)||(h=t[d]=new u({owner:e,primitiveType:a._primitiveType,pickOnly:!0})),h.vertexArray=g,h.renderState=e._rsStencilPreloadPass,h.shaderProgram=e._sp,h.uniformMap=m,h.pass=c.TERRAIN_CLASSIFICATION,o&&(h.offset=n.offset,h.count=n.count),p=u.shallowClone(h,h.derivedCommands.tileset),p.renderState=e._rsStencilPreloadPass3DTiles,p.pass=c.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=p,h=t[d+1],r(h)||(h=t[d+1]=new u({owner:e,primitiveType:a._primitiveType,pickOnly:!0})),h.vertexArray=g,h.renderState=e._rsStencilDepthPass,h.shaderProgram=e._sp,h.uniformMap=m,h.pass=c.TERRAIN_CLASSIFICATION,o&&(h.offset=n.offset,h.count=n.count),p=u.shallowClone(h,h.derivedCommands.tileset),p.renderState=e._rsStencilDepthPass3DTiles,p.pass=c.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=p,h=t[d+2],r(h)||(h=t[d+2]=new u({owner:e,primitiveType:a._primitiveType,pickOnly:!0})),h.vertexArray=g,h.renderState=e._rsPickPass,h.shaderProgram=e._spPick,h.uniformMap=m,h.pass=c.TERRAIN_CLASSIFICATION,o&&(h.offset=n.offset,h.count=n.count),p=u.shallowClone(h,h.derivedCommands.tileset),p.pass=c.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=p,_){var v=u.shallowClone(h,h.derivedCommands.pick2D);v.shaderProgram=e._spPick2D,h.derivedCommands.pick2D=v,v=u.shallowClone(p,p.derivedCommands.pick2D),v.shaderProgram=e._spPick2D,p.derivedCommands.pick2D=v}}}function F(e,t,i,r,n,o,a){L(e,o),N(e,a)}function B(e,t){return Math.floor(e%t/3)}function k(e,t,i,r,n,o){e.modelMatrix=i,e.boundingVolume=n,e.cull=r,e.debugShowBoundingVolume=o,t.commandList.push(e)}function z(e,t,i,r,n){e.modelMatrix=i,e.boundingVolume=n,e.cull=r,t.commandList.push(e)}function V(e,t,i,n,o,a,s,l){var u=e._primitive;b._updateBoundingVolumes(u,t,o);var c;t.mode===S.SCENE3D?c=u._boundingSphereWC:t.mode===S.COLUMBUS_VIEW?c=u._boundingSphereCV:t.mode===S.SCENE2D&&r(u._boundingSphere2D)?c=u._boundingSphere2D:r(u._boundingSphereMorph)&&(c=u._boundingSphereMorph);var d,h,p,f=e.classificationType,m=f!==v.CESIUM_3D_TILE,_=f!==v.TERRAIN,g=t.passes;if(g.render){var y=i.length;for(d=0;d<y;++d)h=c[B(d,y)],m&&(p=i[d],k(p,t,o,a,h,s)),_&&(p=i[d].derivedCommands.tileset,k(p,t,o,a,h,s));if(t.invertClassification){var C=e._commandsIgnoreShow,T=C.length;for(d=0;d<T;++d)h=c[Math.floor(d/2)],p=C[d],k(p,t,o,a,h,s)}}if(g.pick){var E=n.length,A=u._pickOffsets;for(d=0;d<E;++d){h=c[A[B(d,E)].index],m&&(p=n[d],z(p,t,o,a,h)),_&&(p=n[d].derivedCommands.tileset,z(p,t,o,a,h))}}}var U=["color"];n(x.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}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),x.isSupported=function(e){return e.context.stencilBuffer};var G={stencilTest:{enabled:!0,frontFunction:A.NOT_EQUAL,frontOperation:{fail:w.KEEP,zFail:w.KEEP,zPass:w.DECREMENT_WRAP},backFunction:A.NOT_EQUAL,backOperation:{fail:w.KEEP,zFail:w.KEEP,zPass:w.DECREMENT_WRAP},reference:0,mask:E.CLASSIFICATION_MASK},stencilMask:E.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};return x.prototype.update=function(t){if(r(this._primitive)||r(this.geometryInstances)){var n=this.appearance;r(n)&&r(n.material)&&n.material.update(t.context);var o=this,u=this._primitiveOptions;if(!r(this._primitive)){var c,h,p,f,m=l(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],_=m.length,g=!1,v=!0,y=!1,S=!1;for(_>0&&(p=m[0].attributes,y=T.hasAttributesForSphericalExtents(p),S=T.hasAttributesForTextureCoordinatePlanes(p),f=p.color),c=0;c<_;c++){h=m[c];var E=h.attributes.color;r(E)&&(g=!0),v=v&&r(E)&&e.equals(f,E)}if(!v&&!y&&!S)throw new a("All GeometryInstances must have the same color attribute except via GroundPrimitives");g&&!r(n)&&(n=new C({flat:!0}),this.appearance=n),this._usePickOffsets=!y&&!S,this._hasSphericalExtentsAttribute=y,this._hasPlanarExtentsAttributes=S,this._hasPerColorAttribute=g;var A=new Array(_);for(c=0;c<_;++c)h=m[c],A[c]=new s({geometry:h.geometry,attributes:h.attributes,modelMatrix:h.modelMatrix,id:h.id,pickPrimitive:i(this._pickPrimitive,o)});u.appearance=n,u.geometryInstances=A,r(this._createBoundingVolumeFunction)&&(u._createBoundingVolumeFunction=function(e,t){o._createBoundingVolumeFunction(e,t)}),u._createRenderStatesFunction=function(e,t,i,r){M(o,t)},u._createShaderProgramFunction=function(e,t,i){O(o,t)},u._createCommandsFunction=function(e,t,i,r,n,a,s){F(o,void 0,void 0,!0,!1,a,s)},r(this._updateAndQueueCommandsFunction)?u._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,s,l){o._updateAndQueueCommandsFunction(e,t,i,r,n,a,s,l)}:u._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,s,l){V(o,t,i,r,n,a,s,l)},this._primitive=new b(u),this._primitive.readyPromise.then(function(e){o._ready=!0,o.releaseGeometryInstances&&(o.geometryInstances=void 0);var t=e._error;r(t)?o._readyPromise.reject(t):o._readyPromise.resolve(o)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilPreloadPass=d.fromCache(P(!1,!1)),this._rsStencilPreloadPass3DTiles=d.fromCache(P(!1,!0)),this._rsStencilDepthPass=d.fromCache(D(!1,!1)),this._rsStencilDepthPass3DTiles=d.fromCache(D(!1,!0)),this._rsColorPass=d.fromCache(I(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilPreloadPass=d.fromCache(P(!0,!1)),this._rsStencilPreloadPass3DTiles=d.fromCache(P(!0,!0)),this._rsStencilDepthPass=d.fromCache(D(!0,!1)),this._rsStencilDepthPass3DTiles=d.fromCache(D(!0,!0)),this._rsColorPass=d.fromCache(I(!0))),this._primitive.appearance!==n&&(this._primitive.appearance=n),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t)}},x.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},x.prototype.isDestroyed=function(){return!1},x.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(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,o(this)},x}),define("Scene/GroundPrimitive",["../Core/ApproximateTerrainHeights","../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../Core/RectangleGeometry","../Core/Resource","../Renderer/DrawCommand","../Renderer/Pass","../ThirdParty/when","./ClassificationPrimitive","./ClassificationType","./PerInstanceColorAppearance","./SceneMode","./ShadowVolumeAppearance"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P){"use strict";function D(t){t=l(t,l.EMPTY_OBJECT);var i=t.appearance,r=t.geometryInstances;if(!u(i)&&u(r))for(var n=m(r)?r:[r],o=n.length,a=0;a<o;a++){var s=n[a].attributes;if(u(s)&&u(s.color)){i=new w({flat:!0});break}}this.appearance=i,this.geometryInstances=t.geometryInstances,this.show=l(t.show,!0),this.classificationType=l(t.classificationType,A.BOTH),this.debugShowBoundingVolume=l(t.debugShowBoundingVolume,!1),this.debugShowShadowVolume=l(t.debugShowShadowVolume,!1),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=e._defaultMaxTerrainHeight,this._minTerrainHeight=e._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;var c=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:l(t.vertexCacheOptimize,!1),interleave:l(t.interleave,!1),releaseGeometryInstances:l(t.releaseGeometryInstances,!0),allowPicking:l(t.allowPicking,!0),asynchronous:l(t.asynchronous,!0),compressVertices:l(t.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:c,_extruded:!0,_uniformMap:z}}function I(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function M(e){return function(t,i){return e._minHeight}}function R(e,t){var i=e.mapProjection.ellipsoid;{if(u(t.attributes)&&u(t.attributes.position3DHigh)){for(var r=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=r.length,s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=0;h<a;h+=3){var p=n.unpack(r,h,V),f=n.unpack(o,h,U),m=n.add(p,f,G),_=i.cartesianToCartographic(m,H),g=_.latitude,v=_.longitude;s=Math.min(s,g),l=Math.min(l,v),c=Math.max(c,g),d=Math.max(d,v)}var y=W;return y.north=c,y.south=s,y.east=d,y.west=l,y}if(u(t.rectangle))return t.rectangle}}function O(t,i,r){var n=e.getMinimumMaximumHeights(i,r);t._minTerrainHeight=n.minimumTerrainHeight,t._maxTerrainHeight=n.maximumTerrainHeight}function L(e,i,r){var o=i.mapProjection.ellipsoid,a=R(i,r);if(a.width<_.PI){var s=g.fromRectangle(a,e._maxHeight,e._minHeight,o);e._boundingVolumes.push(s)}else{var l=r.attributes.position3DHigh.values,u=r.attributes.position3DLow.values;e._boundingVolumes.push(t.fromEncodedCartesianVertices(l,u))}if(!i.scene3DOnly){var c=i.mapProjection,d=t.fromRectangleWithHeights2D(a,c,e._maxHeight,e._minHeight);n.fromElements(d.center.z,d.center.x,d.center.y,d.center),e._boundingVolumes2D.push(d)}}function N(e,t){return Math.floor(e%t/3)}function F(e,t,i,r,n,o,a){var s=e._primitive;i.mode!==x.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=r,t.boundingVolume=o,t.cull=n,t.debugShowBoundingVolume=a,i.commandList.push(t)}function B(e,t,i,r,n,o){var a=e._primitive;i.mode!==x.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=r,t.boundingVolume=o,t.cull=n,i.commandList.push(t)}function k(e,t,i,r,n,o,a,s){var l;l=t.mode===x.SCENE3D?e._boundingVolumes:e._boundingVolumes2D;var u,c,d,h=e.classificationType,p=h!==A.CESIUM_3D_TILE,f=h!==A.TERRAIN,m=t.passes,_=e._primitive;if(m.render){var g=i.length;for(u=0;u<g;++u)c=l[N(u,g)],p&&(d=i[u],F(e,d,t,n,o,c,a)),f&&(d=i[u].derivedCommands.tileset,F(e,d,t,n,o,c,a));if(t.invertClassification){var v=_._commandsIgnoreShow,y=v.length;for(u=0;u<y;++u)c=l[Math.floor(u/2)],d=v[u],F(e,d,t,n,o,c,a)}}if(m.pick){var C,b=r.length;for(e._useFragmentCulling||(C=_._primitive._pickOffsets),u=0;u<b;++u){if(c=l[N(u,b)],!e._useFragmentCulling){c=l[C[N(u,b)].index]}p&&(d=r[u],B(e,d,t,n,o,c)),f&&(d=r[u].derivedCommands.tileset,B(e,d,t,n,o,c))}}}var z={u_globeMinimumAltitude:function(){return 55e3}};c(D.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),D.isSupported=E.isSupported;var V=new n,U=new n,G=new n,H=new o,W=new v;return D.initializeTerrainHeights=function(){return e.initialize()},D.prototype.update=function(t){if(u(this._primitive)||u(this.geometryInstances)){if(!e.initialized)return void D.initializeTerrainHeights();var i=this,r=this._classificationPrimitiveOptions;if(!u(this._primitive)){var n,o,a,s,l,c=t.mapProjection.ellipsoid,d=m(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],h=d.length,p=new Array(h);for(s=0;s<h;++s){n=d[s],o=n.geometry;var _=R(t,o);u(l)?u(_)&&v.union(l,_,l):l=v.clone(_);var g=n.id;if(u(g)&&u(_)){var y=e.getBoundingSphere(_,c);this._boundingSpheresKeys.push(g),this._boundingSpheres.push(y)}a=o.constructor,!u(a)||u(a.createShadowVolume)}O(this,l,c);var C=t.terrainExaggeration;this._minHeight=this._minTerrainHeight*C,this._maxHeight=this._maxTerrainHeight*C;var b=D._supportsMaterials(t.context);if(this._useFragmentCulling=b,b){var S,T=!0;for(s=0;s<h;++s)if(n=d[s],o=n.geometry,l=R(t,o),P.shouldUseSphericalCoordinates(l)){T=!1;break}for(s=0;s<h;++s){n=d[s],o=n.geometry,a=o.constructor;var A=R(t,o),w=o.textureCoordinateRotationPoints;S=T?P.getPlanarTextureCoordinateAttributes(A,w,c,t.mapProjection,this._maxHeight):P.getSphericalExtentGeometryInstanceAttributes(A,w,c,t.mapProjection);var x=n.attributes;for(var N in x)x.hasOwnProperty(N)&&(S[N]=x[N]);p[s]=new f({geometry:a.createShadowVolume(o,M(this),I(this)),attributes:S,id:n.id})}}else for(s=0;s<h;++s)n=d[s],o=n.geometry,a=o.constructor,p[s]=new f({geometry:a.createShadowVolume(o,M(this),I(this)),attributes:n.attributes,id:n.id});r.geometryInstances=p,r.appearance=this.appearance,r._createBoundingVolumeFunction=function(e,t){L(i,e,t)},r._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){k(i,t,r,n,o,a,s,l)},this._primitive=new E(r),this._primitive.readyPromise.then(function(e){i._ready=!0,i.releaseGeometryInstances&&(i.geometryInstances=void 0);var t=e._error;u(t)?i._readyPromise.reject(t):i._readyPromise.resolve(i)})}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t)}},D.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(-1!==t)return this._boundingSpheres[t]},D.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),d(this)},D._supportsMaterials=function(e){return e.depthTexture},D.supportsMaterials=function(e){return D._supportsMaterials(e.frameState.context)},D}),define("Shaders/PolylineShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\n#ifndef COLUMBUS_VIEW_2D\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\n#else\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\n#endif\nattribute float batchId;\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef COLUMBUS_VIEW_2D\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\nvec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\nvec3 ecEnd = forwardDirectionEC + ecStart;\nforwardDirectionEC = normalize(forwardDirectionEC);\nv_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\nvec4 startPlaneEC;\nstartPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\nvec4 endPlaneEC;\nendPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\nv_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\nv_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\n#else // COLUMBUS_VIEW_2D\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\nvec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\nvec3 ecEnd = ecStart + offset;\nvec3 forwardDirectionEC = normalize(offset);\nvec4 startPlaneEC;\nstartPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\nvec4 endPlaneEC;\nendPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\nv_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\nv_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\nv_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n#endif // COLUMBUS_VIEW_2D\nv_endEcAndStartEcX.xyz = ecEnd;\nv_endEcAndStartEcX.w = ecStart.x;\nv_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif // PER_INSTANCE_COLOR\nvec4 positionRelativeToEye = czm_computePosition();\nvec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\nvec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\nupOrDown = cross(forwardDirectionEC, normalEC);\nupOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\nupOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\nupOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\npositionEC.xyz += upOrDown;\nv_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\nfloat width = czm_batchTable_width(batchId);\n#ifdef WIDTH_VARYING\nv_width = width;\n#endif\nv_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\nv_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\nv_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\nv_endPlaneNormalEcAndBatchId.w = batchId;\nwidth = width * max(0.0, czm_metersPerPixel(positionEC));\nwidth = width / dot(normalEC, v_rightPlaneEC.xyz);\n#ifdef COLUMBUS_VIEW_2D\nnormalEC *= sign(texcoordNormalization2D.x);\n#else\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n#endif\npositionEC.xyz += width * normalEC;\ngl_Position = czm_depthClampFarPlane(czm_projection * positionEC);\n#ifdef ANGLE_VARYING\nvec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n"}),define("Shaders/PolylineShadowVolumeFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\nvoid main(void)\n{\nfloat logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\nvec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\nif (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\nfloat widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\nfloat distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\nfloat distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\nif (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec3 alignedPlaneNormal;\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\ndistanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\ndistanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n#ifdef PER_INSTANCE_COLOR\ngl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\nfloat s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\ns = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\nfloat t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\nczm_materialInput materialInput;\nmaterialInput.s = s;\nmaterialInput.st = vec2(s, t);\nmaterialInput.str = vec3(s, t, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\nczm_writeDepthClampedToFarPlane();\n}\n"}),define("Shaders/PolylineShadowVolumeMorphVS",[],function(){"use strict"
- ;return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\nattribute float batchId;\nvarying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\nvoid main()\n{\nv_batchId = batchId;\nvec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\nvec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\nvec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\nvec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\nvec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\nvec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\nvec4 startPlane2D;\nvec4 startPlane3D;\nstartPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\nstartPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\nstartPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\nstartPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\nvec4 rightPlane2D;\nvec4 rightPlane3D;\nrightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\nrightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\nrightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\nrightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\nposRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\nposRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\nposRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\nposEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\nposEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\nvec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\nvec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\nvec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\nvec4 endPlane2D;\nvec4 endPlane3D;\nendPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\nendPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\nendPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\nendPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\nv_forwardDirectionEC = normalize(endEC - startEC);\nvec2 cleanTexcoordNormalization2D;\ncleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\ncleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\nvec2 cleanTexcoordNormalization3D;\ncleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\ncleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\ncleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\nv_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#else // PER_INSTANCE_COLOR\nv_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\nv_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\n#endif // PER_INSTANCE_COLOR\n#ifdef WIDTH_VARYING\nfloat width = czm_batchTable_width(batchId);\nfloat halfWidth = width * 0.5;\nv_width = width;\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#else\nfloat halfWidth = 0.5 * czm_batchTable_width(batchId);\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#endif\nvec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\nvec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection));\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\nvec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\ngeodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\npositionEc3D.xyz += geodeticSurfaceNormal;\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\npositionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;\nvec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nabsStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\nabsEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\nplaneDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\nupOrDown = normalize(cross(rightPlane2D.xyz, planeDirection));\nnormalEC = normalize(cross(planeDirection, upOrDown));\ngeodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\ngeodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\npositionEc2D.xyz += geodeticSurfaceNormal;\nnormalEC *= sign(texcoordNormalization2D.x);\n#ifndef PER_INSTANCE_COLOR\nv_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\n#endif\npositionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;\ngl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\n#ifdef ANGLE_VARYING\nvec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n"}),define("Shaders/PolylineShadowVolumeMorphFS",[],function(){"use strict";return"varying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\nreturn (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\n}\nvoid main(void)\n{\nvec4 eyeCoordinate = gl_FragCoord;\neyeCoordinate /= eyeCoordinate.w;\n#ifdef PER_INSTANCE_COLOR\ngl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\nfloat distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\nfloat distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\ndistanceFromStart = max(0.0, distanceFromStart);\ndistanceFromEnd = max(0.0, distanceFromEnd);\nfloat s = distanceFromStart / (distanceFromStart + distanceFromEnd);\ns = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\nczm_materialInput materialInput;\nmaterialInput.s = s;\nmaterialInput.st = vec2(s, v_texcoordT);\nmaterialInput.str = vec3(s, v_texcoordT, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n}\n"}),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;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(czm_modelViewProjectionRelativeToEye * p);\n#endif\n}\n"}),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 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\n#ifdef POLYLINE_DASH\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\nvec2 lineDir;\nif (usePrevious) {\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\n}\nelse {\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\n}\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\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;\n#ifdef CLIP_POLYLINE\nif (clipped)\n{\nif (prevEC.z - positionEC.z < 0.0)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\ndirection = vec2(-prevWC.y, prevWC.x);\n}\n}\nelse\n#endif\nif (czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\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}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nreturn getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n"}),define("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/FeatureDetection","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./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),r=l.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,u),this._fragmentShaderSource=e(t.fragmentShaderSource,c),this._renderState=s.getDefaultRenderState(i,!1,t.renderState),this._closed=!1,this._vertexFormat=r}var u=a+"\n"+o,c=n;return i.isInternetExplorer()||(u="#define CLIP_POLYLINE \n"+u),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}}}),l.VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),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;\nvarying float v_polylineAngle;\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, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(czm_modelViewProjectionRelativeToEye * p);\n#endif\n}\n"}),define("Shaders/PolylineFS",[],function(){"use strict";return"#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying 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#ifdef VECTOR_TILE\ngl_FragColor *= u_highlightColor;\n#endif\nczm_writeLogDepth();\n}\n"}),define("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/FeatureDetection","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=c.VERTEX_FORMAT;this.material=t(i.material)?i.material:u.fromType(u.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,d),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=l.getDefaultRenderState(r,!1,i.renderState),this._closed=!1,this._vertexFormat=n}var d=a+"\n"+o,h=s;return r.isInternetExplorer()||(d="#define CLIP_POLYLINE \n"+d),i(c.prototype,{vertexShaderSource:{get:function(){var e=this._vertexShaderSource;return-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&(e="#define POLYLINE_DASH\n"+e),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),c.VERTEX_FORMAT=n.POSITION_AND_ST,c.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,c.prototype.isTranslucent=l.prototype.isTranslucent,c.prototype.getRenderState=l.prototype.getRenderState,c}),define("Scene/GroundPolylinePrimitive",["../Core/ApproximateTerrainHeights","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/GroundPolylineGeometry","../Core/isArray","../Shaders/PolylineShadowVolumeVS","../Shaders/PolylineShadowVolumeFS","../Shaders/PolylineShadowVolumeMorphVS","../Shaders/PolylineShadowVolumeMorphFS","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../ThirdParty/when","./BlendingState","./ClassificationType","./CullFace","./PolylineColorAppearance","./PolylineMaterialAppearance","./Primitive","./SceneMode","./StencilConstants","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I){"use strict";function M(e){e=i(e,i.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;var t=e.appearance;r(t)||(t=new A),this.appearance=t,this.show=i(e.show,!0),this.classificationType=i(e.classificationType,S.BOTH),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=i(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:i(e.interleave,!1),releaseGeometryInstances:i(e.releaseGeometryInstances,!0),allowPicking:i(e.allowPicking,!0),asynchronous:i(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._readyPromise=C.defer(),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=O(!1),this._renderState3DTiles=O(!0),this._renderStateMorph=g.fromCache({cull:{enabled:!0,face:T.FRONT},depthTest:{enabled:!0},blending:b.ALPHA_BLEND,depthMask:!1})}function R(t,i,n){var o=i.context,a=t._primitive,s=a._attributeLocations,l=a._batchTable.getVertexShaderCallback()(d);l=w._appendShowToShader(a,l),l=w._appendDistanceDisplayConditionToShader(a,l),l=w._modifyShaderPosition(t,l,i.scene3DOnly);var u=a._batchTable.getVertexShaderCallback()(p);u=w._appendShowToShader(a,u),u=w._appendDistanceDisplayConditionToShader(a,u),u=w._modifyShaderPosition(t,u,i.scene3DOnly);var c=a._batchTable.getVertexShaderCallback()(h),m=["ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT","GLOBE_MINIMUM_ALTITUDE "+i.mapProjection.ellipsoid.minimumRadius.toFixed(1)],_="",g="";r(n.material)?(g=r(n.material)?n.material.shaderSource:"",-1!==g.search(/varying\s+float\s+v_polylineAngle;/g)&&m.push("ANGLE_VARYING"),-1!==g.search(/varying\s+float\s+v_width;/g)&&m.push("WIDTH_VARYING")):_="PER_INSTANCE_COLOR",m.push(_);var C=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",_]:[_],b=new y({defines:m,sources:[l]}),S=new y({defines:C,sources:[g,c]});t._sp=v.replaceCache({context:o,shaderProgram:a._sp,vertexShaderSource:b,fragmentShaderSource:S,attributeLocations:s});var T=o.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!r(T)){var E=new y({defines:m.concat(["COLUMBUS_VIEW_2D"]),sources:[l]});T=o.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:o,shaderProgram:t._sp2D,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:s})}t._sp2D=T;var A=o.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!r(A)){var x=new y({defines:m.concat(["MAX_TERRAIN_HEIGHT "+e._defaultMaxTerrainHeight.toFixed(1)]),sources:[u]});c=a._batchTable.getVertexShaderCallback()(f);var P=new y({defines:C,sources:[g,c]});A=o.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:o,shaderProgram:t._spMorph,vertexShaderSource:x,fragmentShaderSource:P,attributeLocations:s})}t._spMorph=A}function O(e){return g.fromCache({cull:{enabled:!0},blending:b.ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:D.EQUAL,frontOperation:{fail:I.KEEP,zFail:I.KEEP,zPass:I.KEEP},backFunction:D.EQUAL,backOperation:{fail:I.KEEP,zFail:I.KEEP,zPass:I.KEEP},reference:P.CESIUM_3D_TILE_MASK,mask:P.CESIUM_3D_TILE_MASK}})}function L(e,t,i,n,o,a){var s=e._primitive,l=s._va.length;o.length=l,a.length=l;for(var u=t instanceof E,c=u?{}:i._uniforms,d=s._batchTable.getUniformMapCallback()(c),h=0;h<l;h++){var p=s._va[h],f=o[h];r(f)||(f=o[h]=new m({owner:e,primitiveType:s._primitiveType})),f.vertexArray=p,f.renderState=e._renderState,f.shaderProgram=e._sp,f.uniformMap=d,f.pass=_.TERRAIN_CLASSIFICATION,f.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";var g=m.shallowClone(f,f.derivedCommands.tileset);g.renderState=e._renderState3DTiles,g.pass=_.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=g;var v=m.shallowClone(f,f.derivedCommands.color2D);v.shaderProgram=e._sp2D,f.derivedCommands.color2D=v;var y=m.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;var C=m.shallowClone(f,f.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",f.derivedCommands.colorMorph=C}}function N(e,t,i,r,n,o,a){i.mode===x.MORPHING?t=t.derivedCommands.colorMorph:i.mode!==x.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=r,t.boundingVolume=o,t.cull=n,t.debugShowBoundingVolume=a,i.commandList.push(t)}function F(e,t,i,n,o,a,s){var l=e._primitive;w._updateBoundingVolumes(l,t,o);var u;t.mode===x.SCENE3D?u=l._boundingSphereWC:t.mode===x.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===x.SCENE2D&&r(l._boundingSphere2D)?u=l._boundingSphere2D:r(l._boundingSphereMorph)&&(u=l._boundingSphereMorph);var c,d=t.mode===x.MORPHING,h=e.classificationType,p=h!==S.CESIUM_3D_TILE,f=h!==S.TERRAIN&&!d,m=t.passes;if(m.render||m.pick&&l.allowPicking)for(var _=i.length,g=0;g<_;++g){var v=u[g];p&&(c=i[g],N(e,c,t,o,a,v,s)),f&&(c=i[g].derivedCommands.tileset,N(e,c,t,o,a,v,s))}}return n(M.prototype,{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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),M.initializeTerrainHeights=function(){return e.initialize()},M.prototype.update=function(i){if(r(this._primitive)||r(this.geometryInstances)){if(!e.initialized)return void M.initializeTerrainHeights();var n,o=this,d=this._primitiveOptions;if(!r(this._primitive)){var h,p=c(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],f=p.length,m=new Array(f);for(n=0;n<f;++n)if(h=p[n].attributes,!r(h)||!r(h.color)){this._hasPerInstanceColors=!1;break}for(n=0;n<f;++n){var _=p[n];h={};var g=_.attributes;for(var v in g)g.hasOwnProperty(v)&&(h[v]=g[v]);r(h.width)||(h.width=new l({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:1,value:[_.geometry.width]})),_.geometry._scene3DOnly=i.scene3DOnly,u.setProjectionAndEllipsoid(_.geometry,i.mapProjection),m[n]=new s({geometry:_.geometry,attributes:h,id:_.id,pickPrimitive:o})}d.geometryInstances=m,d.appearance=this.appearance,d._createShaderProgramFunction=function(e,t,i){R(o,t,i)},d._createCommandsFunction=function(e,t,i,r,n,a,s){L(o,t,i,r,a,s)},d._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,s,l){F(o,t,i,r,n,a,s)},this._primitive=new w(d),this._primitive.readyPromise.then(function(e){o._ready=!0,o.releaseGeometryInstances&&(o.geometryInstances=void 0);var t=e._error;r(t)?o._readyPromise.reject(t):o._readyPromise.resolve(o)})}if(this.appearance instanceof E&&!this._hasPerInstanceColors)throw new a("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(i)}},M.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},M.isSupported=function(e){return e.frameState.context.depthTexture},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,o(this)},M}),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=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,c,t.color),s.getValueOrDefault(this._transparent,e,!1)&&(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._repeat,e._repeat)&&s.equals(this._color,e._color)&&s.equals(this._transparent,e._transparent)},l}),define("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","../Core/Resource","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,i,r,n,o){"use strict";function a(t){if(t instanceof e)return new r(t);if("string"==typeof t||t instanceof i||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var n=new o;return n.image=t,n}}function s(e,t){return n(e,t,a)}return s}),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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=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.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),heightReference:a("heightReference"),fill:a("fill"),material:o("material"),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.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,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.dimensions=e(this.dimensions,t.dimensions),this.heightReference=e(this.heightReference,t.heightReference),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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/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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,
- this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=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._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),positions:a("positions"),width:a("width"),height:a("height"),heightReference:a("heightReference"),extrudedHeight:a("extrudedHeight"),extrudedHeightReference:a("extrudedHeightReference"),cornerType:a("cornerType"),granularity:a("granularity"),fill:a("fill"),material:o("material"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition"),classificationType:a("classificationType"),zIndex:a("zIndex")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.height=e(this.height,t.height),this.heightReference=e(this.heightReference,t.heightReference),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=e(this.extrudedHeightReference,t.extrudedHeightReference),this.cornerType=e(this.cornerType,t.cornerType),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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),this.classificationType=e(this.classificationType,t.classificationType),this.zIndex=e(this.zIndex,t.zIndex)},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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,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._heightReference=void 0,this._heightReferenceSubscription=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._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=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"),length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),heightReference:a("heightReference"),fill:a("fill"),material:o("material"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,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.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.heightReference=e(this.heightReference,t.heightReference),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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.slices=e(this.slices,t.slices),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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=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._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),height:a("height"),heightReference:a("heightReference"),extrudedHeight:a("extrudedHeight"),extrudedHeightReference:a("extrudedHeightReference"),rotation:a("rotation"),stRotation:a("stRotation"),granularity:a("granularity"),fill:a("fill"),material:o("material"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition"),classificationType:a("classificationType"),zIndex:a("zIndex")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,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.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.height=e(this.height,t.height),this.heightReference=e(this.heightReference,t.heightReference),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=e(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=e(this.rotation,t.rotation),this.stRotation=e(this.stRotation,t.stRotation),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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),this.classificationType=e(this.classificationType,t.classificationType),this.zIndex=e(this.zIndex,t.zIndex)},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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=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._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=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"),radii:a("radii"),heightReference:a("heightReference"),fill:a("fill"),material:o("material"),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.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,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.heightReference=e(this.heightReference,t.heightReference),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,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._scale=void 0,this._scaleSubscription=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._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=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._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._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),text:o("text"),font:o("font"),style:o("style"),scale:o("scale"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor"),backgroundPadding:o("backgroundPadding"),pixelOffset:o("pixelOffset"),eyeOffset:o("eyeOffset"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),heightReference:o("heightReference"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),scaleByDistance:o("scaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.style=e(this.style,t.style),this.scale=e(this.scale,t.scale),this.showBackground=e(this.showBackground,t.showBackground),this.backgroundColor=e(this.backgroundColor,t.backgroundColor),this.backgroundPadding=e(this.backgroundPadding,t.backgroundPadding),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.heightReference=e(this.heightReference,t.heightReference),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),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),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},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];if(-1===r.indexOf(a))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-1!==this._propertyNames.indexOf(e)},c.prototype.addProperty=function(i,r,n){this._propertyNames.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&&-1===r.indexOf(s)&&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(e){return new s(e)}function d(t){this._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=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._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=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._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(d.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),uri:o("uri"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"),incrementallyLoadTextures:o("incrementallyLoadTextures"),runAnimations:o("runAnimations"),clampAnimations:o("clampAnimations"),shadows:o("shadows"),heightReference:o("heightReference"),silhouetteColor:o("silhouetteColor"),silhouetteSize:o("silhouetteSize"),color:o("color"),colorBlendMode:o("colorBlendMode"),colorBlendAmount:o("colorBlendAmount"),imageBasedLightingFactor:o("imageBasedLightingFactor"),lightColor:o("lightColor"),distanceDisplayCondition:o("distanceDisplayCondition"),nodeTransformations:o("nodeTransformations",void 0,u),articulations:o("articulations",void 0,c),clippingPlanes:o("clippingPlanes")}),d.prototype.clone=function(e){return t(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e):new d(this)},d.prototype.merge=function(i){this.show=e(this.show,i.show),this.uri=e(this.uri,i.uri),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.runAnimations=e(this.runAnimations,i.runAnimations),this.clampAnimations=e(this.clampAnimations,i.clampAnimations),this.shadows=e(this.shadows,i.shadows),this.heightReference=e(this.heightReference,i.heightReference),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),this.imageBasedLightingFactor=e(this.imageBasedLightingFactor,i.imageBasedLightingFactor),this.lightColor=e(this.lightColor,i.lightColor),this.distanceDisplayCondition=e(this.distanceDisplayCondition,i.distanceDisplayCondition),this.clippingPlanes=e(this.clippingPlanes,i.clippingPlanes);var r=i.nodeTransformations;if(t(r)){var n=this.nodeTransformations;t(n)?n.merge(r):this.nodeTransformations=new s(r,l)}var o=i.articulations;if(t(o)){var a=this.articulations;t(a)?a.merge(o):this.articulations=new s(o)}},d}),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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=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"),leadTime:a("leadTime"),trailTime:a("trailTime"),width:a("width"),resolution:a("resolution"),material:o("material"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.material=e(this.material,t.material),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PlaneGraphics",["../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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=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.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),plane:a("plane"),dimensions:a("dimensions"),fill:a("fill"),material:o("material"),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.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,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.plane=e(this.plane,t.plane),this.dimensions=e(this.dimensions,t.dimensions),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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/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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,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._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),pixelSize:o("pixelSize"),heightReference:o("heightReference"),color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.pixelSize=e(this.pixelSize,t.pixelSize),this.heightReference=e(this.heightReference,t.heightReference),this.color=e(this.color,t.color),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),
- define("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/isArray","../Core/PolygonHierarchy","./ConstantProperty","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){return o(e)&&(e=new a(e)),new s(e)}function d(t){this._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=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._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(d.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:u("show"),hierarchy:u("hierarchy",void 0,c),height:u("height"),heightReference:u("heightReference"),extrudedHeight:u("extrudedHeight"),extrudedHeightReference:u("extrudedHeightReference"),stRotation:u("stRotation"),granularity:u("granularity"),fill:u("fill"),material:l("material"),outline:u("outline"),outlineColor:u("outlineColor"),outlineWidth:u("outlineWidth"),perPositionHeight:u("perPositionHeight"),closeTop:u("closeTop"),closeBottom:u("closeBottom"),arcType:u("arcType"),shadows:u("shadows"),distanceDisplayCondition:u("distanceDisplayCondition"),classificationType:u("classificationType"),zIndex:u("zIndex")}),d.prototype.clone=function(e){return t(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,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.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new d(this)},d.prototype.merge=function(t){this.show=e(this.show,t.show),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.heightReference=e(this.heightReference,t.heightReference),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=e(this.extrudedHeightReference,t.extrudedHeightReference),this.stRotation=e(this.stRotation,t.stRotation),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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.arcType=e(this.arcType,t.arcType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=e(this.classificationType,t.classificationType),this.zIndex=e(this.zIndex,t.zIndex)},d}),define("DataSources/PolylineGraphics",["../Core/ArcType","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._definitionChanged=new o,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(t(e,t.EMPTY_OBJECT))}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:s("show"),positions:s("positions"),width:s("width"),granularity:s("granularity"),material:a("material"),depthFailMaterial:a("depthFailMaterial"),arcType:s("arcType"),clampToGround:s("clampToGround"),shadows:s("shadows"),distanceDisplayCondition:s("distanceDisplayCondition"),classificationType:s("classificationType"),zIndex:s("zIndex")}),l.prototype.clone=function(e){return i(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new l(this)},l.prototype.merge=function(e){this.show=t(this.show,e.show),this.positions=t(this.positions,e.positions),this.width=t(this.width,e.width),this.granularity=t(this.granularity,e.granularity),this.material=t(this.material,e.material),this.depthFailMaterial=t(this.depthFailMaterial,e.depthFailMaterial),this.arcType=t(this.arcType,e.arcType),this.clampToGround=t(this.clampToGround,e.clampToGround),this.shadows=t(this.shadows,e.shadows),this.distanceDisplayCondition=t(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=t(this.classificationType,e.classificationType),this.zIndex=t(this.zIndex,e.zIndex)},l}),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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=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._distanceDisplayConditionSubsription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),positions:a("positions"),shape:a("shape"),cornerType:a("cornerType"),granularity:a("granularity"),fill:a("fill"),material:o("material"),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.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,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.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.cornerType=e(this.cornerType,t.cornerType),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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/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._definitionChanged=new n,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=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._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),height:a("height"),heightReference:a("heightReference"),extrudedHeight:a("extrudedHeight"),extrudedHeightReference:a("extrudedHeightReference"),rotation:a("rotation"),stRotation:a("stRotation"),granularity:a("granularity"),fill:a("fill"),material:o("material"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition"),classificationType:a("classificationType"),zIndex:a("zIndex")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.height=e(this.height,t.height),this.heightReference=e(this.heightReference,t.heightReference),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=e(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=e(this.rotation,t.rotation),this.stRotation=e(this.stRotation,t.stRotation),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.material=e(this.material,t.material),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),this.classificationType=e(this.classificationType,t.classificationType),this.zIndex=e(this.zIndex,t.zIndex)},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._definitionChanged=new n,this._show=void 0,this._showSubscription=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._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.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),material:o("material"),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.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,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.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.material=e(this.material,t.material),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/Cartographic","../Core/Check","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","../Scene/HeightReference","../Scene/GroundPrimitive","../Scene/GroundPolylinePrimitive","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PlaneGraphics","./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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B){"use strict";function k(e){return new y(e)}function z(e,t){return b(e,void 0,function(e){return e instanceof t?e:new t(e)})}function V(e){e=n(e,n.EMPTY_OBJECT);var t=e.id;o(t)||(t=r()),this._availability=void 0,this._id=t,this._definitionChanged=new l,this._name=e.name,this._show=n(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","plane","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._plane=void 0,this._planeSubscription=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 U(e,t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n],a=o._show;(!i&&a)!==(i&&a)&&U(o,o._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}var G=new t;a(V.prototype,{availability:S("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:S("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&&U(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!o(this.entityCollection)||this.entityCollection.show)&&(!o(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(o(t)){var r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,o(e)&&e._children.push(this);var n=this.isShowing;i!==n&&U(this,this._children,n),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:z("billboard",g),box:z("box",v),corridor:z("corridor",C),cylinder:z("cylinder",T),description:b("description"),ellipse:z("ellipse",E),ellipsoid:z("ellipsoid",A),label:z("label",w),model:z("model",x),orientation:b("orientation"),path:z("path",P),plane:z("plane",D),point:z("point",I),polygon:z("polygon",M),polyline:z("polyline",R),polylineVolume:z("polylineVolume",O),properties:z("properties",N),position:function(e){return b(e,void 0,k)}("position"),rectangle:z("rectangle",F),viewFrom:b("viewFrom"),wall:z("wall",B)}),V.prototype.isAvailable=function(e){var t=this._availability;return!o(t)||t.contains(e)},V.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,S(e,!0))},V.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e]},V.prototype.merge=function(e){this.name=n(this.name,e.name),this.availability=n(this.availability,e.availability);for(var t=this._propertyNames,i=o(e._propertyNames)?e._propertyNames:Object.keys(e),r=i.length,a=0;a<r;a++){var s=i[a];if("parent"!==s){var l=this[s],u=e[s];o(l)||-1!==t.indexOf(s)||this.addProperty(s),o(u)&&(o(l)?o(l.merge)&&l.merge(u):o(u.merge)&&o(u.clone)?this[s]=u.clone():this[s]=u)}}};var H=new c,W=new e,q=new h;return V.prototype.computeModelMatrix=function(e,t){var i=L.getValueOrUndefined(this._position,e,W);if(o(i)){var r=L.getValueOrUndefined(this._orientation,e,q);return t=o(r)?d.fromRotationTranslation(c.fromQuaternion(r,H),i,t):p.eastNorthUpToFixedFrame(i,void 0,t)}},V.prototype.computeModelMatrixForHeightReference=function(t,i,r,n,a){var s=L.getValueOrDefault(i,t,f.NONE),l=L.getValueOrUndefined(this._position,t,W);if(s===f.NONE||!o(l)||e.equalsEpsilon(l,e.ZERO,u.EPSILON8))return this.computeModelMatrix(t,a);var h=n.cartesianToCartographic(l,G);s===f.CLAMP_TO_GROUND?h.height=r:h.height+=r,l=n.cartographicToCartesian(h,l);var m=L.getValueOrUndefined(this._orientation,t,q);return a=o(m)?d.fromRotationTranslation(c.fromQuaternion(m,H),l,a):p.eastNorthUpToFixedFrame(l,void 0,a)},V.supportsMaterialsforEntitiesOnTerrain=function(e){return m.supportsMaterials(e)},V.supportsPolylinesOnTerrain=function(e){return _.isSupported(e)},V}),define("DataSources/GeometryUpdater",["../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Event","../Core/Iso8601","../Core/oneTimeWarning","../Scene/ClassificationType","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./Entity","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){var t=e.entity,i=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new l,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=i,this._id=i+"-"+t.id,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=m.supportsMaterialsforEntitiesOnTerrain(e.scene)}var v=new p(t.WHITE),y=new f(!0),C=new f(!0),b=new f(!1),S=new f(t.BLACK),T=new f(h.DISABLED),E=new f(new s),A=new f(d.BOTH);return n(g.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&_.isConstant(this._showProperty)&&_.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)&&_.isConstant(this._showProperty)&&_.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}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),g.prototype.isOutlineVisible=function(e){var t=this._entity,r=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return i(r,!1)},g.prototype.isFilled=function(e){var t=this._entity,r=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return i(r,!1)},g.prototype.createFillGeometryInstance=a.throwInstantiationError,g.prototype.createOutlineGeometryInstance=a.throwInstantiationError,g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){o(this)},g.prototype._isHidden=function(e,t){var i=t.show;return r(i)&&i.isConstant&&!i.getValue(u.MINIMUM_VALUE)},g.prototype._isOnTerrain=function(e,t){return!1},g.prototype._getIsClosed=function(e){return!0},g.prototype._isDynamic=a.throwInstantiationError,g.prototype._setStaticOptions=a.throwInstantiationError,g.prototype._onEntityPropertyChanged=function(e,t,n,o){if(-1!==this._observedPropertyNames.indexOf(t)){var a=this._entity[this._geometryPropertyName];if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(u.MINIMUM_VALUE),d=a.outline,h=r(d);if(h&&d.isConstant&&(h=d.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=a.show;if(this._isHidden(e,a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));this._materialProperty=i(a.material,v),this._fillProperty=i(s,C),this._showProperty=i(f,y),this._showOutlineProperty=i(a.outline,b),this._outlineColorProperty=h?i(a.outlineColor,S):void 0,this._shadowsProperty=i(a.shadows,T),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,E),this._classificationTypeProperty=i(a.classificationType,A),this._fillEnabled=l;var m=this._isOnTerrain(e,a)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof p);if(h&&m&&(c(c.geometryOutlines),h=!1),this._onTerrain=m,this._outlineEnabled=h,this._isDynamic(e,a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,a),this._isClosed=this._getIsClosed(this._options);var _=a.outlineWidth;this._outlineWidth=r(_)?_.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}}},g.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)},g}),define("DataSources/TerrainOffsetProperty",["../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event","../Core/Iso8601","../Core/Math","../Scene/HeightReference","../Scene/SceneMode","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(i,n,o,l){this._scene=i,this._heightReference=o,this._extrudedHeightReference=l,this._positionProperty=n,this._position=new e,this._cartographicPosition=new t,this._normal=new e,this._definitionChanged=new a,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;var u=this;if(r(i.globe)&&(this._removeEventListener=i.terrainProviderChanged.addEventListener(function(){u._updateClamping()}),this._removeModeListener=i.morphComplete.addEventListener(function(){u._updateClamping()})),n.isConstant){var c=n.getValue(s.MINIMUM_VALUE,p);if(!r(c)||e.equals(c,e.ZERO)||!r(i.globe))return;this._position=e.clone(c,this._position),this._updateClamping(),this._normal=i.globe.ellipsoid.geodeticSurfaceNormal(c,this._normal)}}var p=new e,f=new t;return n(h.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),h.prototype._updateClamping=function(){function t(e){if(i.mode===c.SCENE3D){var t=a.cartesianToCartographic(e,f);l._terrainHeight=t.height}else l._terrainHeight=e.x;l.definitionChanged.raiseEvent()}r(this._removeCallbackFunc)&&this._removeCallbackFunc();var i=this._scene,n=i.globe,o=this._position;if(!r(n)||e.equals(o,e.ZERO))return void(this._terrainHeight=0);var a=n.ellipsoid,s=n._surface,l=this,u=a.cartesianToCartographic(o,this._cartographicPosition),d=n.getHeight(u);r(d)?this._terrainHeight=d:this._terrainHeight=0,this._removeCallbackFunc=s.updateHeight(u,t)},h.prototype.getValue=function(t,i){var n=d.getValueOrDefault(this._heightReference,t,u.NONE),o=d.getValueOrDefault(this._extrudedHeightReference,t,u.NONE);if(n===u.NONE&&o!==u.RELATIVE_TO_GROUND)return this._position=e.clone(e.ZERO,this._position),e.clone(e.ZERO,i);if(this._positionProperty.isConstant)return e.multiplyByScalar(this._normal,this._terrainHeight,i);var a=this._scene,s=this._positionProperty.getValue(t,p);if(!r(s)||e.equals(s,e.ZERO)||!r(a.globe))return e.clone(e.ZERO,i);if(e.equalsEpsilon(this._position,s,l.EPSILON10))return e.multiplyByScalar(this._normal,this._terrainHeight,i);this._position=e.clone(s,this._position),this._updateClamping();var c=a.globe.ellipsoid.geodeticSurfaceNormal(s,this._normal);return e.multiplyByScalar(c,this._terrainHeight,i)},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return r(this._removeEventListener)&&this._removeEventListener(),r(this._removeModeListener)&&this._removeModeListener(),r(this._removeCallbackFunc)&&this._removeCallbackFunc(),o(this)},h}),define("DataSources/heightReferenceOnEntityPropertyChanged",["../Core/defaultValue","../Core/defined","./CallbackProperty","./GeometryUpdater","./TerrainOffsetProperty"],function(e,t,i,r,n){"use strict";function o(e,o,a,s){if(r.prototype._onEntityPropertyChanged.call(this,e,o,a,s),-1!==this._observedPropertyNames.indexOf(o)){var l=this._entity[this._geometryPropertyName];if(t(l)){t(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);var u=l.heightReference;if(t(u)){var c=new i(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new n(this._scene,c,u)}}}}return o}),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/DynamicGeometryUpdater",["../Core/BoundingSphere","../Core/Check","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,i){this._primitives=t,this._orderedGroundPrimitives=i,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}return p.prototype._isHidden=function(e,t,i){return!e.isShowing||!e.isAvailable(i)||!h.getValueOrDefault(t.show,i,!0)},p.prototype._setOptions=n.throwInstantiationError,p.prototype.update=function(e){var t=this._geometryUpdater,r=t._onTerrain,n=this._primitives,u=this._orderedGroundPrimitives;r?u.remove(this._primitive):(n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0
- ;var p=this._entity,f=p[this._geometryUpdater._geometryPropertyName];if(this._setOptions(p,f,e),!this._isHidden(p,f,e)){var m=this._geometryUpdater.shadowsProperty.getValue(e),_=this._options;if(!i(f.fill)||f.fill.getValue(e)){var g,v=t.fillMaterialProperty,y=v instanceof c,C=t._getIsClosed(_);if(y)g=new s({closed:C,flat:r&&!t._supportsMaterialsforEntitiesOnTerrain});else{var b=d.getValue(e,v,this._material);this._material=b,g=new a({material:b,translucent:b.isTranslucent(),closed:C})}if(r)_.vertexFormat=s.VERTEX_FORMAT,this._primitive=u.add(new o({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:g,asynchronous:!1,shadows:m,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),h.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{_.vertexFormat=g.vertexFormat;var S=this._geometryUpdater.createFillGeometryInstance(e);y&&(g.translucent=255!==S.attributes.color.value[3]),this._primitive=n.add(new l({geometryInstances:S,appearance:g,asynchronous:!1,shadows:m}))}}if(!r&&i(f.outline)&&f.outline.getValue(e)){var T=this._geometryUpdater.createOutlineGeometryInstance(e),E=h.getValueOrDefault(f.outlineWidth,e,1);this._outlinePrimitive=n.add(new l({geometryInstances:T,appearance:new s({flat:!0,translucent:255!==T.attributes.color.value[3],renderState:{lineWidth:t._scene.clampLineWidth(E)}}),asynchronous:!1,shadows:m}))}}},p.prototype.getBoundingSphere=function(t){var r,n=this._entity,o=this._primitive,a=this._outlinePrimitive;return i(o)&&o.show&&o.ready&&(r=o.getGeometryInstanceAttributes(n),i(r)&&i(r.boundingSphere))?(e.clone(r.boundingSphere,t),u.DONE):i(a)&&a.show&&a.ready&&(r=a.getGeometryInstanceAttributes(n),i(r)&&i(r.boundingSphere))?(e.clone(r.boundingSphere,t),u.DONE):i(o)&&!o.ready||i(a)&&!a.ready?u.PENDING:u.FAILED},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){var e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),r(this)},p}),define("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./heightReferenceOnEntityPropertyChanged","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function E(e,t){b.call(this,{entity:e,scene:t,geometryOptions:new T(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function A(e,t,i){C.call(this,e,t,i)}var w=i.ZERO,x=new i,P=new i,D=new n;return a(Object.create)&&(E.prototype=Object.create(b.prototype),E.prototype.constructor=E),s(E.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),E.prototype.createFillGeometryInstance=function(t){var i=this._entity,r=i.isAvailable(t),s=new f(r&&i.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),l=this._distanceDisplayConditionProperty.getValue(t),d=u.fromDistanceDisplayCondition(l),h={show:s,distanceDisplayCondition:d,color:void 0,offset:void 0};if(this._materialProperty instanceof y){var m;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(m=this._materialProperty.color.getValue(t,D)),a(m)||(m=n.WHITE),h.color=o.fromColor(m)}return a(this._options.offsetAttribute)&&(h.offset=p.fromCartesian3(S.getValueOrDefault(this._terrainOffsetProperty,t,w,x))),new c({id:i,geometry:e.fromDimensions(this._options),modelMatrix:i.computeModelMatrixForHeightReference(t,i.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:h})},E.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,r=i.isAvailable(e),s=S.getValueOrDefault(this._outlineColorProperty,e,n.BLACK,D),l=this._distanceDisplayConditionProperty.getValue(e),d={show:new f(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o.fromColor(s),distanceDisplayCondition:u.fromDistanceDisplayCondition(l),offset:void 0};return a(this._options.offsetAttribute)&&(d.offset=p.fromCartesian3(S.getValueOrDefault(this._terrainOffsetProperty,e,w,x))),new c({id:i,geometry:t.fromDimensions(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:d})},E.prototype._computeCenter=function(e,t){return S.getValueOrUndefined(this._entity.position,e,t)},E.prototype._isHidden=function(e,t){return!a(t.dimensions)||!a(e.position)||b.prototype._isHidden.call(this,e,t)},E.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&S.isConstant(e.orientation)&&t.dimensions.isConstant&&S.isConstant(t.outlineWidth))},E.prototype._setStaticOptions=function(e,t){var i=S.getValueOrDefault(t.heightReference,h.MINIMUM_VALUE,m.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof y?g.VERTEX_FORMAT:_.MaterialSupport.TEXTURED.vertexFormat,r.dimensions=t.dimensions.getValue(h.MINIMUM_VALUE,r.dimensions),r.offsetAttribute=i!==m.NONE?d.ALL:void 0},E.prototype._onEntityPropertyChanged=v,E.DynamicGeometryUpdater=A,a(Object.create)&&(A.prototype=Object.create(C.prototype),A.prototype.constructor=A),A.prototype._isHidden=function(e,t,i){var r=S.getValueOrUndefined(e.position,i,P),n=this._options.dimensions;return!a(r)||!a(n)||C.prototype._isHidden.call(this,e,t,i)},A.prototype._setOptions=function(e,t,i){var r=S.getValueOrDefault(t.heightReference,i,m.NONE),n=this._options;n.dimensions=S.getValueOrUndefined(t.dimensions,i,n.dimensions),n.offsetAttribute=r!==m.NONE?d.ALL:void 0},E}),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/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;e._name=void 0,e._availability=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),b=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,b,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,b,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 T=C.values;for(i=0;i<T.length;i++)y.add(T[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){return e.indexOf(t)}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){t(i)?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-1!==t&&(this._collections.splice(t,1),c(this),!0)},d.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},d.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},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 b=i.length;for(d=0;d<b;d++){var S=i[d];l(this,g,v,S);var T=S.id;for(h=a-1;h>=0;h--)p=n[h].getById(T),t(p)&&(t(m)||(m=c.getById(T),t(m)?s(m):(f.id=T,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&&-1===u.propertyNames.indexOf(i)&&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)&&-1===a.indexOf(u.data)&&i.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new r,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);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("DataSources/GroundGeometryUpdater",["../Core/ApproximateTerrainHeights","../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/oneTimeWarning","../Scene/GroundPrimitive","../Scene/HeightReference","./CallbackProperty","./ConstantProperty","./GeometryUpdater","./Property","./TerrainOffsetProperty"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){f.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}var v=new p(0);return n(Object.create)&&(g.prototype=Object.create(f.prototype),g.prototype.constructor=g),o(g.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),g.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!n(t.height)&&!n(t.extrudedHeight)&&c.isSupported(this._scene)},g.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight;return 0===t||n(i)&&i!==t},g.prototype._computeCenter=a.throwInstantiationError,g.prototype._onEntityPropertyChanged=function(e,t,i,o){if(f.prototype._onEntityPropertyChanged.call(this,e,t,i,o),-1!==this._observedPropertyNames.indexOf(t)){var a=this._entity[this._geometryPropertyName];if(n(a)){n(a.zIndex)&&(n(a.height)||n(a.extrudedHeight))&&u(u.geometryZIndex),this._zIndex=r(a.zIndex,v),n(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);var s=a.heightReference,l=a.extrudedHeightReference;if(n(s)||n(l)){var c=new h(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new _(this._scene,c,s,l)}}}},g.prototype.destroy=function(){n(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),f.prototype.destroy.call(this)},g.getGeometryHeight=function(e,t){return n(e)?t!==d.CLAMP_TO_GROUND?e:0:void(t!==d.NONE&&u(u.geometryHeightReference))},g.getGeometryExtrudedHeight=function(e,t){return n(e)?t!==d.CLAMP_TO_GROUND?e:g.CLAMP_TO_GROUND:void(t!==d.NONE&&u(u.geometryExtrudedHeightReference))},g.CLAMP_TO_GROUND="clamp",g.computeGeometryOffsetAttribute=function(e,t,i,r){n(e)&&n(t)||(t=d.NONE),n(i)&&n(r)||(r=d.NONE);var o=0;return t!==d.NONE&&o++,r===d.RELATIVE_TO_GROUND&&o++,2===o?s.ALL:1===o?s.TOP:void 0},g}),define("DataSources/CorridorGeometryUpdater",["../Core/ApproximateTerrainHeights","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/Rectangle","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./GroundGeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E){"use strict";function A(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,this.offsetAttribute=void 0}function w(e,t){T.call(this,{entity:e,scene:t,geometryOptions:new A(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function x(e,t,i){b.call(this,e,t,i)}var P=new r,D=t.ZERO,I=new t,M=new f;return s(Object.create)&&(w.prototype=Object.create(T.prototype),w.prototype.constructor=w),w.prototype.createFillGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),a={show:new m(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:u.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof C){var l;s(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(l=this._materialProperty.color.getValue(e,P)),s(l)||(l=r.WHITE),a.color=n.fromColor(l)}return s(this._options.offsetAttribute)&&(a.offset=p.fromCartesian3(E.getValueOrDefault(this._terrainOffsetProperty,e,D,I))),new c({id:t,geometry:new o(this._options),attributes:a})},w.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),o=E.getValueOrDefault(this._outlineColorProperty,e,r.BLACK,P),l={show:new m(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:n.fromColor(o),distanceDisplayCondition:u.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return s(this._options.offsetAttribute)&&(l.offset=p.fromCartesian3(E.getValueOrDefault(this._terrainOffsetProperty,e,D,I))),new c({id:t,geometry:new a(this._options),attributes:l})},w.prototype._computeCenter=function(e,i){var r=E.getValueOrUndefined(this._entity.corridor.positions,e);if(s(r)&&0!==r.length)return t.clone(r[Math.floor(r.length/2)],i)},w.prototype._isHidden=function(e,t){return!s(t.positions)||!s(t.width)||S.prototype._isHidden.call(this,e,t)},w.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!E.isConstant(t.height)||!E.isConstant(t.extrudedHeight)||!E.isConstant(t.granularity)||!E.isConstant(t.width)||!E.isConstant(t.outlineWidth)||!E.isConstant(t.cornerType)||!E.isConstant(t.zIndex)||this._onTerrain&&!E.isConstant(this._materialProperty)},w.prototype._setStaticOptions=function(t,i){var r=E.getValueOrUndefined(i.height,h.MINIMUM_VALUE),n=E.getValueOrDefault(i.heightReference,h.MINIMUM_VALUE,g.NONE),a=E.getValueOrUndefined(i.extrudedHeight,h.MINIMUM_VALUE),l=E.getValueOrDefault(i.extrudedHeightReference,h.MINIMUM_VALUE,g.NONE);s(a)&&!s(r)&&(r=0);var u=this._options;u.vertexFormat=this._materialProperty instanceof C?y.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,u.positions=i.positions.getValue(h.MINIMUM_VALUE,u.positions),u.width=i.width.getValue(h.MINIMUM_VALUE),u.granularity=E.getValueOrUndefined(i.granularity,h.MINIMUM_VALUE),u.cornerType=E.getValueOrUndefined(i.cornerType,h.MINIMUM_VALUE),u.offsetAttribute=T.computeGeometryOffsetAttribute(r,n,a,l),u.height=T.getGeometryHeight(r,n),a=T.getGeometryExtrudedHeight(a,l),a===T.CLAMP_TO_GROUND&&(a=e.getMinimumMaximumHeights(o.computeRectangle(u,M)).minimumTerrainHeight),u.extrudedHeight=a},w.DynamicGeometryUpdater=x,s(Object.create)&&(x.prototype=Object.create(b.prototype),x.prototype.constructor=x),x.prototype._isHidden=function(e,t,i){var r=this._options;return!s(r.positions)||!s(r.width)||b.prototype._isHidden.call(this,e,t,i)},x.prototype._setOptions=function(t,i,r){var n=this._options,a=E.getValueOrUndefined(i.height,r),l=E.getValueOrDefault(i.heightReference,r,g.NONE),u=E.getValueOrUndefined(i.extrudedHeight,r),c=E.getValueOrDefault(i.extrudedHeightReference,r,g.NONE);s(u)&&!s(a)&&(a=0),n.positions=E.getValueOrUndefined(i.positions,r),n.width=E.getValueOrUndefined(i.width,r),n.granularity=E.getValueOrUndefined(i.granularity,r),n.cornerType=E.getValueOrUndefined(i.cornerType,r),n.offsetAttribute=T.computeGeometryOffsetAttribute(a,l,u,c),n.height=T.getGeometryHeight(a,l),u=T.getGeometryExtrudedHeight(u,c),u===T.CLAMP_TO_GROUND&&(u=e.getMinimumMaximumHeights(o.computeRectangle(n,M)).minimumTerrainHeight),n.extrudedHeight=u},w}),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/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/Transforms","./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,b),b);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,b=new i,S=new n(Math.PI,s.PI_OVER_TWO),T=new i,E=new i;f.wgs84WithEyeOffsetToWindowCoordinates=function(e,r,n,a){var C=e.frameState,b=f.computeActualWgs84Position(C,r,m);if(o(b)){var A=e.canvas,w=g;w.x=0,w.y=0,w.width=A.clientWidth,w.height=A.clientHeight;var x=e.camera,P=!1;if(C.mode===h.SCENE2D){var D=e.mapProjection,I=S,M=D.project(I,T),R=i.clone(x.position,E),O=x.frustum.clone(),L=l.computeViewportTransformation(w,0,1,new l),N=x.frustum.projectionMatrix,F=x.positionWC.y,B=i.fromElements(s.sign(F)*M.x-F,0,-x.positionWC.x),k=d.pointToGLWindowCoordinates(N,L,B);if(0===F||k.x<=0||k.x>=A.clientWidth)P=!0;else{if(k.x>.5*A.clientWidth){w.width=k.x,x.frustum.right=M.x-F,_=p(b,n,x,_),f.clipToGLWindowCoordinates(w,_,v),w.x+=k.x,x.position.x=-x.position.x;var z=x.frustum.right;x.frustum.right=-x.frustum.left,x.frustum.left=-z,_=p(b,n,x,_),f.clipToGLWindowCoordinates(w,_,y)}else{w.x+=k.x,w.width-=k.x,x.frustum.left=-M.x-F,_=p(b,n,x,_),f.clipToGLWindowCoordinates(w,_,v),w.x=w.x-w.width,x.position.x=-x.position.x;var V=x.frustum.left;x.frustum.left=-x.frustum.right,x.frustum.right=-V,_=p(b,n,x,_),f.clipToGLWindowCoordinates(w,_,y)}i.clone(R,x.position),x.frustum=O.clone(),a=t.clone(v,a),(a.x<0||a.x>A.clientWidth)&&(a.x=y.x)}}if(C.mode!==h.SCENE2D||P){if(_=p(b,n,x,_),_.z<0&&!(x.frustum instanceof u)&&!(x.frustum instanceof c))return;a=f.clipToGLWindowCoordinates(w,_,a)}return a.y=A.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 A=new i,w=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,w);if(o(l)){if(a.project(l,A),n===h.COLUMBUS_VIEW)return i.fromElements(A.z,A.x,A.y,r);if(n===h.SCENE2D)return i.fromElements(0,A.x,A.y,r);var u=e.morphTime;return i.fromElements(s.lerp(A.z,t.x,u),s.lerp(A.x,t.y,u),s.lerp(A.y,t.z,u),r)}};var x=new i,P=new i,D=new l;f.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,x),l.computeViewportTransformation(e,0,1,D),l.multiplyByPoint(D,x,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 I=new r,M=new r;return f.drawingBufferToWgs84Coordinates=function(e,t,n,a){var u=e.context,c=u.uniformState,d=c.currentFrustum,h=d.x,p=d.y;e.frameState.useLogDepth&&(n=Math.pow(2,n*s.log2(p+1))-1,n=p*(1-h/n)/(p-h));var f=e._view.passState.viewport,m=r.clone(r.UNIT_W,I);m.x=(t.x-f.x)/f.width*2-1,m.y=(t.y-f.y)/f.height*2-1,m.z=2*n-1,m.w=1;var _,g=e.camera.frustum;if(o(g.fovy)){_=l.multiplyByVector(c.inverseViewProjection,m,M);var v=1/_.w;i.multiplyByScalar(_,v,_)}else o(g._offCenterFrustum)&&(g=g._offCenterFrustum),_=M,_.x=.5*(m.x*(g.right-g.left)+g.left+g.right),_.y=.5*(m.y*(g.top-g.bottom)+g.bottom+g.top),_.z=.5*(m.z*(h-p)-h-p),_.w=1,_=l.multiplyByVector(c.inverseView,_,_);return i.fromCartesian4(_,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","../Core/Resource","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],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,r){e=s(e,s.EMPTY_OBJECT);var n=e.translucencyByDistance,u=e.pixelOffsetScaleByDistance,c=e.scaleByDistance,h=e.distanceDisplayCondition;l(n)&&(n=p.clone(n)),l(u)&&(u=p.clone(u)),l(c)&&(c=p.clone(c)),l(h)&&(h=d.clone(h)),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,m.NONE),this._verticalOrigin=s(e.verticalOrigin,y.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,_.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=c,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=u,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=h,this._disableDepthTestDistance=e.disableDepthTestDistance,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._batchIndex=void 0,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,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;var f=e.image,v=e.imageId;l(f)&&(l(v)||(v="string"==typeof f?f:l(f.src)?f.src:a()),this._imageId=v,this._image=f),l(e.imageSubRegion)&&(this._imageId=v,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=g.SCENE3D,this._clusterShow=!0,this._outlineColor=o.clone(s(e.outlineColor,o.BLACK)),this._outlineWidth=s(e.outlineWidth,0),this._updateClamping()}function b(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var S=C.SHOW_INDEX=0,T=C.POSITION_INDEX=1,E=C.PIXEL_OFFSET_INDEX=2,A=C.EYE_OFFSET_INDEX=3,w=C.HORIZONTAL_ORIGIN_INDEX=4,x=C.VERTICAL_ORIGIN_INDEX=5,P=C.SCALE_INDEX=6,D=C.IMAGE_INDEX_INDEX=7,I=C.COLOR_INDEX=8,M=C.ROTATION_INDEX=9,R=C.ALIGNED_AXIS_INDEX=10,O=C.SCALE_BY_DISTANCE_INDEX=11,L=C.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=C.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,F=C.DISTANCE_DISPLAY_CONDITION=14,B=C.DISABLE_DEPTH_DISTANCE=15;C.TEXTURE_COORDINATE_BOUNDS=16;var k=C.SDF_INDEX=17;C.NUMBER_OF_PROPERTIES=18,u(C.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,b(this,S))}},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(),b(this,T))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),b(this,T))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),b(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),b(this,O))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),b(this,L))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),b(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),b(this,A))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,b(this,w))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,b(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,b(this,P))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),b(this,I))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,b(this,M))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),b(this,R))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,b(this,D))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,b(this,D))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,b(this,I))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){d.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=d.clone(e,this._distanceDisplayCondition),b(this,F))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,b(this,B))}},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)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):e instanceof f?this.setImage(e.url,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,b(this,D))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),b(this,T)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,b(this,S))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;o.equals(t,e)||(o.clone(e,t),b(this,k))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,b(this,k))}}}),C.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},C.prototype._updateClamping=function(){C._updateClamping(this._billboardCollection,this)};var z=new n,V=new i;C._updateClamping=function(e,t){function r(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===g.SCENE3D){var r=s.cartesianToCartographic(e,z);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)&&l(o.globe)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,d=c!==t._mode;if(t._mode=c,(t._heightReference===m.NONE||d)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var h=s.cartesianToCartographic(t._position);if(!l(h))return void(t._actualClampedPosition=void 0);l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(h,r),n.clone(h,z);var p=a.getHeight(h);l(p)&&(z.height=p),s.cartographicToCartesian(z,V),r(V)}}},C.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,b(a,D)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},C.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())},C.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())},C.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),b(this,E))},C.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},C.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),b(this,T)};var U=new r;C._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===g.SCENE3D?t:(h.multiplyByPoint(r,t,U),v.computeActualWgs84Position(i,U))};var G=new i;C._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=h.multiplyByPoint(e,i,G),u=v.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var H=new t(0,0);return C.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,H),t.add(H,this._translate,H);var n=r.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==g.SCENE3D)){var a=e.mapProjection,s=a.ellipsoid,u=a.unproject(o,z);o=s.cartographicToCartesian(u,G),n=h.IDENTITY}return C._computeScreenSpacePosition(n,o,this._eyeOffset,H,e,i)},C.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===_.RIGHT?s-=n:t.horizontalOrigin===_.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===y.BOTTOM||t.verticalOrigin===y.BASELINE?u-=o:t.verticalOrigin===y.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},C.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)&&this._disableDepthTestDistance===r._disableDepthTestDistance},C.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},C}),define("Renderer/VertexArrayFacade",["../Core/Check","../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,u){"use strict";function c(e,n,o,a){function s(e,i){return t.getSizeInBytes(i.componentDatatype)-t.getSizeInBytes(e.componentDatatype)}var l=c._verifyAttributes(n);o=i(o,0);for(var u,d,h=[],p={},f=l.length,m=0;m<f;++m){var _=l[m];_.vertexBuffer?h.push(_):(d=_.usage,u=p[d],r(u)||(u=p[d]=[]),u.push(_))}this._allBuffers=[];for(d in p)if(p.hasOwnProperty(d)){u=p[d],u.sort(s);var g=c._vertexSizeInBytes(u),v=u[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:v,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(u,g)};this._allBuffers.push(y)}this._size=0,this._instanced=i(a,!1),this._precreated=h,this._context=e,this.writers=void 0,this.va=void 0,this.resize(o)}function d(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=r(i);if(!o||i.sizeInBytes<n)return o&&i.destroy(),t.vertexBuffer=s.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function h(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function p(e){var t=e.va;if(r(t)){for(var i=t.length,n=0;n<i;++n)t[n].va.destroy();e.va=void 0}}c._verifyAttributes=function(e){for(var r=[],n=0;n<e.length;++n){var o=e[n],a={index:i(o.index,n),enabled:i(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:i(o.componentDatatype,t.FLOAT),normalize:i(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:i(o.usage,l.STATIC_DRAW)};r.push(a)}for(var s=new Array(r.length),u=0;u<r.length;++u){s[r[u].index]=!0}return r},c._vertexSizeInBytes=function(e){for(var i=0,r=e.length,n=0;n<r;++n){var o=e[n];i+=o.componentsPerAttribute*t.getSizeInBytes(o.componentDatatype)}var a=r>0?t.getSizeInBytes(e[0].componentDatatype):0,s=a>0?i%a:0;return i+=0===s?0:a-s},c._createArrayViews=function(e,i){for(var r=[],n=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;r.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:i/t.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*t.getSizeInBytes(l)}return r},c.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];c._resize(n,this._size),c._appendWriters(this.writers,n)}p(this)},c._resize=function(e,i){if(e.vertexSizeInBytes>0){var n=new ArrayBuffer(i*e.vertexSizeInBytes);if(r(e.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length,l=0;l<s;++l)o[l]=a[l];for(var u=e.arrayViews,c=u.length,d=0;d<c;++d){var h=u[d];h.view=t.createArrayBufferView(h.componentDatatype,n,h.offsetInBytes)}e.arrayBuffer=n}};var f=[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 c._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;n<r;++n){var o=i[n];e[o.index]=f[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){var t,i,n,o=!1,s=this._allBuffers;for(i=0,n=s.length;i<n;++i)t=s[i],o=d(this,t)||o;if(o||!r(this.va)){p(this);for(var l=this.va=[],h=r(e)?Math.ceil(this._size/(a.SIXTY_FOUR_KILOBYTES-1)):1,f=0;f<h;++f){var m=[];for(i=0,n=s.length;i<n;++i){t=s[i];var _=f*(t.vertexSizeInBytes*(a.SIXTY_FOUR_KILOBYTES-1));c._appendAttributes(m,t,_,this._instanced)}m=m.concat(this._precreated),l.push({va:new u({context:this._context,attributes:m,indexBuffer:e}),indicesCount:1.5*(f!==h-1?a.SIXTY_FOUR_KILOBYTES-1:this._size%(a.SIXTY_FOUR_KILOBYTES-1))})}}},c._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})}},c.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;r<n;++r)h(i[r],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t){var r=e[t];r.vertexBuffer=r.vertexBuffer&&r.vertexBuffer.destroy()}return p(this),n(this)},c}),define("Shaders/BillboardCollectionFS",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D u_atlas;\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying vec2 v_textureCoordinates;\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;\nvarying mat2 v_rotationMatrix;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\n{\nvec2 lookupVector = imageSize * (depthLookupST - adjustedST);\nlookupVector = v_rotationMatrix * lookupVector;\nvec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y));\nvec2 translation = v_originTextureCoordinateAndTranslate.zw;\nif (applyTranslate)\n{\ntranslation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\n}\nvec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));\nif (logDepthOrDepth == 0.0)\n{\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\n#ifdef SDF\nfloat getDistance(vec2 position)\n{\nreturn texture2D(u_atlas, position).r;\n}\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\n{\nfloat distance = getDistance(position);\nif (outlineWidth > 0.0)\n{\nfloat outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\nfloat outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\nvec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\nfloat alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\nreturn vec4(sdfColor.rgb, sdfColor.a * alpha);\n}\nelse\n{\nfloat alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\nreturn vec4(v_color.rgb, v_color.a * alpha);\n}\n}\n#endif\nvoid main()\n{\nvec4 color = texture2D(u_atlas, v_textureCoordinates);\n#ifdef SDF\nfloat outlineWidth = v_outlineWidth;\nvec4 outlineColor = v_outlineColor;\nfloat distance = getDistance(v_textureCoordinates);\n#ifdef GL_OES_standard_derivatives\nfloat smoothing = fwidth(distance);\nvec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\nvec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\nvec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\ncolor = (center + color1 + color2 + color3 + color4)/5.0;\n#else\nfloat smoothing = 1.0/32.0;\ncolor = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n#endif\ncolor = czm_gammaCorrect(color);\n#else\ncolor = czm_gammaCorrect(color);\ncolor *= czm_gammaCorrect(v_color);\n#endif\n#if !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 VECTOR_TILE\ncolor *= u_highlightColor;\n#endif\ngl_FragColor = color;\nczm_writeLogDepth();\n#ifdef FRAGMENT_DEPTH_CHECK\nfloat temp = v_compressed.y;\ntemp = temp * SHIFT_RIGHT1;\nfloat temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\nbool enableDepthTest = temp2 != 0.0;\nbool applyTranslate = floor(temp) != 0.0;\nif (enableDepthTest) {\ntemp = v_compressed.z;\ntemp = temp * SHIFT_RIGHT12;\nvec2 dimensions;\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\ndimensions.x = floor(temp);\ntemp = v_compressed.w;\ntemp = temp * SHIFT_RIGHT12;\nvec2 imageSize;\nimageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\nimageSize.x = floor(temp);\nvec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\nadjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\nfloat epsilonEyeDepth = v_compressed.x + czm_epsilon1;\nfloat globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\nif (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\n{\nfloat globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);\nif (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\n{\nfloat globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);\nif (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\n{\ndiscard;\n}\n}\n}\n}\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 vec4 compressedAttribute3;\nattribute vec2 sdf;\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\nattribute vec4 textureCoordinateBoundsOrLabelTranslate;\n#endif\n#ifdef VECTOR_TILE\nattribute float a_batchId;\n#endif\nvarying vec2 v_textureCoordinates;\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;\nvarying mat2 v_rotationMatrix;\n#endif\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT12 = 4096.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_RIGHT12 = 1.0 / 4096.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 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)\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{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nrotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\nelse\n{\nrotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nmpp = czm_metersPerPixel(positionEC);\nif (!sizeInMeters)\n{\noriginTranslate *= mpp;\n}\npositionEC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionEC.xy += halfSize * mpp;\n}\npositionEC.xy += translate * mpp;\npositionEC.xy += (pixelOffset * czm_resolutionScale) * mpp;\nreturn positionEC;\n}\n#ifdef VERTEX_DEPTH_CHECK\nfloat getGlobeDepth(vec4 positionEC)\n{\nvec4 posWC = czm_eyeToWindowCoordinates(positionEC);\nfloat globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\nif (globeDepth == 0.0)\n{\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\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;\n#ifdef FRAGMENT_DEPTH_CHECK\nvec2 depthOrigin = origin.xy;\n#endif\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;\nfloat temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\nvec2 imageSize = vec2(floor(temp), temp2);\n#ifdef FRAGMENT_DEPTH_CHECK\nfloat labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\nfloat applyTranslate = 0.0;\nif (labelHorizontalOrigin != 0.0)\n{\napplyTranslate = 1.0;\nlabelHorizontalOrigin -= 2.0;\ndepthOrigin.x = labelHorizontalOrigin + 1.0;\n}\ndepthOrigin = vec2(1.0) - (depthOrigin * 0.5);\n#endif\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#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\ntemp = compressedAttribute3.w;\ntemp = temp * SHIFT_RIGHT12;\nvec2 dimensions;\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\ndimensions.x = floor(temp);\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\nvec4 pickColor;\nvec4 color;\ntemp = compressedAttribute2.y;\ntemp = temp * 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);\ntemp = compressedAttribute2.x;\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;\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\nfloat eyeDepth = positionEC.z;\n#endif\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) || defined(DISABLE_DEPTH_DISTANCE)\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 = compressedAttribute3.x;\nfloat farSq = compressedAttribute3.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nmat2 rotationMatrix;\nfloat mpp;\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = compressedAttribute3.z;\n#endif\n#ifdef VERTEX_DEPTH_CHECK\nif (lengthSq < disableDepthTestDistance) {\nfloat depthsilon = 10.0;\nvec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\nvec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth1 = getGlobeDepth(pEC1);\nif (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\n{\nvec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth2 = getGlobeDepth(pEC2);\nif (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\n{\nvec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth3 = getGlobeDepth(pEC3);\nif (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\n{\npositionEC.xyz = vec3(0.0);\n}\n}\n}\n}\n#endif\npositionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\ngl_Position = czm_projection * positionEC;\nv_textureCoordinates = textureCoordinates;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth();\n#endif\n#ifdef DISABLE_DEPTH_DISTANCE\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(vec4(czm_currentFrustum.x));\n#endif\n}\n}\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nif (sizeInMeters) {\ntranslate /= mpp;\ndimensions /= mpp;\nimageSize /= mpp;\n}\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nv_rotationMatrix = rotationMatrix;\n#else\nv_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n#endif\nfloat enableDepthCheck = 0.0;\nif (lengthSq < disableDepthTestDistance)\n{\nenableDepthCheck = 1.0;\n}\nfloat dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\nfloat dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\nfloat iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\nfloat ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\nv_compressed.x = eyeDepth;\nv_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\nv_compressed.z = dw * SHIFT_LEFT12 + dh;\nv_compressed.w = iw * SHIFT_LEFT12 + ih;\nv_originTextureCoordinateAndTranslate.xy = depthOrigin;\nv_originTextureCoordinateAndTranslate.zw = translate;\nv_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\n#endif\n#ifdef SDF\nvec4 outlineColor;\nfloat outlineWidth;\ntemp = sdf.x;\ntemp = temp * 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);\ntemp = sdf.y;\ntemp = temp * SHIFT_RIGHT8;\nfloat temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.a = floor(temp);\noutlineColor /= 255.0;\nv_outlineWidth = outlineWidth / 255.0;\nv_outlineColor = outlineColor;\n#endif\nv_pickColor = pickColor;\nv_color = color;\nv_color.a *= translucency;\n}\n"}),define("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";return e({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2})}),define("Scene/SDFSettings",["../Core/freezeObject"],function(e){"use strict";return e({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25})}),define("Renderer/Framebuffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits","./PixelDatatype"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function c(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function d(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl;s.maximumColorAttachments;this._gl=n,this._framebuffer=n.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=t(e.destroyAttachments,!0);i(e.depthTexture)||i(e.depthRenderbuffer),i(e.depthStencilTexture)||i(e.depthStencilRenderbuffer);this._bind();var o,a,l,d,h;if(i(e.colorTextures)){var p=e.colorTextures;for(d=this._colorTextures.length=this._activeColorAttachments.length=p.length,l=0;l<d;++l)o=p[l],h=this._gl.COLOR_ATTACHMENT0+l,u(this,h,o),this._activeColorAttachments[l]=h,this._colorTextures[l]=o}if(i(e.colorRenderbuffers)){var f=e.colorRenderbuffers;for(d=this._colorRenderbuffers.length=this._activeColorAttachments.length=f.length,l=0;l<d;++l)a=f[l],h=this._gl.COLOR_ATTACHMENT0+l,c(this,h,a),this._activeColorAttachments[l]=h,this._colorRenderbuffers[l]=a}i(e.depthTexture)&&(o=e.depthTexture,u(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o),i(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,c(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),i(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,c(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),i(e.depthStencilTexture)&&(o=e.depthStencilTexture,u(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o),i(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,c(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}return r(d.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)}}}),d.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},d.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},d.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},d.prototype.getColorTexture=function(e){return this._colorTextures[e]},d.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,t=this._colorTextures,r=t.length;e<r;++e){var o=t[e];i(o)&&o.destroy()}var a=this._colorRenderbuffers;for(r=a.length,e=0;e<r;++e){var s=a[e];i(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),n(this)},d}),define("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","../Core/Resource","../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,l.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=e._borderWidthInPixels;if(o>0){for(var s=e._texture.width,l=e._texture.height,u=2*(s+i.width+a),c=2*(l+i.height+a),p=s/u,m=l/c,_=new f(new t(s+a,a),new t(u,l)),g=new f(new t,new t(u,l),e._root,_),v=new f(new t(a,l+a),new t(u,c)),y=new f(new t,new t(u,c),g,v),C=0;C<e._textureCoordinates.length;C++){var b=e._textureCoordinates[C];n(b)&&(b.x*=p,b.y*=m,b.width*=p,b.height*=m)}var S=new h({context:e._context,width:u,height:c,pixelFormat:e._pixelFormat}),T=new d({context:r,colorTextures:[e._texture],destroyAttachments:!1});T._bind(),S.copyFromFramebuffer(0,0,0,0,u,c),T._unBind(),T.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=S,e._root=y}else{var E=2*(i.width+2*a),A=2*(i.height+2*a);E<e._initialSize.x&&(E=e._initialSize.x),A<e._initialSize.y&&(A=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new h({context:e._context,width:E,height:A,pixelFormat:e._pixelFormat}),e._root=new f(new t(a,a),new t(E,A))}}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;if("function"==typeof t)t=t(e);else if("string"==typeof t||t instanceof u){var r=u.createIfNeeded(t);t=r.fetchImage()}var o=this;return i=p(t,function(e){if(o.isDestroyed())return-1;var t=o.numberOfImages;return v(o,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(-1===t)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/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./BlendOption","./HeightReference","./HorizontalOrigin","./SceneMode","./SDFSettings","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N){"use strict";function F(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=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._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(Ee),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.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=a(e.debugShowTextureAtlas,!1),this.blendOption=a(e.blendOption,D.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=R.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,g.STATIC_DRAW],this._highlightColor=n.clone(n.WHITE);var i=this;this._uniforms={u_atlas:function(){return i._textureAtlas.texture},u_highlightColor:function(){return i._highlightColor}};var r=this._scene;s(r)&&s(r.terrainProviderChanged)&&(this._removeCallbackFunc=r.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)e[i]._updateClamping()},this))}function B(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function k(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 z(e){var t=e.cache.billboardCollection_indexBufferBatched;if(s(t))return t;for(var i=new Uint16Array(98298),r=0,n=0;r<98298;r+=6,n+=4)i[r]=n,i[r+1]=n+1,i[r+2]=n+2,i[r+3]=n+0,i[r+4]=n+2,i[r+5]=n+3;return t=_.createIndexBuffer({context:e,typedArray:i,usage:g.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function V(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=_.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:g.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function U(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 G(e,t,i,r,n,a){var l=[{index:oe.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[se]},{index:oe.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[se]},{index:oe.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[le]},{index:oe.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ve]},{index:oe.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[fe]},{index:oe.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ue]},{index:oe.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ge]},{index:oe.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ye]},{index:oe.compressedAttribute3,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[Ce]},{index:oe.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[Se]}];return r&&l.push({index:oe.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:U(e)}),s(n)&&l.push({index:oe.a_batchId,componentsPerAttribute:1,componentDatatyps:o.FLOAT,bufferUsage:g.STATIC_DRAW}),a&&l.push({index:oe.sdf,componentsPerAttribute:2,componentDatatype:o.FLOAT,usage:i[Te]}),new E(e,l,r?t:4*t,r)}function H(e,i,r,n,o){var a,s=n[oe.positionHighAndScale],l=n[oe.positionLowAndRotation],u=o._getActualPosition();e._mode===R.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),d.fromCartesian(u,Pe);var c=o.scale,h=o.rotation;0!==h&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=Pe.high,f=Pe.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 W(t,i,r,n,o){var a,s=n[oe.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),_===N.BASELINE&&(_=N.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&m===M.CENTER,t._allVerticalCenter=t._allVerticalCenter&&_===N.CENTER;var v=0,y=0,C=0,b=0,S=o._imageIndex;if(-1!==S){var T=r[S];v=T.x,y=T.y,C=T.width,b=T.height}var E=v+C,A=y+b,w=Math.floor(p.clamp(u,-Ie,Ie)+Ie)*Le;w+=(m+1)*Ne,w+=(_+1)*Fe,w+=(g?1:0)*Be;var x=Math.floor(p.clamp(c,-Ie,Ie)+Ie)*Oe,P=Math.floor(p.clamp(h,-Ie,Ie)+Ie)*Oe,D=(p.clamp(f,-Ie,Ie)+Ie)*ke,I=Math.floor(D),R=Math.floor((D-I)*Oe);x+=I,P+=R,De.x=v,De.y=y;var O=e.compressTextureCoordinates(De);De.x=E;var L=e.compressTextureCoordinates(De);De.y=A;var F=e.compressTextureCoordinates(De);De.x=v;var B=e.compressTextureCoordinates(De);t._instanced?(a=o._index,s(a,w,x,P,O)):(a=4*o._index,s(a+0,w+ze,x,P,O),s(a+1,w+Ve,x,P,L),s(a+2,w+Ue,x,P,F),s(a+3,w+Ge,x,P,B))}function q(t,i,n,o,l){var u,c=o[oe.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(-1!==y){v=n[y].width}var C=t._textureAtlas.texture.width,b=Math.round(a(l.width,C*v));t._maxSize=Math.max(t._maxSize,b);var S=p.clamp(b,0,Me),T=0;Math.abs(r.magnitudeSquared(d)-1)<p.EPSILON6&&(T=e.octEncodeFloat(d)),f=p.clamp(f,0,1),f=1===f?255:255*f|0,S=S*Oe+f,_=p.clamp(_,0,1),_=1===_?255:255*_|0,T=T*Oe+_,t._instanced?(u=l._index,c(u,S,T,h,m)):(u=4*l._index,c(u+0,S,T,h,m),c(u+1,S,T,h,m),c(u+2,S,T,h,m),c(u+3,S,T,h,m))}function Y(e,t,i,o,l){var u,c=o[oe.compressedAttribute2],d=l.color,h=s(e._batchTable)?n.WHITE:l.getPickId(t).color,f=l.sizeInMeters?1:0,m=Math.abs(r.magnitudeSquared(l.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===f;var _=0,g=l._imageIndex;if(-1!==g){_=i[g].height}var v=e._textureAtlas.texture.dimensions,y=Math.round(a(l.height,v.y*_));e._maxSize=Math.max(e._maxSize,y);var C=a(l._labelHorizontalOrigin,-2);C+=2;var b=y*Be+C,S=n.floatToByte(d.red),T=n.floatToByte(d.green),E=n.floatToByte(d.blue),A=S*Me+T*Oe+E;S=n.floatToByte(h.red),T=n.floatToByte(h.green),E=n.floatToByte(h.blue);var w=S*Me+T*Oe+E,x=n.floatToByte(d.alpha)*Me+n.floatToByte(h.alpha)*Oe;x+=2*f+m,e._instanced?(u=l._index,c(u,A,w,x,b)):(u=4*l._index,c(u+0,A,w,x,b),c(u+1,A,w,x,b),c(u+2,A,w,x,b),c(u+3,A,w,x,b))}function j(t,i,r,n,o){var a,s=n[oe.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==I.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(-1!==h){var p=r[h];c=p.width,d=p.height}De.x=c,De.y=d;var f=e.compressTextureCoordinates(De);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 X(e,t,i,r,n){var o,a=r[oe.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 Q(e,t,i,r,n){var o,a=r[oe.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 K(e,t,i,r,n){var o,l=r[oe.compressedAttribute3],u=0,c=Number.MAX_VALUE,d=n.distanceDisplayCondition;s(d)&&(u=d.near,c=d.far,u*=u,c*=c,e._shaderDistanceDisplayCondition=!0);var h=n.disableDepthTestDistance,f=n.heightReference===I.CLAMP_TO_GROUND&&e._scene.context.depthTexture;s(h)||(h=f?5e3:0),h*=h,(f||h>0)&&(e._shaderDisableDepthDistance=!0,h===Number.POSITIVE_INFINITY&&(h=-1));var m,_;if(s(n._labelDimensions))_=n._labelDimensions.x,m=n._labelDimensions.y;else{var g=0,v=0,y=n._imageIndex;if(-1!==y){var C=i[y];g=C.height,v=C.width}m=Math.round(a(n.height,e._textureAtlas.texture.dimensions.y*g));var b=e._textureAtlas.texture.width;_=Math.round(a(n.width,b*v))}var S=Math.floor(p.clamp(_,0,Re)),T=Math.floor(p.clamp(m,0,Re)),E=S*Re+T;e._instanced?(o=n._index,l(o,u,c,h,E)):(o=4*n._index,l(o+0,u,c,h,E),l(o+1,u,c,h,E),l(o+2,u,c,h,E),l(o+3,u,c,h,E))}function Z(e,t,i,r,n){
- n.heightReference===I.CLAMP_TO_GROUND&&(e._shaderClampToGround=e._scene.context.depthTexture);var o,a=r[oe.textureCoordinateBoundsOrLabelTranslate];if(v.maximumVertexTextureImageUnits>0){var l=0,u=0;return s(n._labelTranslate)&&(l=n._labelTranslate.x,u=n._labelTranslate.y),void(e._instanced?(o=n._index,a(o,l,u,0,0)):(o=4*n._index,a(o+0,l,u,0,0),a(o+1,l,u,0,0),a(o+2,l,u,0,0),a(o+3,l,u,0,0)))}var c=0,d=0,h=0,p=0,f=n._imageIndex;if(-1!==f){var m=i[f];c=m.x,d=m.y,h=m.width,p=m.height}var _=c+h,g=d+p;e._instanced?(o=n._index,a(o,c,d,_,g)):(o=4*n._index,a(o+0,c,d,_,g),a(o+1,c,d,_,g),a(o+2,c,d,_,g),a(o+3,c,d,_,g))}function J(e,t,i,r,n){if(s(e._batchTable)){var o,a=r[oe.a_batchId],l=n._batchIndex;e._instanced?(o=n._index,a(o,l)):(o=4*n._index,a(o+0,l),a(o+1,l),a(o+2,l),a(o+3,l))}}function $(e,t,i,r,o){if(e._sdf){var a,s=r[oe.sdf],l=o.outlineColor,u=o.outlineWidth,c=n.floatToByte(l.red),d=n.floatToByte(l.green),h=n.floatToByte(l.blue),p=c*Me+d*Oe+h,f=u/O.RADIUS,m=n.floatToByte(l.alpha)*Me+n.floatToByte(f)*Oe;e._instanced?(a=o._index,s(a,p,m)):(a=4*o._index,s(a+0,p+ze,m),s(a+1,p+Ve,m),s(a+2,p+Ue,m),s(a+3,p+Ge,m))}}function ee(e,t,i,r,n){H(e,t,i,r,n),W(e,t,i,r,n),q(e,t,i,r,n),Y(e,t,i,r,n),j(e,t,i,r,n),X(e,t,i,r,n),Q(e,t,i,r,n),K(e,t,i,r,n),Z(e,t,i,r,n),J(e,t,i,r,n),$(e,t,i,r,n)}function te(e,i,r,n,o,a){var l;n.mode===R.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 ie(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==R.SCENE3D&&!f.equals(o,e.modelMatrix)?(e._mode=i,f.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==R.SCENE3D&&i!==R.SCENE2D&&i!==R.COLUMBUS_VIEW||te(e,r,r.length,t,o,!0)):i===R.MORPHING?te(e,r,r.length,t,o,!0):i!==R.SCENE2D&&i!==R.COLUMBUS_VIEW||te(e,n,e._billboardsToUpdateIndex,t,o,!1)}function re(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}function ne(e,t){var i;i="uniform sampler2D billboard_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n gl_FragColor = texture2D(billboard_texture, v_textureCoordinates); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return r.pass=C.OVERLAY,r}var oe,ae=x.SHOW_INDEX,se=x.POSITION_INDEX,le=x.PIXEL_OFFSET_INDEX,ue=x.EYE_OFFSET_INDEX,ce=x.HORIZONTAL_ORIGIN_INDEX,de=x.VERTICAL_ORIGIN_INDEX,he=x.SCALE_INDEX,pe=x.IMAGE_INDEX_INDEX,fe=x.COLOR_INDEX,me=x.ROTATION_INDEX,_e=x.ALIGNED_AXIS_INDEX,ge=x.SCALE_BY_DISTANCE_INDEX,ve=x.TRANSLUCENCY_BY_DISTANCE_INDEX,ye=x.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Ce=x.DISTANCE_DISPLAY_CONDITION,be=x.DISABLE_DEPTH_DISTANCE,Se=x.TEXTURE_COORDINATE_BOUNDS,Te=x.SDF_INDEX,Ee=x.NUMBER_OF_PROPERTIES,Ae={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},we={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};l(F.prototype,{length:{get:function(){return k(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}}}),F.prototype.add=function(e){var t=new x(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},F.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},F.prototype.removeAll=function(){B(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},F.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},F.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},F.prototype.get=function(e){return k(this),this._billboards[e]};var xe;F.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<Ee;++r){var n=0===i[r]?g.STATIC_DRAW:g.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var Pe=new d,De=new i,Ie=32768,Me=65536,Re=4096,Oe=256,Le=128,Ne=32,Fe=8,Be=4,ke=1/256,ze=0,Ve=2,Ue=3,Ge=1,He=[];return F.prototype.update=function(e){k(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,oe=this._instanced?we:Ae,xe=this._instanced?V:z;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new L({context:n});for(var a=0;a<r;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){ie(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<Ee;++x)d[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=G(n,r,this._buffersUsage,this._instanced,this._batchTable,this._sdf),_=this._vaf.writers;for(var I=0;I<r;++I){var M=this._billboards[I];M._dirty=!1,ee(this,n,l,_,M)}this._vaf.commit(xe(n))}this._billboardsToUpdateIndex=0}else if(c>0){var N=He;N.length=0,(d[se]||d[me]||d[he])&&N.push(H),(d[pe]||d[le]||d[ce]||d[de]||d[ae])&&(N.push(W),this._instanced&&N.push(j)),(d[pe]||d[_e]||d[ve])&&(N.push(q),N.push(Y)),(d[pe]||d[fe])&&N.push(Y),d[ue]&&N.push(j),d[ge]&&N.push(X),d[ye]&&N.push(Q),(d[Ce]||d[be]||d[pe]||d[se])&&N.push(K),(d[pe]||d[se])&&N.push(Z),d[Te]&&N.push($);var F=N.length;if(_=this._vaf.writers,c/r>.1){for(var B=0;B<c;++B){var U=u[B];U._dirty=!1;for(var J=0;J<F;++J)N[J](this,n,l,_,U)}this._vaf.commit(xe(n))}else{for(var te=0;te<c;++te){var Se=u[te];Se._dirty=!1;for(var Pe=0;Pe<F;++Pe)N[Pe](this,n,l,_,Se);this._instanced?this._vaf.subCommit(Se._index,1):this._vaf.subCommit(4*Se._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 De,Ie=f.IDENTITY;e.mode===R.SCENE3D?(Ie=this.modelMatrix,De=t.clone(this._baseVolumeWC,this._boundingVolume)):De=t.clone(this._baseVolume2D,this._boundingVolume),re(this,e,De);var Me=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,Me){this._blendOption===D.OPAQUE||this._blendOption===D.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=b.fromCache({depthTest:{enabled:!0,func:m.LESS},depthMask:!0}):this._rsOpaque=void 0;var Re=this._blendOption===D.TRANSLUCENT;this._blendOption===D.TRANSLUCENT||this._blendOption===D.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=b.fromCache({depthTest:{enabled:!0,func:Re?m.LEQUAL:m.LESS},depthMask:Re,blending:P.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;var Oe,Le,Ne,Fe,Be,ke=v.maximumVertexTextureImageUnits>0;if(Me||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){Oe=w,Le=A,Be=[],s(this._batchTable)&&(Be.push("VECTOR_TILE"),Oe=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(Oe),Le=this._batchTable.getFragmentShaderCallback(!1,void 0)(Le)),Ne=new T({defines:Be,sources:[Oe]}),this._instanced&&Ne.defines.push("INSTANCED"),this._shaderRotation&&Ne.defines.push("ROTATION"),this._shaderAlignedAxis&&Ne.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Ne.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Ne.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Ne.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Ne.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Ne.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(ke?Ne.defines.push("VERTEX_DEPTH_CHECK"):Ne.defines.push("FRAGMENT_DEPTH_CHECK"));var ze=1-O.CUTOFF;this._sdf&&Ne.defines.push("SDF");var Ve=s(this._batchTable)?"VECTOR_TILE":"";this._blendOption===D.OPAQUE_AND_TRANSLUCENT&&(Fe=new T({defines:["OPAQUE",Ve],sources:[Le]}),this._shaderClampToGround&&(ke?Fe.defines.push("VERTEX_DEPTH_CHECK"):Fe.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Fe.defines.push("SDF"),Fe.defines.push("SDF_EDGE "+ze)),this._sp=S.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Ne,fragmentShaderSource:Fe,attributeLocations:oe}),Fe=new T({defines:["TRANSLUCENT",Ve],sources:[Le]}),this._shaderClampToGround&&(ke?Fe.defines.push("VERTEX_DEPTH_CHECK"):Fe.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Fe.defines.push("SDF"),Fe.defines.push("SDF_EDGE "+ze)),this._spTranslucent=S.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Ne,fragmentShaderSource:Fe,attributeLocations:oe})),this._blendOption===D.OPAQUE&&(Fe=new T({defines:[Ve],sources:[Le]}),this._shaderClampToGround&&(ke?Fe.defines.push("VERTEX_DEPTH_CHECK"):Fe.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Fe.defines.push("SDF"),Fe.defines.push("SDF_EDGE "+ze)),this._sp=S.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Ne,fragmentShaderSource:Fe,attributeLocations:oe})),this._blendOption===D.TRANSLUCENT&&(Fe=new T({defines:[Ve],sources:[Le]}),this._shaderClampToGround&&(ke?Fe.defines.push("VERTEX_DEPTH_CHECK"):Fe.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Fe.defines.push("SDF"),Fe.defines.push("SDF_EDGE "+ze)),this._spTranslucent=S.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Ne,fragmentShaderSource:Fe,attributeLocations:oe})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}var Ue=e.commandList;if(g.render||g.pick){var Ge,We=this._colorCommands,qe=this._blendOption===D.OPAQUE,Ye=this._blendOption===D.OPAQUE_AND_TRANSLUCENT,je=this._vaf.va,Xe=je.length,Qe=this._uniforms;s(this._batchTable)?(Qe=this._batchTable.getUniformMapCallback()(Qe),Ge=this._batchTable.getPickId()):Ge="v_pickColor",We.length=Xe;for(var Ke=Ye?2*Xe:Xe,Ze=0;Ze<Ke;++Ze){var Je=We[Ze];s(Je)||(Je=We[Ze]=new y);var $e=qe||Ye&&Ze%2==0;Je.pass=$e||!Ye?C.OPAQUE:C.TRANSLUCENT,Je.owner=this;var et=Ye?Math.floor(Ze/2):Ze;Je.boundingVolume=De,Je.modelMatrix=Ie,Je.count=je[et].indicesCount,Je.shaderProgram=$e?this._sp:this._spTranslucent,Je.uniformMap=Qe,Je.vertexArray=je[et].va,Je.renderState=$e?this._rsOpaque:this._rsTranslucent,Je.debugShowBoundingVolume=this.debugShowBoundingVolume,Je.pickId=Ge,this._instanced&&(Je.count=6,Je.instanceCount=r),Ue.push(Je)}this.debugShowTextureAtlas&&(s(this.debugCommand)||(this.debugCommand=ne(this,e.context)),Ue.push(this.debugCommand))}}}},F.prototype.isDestroyed=function(){return!1},F.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._vaf=this._vaf&&this._vaf.destroy(),B(this._billboards),u(this)},F}),define("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";return e({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2})}),define("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/freezeObject","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./SDFSettings","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function v(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function y(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function C(e){var t=document.createElement("div");t.style.position="absolute",t.style.opacity=0,t.style.font=e._font,document.body.appendChild(t),e._fontFamily=y(t,"font-family"),e._fontSize=y(t,"font-size").replace("px",""),e._fontStyle=y(t,"font-style"),e._fontWeight=y(t,"font-weight"),document.body.removeChild(t)}function b(e,a){e=n(e,n.EMPTY_OBJECT);var s=e.translucencyByDistance,u=e.pixelOffsetScaleByDistance,d=e.scaleByDistance,m=e.distanceDisplayCondition;o(s)&&(s=c.clone(s)),o(u)&&(u=c.clone(u)),o(d)&&(d=c.clone(d)),o(m)&&(m=l.clone(m)),this._renderedText=void 0,this._text=void 0,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,f.FILL),this._verticalOrigin=n(e.verticalOrigin,_.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,p.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=s,this._pixelOffsetScaleByDistance=u,this._scaleByDistance=d,this._heightReference=n(e.heightReference,h.NONE),this._distanceDisplayCondition=m,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=a,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=n(e.text,""),this._relativeSize=1,C(this),this._updateClamping()}function S(e,t){for(var i=/[a-zA-Z0-9]/,r=/[()[\]{}<>]/,n=[],o="",a=x.LTR,s="",l=e.length,u=0;u<l;++u){var c=e.charAt(u);s=t.test(c)?x.RTL:i.test(c)?x.LTR:r.test(c)?x.BRACKETS:x.WEAK,0===u&&(a=s),a===s&&s!==x.BRACKETS?o+=c:(""!==o&&n.push({Type:a,Word:o}),a=s,o=c)}return n.push({Type:s,Word:o}),n}function T(e){return e.split("").reverse().join("")}function E(e,t,i){return e.slice(0,t)+i+e.slice(t)}function A(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}function w(e){for(var t=e.split("\n"),i="",r=0;r<t.length;r++){for(var n=t[r],o=P.test(n.charAt(0)),a=S(n,P),s=0,l="",u=0;u<a.length;++u){var c=a[u],d=c.Type===x.BRACKETS?A(c.Word):T(c.Word);o?c.Type===x.RTL?(l=d+l,s=0):c.Type===x.LTR?(l=E(l,s,c.Word),s+=c.Word.length):c.Type!==x.WEAK&&c.Type!==x.BRACKETS||(c.Type===x.WEAK&&a[u-1].Type===x.BRACKETS?l=d+l:a[u-1].Type===x.RTL?(l=d+l,s=0):a.length>u+1?a[u+1].Type===x.RTL?(l=d+l,s=0):(l=E(l,s,c.Word),s+=c.Word.length):l=E(l,0,d)):c.Type===x.RTL?l=E(l,s,d):c.Type===x.LTR?(l+=c.Word,s=l.length):c.Type!==x.WEAK&&c.Type!==x.BRACKETS||(u>0&&a[u-1].Type===x.RTL?a.length>u+1?a[u+1].Type===x.RTL?l=E(l,s,d):(l+=c.Word,s=l.length):l+=c.Word:(l+=c.Word,s=l.length))}i+=l,r<t.length-1&&(i+="\n")}return i}var x=u({LTR:0,RTL:1,WEAK:2,BRACKETS:3});a(b.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._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),v(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._renderedText=b.enableRightToLeftDetection?w(e):e,g(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,g(this),C(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;r.equals(t,e)||(r.clone(e,t),g(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),g(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,g(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,g(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),v(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,g(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(!c.equals(t,e)){this._translucencyByDistance=c.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(!c.equals(t,e)){this._pixelOffsetScaleByDistance=c.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(!c.equals(t,e)){this._scaleByDistance=c.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,v(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),v(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*this._relativeSize)}var a=this._backgroundBillboard;o(a)&&(a.scale=e*this._relativeSize),v(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},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)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}var a=this._backgroundBillboard;o(a)&&(a.disableDepthTestDistance=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)}}},pickId:{get:function(){if(0!==this._glyphs.length&&o(this._glyphs[0].billboard))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition);for(var t=this._glyphs,r=0,n=t.length;r<n;r++){var a=t[r];o(a.billboard)&&(a.billboard._clampedPosition=e)}var s=this._backgroundBillboard;o(s)&&(s._clampedPosition=e)}},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)}}}}),b.prototype._updateClamping=function(){d._updateClamping(this._labelCollection,this)},b.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;return d._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,i)},b.getScreenSpaceBoundingBox=function(t,i,r){var n=0,a=0,s=0,l=0,u=t.totalScale,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===_.BOTTOM||t.verticalOrigin===_.BASELINE?a-=l:t.verticalOrigin===_.CENTER&&(a-=.5*l);else{n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(var h=0,p=0,f=t._glyphs,g=f.length,v=0;v<g;++v){var y=f[v],C=y.billboard;if(o(C)){var b=i.x+C._translate.x/c,S=i.y-C._translate.y/c,T=y.dimensions.width*u,E=y.dimensions.height*u;t.verticalOrigin===_.BOTTOM||t.verticalOrigin===_.BASELINE?S-=E:t.verticalOrigin===_.CENTER&&(S-=.5*E),t._verticalOrigin===_.TOP?S+=m.PADDING*u:t._verticalOrigin!==_.BOTTOM&&t._verticalOrigin!==_.BASELINE||(S-=m.PADDING*u),n=Math.min(n,b),a=Math.min(a,S),h=Math.max(h,b+T),p=Math.max(p,S+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},b.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._renderedText===e._renderedText&&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)&&c.equals(this._translucencyByDistance,e._translucencyByDistance)&&c.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&c.equals(this._scaleByDistance,e._scaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},b.prototype.isDestroyed=function(){return!1},b.enableRightToLeftDetection=!1;var P=new RegExp("[א-ת-ۿݐ-ݿࢠ-ࣿ]");return b}),define("ThirdParty/bitmap-sdf",[],function(){"use strict";function e(e,t,i){return t<i?e<t?t:e>i?i:e:e<i?i:e>t?t:e}function t(t,r){r||(r={});var o,a,s,l,u,c,d,h,p,f,m,_=null==r.cutoff?.25:r.cutoff,g=null==r.radius?8:r.radius,v=r.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!r.width||!r.height)throw Error("For raw data width and height should be provided by options");o=r.width,a=r.height,l=t,c=r.stride?r.stride:Math.floor(t.length/o/a)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=t,d=h.getContext("2d"),o=h.width,a=h.height,p=d.getImageData(0,0,o,a),l=p.data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t.canvas,d=t,o=h.width,a=h.height,p=d.getImageData(0,0,o,a),l=p.data,c=4):window.ImageData&&t instanceof window.ImageData&&(p=t,o=t.width,a=t.height,l=p.data,c=4);if(s=Math.max(o,a),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(o*a),f=0,m=u.length;f<m;f++)l[f]=u[f*c+v]/255;else if(1!==c)throw Error("Raw data can have only 1 value per pixel");var y=Array(o*a),C=Array(o*a),b=Array(s),S=Array(s),T=Array(s+1),E=Array(s);for(f=0,m=o*a;f<m;f++){var A=l[f];y[f]=1===A?0:0===A?n:Math.pow(Math.max(0,.5-A),2),C[f]=1===A?n:0===A?0:Math.pow(Math.max(0,A-.5),2)}i(y,o,a,b,S,E,T),i(C,o,a,b,S,E,T);var w=window.Float32Array?new Float32Array(o*a):new Array(o*a);for(f=0,m=o*a;f<m;f++)w[f]=e(1-((y[f]-C[f])/g+_),0,1);return w}function i(e,t,i,n,o,a,s){for(var l=0;l<t;l++){for(var u=0;u<i;u++)n[u]=e[u*t+l];for(r(n,o,a,s,i),u=0;u<i;u++)e[u*t+l]=o[u]}for(u=0;u<i;u++){for(l=0;l<t;l++)n[l]=e[u*t+l];for(r(n,o,a,s,t),l=0;l<t;l++)e[u*t+l]=Math.sqrt(o[l])}}function r(e,t,i,r,o){i[0]=0,r[0]=-n,r[1]=+n;for(var a=1,s=0;a<o;a++){for(var l=(e[a]+a*a-(e[i[s]]+i[s]*i[s]))/(2*a-2*i[s]);l<=r[s];)s--,l=(e[a]+a*a-(e[i[s]]+i[s]*i[s]))/(2*a-2*i[s]);s++,i[s]=a,r[s]=l,r[s+1]=+n}for(a=0,s=0;a<o;a++){for(;r[s+1]<a;)s++;t[a]=(a-i[s])*(a-i[s])+e[i[s]]}}var n=1e20;return t}),define("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/writeTextToCanvas","../Core/Matrix4","./BillboardCollection","./BlendOption","./HeightReference","./HorizontalOrigin","./Label","./LabelStyle","./SDFSettings","./TextureAtlas","./VerticalOrigin","../ThirdParty/bitmap-sdf"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y){"use strict";function C(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function b(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function S(e,t){var i=document.createElement("canvas");i.width=O.x,i.height=O.y;var r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,i.width,i.height),e.addImage(R,i).then(function(e){t._whitePixelIndex=e})}function T(e,t,r,n,o,a,s){return N.font=t,N.fillColor=r,N.strokeColor=n,N.strokeWidth=o,N.padding=_.PADDING,s===v.CENTER?N.textBaseline="middle":s===v.TOP?N.textBaseline="top":N.textBaseline="bottom",N.fill=a===m.FILL||a===m.FILL_AND_OUTLINE,N.stroke=a===m.OUTLINE||a===m.FILL_AND_OUTLINE,N.backgroundColor=i.BLACK,l(e,N)}function E(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;n(i)&&(i.show=!1,i.image=void 0,n(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0),e._spareBillboards.push(i),t.billboard=void 0)}function A(e,t,i,r){e.addImage(t,i).then(function(e){r.index=e})}function w(e,r){var o,a,s,l=r._renderedText,u=l.length,c=r._glyphs,d=c.length;if(r._relativeSize=r._fontSize/_.FONT_SIZE,u<d)for(a=u;a<d;++a)E(e,c[a]);c.length=u;var h=r._showBackground&&l.split("\n").join("").length>0,f=r._backgroundBillboard,g=e._backgroundBillboardCollection;h?(n(f)||(f=g.add({collection:e,image:R,imageSubRegion:L}),r._backgroundBillboard=f),f.color=r._backgroundColor,f.show=r._show,f.position=r._position,f.eyeOffset=r._eyeOffset,f.pixelOffset=r._pixelOffset,f.horizontalOrigin=p.LEFT,f.verticalOrigin=r._verticalOrigin,f.heightReference=r._heightReference,f.scale=r.totalScale,f.pickPrimitive=r,f.id=r._id,f.translucencyByDistance=r._translucencyByDistance,f.pixelOffsetScaleByDistance=r._pixelOffsetScaleByDistance,f.scaleByDistance=r._scaleByDistance,f.distanceDisplayCondition=r._distanceDisplayCondition,f.disableDepthTestDistance=r._disableDepthTestDistance):n(f)&&(g.remove(f),r._backgroundBillboard=f=void 0);var v=e._glyphTextureCache;for(s=0;s<u;++s){var S=l.charAt(s),w=r._verticalOrigin,x=JSON.stringify([S,r._fontFamily,r._fontStyle,r._fontWeight,+w]),P=v[x];if(!n(P)){var D=r._fontStyle+" "+r._fontWeight+" "+_.FONT_SIZE+"px "+r._fontFamily,I=T(S,D,i.WHITE,i.WHITE,0,m.FILL,w);if(P=new b(e,-1,I.dimensions),v[x]=P,I.width>0&&I.height>0){for(var M=y(I,{cutoff:_.CUTOFF,radius:_.RADIUS}),O=I.getContext("2d"),N=I.width,F=I.height,B=O.getImageData(0,0,N,F),k=0;k<N;k++)for(var z=0;z<F;z++){var V=z*N+k,U=255*M[V],G=4*V;B.data[G+0]=U,B.data[G+1]=U,B.data[G+2]=U,B.data[G+3]=U}O.putImageData(B,0,0)," "!==S&&A(e._textureAtlas,x,I,P)}}if(o=c[s],n(o)?-1===P.index?E(e,o):n(o.textureInfo)&&(o.textureInfo=void 0):(o=new C,c[s]=o),o.textureInfo=P,o.dimensions=P.dimensions,-1!==P.index){var H=o.billboard,W=e._spareBillboards;n(H)||(W.length>0?H=W.pop():(H=e._billboardCollection.add({collection:e}),H._labelDimensions=new t,H._labelTranslate=new t),o.billboard=H),H.show=r._show,H.position=r._position,H.eyeOffset=r._eyeOffset,H.pixelOffset=r._pixelOffset,H.horizontalOrigin=p.LEFT,H.verticalOrigin=r._verticalOrigin,H.heightReference=r._heightReference,H.scale=r.totalScale,H.pickPrimitive=r,H.id=r._id,H.image=x,H.translucencyByDistance=r._translucencyByDistance,H.pixelOffsetScaleByDistance=r._pixelOffsetScaleByDistance,H.scaleByDistance=r._scaleByDistance,H.distanceDisplayCondition=r._distanceDisplayCondition,H.disableDepthTestDistance=r._disableDepthTestDistance,H._batchIndex=r._batchIndex,H.outlineColor=r.outlineColor,r.style===m.FILL_AND_OUTLINE?(H.color=r._fillColor,
- H.outlineWidth=r.outlineWidth):r.style===m.FILL?(H.color=r._fillColor,H.outlineWidth=0):r.style===m.OUTLINE&&(H.color=i.TRANSPARENT,H.outlineWidth=r.outlineWidth)}}r._repositionAllGlyphs=!0}function x(e,t,i){return t===p.CENTER?-e/2:t===p.RIGHT?-(e+i.x):i.x}function P(e,i){var r,o,a,s=e._glyphs,l=e._renderedText,u=0,c=0,d=[],f=Number.NEGATIVE_INFINITY,m=0,g=1,y=s.length,C=e._backgroundBillboard,b=t.clone(n(C)?e._backgroundPadding:t.ZERO,B);for(b.x/=e._relativeSize,b.y/=e._relativeSize,a=0;a<y;++a)"\n"===l.charAt(a)?(d.push(u),++g,u=0):(r=s[a],o=r.dimensions,m=Math.max(m,o.height-o.descent),f=Math.max(f,o.descent),u+=o.width-o.bounds.minx,a<y-1&&(u+=s[a+1].dimensions.bounds.minx),c=Math.max(c,u));d.push(u);var S=m+f,T=e.totalScale,E=e._horizontalOrigin,A=e._verticalOrigin,w=0,P=d[w],D=x(P,E,b),I=M*S,R=I*(g-1),O=c,L=S+R;n(C)&&(O+=2*b.x,L+=2*b.y,C._labelHorizontalOrigin=E),F.x=D*T*i,F.y=0;var N=!0,k=0;for(a=0;a<y;++a)if("\n"===l.charAt(a))++w,k+=I,P=d[w],D=x(P,E,b),F.x=D*T*i,N=!0;else if(r=s[a],o=r.dimensions,A===v.TOP?(F.y=o.height-m-b.y,F.y+=_.PADDING):A===v.CENTER?F.y=(R+o.height-m)/2:A===v.BASELINE?(F.y=R,F.y-=_.PADDING):(F.y=R+f+b.y,F.y-=_.PADDING),F.y=(F.y-o.descent-k)*T*i,N&&(F.x-=_.PADDING*T*i,N=!1),n(r.billboard)&&(r.billboard._setTranslate(F),r.billboard._labelDimensions.x=O,r.billboard._labelDimensions.y=L,r.billboard._labelHorizontalOrigin=E),a<y-1){var z=s[a+1];F.x+=(o.width-o.bounds.minx+z.dimensions.bounds.minx)*T*i}if(n(C)&&l.split("\n").join("").length>0&&(D=E===p.CENTER?-c/2-b.x:E===p.RIGHT?-(c+2*b.x):0,F.x=D*T*i,A===v.TOP?F.y=S-m-f:A===v.CENTER?F.y=(S-m)/2-f:A===v.BASELINE?F.y=-b.y-f:F.y=0,F.y=F.y*T*i,C.width=O,C.height=L,C._setTranslate(F),C._labelTranslate=t.clone(F,C._labelTranslate)),e.heightReference===h.CLAMP_TO_GROUND)for(a=0;a<y;++a){r=s[a];var V=r.billboard;n(V)&&(V._labelTranslate=t.clone(F,V._labelTranslate))}}function D(e,t){for(var i=t._glyphs,r=0,o=i.length;r<o;++r)E(e,i[r]);n(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,n(t._removeCallbackFunc)&&t._removeCallbackFunc(),a(t)}function I(e){e=r(e,r.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new c({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new c({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this._highlightColor=i.clone(i.WHITE),this.modelMatrix=u.clone(r(e.modelMatrix,u.IDENTITY)),this.debugShowBoundingVolume=r(e.debugShowBoundingVolume,!1),this.blendOption=r(e.blendOption,d.OPAQUE_AND_TRANSLUCENT)}var M=1.2,R="ID_WHITE_PIXEL",O=new t(4,4),L=new e(1,1,1,1),N={},F=new t,B=new t;return o(I.prototype,{length:{get:function(){return this._labels.length}}}),I.prototype.add=function(e){var t=new f(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},I.prototype.remove=function(e){if(n(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),D(this,e),!0}return!1},I.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;t<i;++t)D(this,e[t]);e.length=0},I.prototype.contains=function(e){return n(e)&&e._labelCollection===this},I.prototype.get=function(e){return this._labels[e]},I.prototype.update=function(e){var t=this._billboardCollection,i=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,i.modelMatrix=this.modelMatrix,i.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;n(this._textureAtlas)||(this._textureAtlas=new g({context:r}),t.textureAtlas=this._textureAtlas),n(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new g({context:r,initialSize:O}),i.textureAtlas=this._backgroundTextureAtlas,S(this._backgroundTextureAtlas,this));var o=r.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=l.length,c=0;c<u;++c){var h=l[c];if(!h.isDestroyed()){var p=h._glyphs.length;h._rebindAllGlyphs&&(w(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(P(h,a),h._repositionAllGlyphs=!1);var f=h._glyphs.length-p;this._totalGlyphCount+=f}}var m=i.length>0?d.TRANSLUCENT:this.blendOption;t.blendOption=m,i.blendOption=m,t._highlightColor=this._highlightColor,i._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,i.update(e),t.update(e)},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),a(this)},I}),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);var r=e.translucencyByDistance,s=e.scaleByDistance,l=e.distanceDisplayCondition;a(r)&&(r=d.clone(r)),a(s)&&(s=d.clone(s)),a(l)&&(l=u.clone(l)),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=s,this._translucencyByDistance=r,this._distanceDisplayCondition=l,this._disableDepthTestDistance=o(e.disableDepthTestDistance,0),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,b=f.PIXEL_SIZE_INDEX=5,S=f.SCALE_BY_DISTANCE_INDEX=6,T=f.TRANSLUCENCY_BY_DISTANCE_INDEX=7,E=f.DISTANCE_DISPLAY_CONDITION_INDEX=8,A=f.DISABLE_DEPTH_DISTANCE_INDEX=9;f.NUMBER_OF_PROPERTIES=10,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,T))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,b))}},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,E))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,m(this,A))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},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 w=new r;f._computeActualPosition=function(e,t,i){return t.mode===h.SCENE3D?e:(c.multiplyByPoint(i,e,w),p.computeActualWgs84Position(t,w))};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);return p.wgs84ToWindowCoordinates(i,o,n)},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)&&this._disableDepthTestDistance===e._disableDepthTestDistance},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;\nvarying vec4 v_pickColor;\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(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\ngl_FragColor = czm_gammaCorrect(color);\nczm_writeLogDepth();\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 vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\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;\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);\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);\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\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) || defined(DISABLE_DEPTH_DISTANCE)\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 = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\ngl_Position = czm_projection * positionEC;\nczm_vertexLogDepth();\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(vec4(czm_currentFrustum.x));\n#endif\n}\n}\n#endif\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;\nv_pickColor = pickColor;\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,b,S,T,E,A,w){"use strict";function x(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=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._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(K),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.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,E.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=w.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 I(e,t,r){return new C(e,[{index:Z.positionHighAndSize,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:Z.positionLowAndShow,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:Z.compressedAttribute0,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[G]},{index:Z.compressedAttribute1,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[j]},{index:Z.scaleByDistance,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[Y]},{index:Z.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:i.FLOAT,usage:r[X]}],t)}function M(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===w.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,J);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=r[Z.positionHighAndSize],d=J.high;c(o,d.x,d.y,d.z,s);var h=r[Z.positionLowAndOutline],p=J.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*$+c*ee+d;u=t.floatToByte(l.red),c=t.floatToByte(l.green),d=t.floatToByte(l.blue);var p=u*$+c*ee+d;u=t.floatToByte(s.red),c=t.floatToByte(s.green),d=t.floatToByte(s.blue);var f=u*$+c*ee+d,m=t.floatToByte(a.alpha)*$+t.floatToByte(l.alpha)*ee+t.floatToByte(s.alpha);(0,r[Z.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)*ee+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var f=c;(0,i[Z.compressedAttribute1])(o,p,f,a,l)}function L(e,t,i,r){var o=r._index,a=i[Z.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 N(e,t,i,r){var o=r._index,a=i[Z.distanceDisplayConditionAndDisableDepth],s=0,l=Number.MAX_VALUE,u=r.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,s*=s,l*=l,e._shaderDistanceDisplayCondition=!0);var c=r.disableDepthTestDistance;c*=c,c>0&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1)),a(o,s,l,c)}function F(e,t,i,r){M(e,t,i,r),R(e,t,i,r),O(e,t,i,r),L(e,t,i,r),N(e,t,i,r)}function B(t,i,r,o,a,s){var l;o.mode===w.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=A._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!==w.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=i,c.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==w.SCENE3D&&i!==w.SCENE2D&&i!==w.COLUMBUS_VIEW||B(e,r,r.length,t,o,!0)):i===w.MORPHING?B(e,r,r.length,t,o,!0):i!==w.SCENE2D&&i!==w.COLUMBUS_VIEW||B(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function z(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var V=A.SHOW_INDEX,U=A.POSITION_INDEX,G=A.COLOR_INDEX,H=A.OUTLINE_COLOR_INDEX,W=A.OUTLINE_WIDTH_INDEX,q=A.PIXEL_SIZE_INDEX,Y=A.SCALE_BY_DISTANCE_INDEX,j=A.TRANSLUCENCY_BY_DISTANCE_INDEX,X=A.DISTANCE_DISPLAY_CONDITION_INDEX,Q=A.DISABLE_DEPTH_DISTANCE_INDEX,K=A.NUMBER_OF_PROPERTIES,Z={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};o(x.prototype,{length:{get:function(){return D(this),this._pointPrimitives.length}}}),x.prototype.add=function(e){var t=new A(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},x.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},x.prototype.removeAll=function(){P(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},x.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},x.prototype.contains=function(e){return n(e)&&e._pointPrimitiveCollection===this},x.prototype.get=function(e){return D(this),this._pointPrimitives[e]},x.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<K;++r){var n=0===i[r]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var J=new l,$=65536,ee=256,te=[];return x.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,A=C.pick;if(u||!A&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<K;++x)l[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=I(p,o,this._buffersUsage),i=this._vaf.writers;for(var P=0;P<o;++P){var B=this._pointPrimitives[P];B._dirty=!1,F(this,p,i,B)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var J=te;J.length=0,(l[U]||l[W]||l[q])&&J.push(M),(l[G]||l[H])&&J.push(R),(l[V]||l[j])&&J.push(O),l[Y]&&J.push(L),(l[X]||l[Q])&&J.push(N);var $=J.length;if(i=this._vaf.writers,s/o>.1){for(var ee=0;ee<s;++ee){var ie=a[ee];ie._dirty=!1;for(var re=0;re<$;++re)J[re](this,p,i,ie)}this._vaf.commit()}else{for(var ne=0;ne<s;++ne){var oe=a[ne];oe._dirty=!1;for(var ae=0;ae<$;++ae)J[ae](this,p,i,oe);this._vaf.subCommit(oe._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 se,le=c.IDENTITY;t.mode===w.SCENE3D?(le=this.modelMatrix,se=e.clone(this._baseVolumeWC,this._boundingVolume)):se=e.clone(this._baseVolume2D,this._boundingVolume),z(this,t,se);var ue=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,ue&&(this._blendOption===E.OPAQUE||this._blendOption===E.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=g.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===E.TRANSLUCENT||this._blendOption===E.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=g.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!1,blending:T.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==t.minimumDisableDepthTestDistance;var ce,de;(ue||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(ce=new y({sources:[S]}),this._shaderScaleByDistance&&ce.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&ce.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&ce.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&ce.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===E.OPAQUE_AND_TRANSLUCENT&&(de=new y({defines:["OPAQUE"],sources:[b]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:Z}),de=new y({defines:["TRANSLUCENT"],sources:[b]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:Z})),this._blendOption===E.OPAQUE&&(de=new y({sources:[b]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:Z})),this._blendOption===E.TRANSLUCENT&&(de=new y({sources:[b]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:Z})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);var he,pe,fe,me,_e=t.commandList;if(C.render||A){var ge=this._colorCommands,ve=this._blendOption===E.OPAQUE,ye=this._blendOption===E.OPAQUE_AND_TRANSLUCENT;he=this._vaf.va,pe=he.length,ge.length=pe;var Ce=ye?2*pe:pe;for(me=0;me<Ce;++me){var be=ve||ye&&me%2==0;fe=ge[me],n(fe)||(fe=ge[me]=new m),fe.primitiveType=d.POINTS,fe.pass=be||!ye?_.OPAQUE:_.TRANSLUCENT,fe.owner=this;var Se=ye?Math.floor(me/2):me;fe.boundingVolume=se,fe.modelMatrix=le,fe.shaderProgram=be?this._sp:this._spTranslucent,fe.uniformMap=this._uniforms,fe.vertexArray=he[Se].va,fe.renderState=be?this._rsOpaque:this._rsTranslucent,fe.debugShowBoundingVolume=this.debugShowBoundingVolume,fe.pickId="v_pickColor",_e.push(fe)}}}},x.prototype.isDestroyed=function(){return!1},x.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)},x}),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);a(e,t,i,Math.max(r,Math.floor(i-u*d/l+h)),Math.min(n,Math.floor(i+(l-u)*d/l+h)),o)}var p=t[2*i+o],f=r,m=n;for(s(e,t,r,i),t[2*n+o]>p&&s(e,t,r,n);f<m;){for(s(e,t,f,m),f++,m--;t[2*f+o]<p;)f++;for(;t[2*m+o]>p;)m--}t[2*r+o]===p?s(e,t,r,m):(m++,s(e,t,m,n)),m<=i&&(r=m+1),i<=m&&(n=m-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 b(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)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=d.getScreenSpaceBoundingBox(l,i,M);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)&&E(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id];t._labelCollection.get(i).clusterShow=!0}}function T(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.label.id=i,n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function A(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 w(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,E=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(E)?E.removeAll():E=r._clusterPointCollection=new f;var w=r._pixelRange,x=r._minimumClusterSize,P=r._previousClusters,D=[],I=r._previousHeight,M=s.camera.positionCartographic.height,N=s.mapProjection.ellipsoid,F=s.camera.positionWC,B=new a(N,F),k=[];r._clusterLabels&&A(d,k,s,B,r),r._clusterBillboards&&A(p,k,s,B,r),r._clusterPoints&&A(m,k,s,B,r);var z,V,U,G,H,W,q,Y,j,X,Q,K,Z=_(k,v,y,64,Int32Array);if(M<I)for(U=P.length,z=0;z<U;++z){var J=P[z];if(B.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,i.ZERO,t.ZERO,s);if(n($)){var ee=1-M/I,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=Z.range(re,ne,oe,ae),W=H.length,X=0,j=[],V=0;V<W;++V)q=H[V],Y=k[q],Y.clustered||(++X,Q=Y.collection,K=Y.index,j.push(Q.get(K).id));if(X>=x)for(T(J.position,X,j,r),D.push(J),V=0;V<W;++V)k[H[V]].clustered=!0}}}for(U=k.length,z=0;z<U;++z){var se=k[z];if(!se.clustered){se.clustered=!0,Q=se.collection,K=se.index;var le=Q.get(K);G=b(le,se.coord,w,r,R);var ue=e.clone(G,O);H=Z.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,j=[le.id],V=0;V<W;++V)if(q=H[V],Y=k[q],!Y.clustered){var de=Y.collection.get(Y.index),he=b(de,Y.coord,w,r,L);i.add(de.position,ce,ce),e.union(ue,he,ue),++X,j.push(de.id)}if(X>=x){var pe=i.multiplyByScalar(ce,1/X,ce);for(T(pe,X,j,r),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),V=0;V<W;++V)k[H[V]].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===E.length&&(E.destroy(),r._clusterPointCollection=void 0),r._previousClusters=D,r._previousHeight=M}}}}function x(e,t,i,r){return function(o){var a=this[e];n(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var s=this._collectionIndicesByEntity[o.id];if(n(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),n(a)&&n(s[r]))return a.get(s[r]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[i];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function 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 I(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 M=new e,R=new e,O=new e,L=new e;return g.prototype._initialize=function(e){this._scene=e;var t=w(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=x("_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=x("_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=x("_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){var t;n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),n(this._billboardCollection)&&this._billboardCollection.length>0&&!n(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,I(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/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./heightReferenceOnEntityPropertyChanged","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S){"use strict";function T(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,this.offsetAttribute=void 0}function E(e,t){b.call(this,{entity:e,scene:t,geometryOptions:new T(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function A(e,t,i){C.call(this,e,t,i)}var w=e.ZERO,x=new e,P=new e,D=new i;return a(Object.create)&&(E.prototype=Object.create(b.prototype),E.prototype.constructor=E),s(E.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),E.prototype.createFillGeometryInstance=function(e){var t=this._entity,o=t.isAvailable(e),s=new f(o&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(l),h={show:s,distanceDisplayCondition:d,color:void 0,offset:void 0};if(this._materialProperty instanceof y){var m;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(m=this._materialProperty.color.getValue(e,D)),a(m)||(m=i.WHITE),h.color=r.fromColor(m)}return a(this._options.offsetAttribute)&&(h.offset=p.fromCartesian3(S.getValueOrDefault(this._terrainOffsetProperty,e,w,x))),new c({id:t,geometry:new n(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:h})},E.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,n=t.isAvailable(e),s=S.getValueOrDefault(this._outlineColorProperty,e,i.BLACK,D),l=this._distanceDisplayConditionProperty.getValue(e),d={show:new f(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(s),distanceDisplayCondition:u.fromDistanceDisplayCondition(l),offset:void 0};return a(this._options.offsetAttribute)&&(d.offset=p.fromCartesian3(S.getValueOrDefault(this._terrainOffsetProperty,e,w,x))),new c({id:t,geometry:new o(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:d})},E.prototype._computeCenter=function(e,t){return S.getValueOrUndefined(this._entity.position,e,t)},E.prototype._isHidden=function(e,t){return!a(e.position)||!a(t.length)||!a(t.topRadius)||!a(t.bottomRadius)||b.prototype._isHidden.call(this,e,t)},E.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&S.isConstant(e.orientation)&&t.length.isConstant&&t.topRadius.isConstant&&t.bottomRadius.isConstant&&S.isConstant(t.slices)&&S.isConstant(t.outlineWidth)&&S.isConstant(t.numberOfVerticalLines))},E.prototype._setStaticOptions=function(e,t){var i=S.getValueOrDefault(t.heightReference,h.MINIMUM_VALUE,m.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof y?g.VERTEX_FORMAT:_.MaterialSupport.TEXTURED.vertexFormat,r.length=t.length.getValue(h.MINIMUM_VALUE),r.topRadius=t.topRadius.getValue(h.MINIMUM_VALUE),r.bottomRadius=t.bottomRadius.getValue(h.MINIMUM_VALUE),r.slices=S.getValueOrUndefined(t.slices,h.MINIMUM_VALUE),r.numberOfVerticalLines=S.getValueOrUndefined(t.numberOfVerticalLines,h.MINIMUM_VALUE),r.offsetAttribute=i!==m.NONE?d.ALL:void 0},E.prototype._onEntityPropertyChanged=v,E.DynamicGeometryUpdater=A,a(Object.create)&&(A.prototype=Object.create(C.prototype),A.prototype.constructor=A),A.prototype._isHidden=function(e,t,i){var r=this._options,n=S.getValueOrUndefined(e.position,i,P);return!a(n)||!a(r.length)||!a(r.topRadius)||!a(r.bottomRadius)||C.prototype._isHidden.call(this,e,t,i)},A.prototype._setOptions=function(e,t,i){var r=S.getValueOrDefault(t.heightReference,i,m.NONE),n=this._options;n.length=S.getValueOrUndefined(t.length,i),n.topRadius=S.getValueOrUndefined(t.topRadius,i),n.bottomRadius=S.getValueOrUndefined(t.bottomRadius,i),n.slices=S.getValueOrUndefined(t.slices,i),n.numberOfVerticalLines=S.getValueOrUndefined(t.numberOfVerticalLines,i),n.offsetAttribute=r!==m.NONE?d.ALL:void 0},E}),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._definitionChanged=new o,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}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=new e(8,8),d=new e(0,0),h=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,.1),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,c,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,h,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),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/PolylineDashMaterialProperty",["../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._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}var l=e.WHITE,u=e.TRANSPARENT;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._gapColor)&&a.isConstant(this._dashLength)&&a.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),gapColor:o("gapColor"),dashLength:o("dashLength"),dashPattern:o("dashPattern")}),s.prototype.getType=function(e){return"PolylineDash"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.gapColor=a.getValueOrClonedDefault(this._gapColor,e,u,t.gapColor),t.dashLength=a.getValueOrDefault(this._dashLength,e,16,t.dashLength),t.dashPattern=a.getValueOrDefault(this._dashPattern,e,255,t.dashPattern),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._gapColor,e._gapColor)&&a.equals(this._dashLength,e._dashLength)&&a.equals(this._dashPattern,e._dashPattern)},s}),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._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}var l=e.WHITE;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"),taperPower:o("taperPower")}),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,.25,t.glowPower),t.taperPower=a.getValueOrDefault(this._taperPower,e,1,t.taperPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)&&a.equals(this._taperPower,e._taperPower)},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;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,1),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)&&(-1!==r.indexOf(n)?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),define("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,i,r){"use strict";return{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}}}),define("DataSources/SampledProperty",["../Core/binarySearch","../Core/Check","../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,u){"use strict";function c(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 d(e,t){return e instanceof l?e:"string"==typeof e?l.fromIso8601(e):l.addSeconds(t,e,new l)}function h(t,i,n,o,a){for(var s,u,h,p,f,m,v=0;v<o.length;){f=d(o[v],t),h=e(i,f,l.compare);var y=0,C=0;if(h<0){for(h=~h,p=h*a,u=void 0,m=i[h];v<o.length&&(f=d(o[v],t),!(r(u)&&l.compare(u,f)>=0||r(m)&&l.compare(f,m)>=0));){for(_[y++]=f,v+=1,s=0;s<a;s++)g[C++]=o[v],v+=1;u=f}y>0&&(g.length=C,c(n,p,g),_.length=y,c(i,h,_))}else{for(s=0;s<a;s++)v++,n[h*a+s]=o[v];v++}}}function p(e,t){var n=e;n===Number&&(n=m);var o,l=n.packedLength,c=i(n.packedInterpolationLength,l),d=0;if(r(t)){var h=t.length;o=new Array(h);for(var p=0;p<h;p++){var f=t[p];f===Number&&(f=m);var _=f.packedLength;l+=_,c+=i(f.packedInterpolationLength,_),o[p]=f}d=h}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=u,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=l,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new a,this._derivativeTypes=t,this._innerDerivativeTypes=o,this._inputOrder=d,this._forwardExtrapolationType=s.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=s.NONE,this._backwardExtrapolationDuration=0}function f(e,t,i){var r=e._packedLength;e._times.splice(t,i),e._values.splice(t*r,i*r),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}var m={packedLength:1,pack:function(e,t,r){r=i(r,0),
- t[r]=e},unpack:function(e,t,r){return t=i(t,0),e[t]}},_=[],g=[];return n(p.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))}}}),p.prototype.getValue=function(t,i){var n=this._times,o=n.length;if(0!==o){var a,u=this._innerType,c=this._values,d=e(n,t,l.compare);if(d<0){if(0===(d=~d)){var h=n[d];if(a=this._backwardExtrapolationDuration,this._backwardExtrapolationType===s.NONE||0!==a&&l.secondsDifference(h,t)>a)return;if(this._backwardExtrapolationType===s.HOLD)return u.unpack(c,0,i)}if(d>=o){d=o-1;var p=n[d];if(a=this._forwardExtrapolationDuration,this._forwardExtrapolationType===s.NONE||0!==a&&l.secondsDifference(t,p)>a)return;if(this._forwardExtrapolationType===s.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,i)}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 b=0,S=o-1;if(S-b+1>=C+1){var T=d-(C/2|0)-1;T<b&&(T=b);var E=T+C;E>S&&(E=S,(T=E-C)<b&&(T=b)),b=T,S=E}for(var A=S-b+1,w=0;w<A;++w)f[w]=l.secondsDifference(n[b+w],n[S]);if(r(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,b,S,m);else for(var x=0,P=this._packedLength,D=b*P,I=(S+1)*P;D<I;)m[x]=c[D],D++,x++;var M,R=l.secondsDifference(t,n[S]);if(0!==v&&r(_.interpolate)){var O=Math.floor(g/(v+1));M=_.interpolate(R,f,m,O,v,v,this._interpolationResult)}else M=_.interpolateOrderZero(R,f,m,g,this._interpolationResult);return r(u.unpackInterpolationResult)?u.unpackInterpolationResult(M,c,b,S,i):u.unpack(M,0,i)}return u.unpack(c,d*this._packedLength,i)}},p.prototype.setInterpolationOptions=function(e){if(r(e)){var t=!1,i=e.interpolationAlgorithm,n=e.interpolationDegree;r(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),r(n)&&this._interpolationDegree!==n&&(this._interpolationDegree=n,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))}},p.prototype.addSample=function(e,t,i){var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;u<l;u++)n[u].pack(i[u],s,s.length);h(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.addSamples=function(e,t,i){for(var n=this._innerDerivativeTypes,o=r(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=i[u],d=n.length,p=0;p<d;p++)n[p].pack(c[p],l,l.length);h(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.addSamplesPackedArray=function(e,t){h(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},p.prototype.removeSample=function(t){var i=e(this._times,t,l.compare);return!(i<0)&&(f(this,i,1),!0)},p.prototype.removeSamples=function(t){var i=this._times,r=e(i,t.start,l.compare);r<0?r=~r:t.isStartIncluded||++r;var n=e(i,t.stop,l.compare);n<0?n=~n:t.isStopIncluded&&++n,f(this,r,n-r)},p.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,i=r(t),n=e._derivativeTypes;if(i!==r(n))return!1;var o,a;if(i){if((a=t.length)!==n.length)return!1;for(o=0;o<a;o++)if(t[o]!==n[o])return!1}var s=this._times,u=e._times;if((a=s.length)!==u.length)return!1;for(o=0;o<a;o++)if(!l.equals(s[o],u[o]))return!1;var c=this._values,d=e._values;for(o=0;o<a;o++)if(c[o]!==d[o])return!1;return!0},p._mergeNewSamples=h,p}),define("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/Check","../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,c){"use strict";function d(t,r){r=i(r,0);var n;if(r>0){n=new Array(r);for(var o=0;o<r;o++)n[o]=e}this._numberOfDerivatives=r,this._property=new c(e,n),this._definitionChanged=new a,this._referenceFrame=i(t,s.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return n(d.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}}}),d.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,s.FIXED,t)},d.prototype.getValueInReferenceFrame=function(e,t,i){if(i=this._property.getValue(e,i),r(i))return l.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},d.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},d.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},d.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},d.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},d.prototype.removeSample=function(e){this._property.removeSample(e)},d.prototype.removeSamples=function(e){this._property.removeSamples(e)},d.prototype.equals=function(e){return this===e||e instanceof d&&u.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},d}),define("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";return e({HORIZONTAL:0,VERTICAL:1})}),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;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,0),t.repeat=a.getValueOrDefault(this._repeat,e,1),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;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),h=o.getValue(a.addSeconds(t,1/60,d),c);if(i(l)&&(i(h)||(h=l,l=o.getValue(a.addSeconds(t,-1/60,d),c),i(l)))){if(e.equals(l,h))return this._normalize?void 0:e.clone(e.ZERO,r);i(n)&&l.clone(n);var p=e.subtract(h,l,r);return this._normalize?e.normalize(p,r):e.divideByScalar(p,1/60,r)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),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){this._ellipsoid!==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/CzmlDataSource",["../Core/ArcType","../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/DistanceDisplayCondition","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/Math","../Core/NearFarScalar","../Core/PolygonHierarchy","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/Resource","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/ClassificationType","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/ShadowMode","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./BoxGraphics","./CallbackProperty","./CheckerboardMaterialProperty","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./CylinderGraphics","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCluster","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineArrowMaterialProperty","./PolylineDashMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./Property","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityOrientationProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,be,Se,Te,Ee,Ae,we,xe,Pe,De,Ie,Me,Re,Oe,Le,Ne,Fe,Be){"use strict";function ke(){}function ze(e,t){return"#"===t[0]&&(t=ni+t),xe.fromString(e,t)}function Ve(e,t,i){if(d(i.reference))return ze(t,i.reference);if(d(i.velocityReference)){var n=ze(t,i.velocityReference);switch(e){case r:case ke:return new Fe(n,e===ke);case P:return new Ne(n)}}throw new R(JSON.stringify(i)+" is not valid CZML.")}function Ue(e,t){return new j(function(i,r){return t(e.getValue(i,r))},e.isConstant)}function Ge(e){var t=e.rgbaf;if(d(t))return t;var i=e.rgba;if(d(i)){var r=i.length;if(r===s.packedLength)return[s.byteToFloat(i[0]),s.byteToFloat(i[1]),s.byteToFloat(i[2]),s.byteToFloat(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=s.byteToFloat(i[n+1]),t[n+2]=s.byteToFloat(i[n+2]),t[n+3]=s.byteToFloat(i[n+3]),t[n+4]=s.byteToFloat(i[n+4]);return t}}function He(e,t){var i=c(e.uri,e);return d(t)?t.getDerivedResource({url:i}):M.createIfNeeded(i)}function We(e){var t=e.wsen;if(d(t))return t;var i=e.wsenDegrees;if(d(i)){var r=i.length;if(r===D.packedLength)return[A.toRadians(i[0]),A.toRadians(i[1]),A.toRadians(i[2]),A.toRadians(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=A.toRadians(i[n+1]),t[n+2]=A.toRadians(i[n+2]),t[n+3]=A.toRadians(i[n+3]),t[n+4]=A.toRadians(i[n+4]);return t}}function qe(e){var t=e.length;if(ai.magnitude=1,2===t)return ai.clock=e[0],ai.cone=e[1],r.fromSpherical(ai,oi),[oi.x,oi.y,oi.z];for(var i=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)i[o]=e[n],ai.clock=e[n+1],ai.cone=e[n+2],r.fromSpherical(ai,oi),i[o+1]=oi.x,i[o+2]=oi.y,i[o+3]=oi.z;return i}function Ye(e){var t=e.length;if(3===t)return ai.clock=e[0],ai.cone=e[1],ai.magnitude=e[2],r.fromSpherical(ai,oi),[oi.x,oi.y,oi.z];for(var i=new Array(t),n=0;n<t;n+=4)i[n]=e[n],ai.clock=e[n+1],ai.cone=e[n+2],ai.magnitude=e[n+3],r.fromSpherical(ai,oi),i[n+1]=oi.x,i[n+2]=oi.y,i[n+3]=oi.z;return i}function je(e){var t=e.length;if(3===t)return si.longitude=e[0],si.latitude=e[1],si.height=e[2],m.WGS84.cartographicToCartesian(si,oi),[oi.x,oi.y,oi.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],si.longitude=e[r+1],si.latitude=e[r+2],si.height=e[r+3],m.WGS84.cartographicToCartesian(si,oi),i[r+1]=oi.x,i[r+2]=oi.y,i[r+3]=oi.z;return i}function Xe(e){var t=e.length;if(3===t)return si.longitude=A.toRadians(e[0]),si.latitude=A.toRadians(e[1]),si.height=e[2],m.WGS84.cartographicToCartesian(si,oi),[oi.x,oi.y,oi.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],si.longitude=A.toRadians(e[r+1]),si.latitude=A.toRadians(e[r+2]),si.height=e[r+3],m.WGS84.cartographicToCartesian(si,oi),i[r+1]=oi.x,i[r+2]=oi.y,i[r+3]=oi.z;return i}function Qe(e){var t=e.cartesian;if(d(t))return t;var i=e.cartesianVelocity;if(d(i))return i;var r=e.unitCartesian;if(d(r))return r;var n=e.unitSpherical;if(d(n))return qe(n);var o=e.spherical;if(d(o))return Ye(o);var a=e.cartographicRadians;if(d(a))return je(a);var s=e.cartographicDegrees;if(d(s))return Xe(s);throw new R(JSON.stringify(e)+" is not a valid CZML interval.")}function Ke(e,t){r.unpack(e,t,oi),r.normalize(oi,oi),r.pack(oi,e,t)}function Ze(e){var t=Qe(e);if(3===t.length)return Ke(t,0),t;for(var i=1;i<t.length;i+=4)Ke(t,i);return t}function Je(e,t){P.unpack(e,t,ui),P.normalize(ui,ui),P.pack(ui,e,t)}function $e(e){var t=e.unitQuaternion;if(d(t)){if(4===t.length)return Je(t,0),t;for(var i=1;i<t.length;i+=5)Je(t,i)}return t}function et(n){return"boolean"==typeof n?Boolean:"number"==typeof n?Number:"string"==typeof n?String:n.hasOwnProperty("array")?Array:n.hasOwnProperty("boolean")?Boolean:n.hasOwnProperty("boundingRectangle")?t:n.hasOwnProperty("cartesian2")?i:n.hasOwnProperty("cartesian")||n.hasOwnProperty("spherical")||n.hasOwnProperty("cartographicRadians")||n.hasOwnProperty("cartographicDegrees")?r:n.hasOwnProperty("unitCartesian")||n.hasOwnProperty("unitSpherical")?ke:n.hasOwnProperty("rgba")||n.hasOwnProperty("rgbaf")?s:n.hasOwnProperty("arcType")?e:n.hasOwnProperty("classificationType")?F:n.hasOwnProperty("colorBlendMode")?B:n.hasOwnProperty("cornerType")?l:n.hasOwnProperty("heightReference")?k:n.hasOwnProperty("horizontalOrigin")?z:n.hasOwnProperty("date")?S:n.hasOwnProperty("labelStyle")?V:n.hasOwnProperty("number")?Number:n.hasOwnProperty("nearFarScalar")?w:n.hasOwnProperty("distanceDisplayCondition")?f:n.hasOwnProperty("object")||n.hasOwnProperty("value")?Object:n.hasOwnProperty("unitQuaternion")?P:n.hasOwnProperty("shadowMode")?U:n.hasOwnProperty("string")?String:n.hasOwnProperty("stripeOrientation")?Re:n.hasOwnProperty("wsen")||n.hasOwnProperty("wsenDegrees")?D:n.hasOwnProperty("uri")?H:n.hasOwnProperty("verticalOrigin")?G:Object}function tt(n,o,a){switch(n){case e:return e[c(o.arcType,o)];case Array:return o.array;case Boolean:return c(o.boolean,o);case t:return o.boundingRectangle;case i:return o.cartesian2;case r:return Qe(o);case ke:return Ze(o);case s:return Ge(o);case F:return F[c(o.classificationType,o)];case B:return B[c(o.colorBlendMode,o)];case l:return l[c(o.cornerType,o)];case k:return k[c(o.heightReference,o)];case z:return z[c(o.horizontalOrigin,o)];case Image:return He(o,a);case S:return S.fromIso8601(c(o.date,o));case V:return V[c(o.labelStyle,o)];case Number:return c(o.number,o);case w:return o.nearFarScalar;case f:return o.distanceDisplayCondition;case Object:return c(c(o.object,o.value),o);case P:return $e(o);case Pe:return c(o.number,o);case U:return U[c(c(o.shadowMode,o.shadows),o)];case String:return c(o.string,o);case Re:return Re[c(o.stripeOrientation,o)];case D:return We(o);case H:return He(o,a);case G:return G[c(o.verticalOrigin,o)];default:throw new R(n)}}function it(e,t){var i=e.interpolationAlgorithm,r=e.interpolationDegree;(d(i)||d(r))&&t.setInterpolationOptions({interpolationAlgorithm:ci[i],interpolationDegree:r});var n=e.forwardExtrapolationType;d(n)&&(t.forwardExtrapolationType=g[n]);var o=e.forwardExtrapolationDuration;d(o)&&(t.forwardExtrapolationDuration=o);var a=e.backwardExtrapolationType;d(a)&&(t.backwardExtrapolationType=g[a]);var s=e.backwardExtrapolationDuration;d(s)&&(t.backwardExtrapolationDuration=s)}function rt(e){if(d(e))return di.iso8601=e,L.fromIso8601(di)}function nt(e){var t=b.MAXIMUM_INTERVAL.clone();return t.data=e,t}function ot(e){var t=new J;return t.intervals.addInterval(nt(e)),t}function at(e){var t=new Z(e.referenceFrame);return t.intervals.addInterval(nt(e)),t}function st(e,t,i,r,n,o,a){var s=rt(r.interval);d(n)&&(s=d(s)?L.intersect(s,n,li):n);var l,u,h,p=!d(r.reference)&&!d(r.velocityReference),f=d(s)&&!s.equals(b.MAXIMUM_INTERVAL);if(!0===r.delete)return f?lt(t[i],s):void(t[i]=void 0);var m=!1;if(p){if(u=tt(e,r,o),!d(u))return;l=c(e.packedLength,1),h=c(u.length,1),m=!d(r.array)&&"string"!=typeof u&&h>l&&e!==Object}var _="function"==typeof e.unpack&&e!==Pe;if(!m&&!f)return void(t[i]=p?new ee(_?e.unpack(u,0):u):Ve(e,a,r));var g,v=t[i],y=r.epoch;if(d(y)&&(g=S.fromIso8601(y)),m&&!f)return v instanceof Ie||(t[i]=v=new Ie(e)),v.addSamplesPackedArray(u,g),void it(r,v);var C;if(!m&&f)return s=s.clone(),s.data=p?_?e.unpack(u,0):u:Ve(e,a,r),d(v)||(t[i]=v=p?new Le:new J),void(p&&v instanceof Le?v.intervals.addInterval(s):v instanceof J?(p&&(s.data=new ee(s.data)),v.intervals.addInterval(s)):(t[i]=v=ot(v),p&&(s.data=new ee(s.data)),v.intervals.addInterval(s)));d(v)||(t[i]=v=new J),v instanceof J||(t[i]=v=ot(v));var T=v.intervals;C=T.findInterval(s),d(C)&&C.data instanceof Ie||(C=s.clone(),C.data=new Ie(e),T.addInterval(C)),C.data.addSamplesPackedArray(u,g),it(r,C.data)}function lt(e,t){if(e instanceof Ie)return void e.removeSamples(t);if(e instanceof Le)return void e.intervals.removeInterval(t);if(e instanceof J){for(var i=e.intervals,r=0;r<i.length;++r){var n=L.intersect(i.get(r),t,li);n.isEmpty||lt(n.data,t)}return void i.removeInterval(t)}}function ut(e,t,i,r,n,o,a){if(d(r))if(C(r))for(var s=0,l=r.length;s<l;++s)st(e,t,i,r[s],n,o,a);else st(e,t,i,r,n,o,a)}function ct(e,t,i,n,o,a){var s=rt(i.interval);d(n)&&(s=d(s)?L.intersect(s,n,li):n);var l,u,h=d(i.cartesianVelocity)?1:0,p=r.packedLength*(h+1),f=!d(i.reference),m=d(s)&&!s.equals(b.MAXIMUM_INTERVAL);if(!0===i.delete)return m?dt(e[t],s):void(e[t]=void 0);var _,g=!1;if(f&&(d(i.referenceFrame)&&(_=I[i.referenceFrame]),_=c(_,I.FIXED),l=Qe(i),u=c(l.length,1),g=u>p),!g&&!m)return void(e[t]=f?new $(r.unpack(l),_):ze(a,i.reference));var v,y=e[t],C=i.epoch;if(d(C)&&(v=S.fromIso8601(C)),g&&!m)return y instanceof De&&(!d(_)||y.referenceFrame===_)||(e[t]=y=new De(_,h)),y.addSamplesPackedArray(l,v),void it(i,y);var T;if(!g&&m)return s=s.clone(),s.data=f?r.unpack(l):ze(a,i.reference),d(y)||(y=f?new Oe(_):new Z(_),e[t]=y),void(f&&y instanceof Oe&&d(_)&&y.referenceFrame===_?y.intervals.addInterval(s):y instanceof Z?(f&&(s.data=new $(s.data,_)),y.intervals.addInterval(s)):(e[t]=y=at(y),f&&(s.data=new $(s.data,_)),y.intervals.addInterval(s)));d(y)?y instanceof Z||(e[t]=y=at(y)):e[t]=y=new Z(_);var E=y.intervals;T=E.findInterval(s),d(T)&&T.data instanceof De&&(!d(_)||T.data.referenceFrame===_)||(T=s.clone(),T.data=new De(_,h),E.addInterval(T)),T.data.addSamplesPackedArray(l,v),it(i,T.data)}function dt(e,t){if(e instanceof De)return void e.removeSamples(t);if(e instanceof Oe)return void e.intervals.removeInterval(t);if(e instanceof Z){for(var i=e.intervals,r=0;r<i.length;++r){var n=L.intersect(i.get(r),t,li);n.isEmpty||dt(n.data,t)}return void i.removeInterval(t)}}function ht(e,t,i,r,n,o){if(d(i))if(C(i))for(var a=0,s=i.length;a<s;++a)ct(e,t,i[a],r,n,o);else ct(e,t,i,r,n,o)}function pt(e,t,r,n,o,a){var l=rt(r.interval);d(n)&&(l=d(l)?L.intersect(l,n,li):n);var u,c,h=e[t];if(d(l)){h instanceof K||(h=new K,e[t]=h);var p=h.intervals;c=p.findInterval({start:l.start,stop:l.stop}),d(c)?u=c.data:(c=l.clone(),p.addInterval(c))}else u=h;var f;d(r.solidColor)?(u instanceof Q||(u=new Q),f=r.solidColor,ut(s,u,"color",f.color,void 0,void 0,a)):d(r.grid)?(u instanceof ue||(u=new ue),f=r.grid,ut(s,u,"color",f.color,void 0,o,a),ut(Number,u,"cellAlpha",f.cellAlpha,void 0,o,a),ut(i,u,"lineCount",f.lineCount,void 0,o,a),ut(i,u,"lineThickness",f.lineThickness,void 0,o,a),ut(i,u,"lineOffset",f.lineOffset,void 0,o,a)):d(r.image)?(u instanceof ce||(u=new ce),f=r.image,ut(Image,u,"image",f.image,void 0,o,a),ut(i,u,"repeat",f.repeat,void 0,o,a),ut(s,u,"color",f.color,void 0,o,a),ut(Boolean,u,"transparent",f.transparent,void 0,o,a)):d(r.stripe)?(u instanceof Me||(u=new Me),f=r.stripe,ut(Re,u,"orientation",f.orientation,void 0,o,a),ut(s,u,"evenColor",f.evenColor,void 0,o,a),ut(s,u,"oddColor",f.oddColor,void 0,o,a),ut(Number,u,"offset",f.offset,void 0,o,a),ut(Number,u,"repeat",f.repeat,void 0,o,a)):d(r.polylineOutline)?(u instanceof be||(u=new be),f=r.polylineOutline,ut(s,u,"color",f.color,void 0,o,a),ut(s,u,"outlineColor",f.outlineColor,void 0,o,a),ut(Number,u,"outlineWidth",f.outlineWidth,void 0,o,a)):d(r.polylineGlow)?(u instanceof ye||(u=new ye),f=r.polylineGlow,ut(s,u,"color",f.color,void 0,o,a),ut(Number,u,"glowPower",f.glowPower,void 0,o,a),ut(Number,u,"taperPower",f.taperPower,void 0,o,a)):d(r.polylineArrow)?(u instanceof ge||(u=new ge),f=r.polylineArrow,ut(s,u,"color",f.color,void 0,void 0,a)):d(r.polylineDash)?(u instanceof ve||(u=new ve),f=r.polylineDash,ut(s,u,"color",f.color,void 0,void 0,a),ut(s,u,"gapColor",f.gapColor,void 0,void 0,a),ut(Number,u,"dashLength",f.dashLength,void 0,o,a),ut(Number,u,"dashPattern",f.dashPattern,void 0,o,a)):d(r.checkerboard)&&(u instanceof X||(u=new X),f=r.checkerboard,ut(s,u,"evenColor",f.evenColor,void 0,o,a),ut(s,u,"oddColor",f.oddColor,void 0,o,a),ut(i,u,"repeat",f.repeat,void 0,o,a)),d(c)?c.data=u:e[t]=u}function ft(e,t,i,r,n,o){if(d(i))if(C(i))for(var a=0,s=i.length;a<s;++a)pt(e,t,i[a],r,n,o);else pt(e,t,i,r,n,o)}function mt(e,t,i,r){var n=t.name;d(n)&&(e.name=t.name)}function _t(e,t,i,r){var n=t.description;d(n)&&ut(String,e,"description",n,void 0,r,i)}function gt(e,t,i,r){var n=t.position;d(n)&&ht(e,"position",n,void 0,r,i)}function vt(e,t,i,n){var o=t.viewFrom;d(o)&&ut(r,e,"viewFrom",o,void 0,n,i)}function yt(e,t,i,r){var n=t.orientation;d(n)&&ut(P,e,"orientation",n,void 0,r,i)}function Ct(e,t,i,r){var n=t.properties;if(d(n)){d(e.properties)||(e.properties=new Ae);for(var o in n)if(n.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);var a=n[o];if(C(a))for(var s=0,l=a.length;s<l;++s)st(et(a[s]),e.properties,o,a[s],void 0,r,i);else st(et(a),e.properties,o,a,void 0,r,i)}}}function bt(e,t,i,r,n,o,a){var s=i.map(function(e){return ze(n,e)});if(d(r)){r=rt(r);var l=e[t];if(!(l instanceof a)){var u=new a;u.intervals.addInterval(nt(l)),e[t]=l=u}r.data=new o(s),l.intervals.addInterval(r)}else e[t]=new o(s)}function St(e,t,i,r){var n=i.references;d(n)?bt(e,t,n,i.interval,r,Ee,J):ut(Array,e,t,i,void 0,void 0,r)}function Tt(e,t,i,r){if(d(i))if(C(i))for(var n=0,o=i.length;n<o;++n)St(e,t,i[n],r);else St(e,t,i,r)}function Et(e,t,i,n){var o=i.references;d(o)?bt(e,t,o,i.interval,n,Se,Z):(d(i.cartesian)?i.array=r.unpackArray(i.cartesian):d(i.cartographicRadians)?i.array=r.fromRadiansArrayHeights(i.cartographicRadians):d(i.cartographicDegrees)&&(i.array=r.fromDegreesArrayHeights(i.cartographicDegrees)),d(i.array)&&ut(Array,e,t,i,void 0,void 0,n))}function At(e,t,i,r){if(d(i))if(C(i))for(var n=0,o=i.length;n<o;++n)Et(e,t,i[n],r);else Et(e,t,i,r)}function wt(e){return r.unpackArray(e)}function xt(e){return r.fromRadiansArrayHeights(e)}function Pt(e){return r.fromDegreesArrayHeights(e)}function Dt(e,t,i,r){var n=i.references;if(d(n)){var o=n.map(function(e){var t={};return bt(t,"positions",e,i.interval,r,Se,Z),t.positions});e[t]=new Se(o)}else d(i.cartesian)?i.array=i.cartesian.map(wt):d(i.cartographicRadians)?i.array=i.cartographicRadians.map(xt):d(i.cartographicDegrees)&&(i.array=i.cartographicDegrees.map(Pt)),d(i.array)&&ut(Array,e,t,i,void 0,void 0,r)}function It(e,t,i,r){if(d(i))if(C(i))for(var n=0,o=i.length;n<o;++n)Dt(e,t,i[n],r);else Dt(e,t,i,r)}function Mt(e,t,i,r){var n=t.availability;if(d(n)){var o;if(C(n))for(var a=0,s=n.length;a<s;++a)d(o)||(o=new N),o.addInterval(rt(n[a]));else o=new N,o.addInterval(rt(n));e.availability=o}}function Rt(e,t,i,r,n){d(t)&&ut(ke,e,"alignedAxis",t,i,r,n)}function Ot(e,n,o,a){var l=n.billboard;if(d(l)){var u=rt(l.interval),c=e.billboard;d(c)||(e.billboard=c=new q),ut(Boolean,c,"show",l.show,u,a,o),ut(Image,c,"image",l.image,u,a,o),ut(Number,c,"scale",l.scale,u,a,o),ut(i,c,"pixelOffset",l.pixelOffset,u,a,o),ut(r,c,"eyeOffset",l.eyeOffset,u,a,o),ut(z,c,"horizontalOrigin",l.horizontalOrigin,u,a,o),ut(G,c,"verticalOrigin",l.verticalOrigin,u,a,o),ut(k,c,"heightReference",l.heightReference,u,a,o),ut(s,c,"color",l.color,u,a,o),ut(Pe,c,"rotation",l.rotation,u,a,o),Rt(c,l.alignedAxis,u,a,o),ut(Boolean,c,"sizeInMeters",l.sizeInMeters,u,a,o),ut(Number,c,"width",l.width,u,a,o),
- ut(Number,c,"height",l.height,u,a,o),ut(w,c,"scaleByDistance",l.scaleByDistance,u,a,o),ut(w,c,"translucencyByDistance",l.translucencyByDistance,u,a,o),ut(w,c,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,a,o),ut(t,c,"imageSubRegion",l.imageSubRegion,u,a,o),ut(f,c,"distanceDisplayCondition",l.distanceDisplayCondition,u,a,o),ut(Number,c,"disableDepthTestDistance",l.disableDepthTestDistance,u,a,o)}}function Lt(e,t,i,n){var o=t.box;if(d(o)){var a=rt(o.interval),l=e.box;d(l)||(e.box=l=new Y),ut(Boolean,l,"show",o.show,a,n,i),ut(r,l,"dimensions",o.dimensions,a,n,i),ut(k,l,"heightReference",o.heightReference,a,n,i),ut(Boolean,l,"fill",o.fill,a,n,i),ft(l,"material",o.material,a,n,i),ut(Boolean,l,"outline",o.outline,a,n,i),ut(s,l,"outlineColor",o.outlineColor,a,n,i),ut(Number,l,"outlineWidth",o.outlineWidth,a,n,i),ut(U,l,"shadows",o.shadows,a,n,i),ut(f,l,"distanceDisplayCondition",o.distanceDisplayCondition,a,n,i)}}function Nt(e,t,i,r){var n=t.corridor;if(d(n)){var o=rt(n.interval),a=e.corridor;d(a)||(e.corridor=a=new te),ut(Boolean,a,"show",n.show,o,r,i),At(a,"positions",n.positions,i),ut(Number,a,"width",n.width,o,r,i),ut(Number,a,"height",n.height,o,r,i),ut(k,a,"heightReference",n.heightReference,o,r,i),ut(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),ut(k,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),ut(l,a,"cornerType",n.cornerType,o,r,i),ut(Number,a,"granularity",n.granularity,o,r,i),ut(Boolean,a,"fill",n.fill,o,r,i),ft(a,"material",n.material,o,r,i),ut(Boolean,a,"outline",n.outline,o,r,i),ut(s,a,"outlineColor",n.outlineColor,o,r,i),ut(Number,a,"outlineWidth",n.outlineWidth,o,r,i),ut(U,a,"shadows",n.shadows,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),ut(F,a,"classificationType",n.classificationType,o,r,i),ut(Number,a,"zIndex",n.zIndex,o,r,i)}}function Ft(e,t,i,r){var n=t.cylinder;if(d(n)){var o=rt(n.interval),a=e.cylinder;d(a)||(e.cylinder=a=new ie),ut(Boolean,a,"show",n.show,o,r,i),ut(Number,a,"length",n.length,o,r,i),ut(Number,a,"topRadius",n.topRadius,o,r,i),ut(Number,a,"bottomRadius",n.bottomRadius,o,r,i),ut(k,a,"heightReference",n.heightReference,o,r,i),ut(Boolean,a,"fill",n.fill,o,r,i),ft(a,"material",n.material,o,r,i),ut(Boolean,a,"outline",n.outline,o,r,i),ut(s,a,"outlineColor",n.outlineColor,o,r,i),ut(Number,a,"outlineWidth",n.outlineWidth,o,r,i),ut(Number,a,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),ut(Number,a,"slices",n.slices,o,r,i),ut(U,a,"shadows",n.shadows,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function Bt(e,t){var i=e.version;if(d(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new R("Cesium only supports CZML version 1.");t._version=i}}if(!d(t._version))throw new R("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;d(e.name)&&(n.name=e.name);var o=e.clock;if(d(o)){var a=n.clock;d(a)?(a.interval=c(o.interval,a.interval),a.currentTime=c(o.currentTime,a.currentTime),a.range=c(o.range,a.range),a.step=c(o.step,a.step),a.multiplier=c(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function kt(e,t,i,r){var n=t.ellipse;if(d(n)){var o=rt(n.interval),a=e.ellipse;d(a)||(e.ellipse=a=new oe),ut(Boolean,a,"show",n.show,o,r,i),ut(Number,a,"semiMajorAxis",n.semiMajorAxis,o,r,i),ut(Number,a,"semiMinorAxis",n.semiMinorAxis,o,r,i),ut(Number,a,"height",n.height,o,r,i),ut(k,a,"heightReference",n.heightReference,o,r,i),ut(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),ut(k,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),ut(Pe,a,"rotation",n.rotation,o,r,i),ut(Pe,a,"stRotation",n.stRotation,o,r,i),ut(Number,a,"granularity",n.granularity,o,r,i),ut(Boolean,a,"fill",n.fill,o,r,i),ft(a,"material",n.material,o,r,i),ut(Boolean,a,"outline",n.outline,o,r,i),ut(s,a,"outlineColor",n.outlineColor,o,r,i),ut(Number,a,"outlineWidth",n.outlineWidth,o,r,i),ut(Number,a,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),ut(U,a,"shadows",n.shadows,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),ut(F,a,"classificationType",n.classificationType,o,r,i),ut(Number,a,"zIndex",n.zIndex,o,r,i)}}function zt(e,t,i,n){var o=t.ellipsoid;if(d(o)){var a=rt(o.interval),l=e.ellipsoid;d(l)||(e.ellipsoid=l=new ae),ut(Boolean,l,"show",o.show,a,n,i),ut(r,l,"radii",o.radii,a,n,i),ut(k,l,"heightReference",o.heightReference,a,n,i),ut(Boolean,l,"fill",o.fill,a,n,i),ft(l,"material",o.material,a,n,i),ut(Boolean,l,"outline",o.outline,a,n,i),ut(s,l,"outlineColor",o.outlineColor,a,n,i),ut(Number,l,"outlineWidth",o.outlineWidth,a,n,i),ut(Number,l,"stackPartitions",o.stackPartitions,a,n,i),ut(Number,l,"slicePartitions",o.slicePartitions,a,n,i),ut(Number,l,"subdivisions",o.subdivisions,a,n,i),ut(U,l,"shadows",o.shadows,a,n,i),ut(f,l,"distanceDisplayCondition",o.distanceDisplayCondition,a,n,i)}}function Vt(e,t,n,o){var a=t.label;if(d(a)){var l=rt(a.interval),u=e.label;d(u)||(e.label=u=new de),ut(Boolean,u,"show",a.show,l,o,n),ut(String,u,"text",a.text,l,o,n),ut(String,u,"font",a.font,l,o,n),ut(V,u,"style",a.style,l,o,n),ut(Number,u,"scale",a.scale,l,o,n),ut(Boolean,u,"showBackground",a.showBackground,l,o,n),ut(s,u,"backgroundColor",a.backgroundColor,l,o,n),ut(i,u,"backgroundPadding",a.backgroundPadding,l,o,n),ut(i,u,"pixelOffset",a.pixelOffset,l,o,n),ut(r,u,"eyeOffset",a.eyeOffset,l,o,n),ut(z,u,"horizontalOrigin",a.horizontalOrigin,l,o,n),ut(G,u,"verticalOrigin",a.verticalOrigin,l,o,n),ut(k,u,"heightReference",a.heightReference,l,o,n),ut(s,u,"fillColor",a.fillColor,l,o,n),ut(s,u,"outlineColor",a.outlineColor,l,o,n),ut(Number,u,"outlineWidth",a.outlineWidth,l,o,n),ut(w,u,"translucencyByDistance",a.translucencyByDistance,l,o,n),ut(w,u,"pixelOffsetScaleByDistance",a.pixelOffsetScaleByDistance,l,o,n),ut(w,u,"scaleByDistance",a.scaleByDistance,l,o,n),ut(f,u,"distanceDisplayCondition",a.distanceDisplayCondition,l,o,n),ut(Number,u,"disableDepthTestDistance",a.disableDepthTestDistance,l,o,n)}}function Ut(e,t,i,r){var n=t.model;if(d(n)){var o=rt(n.interval),a=e.model;d(a)||(e.model=a=new he),ut(Boolean,a,"show",n.show,o,r,i),ut(H,a,"uri",n.gltf,o,r,i),ut(Number,a,"scale",n.scale,o,r,i),ut(Number,a,"minimumPixelSize",n.minimumPixelSize,o,r,i),ut(Number,a,"maximumScale",n.maximumScale,o,r,i),ut(Boolean,a,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),ut(Boolean,a,"runAnimations",n.runAnimations,o,r,i),ut(Boolean,a,"clampAnimations",n.clampAnimations,o,r,i),ut(U,a,"shadows",n.shadows,o,r,i),ut(k,a,"heightReference",n.heightReference,o,r,i),ut(s,a,"silhouetteColor",n.silhouetteColor,o,r,i),ut(Number,a,"silhouetteSize",n.silhouetteSize,o,r,i),ut(s,a,"color",n.color,o,r,i),ut(B,a,"colorBlendMode",n.colorBlendMode,o,r,i),ut(Number,a,"colorBlendAmount",n.colorBlendAmount,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i);var l,u,c=n.nodeTransformations;if(d(c))if(C(c))for(l=0,u=c.length;l<u;++l)Gt(a,c[l],o,r,i);else Gt(a,c,o,r,i);var h=n.articulations;if(d(h))if(C(h))for(l=0,u=h.length;l<u;++l)Ht(a,h[l],o,r,i);else Ht(a,h,o,r,i)}}function Gt(e,t,i,n,o){var a=rt(t.interval);d(i)&&(a=d(a)?L.intersect(a,i,li):i);for(var s=e.nodeTransformations,l=Object.keys(t),u=0,c=l.length;u<c;++u){var h=l[u];if("interval"!==h){var p=t[h];if(d(p)){d(s)||(e.nodeTransformations=s=new Ae),s.hasProperty(h)||s.addProperty(h);var f=s[h];d(f)||(s[h]=f=new pe),ut(r,f,"translation",p.translation,a,n,o),ut(P,f,"rotation",p.rotation,a,n,o),ut(r,f,"scale",p.scale,a,n,o)}}}}function Ht(e,t,i,r,n){var o=rt(t.interval);d(i)&&(o=d(o)?L.intersect(o,i,li):i);for(var a=e.articulations,s=Object.keys(t),l=0,u=s.length;l<u;++l){var c=s[l];if("interval"!==c){var h=t[c];d(h)&&(d(a)||(e.articulations=a=new Ae),a.hasProperty(c)||a.addProperty(c),ut(Number,a,c,h,o,r,n))}}}function Wt(e,t,i,r){var n=t.path;if(d(n)){var o=rt(n.interval),a=e.path;d(a)||(e.path=a=new fe),ut(Boolean,a,"show",n.show,o,r,i),ut(Number,a,"leadTime",n.leadTime,o,r,i),ut(Number,a,"trailTime",n.trailTime,o,r,i),ut(Number,a,"width",n.width,o,r,i),ut(Number,a,"resolution",n.resolution,o,r,i),ft(a,"material",n.material,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function qt(e,t,i,r){var n=t.point;if(d(n)){var o=rt(n.interval),a=e.point;d(a)||(e.point=a=new me),ut(Boolean,a,"show",n.show,o,r,i),ut(Number,a,"pixelSize",n.pixelSize,o,r,i),ut(k,a,"heightReference",n.heightReference,o,r,i),ut(s,a,"color",n.color,o,r,i),ut(s,a,"outlineColor",n.outlineColor,o,r,i),ut(Number,a,"outlineWidth",n.outlineWidth,o,r,i),ut(w,a,"scaleByDistance",n.scaleByDistance,o,r,i),ut(w,a,"translucencyByDistance",n.translucencyByDistance,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),ut(Number,a,"disableDepthTestDistance",n.disableDepthTestDistance,o,r,i)}}function Yt(e){this.polygon=e,this._definitionChanged=new _}function jt(t,i,r,n){var o=i.polygon;if(d(o)){var a=rt(o.interval),l=t.polygon;d(l)||(t.polygon=l=new _e),ut(Boolean,l,"show",o.show,a,n,r),At(l,"_positions",o.positions,r),It(l,"_holes",o.holes,r),(d(l._positions)||d(l._holes))&&(l.hierarchy=new Yt(l)),ut(Number,l,"height",o.height,a,n,r),ut(k,l,"heightReference",o.heightReference,a,n,r),ut(Number,l,"extrudedHeight",o.extrudedHeight,a,n,r),ut(k,l,"extrudedHeightReference",o.extrudedHeightReference,a,n,r),ut(Pe,l,"stRotation",o.stRotation,a,n,r),ut(Number,l,"granularity",o.granularity,a,n,r),ut(Boolean,l,"fill",o.fill,a,n,r),ft(l,"material",o.material,a,n,r),ut(Boolean,l,"outline",o.outline,a,n,r),ut(s,l,"outlineColor",o.outlineColor,a,n,r),ut(Number,l,"outlineWidth",o.outlineWidth,a,n,r),ut(Boolean,l,"perPositionHeight",o.perPositionHeight,a,n,r),ut(Boolean,l,"closeTop",o.closeTop,a,n,r),ut(Boolean,l,"closeBottom",o.closeBottom,a,n,r),ut(e,l,"arcType",o.arcType,a,n,r),ut(U,l,"shadows",o.shadows,a,n,r),ut(f,l,"distanceDisplayCondition",o.distanceDisplayCondition,a,n,r),ut(F,l,"classificationType",o.classificationType,a,n,r),ut(Number,l,"zIndex",o.zIndex,a,n,r)}}function Xt(t){return t?e.GEODESIC:e.NONE}function Qt(t,i,r,n){var o=i.polyline;if(d(o)){var a=rt(o.interval),s=t.polyline;if(d(s)||(t.polyline=s=new Ce),ut(Boolean,s,"show",o.show,a,n,r),At(s,"positions",o.positions,r),ut(Number,s,"width",o.width,a,n,r),ut(Number,s,"granularity",o.granularity,a,n,r),ft(s,"material",o.material,a,n,r),ft(s,"depthFailMaterial",o.depthFailMaterial,a,n,r),ut(e,s,"arcType",o.arcType,a,n,r),ut(Boolean,s,"clampToGround",o.clampToGround,a,n,r),ut(U,s,"shadows",o.shadows,a,n,r),ut(f,s,"distanceDisplayCondition",o.distanceDisplayCondition,a,n,r),ut(F,s,"classificationType",o.classificationType,a,n,r),ut(Number,s,"zIndex",o.zIndex,a,n,r),d(o.followSurface)&&!d(o.arcType)){var l={};ut(Boolean,l,"followSurface",o.followSurface,a,n,r),s.arcType=Ue(l.followSurface,Xt)}}}function Kt(e,t,i,r){var n=t.rectangle;if(d(n)){var o=rt(n.interval),a=e.rectangle;d(a)||(e.rectangle=a=new we),ut(Boolean,a,"show",n.show,o,r,i),ut(D,a,"coordinates",n.coordinates,o,r,i),ut(Number,a,"height",n.height,o,r,i),ut(k,a,"heightReference",n.heightReference,o,r,i),ut(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),ut(k,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),ut(Pe,a,"rotation",n.rotation,o,r,i),ut(Pe,a,"stRotation",n.stRotation,o,r,i),ut(Number,a,"granularity",n.granularity,o,r,i),ut(Boolean,a,"fill",n.fill,o,r,i),ft(a,"material",n.material,o,r,i),ut(Boolean,a,"outline",n.outline,o,r,i),ut(s,a,"outlineColor",n.outlineColor,o,r,i),ut(Number,a,"outlineWidth",n.outlineWidth,o,r,i),ut(U,a,"shadows",n.shadows,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),ut(F,a,"classificationType",n.classificationType,o,r,i),ut(Number,a,"zIndex",n.zIndex,o,r,i)}}function Zt(e,t,i,r){var n=t.wall;if(d(n)){var o=rt(n.interval),a=e.wall;d(a)||(e.wall=a=new Be),ut(Boolean,a,"show",n.show,o,r,i),At(a,"positions",n.positions,i),Tt(a,"minimumHeights",n.minimumHeights,i),Tt(a,"maximumHeights",n.maximumHeights,i),ut(Number,a,"granularity",n.granularity,o,r,i),ut(Boolean,a,"fill",n.fill,o,r,i),ft(a,"material",n.material,o,r,i),ut(Boolean,a,"outline",n.outline,o,r,i),ut(s,a,"outlineColor",n.outlineColor,o,r,i),ut(Number,a,"outlineWidth",n.outlineWidth,o,r,i),ut(U,a,"shadows",n.shadows,o,r,i),ut(f,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function Jt(e,t,i,r,n){var o=e.id;if(d(o)||(o=u()),ni=o,!d(n._version)&&"document"!==o)throw new R("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(o);else if("document"===o)Bt(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;d(s)&&(a.parent=t.getOrCreateEntity(s));for(var l=i.length-1;l>-1;l--)i[l](a,e,t,r)}ni=void 0}function $t(e){var t,i=e._documentPacket.clock;if(!d(i)){if(!d(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(b.MINIMUM_VALUE)){var n=r.start,s=r.stop,l=S.secondsDifference(s,n),u=Math.round(l/120);return t=new ne,t.startTime=S.clone(n),t.stopTime=S.clone(s),t.clockRange=o.LOOP_STOP,t.multiplier=u,t.currentTime=S.clone(n),t.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}d(e._clock)?t=e._clock.clone():(t=new ne,t.startTime=b.MINIMUM_VALUE.clone(),t.stopTime=b.MAXIMUM_VALUE.clone(),t.currentTime=b.MINIMUM_VALUE.clone(),t.clockRange=o.LOOP_STOP,t.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);var h=rt(i.interval);return d(h)&&(t.startTime=h.start,t.stopTime=h.stop),d(i.currentTime)&&(t.currentTime=S.fromIso8601(i.currentTime)),d(i.range)&&(t.clockRange=c(o[i.range],o.LOOP_STOP)),d(i.step)&&(t.clockStep=c(a[i.step],a.SYSTEM_CLOCK_MULTIPLIER)),d(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function ei(e,t,i,r){i=c(i,c.EMPTY_OBJECT);var n=t,o=i.sourceUri;return("string"==typeof t||t instanceof M)&&(t=M.createIfNeeded(t),n=t.fetchJson(),o=c(o,t.clone())),o=M.createIfNeeded(o),re.setLoading(e,!0),W(n,function(t){return ti(e,t,o,r)}).otherwise(function(t){return re.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),W.reject(t)})}function ti(e,t,i,r){re.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new ii,n.removeAll()),ri._processCzml(t,n,i,void 0,e);var o=$t(e),a=e._documentPacket;return d(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!d(e._name)&&d(i)&&(e._name=v(i.getUrlComponent()),o=!0),re.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function ii(){this.name=void 0,this.clock=void 0}function ri(e){this._name=e,this._changed=new _,this._error=new _,this._isLoading=!1,this._loading=new _,this._clock=void 0,this._documentPacket=new ii,this._version=void 0,this._entityCollection=new le(this),this._entityCluster=new se}ke.packedLength=r.packedLength,ke.unpack=r.unpack,ke.pack=r.pack;var ni,oi=new r,ai=new O,si=new n,li=new L,ui=new P,ci={HERMITE:y,LAGRANGE:T,LINEAR:E},di={iso8601:void 0};return h(Yt.prototype,{isConstant:{get:function(){var e=this.polygon._positions,t=this.polygon._holes;return(!d(e)||e.isConstant)&&(!d(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}}),Yt.prototype.getValue=function(e,t){var i;d(this.polygon._positions)&&(i=this.polygon._positions.getValue(e));var r;return d(this.polygon._holes)&&(r=this.polygon._holes.getValue(e),d(r)&&(r=r.map(function(e){return new x(e)}))),d(t)?(t.positions=i,t.holes=r,t):new x(i,r)},Yt.prototype.equals=function(e){return this===e||e instanceof Yt&&Te.equals(this.polygon._positions,e.polygon._positions)&&Te.equals(this.polygon._holes,e.polygon._holes)},ri.load=function(e,t){return(new ri).load(e,t)},h(ri.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}}}),ri.updaters=[Ot,Lt,Nt,Ft,kt,zt,Vt,Ut,mt,_t,Wt,qt,jt,Qt,Ct,Kt,gt,vt,Zt,yt,Mt],ri.prototype.process=function(e,t){return ei(this,e,t,!1)},ri.prototype.load=function(e,t){return ei(this,e,t,!0)},ri.processPacketData=ut,ri.processPositionPacketData=ht,ri.processMaterialPacketData=ft,ri._processCzml=function(e,t,i,r,n){if(r=c(r,ri.updaters),C(e))for(var o=0,a=e.length;o<a;++o)Jt(e[o],t,r,i,n);else Jt(e,t,r,i,n)},ri}),define("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../ThirdParty/when"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o,this._dataSourceMoved=new o}function u(e,t){return e.indexOf(t)}function c(e,t,i){var r=e._dataSources,n=r.length-1;if(t=a.clamp(t,0,n),i=a.clamp(i,0,n),t!==i){var o=r[t];r[t]=r[i],r[i]=o,e.dataSourceMoved.raiseEvent(o,i,t)}}return i(l.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}}),l.prototype.add=function(e){var t=this,i=this._dataSources;return s(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},l.prototype.remove=function(t,i){i=e(i,!1);var r=this._dataSources.indexOf(t);return-1!==r&&(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0)},l.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=[]},l.prototype.contains=function(e){return-1!==this.indexOf(e)},l.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},l.prototype.get=function(e){return this._dataSources[e]},l.prototype.raise=function(e){var t=u(this._dataSources,e);c(this,t,t+1)},l.prototype.lower=function(e){var t=u(this._dataSources,e);c(this,t,t-1)},l.prototype.raiseToTop=function(e){var t=u(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))},l.prototype.lowerToBottom=function(e){var t=u(this._dataSources,e);0!==t&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this.removeAll(!0),r(this)},l}),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._zIndex=void 0,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||{};return(t._composites=t._composites||{})[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){for(var e=this._primitives,t=e.length,i=0;i<t;++i)delete e[i]._external._composites[this._guid],this.destroyPrimitives&&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.prePassesUpdate=function(e){for(var t=this._primitives,r=0;r<t.length;++r){var n=t[r];i(n.prePassesUpdate)&&n.prePassesUpdate(e)}},a.prototype.updateForPass=function(e,t){for(var r=this._primitives,n=0;n<r.length;++n){var o=r[n];i(o.updateForPass)&&o.updateForPass(e,t)}},a.prototype.postPassesUpdate=function(e){for(var t=this._primitives,r=0;r<t.length;++r){var n=t[r];i(n.postPassesUpdate)&&n.postPassesUpdate(e)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),define("Scene/OrderedGroundPrimitiveCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Check","../Core/DeveloperError","./PrimitiveCollection"],function(e,t,i,r,n,o,a){"use strict";function s(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}return i(s.prototype,{length:{get:function(){return this._length}}}),s.prototype.add=function(i,r){r=e(r,0);var n=this._collections[r];if(!t(n)){n=new a({destroyPrimitives:!1}),n._zIndex=r,this._collections[r]=n;for(var o=this._collectionsArray,s=0;s<o.length&&o[s]._zIndex<r;)s++;o.splice(s,0,n)}return n.add(i),this._length++,i._zIndex=r,i},s.prototype.set=function(e,t){return t===e._zIndex?e:(this.remove(e,!0),this.add(e,t),e)},s.prototype.remove=function(e,t){if(this.contains(e)){var i,r=e._zIndex,n=this._collections[r];return i=t?n.remove(e):n.removeAndDestroy(e),i&&this._length--,0===n.length&&(this._collectionsArray.splice(this._collectionsArray.indexOf(n),1),this._collections[r]=void 0,n.destroy()),i}return!1},s.prototype.removeAll=function(){for(var e=this._collectionsArray,t=0;t<e.length;t++){var i=e[t];i.destroyPrimitives=!0,i.destroy()}this._collections={},this._collectionsArray=[],this._length=0},s.prototype.contains=function(e){if(!t(e))return!1;var i=this._collections[e._zIndex];return t(i)&&i.contains(e)},s.prototype.update=function(e){if(this.show)for(var t=this._collectionsArray,i=0;i<t.length;i++)t[i].update(e)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(),r(this)},s}),define("DataSources/DynamicGeometryBatch",["../Core/AssociativeArray","../Core/defined","./BoundingSphereState"],function(e,t,i){"use strict";function r(t,i){this._primitives=t,this._orderedGroundPrimitives=i,this._dynamicUpdaters=new e}return r.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))},r.prototype.remove=function(e){var i=e.id,r=this._dynamicUpdaters.get(i);t(r)&&(this._dynamicUpdaters.remove(i),r.destroy())},r.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e);return!0},r.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},r.prototype.getBoundingSphere=function(e,r){return e=this._dynamicUpdaters.get(e.id),t(e)&&t(e.getBoundingSphere)?e.getBoundingSphere(r):i.FAILED},r}),define("DataSources/EllipseGeometryUpdater",["../Core/ApproximateTerrainHeights","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/GeometryInstance","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/Rectangle","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./GroundGeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E){"use strict";function A(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,this.offsetAttribute=void 0}function w(e,t){T.call(this,{entity:e,scene:t,geometryOptions:new A(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function x(e,t,i){b.call(this,e,t,i)}var P=new r,D=t.ZERO,I=new t,M=new f;return o(Object.create)&&(w.prototype=Object.create(T.prototype),w.prototype.constructor=w),w.prototype.createFillGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),a={show:new m(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:s.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof C){var u;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(u=this._materialProperty.color.getValue(e,P)),o(u)||(u=r.WHITE),a.color=n.fromColor(u)}return o(this._options.offsetAttribute)&&(a.offset=p.fromCartesian3(E.getValueOrDefault(this._terrainOffsetProperty,e,D,I))),new c({id:t,geometry:new l(this._options),attributes:a})},w.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,r.BLACK,P),l=this._distanceDisplayConditionProperty.getValue(e),d={show:new m(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:n.fromColor(a),distanceDisplayCondition:s.fromDistanceDisplayCondition(l),offset:void 0};return o(this._options.offsetAttribute)&&(d.offset=p.fromCartesian3(E.getValueOrDefault(this._terrainOffsetProperty,e,D,I))),new c({id:t,geometry:new u(this._options),attributes:d})},w.prototype._computeCenter=function(e,t){return E.getValueOrUndefined(this._entity.position,e,t)},w.prototype._isHidden=function(e,t){var i=e.position;return!o(i)||!o(t.semiMajorAxis)||!o(t.semiMinorAxis)||S.prototype._isHidden.call(this,e,t)},w.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!E.isConstant(t.rotation)||!E.isConstant(t.height)||!E.isConstant(t.extrudedHeight)||!E.isConstant(t.granularity)||!E.isConstant(t.stRotation)||!E.isConstant(t.outlineWidth)||!E.isConstant(t.numberOfVerticalLines)||!E.isConstant(t.zIndex)||this._onTerrain&&!E.isConstant(this._materialProperty)},w.prototype._setStaticOptions=function(t,i){var r=E.getValueOrUndefined(i.height,h.MINIMUM_VALUE),n=E.getValueOrDefault(i.heightReference,h.MINIMUM_VALUE,g.NONE),a=E.getValueOrUndefined(i.extrudedHeight,h.MINIMUM_VALUE),s=E.getValueOrDefault(i.extrudedHeightReference,h.MINIMUM_VALUE,g.NONE);o(a)&&!o(r)&&(r=0);var u=this._options;u.vertexFormat=this._materialProperty instanceof C?y.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,u.center=t.position.getValue(h.MINIMUM_VALUE,u.center),u.semiMajorAxis=i.semiMajorAxis.getValue(h.MINIMUM_VALUE,u.semiMajorAxis),u.semiMinorAxis=i.semiMinorAxis.getValue(h.MINIMUM_VALUE,u.semiMinorAxis),u.rotation=E.getValueOrUndefined(i.rotation,h.MINIMUM_VALUE),u.granularity=E.getValueOrUndefined(i.granularity,h.MINIMUM_VALUE),u.stRotation=E.getValueOrUndefined(i.stRotation,h.MINIMUM_VALUE),u.numberOfVerticalLines=E.getValueOrUndefined(i.numberOfVerticalLines,h.MINIMUM_VALUE),u.offsetAttribute=T.computeGeometryOffsetAttribute(r,n,a,s),u.height=T.getGeometryHeight(r,n),a=T.getGeometryExtrudedHeight(a,s),a===T.CLAMP_TO_GROUND&&(a=e.getMinimumMaximumHeights(l.computeRectangle(u,M)).minimumTerrainHeight),u.extrudedHeight=a},w.DynamicGeometryUpdater=x,o(Object.create)&&(x.prototype=Object.create(b.prototype),x.prototype.constructor=x),x.prototype._isHidden=function(e,t,i){var r=this._options;return!o(r.center)||!o(r.semiMajorAxis)||!o(r.semiMinorAxis)||b.prototype._isHidden.call(this,e,t,i)},x.prototype._setOptions=function(t,i,r){var n=this._options,a=E.getValueOrUndefined(i.height,r),s=E.getValueOrDefault(i.heightReference,r,g.NONE),u=E.getValueOrUndefined(i.extrudedHeight,r),c=E.getValueOrDefault(i.extrudedHeightReference,r,g.NONE);o(u)&&!o(a)&&(a=0),n.center=E.getValueOrUndefined(t.position,r,n.center),n.semiMajorAxis=E.getValueOrUndefined(i.semiMajorAxis,r),n.semiMinorAxis=E.getValueOrUndefined(i.semiMinorAxis,r),n.rotation=E.getValueOrUndefined(i.rotation,r),n.granularity=E.getValueOrUndefined(i.granularity,r),n.stRotation=E.getValueOrUndefined(i.stRotation,r),n.numberOfVerticalLines=E.getValueOrUndefined(i.numberOfVerticalLines,r),n.offsetAttribute=T.computeGeometryOffsetAttribute(a,s,u,c),n.height=T.getGeometryHeight(a,s),u=T.getGeometryExtrudedHeight(u,c),u===T.CLAMP_TO_GROUND&&(u=e.getMinimumMaximumHeights(l.computeRectangle(n,M)).minimumTerrainHeight),n.extrudedHeight=u},w}),define("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/GeometryInstance","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./heightReferenceOnEntityPropertyChanged","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function D(e,t){A.call(this,{entity:e,scene:t,geometryOptions:new P(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function I(t,i,r){E.call(this,t,i,r),this._scene=t._scene,this._modelMatrix=new m,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,this._lastOffset=new e,this._material={}}var M=new T(i.WHITE),R=e.ZERO,O=new e,L=new e,N=new i,F=new e(1,1,1);return o(Object.create)&&(D.prototype=Object.create(A.prototype),D.prototype.constructor=D),a(D.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),D.prototype.createFillGeometryInstance=function(e,t,n){var a,s=this._entity,c=s.isAvailable(e),h=new _(c&&s.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),p=this._distanceDisplayConditionProperty.getValue(e),m=l.fromDistanceDisplayCondition(p),g={show:h,
- distanceDisplayCondition:m,color:void 0,offset:void 0};if(this._materialProperty instanceof T){var v;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||c)&&(v=this._materialProperty.color.getValue(e,N)),o(v)||(v=i.WHITE),a=r.fromColor(v),g.color=a}return o(this._options.offsetAttribute)&&(g.offset=f.fromCartesian3(x.getValueOrDefault(this._terrainOffsetProperty,e,R,O))),new d({id:s,geometry:new u(this._options),modelMatrix:t?void 0:s.computeModelMatrixForHeightReference(e,s.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,n),attributes:g})},D.prototype.createOutlineGeometryInstance=function(e,t,n){var a=this._entity,s=a.isAvailable(e),u=x.getValueOrDefault(this._outlineColorProperty,e,i.BLACK,N),h=this._distanceDisplayConditionProperty.getValue(e),p={show:new _(s&&a.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(u),distanceDisplayCondition:l.fromDistanceDisplayCondition(h),offset:void 0};return o(this._options.offsetAttribute)&&(p.offset=f.fromCartesian3(x.getValueOrDefault(this._terrainOffsetProperty,e,R,O))),new d({id:a,geometry:new c(this._options),modelMatrix:t?void 0:a.computeModelMatrixForHeightReference(e,a.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,n),attributes:p})},D.prototype._computeCenter=function(e,t){return x.getValueOrUndefined(this._entity.position,e,t)},D.prototype._isHidden=function(e,t){return!o(e.position)||!o(t.radii)||A.prototype._isHidden.call(this,e,t)},D.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&x.isConstant(e.orientation)&&t.radii.isConstant&&x.isConstant(t.stackPartitions)&&x.isConstant(t.slicePartitions)&&x.isConstant(t.outlineWidth)&&x.isConstant(t.subdivisions))},D.prototype._setStaticOptions=function(e,t){var i=x.getValueOrDefault(t.heightReference,p.MINIMUM_VALUE,g.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof T?y.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,r.radii=t.radii.getValue(p.MINIMUM_VALUE,r.radii),r.stackPartitions=x.getValueOrUndefined(t.stackPartitions,p.MINIMUM_VALUE),r.slicePartitions=x.getValueOrUndefined(t.slicePartitions,p.MINIMUM_VALUE),r.subdivisions=x.getValueOrUndefined(t.subdivisions,p.MINIMUM_VALUE),r.offsetAttribute=i!==g.NONE?h.ALL:void 0},D.prototype._onEntityPropertyChanged=S,D.DynamicGeometryUpdater=I,o(Object.create)&&(I.prototype=Object.create(E.prototype),I.prototype.constructor=I),I.prototype.update=function(t){var a=this._entity,u=a.ellipsoid;if(!a.isShowing||!a.isAvailable(t)||!x.getValueOrDefault(u.show,t,!0))return o(this._primitive)&&(this._primitive.show=!1),void(o(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var c=x.getValueOrUndefined(u.radii,t,L),d=o(c)?a.computeModelMatrixForHeightReference(t,u.heightReference,.5*c.z,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!o(d)||!o(c))return o(this._primitive)&&(this._primitive.show=!1),void(o(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var p=x.getValueOrDefault(u.fill,t,!0),S=x.getValueOrDefault(u.outline,t,!1),T=x.getValueOrClonedDefault(u.outlineColor,t,i.BLACK,N),E=w.getValue(t,n(u.material,M),this._material),A=x.getValueOrUndefined(u.stackPartitions,t),P=x.getValueOrUndefined(u.slicePartitions,t),D=x.getValueOrUndefined(u.subdivisions,t),I=x.getValueOrDefault(u.outlineWidth,t,1),B=x.getValueOrDefault(u.heightReference,t,g.NONE),k=B!==g.NONE?h.ALL:void 0,z=this._scene.mode,V=z===b.SCENE3D&&B===g.NONE,U=this._options,G=this._geometryUpdater.shadowsProperty.getValue(t),H=this._geometryUpdater.distanceDisplayConditionProperty,W=H.getValue(t),q=x.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,t,R,O);if(V&&this._lastSceneMode===z&&o(this._primitive)&&U.stackPartitions===A&&U.slicePartitions===P&&U.subdivisions===D&&this._lastOutlineWidth===I&&U.offsetAttribute===k){if(this._primitive.ready){var Y=this._primitive,j=this._outlinePrimitive;Y.show=!0,j.show=!0,Y.appearance.material=E;var X=this._attributes;o(X)||(X=Y.getGeometryInstanceAttributes(a),this._attributes=X),p!==this._lastShow&&(X.show=_.toValue(p,X.show),this._lastShow=p);var Q=this._outlineAttributes;o(Q)||(Q=j.getGeometryInstanceAttributes(a),this._outlineAttributes=Q),S!==this._lastOutlineShow&&(Q.show=_.toValue(S,Q.show),this._lastOutlineShow=S),i.equals(T,this._lastOutlineColor)||(Q.color=r.toValue(T,Q.color),i.clone(T,this._lastOutlineColor)),s.equals(W,this._lastDistanceDisplayCondition)||(X.distanceDisplayCondition=l.toValue(W,X.distanceDisplayCondition),Q.distanceDisplayCondition=l.toValue(W,Q.distanceDisplayCondition),s.clone(W,this._lastDistanceDisplayCondition)),e.equals(q,this._lastOffset)||(X.offset=f.toValue(q,X.offset),Q.offset=f.toValue(q,X.offset),e.clone(q,this._lastOffset))}}else{var K=this._primitives;K.removeAndDestroy(this._primitive),K.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=z,this._lastOutlineWidth=I,U.stackPartitions=A,U.slicePartitions=P,U.subdivisions=D,U.offsetAttribute=k,U.radii=V?F:c;var Z=new v({material:E,translucent:E.isTranslucent(),closed:!0});U.vertexFormat=Z.vertexFormat;var J=this._geometryUpdater.createFillGeometryInstance(t,V,this._modelMatrix);this._primitive=K.add(new C({geometryInstances:J,appearance:Z,asynchronous:!1,shadows:G}));var $=this._geometryUpdater.createOutlineGeometryInstance(t,V,this._modelMatrix);this._outlinePrimitive=K.add(new C({geometryInstances:$,appearance:new y({flat:!0,translucent:255!==$.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:G})),this._lastShow=p,this._lastOutlineShow=S,this._lastOutlineColor=i.clone(T,this._lastOutlineColor),this._lastDistanceDisplayCondition=W,this._lastOffset=e.clone(q,this._lastOffset)}V&&(c.x=Math.max(c.x,.001),c.y=Math.max(c.y,.001),c.z=Math.max(c.z,.001),d=m.multiplyByScale(d,c,d),this._primitive.modelMatrix=d,this._outlinePrimitive.modelMatrix=d)},D}),define("DataSources/PlaneGeometryUpdater",["../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/PlaneGeometry","../Core/PlaneOutlineGeometry","../Core/Quaternion","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function E(e,t){b.call(this,{entity:e,scene:t,geometryOptions:new T(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}function A(e,t,i){C.call(this,e,t,i)}function w(i,r,n,o,a){var s=i.normal,l=i.distance,u=t.multiplyByScalar(s,-l,M);u=h.multiplyByPoint(n,u,u);var p=h.multiplyByPointAsVector(n,s,R);t.normalize(p,p);var f=o.geodeticSurfaceNormal(u,I);c.equalsEpsilon(Math.abs(t.dot(f,p)),1,c.EPSILON8)&&(f=t.clone(t.UNIT_Z,f));var _=t.cross(f,p,D);f=t.cross(p,_,f),t.normalize(_,_),t.normalize(f,f);var g=N;d.setColumn(g,0,_,g),d.setColumn(g,1,f,g),d.setColumn(g,2,p,g);var v=m.fromRotationMatrix(g,L),y=e.clone(r,O);return y.z=1,h.fromTranslationQuaternionRotationScale(u,v,y,a)}var x=new t,P=new r;o(Object.create)&&(E.prototype=Object.create(b.prototype),E.prototype.constructor=E),E.prototype.createFillGeometryInstance=function(e){var t,i,a=this._entity,u=a.isAvailable(e),c=new _(u&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),d=this._distanceDisplayConditionProperty.getValue(e),h=s.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var f;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||u)&&(f=this._materialProperty.color.getValue(e,P)),o(f)||(f=r.WHITE),i=n.fromColor(f),t={show:c,distanceDisplayCondition:h,color:i}}else t={show:c,distanceDisplayCondition:h};var m=a.plane,g=this._options,v=a.computeModelMatrix(e),C=S.getValueOrDefault(m.plane,e,g.plane),b=S.getValueOrUndefined(m.dimensions,e,g.dimensions);return g.plane=C,g.dimensions=b,v=w(C,b,v,this._scene.mapProjection.ellipsoid,v),new l({id:a,geometry:new p(this._options),modelMatrix:v,attributes:t})},E.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),o=S.getValueOrDefault(this._outlineColorProperty,e,r.BLACK,P),a=this._distanceDisplayConditionProperty.getValue(e),u=t.plane,c=this._options,d=t.computeModelMatrix(e),h=S.getValueOrDefault(u.plane,e,c.plane),p=S.getValueOrUndefined(u.dimensions,e,c.dimensions);return c.plane=h,c.dimensions=p,d=w(h,p,d,this._scene.mapProjection.ellipsoid,d),new l({id:t,geometry:new f,modelMatrix:d,attributes:{show:new _(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:n.fromColor(o),distanceDisplayCondition:s.fromDistanceDisplayCondition(a)}})},E.prototype._isHidden=function(e,t){return!o(t.plane)||!o(t.dimensions)||!o(e.position)||b.prototype._isHidden.call(this,e,t)},E.prototype._getIsClosed=function(e){return!1},E.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&S.isConstant(e.orientation)&&t.plane.isConstant&&t.dimensions.isConstant&&S.isConstant(t.outlineWidth))},E.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof y,r=this._options;r.vertexFormat=i?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,r.plane=t.plane.getValue(u.MINIMUM_VALUE,r.plane),r.dimensions=t.dimensions.getValue(u.MINIMUM_VALUE,r.dimensions)},E.DynamicGeometryUpdater=A,o(Object.create)&&(A.prototype=Object.create(C.prototype),A.prototype.constructor=A),A.prototype._isHidden=function(e,t,i){var r=this._options,n=S.getValueOrUndefined(e.position,i,x);return!o(n)||!o(r.plane)||!o(r.dimensions)||C.prototype._isHidden.call(this,e,t,i)},A.prototype._setOptions=function(e,t,i){var r=this._options;r.plane=S.getValueOrDefault(t.plane,i,r.plane),r.dimensions=S.getValueOrUndefined(t.dimensions,i,r.dimensions)};var D=new t,I=new t,M=new t,R=new t,O=new t,L=new m,N=new d;return E.createPrimitiveMatrix=w,E}),define("DataSources/PolygonGeometryUpdater",["../Core/ApproximateTerrainHeights","../Core/ArcType","../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CoplanarPolygonGeometry","../Core/CoplanarPolygonOutlineGeometry","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidTangentPlane","../Core/GeometryInstance","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonOutlineGeometry","../Core/Rectangle","../Core/ShowGeometryInstanceAttribute","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./GroundGeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P){"use strict";function D(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,this.offsetAttribute=void 0,this.arcType=void 0}function I(e,t){x.call(this,{entity:e,scene:t,geometryOptions:new D(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function M(e,t,i){A.call(this,e,t,i)}var R=new o,O=r.ZERO,L=new r,N=new y,F=[],B=new i;return u(Object.create)&&(I.prototype=Object.create(x.prototype),I.prototype.constructor=I),I.prototype.createFillGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=this._options,n={show:new C(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:d.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof E){var l;u(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(l=this._materialProperty.color.getValue(e,R)),u(l)||(l=o.WHITE),n.color=a.fromColor(l)}u(r.offsetAttribute)&&(n.offset=m.fromCartesian3(P.getValueOrDefault(this._terrainOffsetProperty,e,O,L)));var c;return c=r.perPositionHeight&&!u(r.extrudedHeight)?new s(r):new g(r),new p({id:t,geometry:c,attributes:n})},I.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=this._options,n=P.getValueOrDefault(this._outlineColorProperty,e,o.BLACK,R),s=this._distanceDisplayConditionProperty.getValue(e),c={show:new C(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:a.fromColor(n),distanceDisplayCondition:d.fromDistanceDisplayCondition(s),offset:void 0};u(r.offsetAttribute)&&(c.offset=m.fromCartesian3(P.getValueOrDefault(this._terrainOffsetProperty,e,O,L)));var h;return h=r.perPositionHeight&&!u(r.extrudedHeight)?new l(r):new v(r),new p({id:t,geometry:h,attributes:c})},I.prototype._computeCenter=function(e,t){var r=P.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(u(r)){var n=r.positions;if(0!==n.length){for(var o=this._scene.mapProjection.ellipsoid,a=h.fromPoints(n,o),s=a.projectPointsOntoPlane(n,F),l=s.length,c=0,d=l-1,p=new i,f=0;f<l;d=f++){var m=s[f],_=s[d],g=m.x*_.y-_.x*m.y,v=i.add(m,_,B);v=i.multiplyByScalar(v,g,v),p=i.add(p,v,p),c+=g}var y=1/(3*c);return p=i.multiplyByScalar(p,y,p),a.projectPointOntoEllipsoid(p,t)}}},I.prototype._isHidden=function(e,t){return!u(t.hierarchy)||w.prototype._isHidden.call(this,e,t)},I.prototype._isOnTerrain=function(e,t){var i=x.prototype._isOnTerrain.call(this,e,t),r=t.perPositionHeight,n=u(r)&&(!r.isConstant||r.getValue(f.MINIMUM_VALUE));return i&&!n},I.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!P.isConstant(t.height)||!P.isConstant(t.extrudedHeight)||!P.isConstant(t.granularity)||!P.isConstant(t.stRotation)||!P.isConstant(t.outlineWidth)||!P.isConstant(t.perPositionHeight)||!P.isConstant(t.closeTop)||!P.isConstant(t.closeBottom)||!P.isConstant(t.zIndex)||!P.isConstant(t.arcType)||this._onTerrain&&!P.isConstant(this._materialProperty)},I.prototype._setStaticOptions=function(i,r){var n=this._materialProperty instanceof E,o=this._options;o.vertexFormat=n?T.VERTEX_FORMAT:S.MaterialSupport.TEXTURED.vertexFormat;var a=r.hierarchy.getValue(f.MINIMUM_VALUE),s=P.getValueOrUndefined(r.height,f.MINIMUM_VALUE),l=P.getValueOrDefault(r.heightReference,f.MINIMUM_VALUE,b.NONE),c=P.getValueOrUndefined(r.extrudedHeight,f.MINIMUM_VALUE),d=P.getValueOrDefault(r.extrudedHeightReference,f.MINIMUM_VALUE,b.NONE),h=P.getValueOrDefault(r.perPositionHeight,f.MINIMUM_VALUE,!1);s=x.getGeometryHeight(s,l);var p;h?(u(s)&&(s=void 0,_("Entity polygons cannot have both height and perPositionHeight. height will be ignored")),l!==b.NONE&&h&&(s=void 0,_("heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored"))):(u(c)&&!u(s)&&(s=0),p=x.computeGeometryOffsetAttribute(s,l,c,d)),o.polygonHierarchy=a,o.granularity=P.getValueOrUndefined(r.granularity,f.MINIMUM_VALUE),o.stRotation=P.getValueOrUndefined(r.stRotation,f.MINIMUM_VALUE),o.perPositionHeight=h,o.closeTop=P.getValueOrDefault(r.closeTop,f.MINIMUM_VALUE,!0),o.closeBottom=P.getValueOrDefault(r.closeBottom,f.MINIMUM_VALUE,!0),o.offsetAttribute=p,o.height=s,o.arcType=P.getValueOrDefault(r.arcType,f.MINIMUM_VALUE,t.GEODESIC),c=x.getGeometryExtrudedHeight(c,d),c===x.CLAMP_TO_GROUND&&(c=e.getMinimumMaximumHeights(g.computeRectangle(o,N)).minimumTerrainHeight),o.extrudedHeight=c},I.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight,r=u(i)&&i!==t;return!e.perPositionHeight&&(!r&&0===t||r&&e.closeTop&&e.closeBottom)},I.DynamicGeometryUpdater=M,u(Object.create)&&(M.prototype=Object.create(A.prototype),M.prototype.constructor=M),M.prototype._isHidden=function(e,t,i){return!u(this._options.polygonHierarchy)||A.prototype._isHidden.call(this,e,t,i)},M.prototype._setOptions=function(i,r,n){var o=this._options;o.polygonHierarchy=P.getValueOrUndefined(r.hierarchy,n);var a=P.getValueOrUndefined(r.height,n),s=P.getValueOrDefault(r.heightReference,n,b.NONE),l=P.getValueOrDefault(r.extrudedHeightReference,n,b.NONE),c=P.getValueOrUndefined(r.extrudedHeight,n),d=P.getValueOrUndefined(r.perPositionHeight,n);a=x.getGeometryHeight(a,l);var h;d?(u(a)&&(a=void 0,_("Entity polygons cannot have both height and perPositionHeight. height will be ignored")),s!==b.NONE&&d&&(a=void 0,_("heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored"))):(u(c)&&!u(a)&&(a=0),h=x.computeGeometryOffsetAttribute(a,s,c,l)),o.granularity=P.getValueOrUndefined(r.granularity,n),o.stRotation=P.getValueOrUndefined(r.stRotation,n),o.perPositionHeight=P.getValueOrUndefined(r.perPositionHeight,n),o.closeTop=P.getValueOrDefault(r.closeTop,n,!0),o.closeBottom=P.getValueOrDefault(r.closeBottom,n,!0),o.offsetAttribute=h,o.height=a,o.arcType=P.getValueOrDefault(r.arcType,n,t.GEODESIC),c=x.getGeometryExtrudedHeight(c,l),c===x.CLAMP_TO_GROUND&&(c=e.getMinimumMaximumHeights(g.computeRectangle(o,N)).minimumTerrainHeight),o.extrudedHeight=c},I}),define("DataSources/PolylineVolumeGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(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 v(e,t){m.call(this,{entity:e,scene:t,geometryOptions:new g(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function y(e,t,i){f.call(this,e,t,i)}var C=new t;return r(Object.create)&&(v.prototype=Object.create(m.prototype),v.prototype.constructor=v),v.prototype.createFillGeometryInstance=function(e){var n,s,u=this._entity,d=u.isAvailable(e),h=new c(d&&u.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),f=this._distanceDisplayConditionProperty.getValue(e),m=o.fromDistanceDisplayCondition(f);if(this._materialProperty instanceof p){var _;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(_=this._materialProperty.color.getValue(e,C)),r(_)||(_=t.WHITE),s=i.fromColor(_),n={show:h,distanceDisplayCondition:m,color:s}}else n={show:h,distanceDisplayCondition:m};return new a({id:u,geometry:new l(this._options),attributes:n})},v.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),s=_.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,C),l=this._distanceDisplayConditionProperty.getValue(e);return new a({id:r,geometry:new u(this._options),attributes:{show:new c(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(s),distanceDisplayCondition:o.fromDistanceDisplayCondition(l)}})},v.prototype._isHidden=function(e,t){return!r(t.positions)||!r(t.shape)||m.prototype._isHidden.call(this,e,t)},v.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&t.shape.isConstant&&_.isConstant(t.granularity)&&_.isConstant(t.outlineWidth)&&_.isConstant(t.cornerType))},v.prototype._setStaticOptions=function(e,t){var i=t.granularity,n=t.cornerType,o=this._options,a=this._materialProperty instanceof p;o.vertexFormat=a?h.VERTEX_FORMAT:d.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(s.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(s.MINIMUM_VALUE,o.shape),o.granularity=r(i)?i.getValue(s.MINIMUM_VALUE):void 0,o.cornerType=r(n)?n.getValue(s.MINIMUM_VALUE):void 0},v.DynamicGeometryUpdater=y,r(Object.create)&&(y.prototype=Object.create(f.prototype),y.prototype.constructor=y),y.prototype._isHidden=function(e,t,i){var n=this._options;return!r(n.polylinePositions)||!r(n.shapePositions)||f.prototype._isHidden.call(this,e,t,i)},y.prototype._setOptions=function(e,t,i){var r=this._options;r.polylinePositions=_.getValueOrUndefined(t.positions,i,r.polylinePositions),r.shapePositions=_.getValueOrUndefined(t.shape,i),r.granularity=_.getValueOrUndefined(t.granularity,i),r.cornerType=_.getValueOrUndefined(t.cornerType,i)},v}),define("DataSources/RectangleGeometryUpdater",["../Core/ApproximateTerrainHeights","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Ellipsoid","../Core/GeometryInstance","../Core/GeometryOffsetAttribute","../Core/Iso8601","../Core/OffsetGeometryInstanceAttribute","../Core/Rectangle","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/HeightReference","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./GroundGeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function P(e,t){A.call(this,{entity:e,scene:t,geometryOptions:new x(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function D(e,t,i){T.call(this,e,t,i)}var I=new n,M=t.ZERO,R=new t,O=new f,L=new f,N=new i;return a(Object.create)&&(P.prototype=Object.create(A.prototype),P.prototype.constructor=P),P.prototype.createFillGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r={show:new g(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:l.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof S){var s;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(s=this._materialProperty.color.getValue(e,I)),a(s)||(s=n.WHITE),r.color=o.fromColor(s)}return a(this._options.offsetAttribute)&&(r.offset=p.fromCartesian3(w.getValueOrDefault(this._terrainOffsetProperty,e,M,R))),new c({id:t,geometry:new m(this._options),attributes:r})},P.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=w.getValueOrDefault(this._outlineColorProperty,e,n.BLACK,I),s=this._distanceDisplayConditionProperty.getValue(e),u={show:new g(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o.fromColor(r),distanceDisplayCondition:l.fromDistanceDisplayCondition(s),offset:void 0};return a(this._options.offsetAttribute)&&(u.offset=p.fromCartesian3(w.getValueOrDefault(this._terrainOffsetProperty,e,M,R))),new c({id:t,geometry:new _(this._options),attributes:u})},P.prototype._computeCenter=function(e,t){var r=w.getValueOrUndefined(this._entity.rectangle.coordinates,e,L);if(a(r)){var n=f.center(r,N);return i.toCartesian(n,u.WGS84,t)}},P.prototype._isHidden=function(e,t){return!a(t.coordinates)||E.prototype._isHidden.call(this,e,t)},P.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!w.isConstant(t.height)||!w.isConstant(t.extrudedHeight)||!w.isConstant(t.granularity)||!w.isConstant(t.stRotation)||!w.isConstant(t.rotation)||!w.isConstant(t.outlineWidth)||!w.isConstant(t.zIndex)||this._onTerrain&&!w.isConstant(this._materialProperty)},P.prototype._setStaticOptions=function(t,i){var r=this._materialProperty instanceof S,n=w.getValueOrUndefined(i.height,h.MINIMUM_VALUE),o=w.getValueOrDefault(i.heightReference,h.MINIMUM_VALUE,y.NONE),s=w.getValueOrUndefined(i.extrudedHeight,h.MINIMUM_VALUE),l=w.getValueOrDefault(i.extrudedHeightReference,h.MINIMUM_VALUE,y.NONE);a(s)&&!a(n)&&(n=0);var u=this._options;u.vertexFormat=r?b.VERTEX_FORMAT:C.MaterialSupport.TEXTURED.vertexFormat,u.rectangle=i.coordinates.getValue(h.MINIMUM_VALUE,u.rectangle),u.granularity=w.getValueOrUndefined(i.granularity,h.MINIMUM_VALUE),u.stRotation=w.getValueOrUndefined(i.stRotation,h.MINIMUM_VALUE),u.rotation=w.getValueOrUndefined(i.rotation,h.MINIMUM_VALUE),u.offsetAttribute=A.computeGeometryOffsetAttribute(n,o,s,l),u.height=A.getGeometryHeight(n,o),s=A.getGeometryExtrudedHeight(s,l),s===A.CLAMP_TO_GROUND&&(s=e.getMinimumMaximumHeights(m.computeRectangle(u,O)).minimumTerrainHeight),u.extrudedHeight=s},P.DynamicGeometryUpdater=D,a(Object.create)&&(D.prototype=Object.create(T.prototype),D.prototype.constructor=D),D.prototype._isHidden=function(e,t,i){return!a(this._options.rectangle)||T.prototype._isHidden.call(this,e,t,i)},D.prototype._setOptions=function(t,i,r){var n=this._options,o=w.getValueOrUndefined(i.height,r),s=w.getValueOrDefault(i.heightReference,r,y.NONE),l=w.getValueOrUndefined(i.extrudedHeight,r),u=w.getValueOrDefault(i.extrudedHeightReference,r,y.NONE);a(l)&&!a(o)&&(o=0),n.rectangle=w.getValueOrUndefined(i.coordinates,r,n.rectangle),n.granularity=w.getValueOrUndefined(i.granularity,r),n.stRotation=w.getValueOrUndefined(i.stRotation,r),n.rotation=w.getValueOrUndefined(i.rotation,r),n.offsetAttribute=A.computeGeometryOffsetAttribute(o,s,l,u),n.height=A.getGeometryHeight(o,s),l=A.getGeometryExtrudedHeight(l,u),l===A.CLAMP_TO_GROUND&&(l=e.getMinimumMaximumHeights(m.computeRectangle(n,O)).minimumTerrainHeight),n.extrudedHeight=l},P}),define("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/OffsetGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,i,r,o,a,s,l){this.translucent=i,this.appearanceType=r,this.depthFailAppearanceType=o,this.depthFailMaterialProperty=a,this.depthFailMaterial=void 0,this.closed=s,this.shadows=l,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=[],this.invalidated=!1;var u;n(a)&&(u=a.definitionChanged.addEventListener(f.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=u}function m(e,t,i,r,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}function _(e,t){for(var i=e.length,r=i-1;r>=0;r--){var n=e[r];if(n.remove(t))return 0===n.updaters.length&&(e.splice(r,1),n.destroy()),!0}return!1}function g(e,t,i){for(var r=!1,n=t.length,o=0;o<n;++o){var a=t[o],s=a.itemsToRemove,l=s.length;if(l>0)for(o=0;o<l;o++){var u=s[o];a.remove(u),e.add(i,u),r=!0}}return r}function v(e,t,i,r){var n,o=t.length;for(n=o-1;n>=0;n--){var a=t[n];if(a.invalidated){t.splice(n,1);for(var s=a.updaters.values,l=s.length,u=0;u<l;u++)e.add(i,s[u]);a.destroy()}}for(o=t.length,n=0;n<o;++n)r=t[n].update(i)&&r;return r}function y(e,t,i){for(var r=e.length,n=0;n<r;n++){var o=e[n];if(o.contains(t))return o.getBoundingSphere(t,i)}return c.FAILED}function C(e){for(var t=e.length,i=0;i<t;i++)e[i].destroy();e.length=0}var b=new i,S=new o,T=new o,E=t.ZERO,A=new t;return f.prototype.onMaterialChanged=function(){this.invalidated=!0},f.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,i=e.depthFailMaterialProperty;return i===t||!!n(t)&&t.equals(i)},f.prototype.add=function(e,t){var i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&p.isConstant(e.distanceDisplayConditionProperty)&&p.isConstant(e.terrainOffsetProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(i,e)},f.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return n(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},f.prototype.update=function(e){var c,f=!0,m=0,_=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values;if(v.length>0){n(_)&&(n(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_);var y;n(this.depthFailAppearanceType)&&(n(this.depthFailMaterialProperty)&&(this.depthFailMaterial=h.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),y=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),_=new u({show:!1,asynchronous:!0,geometryInstances:v,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:y,shadows:this.shadows}),g.add(_),f=!1}else{n(_)&&(g.remove(_),_=void 0);var C=this.oldPrimitive;n(C)&&(g.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=_,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(n(_)&&_.ready){_.show=!0,n(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0),!n(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof d||(this.depthFailMaterial=h.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var w=this.updatersWithAttributes.values,x=w.length,P=this.waitingOnCreate;for(c=0;c<x;c++){var D=w[c],I=this.geometry.get(D.id),M=this.attributes.get(I.id.id);if(n(M)||(M=_.getGeometryInstanceAttributes(I.id),this.attributes.set(I.id.id,M)),!D.fillMaterialProperty.isConstant||P){var R=D.fillMaterialProperty.color,O=p.getValueOrDefault(R,e,i.WHITE,b);i.equals(M._lastColor,O)||(M._lastColor=i.clone(O,M._lastColor),M.color=r.toValue(O,M.color),(this.translucent&&255===M.color[3]||!this.translucent&&255!==M.color[3])&&(this.itemsToRemove[m++]=D))}if(n(this.depthFailAppearanceType)&&D.depthFailMaterialProperty instanceof d&&(!D.depthFailMaterialProperty.isConstant||P)){var L=D.depthFailMaterialProperty.color,N=p.getValueOrDefault(L,e,i.WHITE,b);i.equals(M._lastDepthFailColor,N)||(M._lastDepthFailColor=i.clone(N,M._lastDepthFailColor),M.depthFailColor=r.toValue(N,M.depthFailColor))}var F=D.entity.isShowing&&(D.hasConstantFill||D.isFilled(e)),B=1===M.show[0];F!==B&&(M.show=l.toValue(F,M.show));var k=D.distanceDisplayConditionProperty;if(!p.isConstant(k)){var z=p.getValueOrDefault(k,e,T,S)
- ;o.equals(z,M._lastDistanceDisplayCondition)||(M._lastDistanceDisplayCondition=o.clone(z,M._lastDistanceDisplayCondition),M.distanceDisplayCondition=a.toValue(z,M.distanceDisplayCondition))}var V=D.terrainOffsetProperty;if(!p.isConstant(V)){var U=p.getValueOrDefault(V,e,E,A);t.equals(U,M._lastOffset)||(M._lastOffset=t.clone(U,M._lastOffset),M.offset=s.toValue(U,M.offset))}}this.updateShows(_),this.waitingOnCreate=!1}else n(_)&&!_.ready&&(f=!1);return this.itemsToRemove.length=m,f},f.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var o=t[r],a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);n(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));var u=o.entity.isShowing;u!==(1===s.show[0])&&(s.show=l.toValue(u,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},f.prototype.contains=function(e){return this.updaters.contains(e.id)},f.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return c.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!n(r)||!n(r.boundingSphere)||n(r.show)&&0===r.show[0]?c.FAILED:(r.boundingSphere.clone(t),c.DONE)},f.prototype.destroy=function(){var e=this.primitive,t=this.primitives;n(e)&&t.remove(e);var i=this.oldPrimitive;n(i)&&t.remove(i),n(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},m.prototype.add=function(e,t){var i,r,n=t.createFillGeometryInstance(e);255===n.attributes.color.value[3]?(i=this._solidItems,r=!1):(i=this._translucentItems,r=!0);for(var o=i.length,a=0;a<o;a++){var s=i[a];if(s.isMaterial(t))return void s.add(t,n)}var l=new f(this._primitives,r,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);l.add(t,n),i.push(l)},m.prototype.remove=function(e){_(this._solidItems,e)||_(this._translucentItems,e)},m.prototype.update=function(e){var t=v(this,this._solidItems,e,!0);t=v(this,this._translucentItems,e,t)&&t;var i=g(this,this._solidItems,e),r=g(this,this._translucentItems,e);return(i||r)&&(t=v(this,this._solidItems,e,t)&&t,t=v(this,this._translucentItems,e,t)&&t),t},m.prototype.getBoundingSphere=function(e,t){var i=y(this._solidItems,e,t);return i===c.FAILED?y(this._translucentItems,e,t):i},m.prototype.removeAllPrimitives=function(){C(this._solidItems),C(this._translucentItems)},m}),define("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/OffsetGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,i,r,n,o,a,s){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.depthFailAppearanceType=n,this.depthFailMaterialProperty=o,this.closed=a,this.shadows=s,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(f.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function m(e,t,i,r,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}var _=new o,g=new o,v=t.ZERO,y=new t;f.prototype.onMaterialChanged=function(){this.invalidated=!0},f.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty,r=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(i===t&&o===r)return!0;var a=n(t)&&t.equals(i);return a=(!n(r)&&!n(o)||n(r)&&r.equals(o))&&a},f.prototype.add=function(e,t){var i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&p.isConstant(t.distanceDisplayConditionProperty)&&p.isConstant(t.terrainOffsetProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},f.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return n(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var C=new i;return f.prototype.update=function(e){var c,f=!0,m=this.primitive,b=this.primitives,S=this.geometry.values;if(this.createPrimitive){if(S.length>0){n(m)&&(n(this.oldPrimitive)?b.remove(m):this.oldPrimitive=m),this.material=h.getValue(e,this.materialProperty,this.material);var T;n(this.depthFailMaterialProperty)&&(this.depthFailMaterial=h.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),T=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),m=new u({show:!1,asynchronous:!0,geometryInstances:S,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:T,shadows:this.shadows}),b.add(m),f=!1}else{n(m)&&(b.remove(m),m=void 0);var E=this.oldPrimitive;n(E)&&(b.remove(E),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1}else if(n(m)&&m.ready){m.show=!0,n(this.oldPrimitive)&&(b.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=h.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!n(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof d||(this.depthFailMaterial=h.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var A=this.updatersWithAttributes.values,w=A.length;for(c=0;c<w;c++){var x=A[c],P=x.entity,D=this.geometry.get(x.id),I=this.attributes.get(D.id.id);if(n(I)||(I=m.getGeometryInstanceAttributes(D.id),this.attributes.set(D.id.id,I)),n(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof d&&!x.depthFailMaterialProperty.isConstant){var M=x.depthFailMaterialProperty.color,R=p.getValueOrDefault(M,e,i.WHITE,C);i.equals(I._lastDepthFailColor,R)||(I._lastDepthFailColor=i.clone(R,I._lastDepthFailColor),I.depthFailColor=r.toValue(R,I.depthFailColor))}var O=P.isShowing&&(x.hasConstantFill||x.isFilled(e)),L=1===I.show[0];O!==L&&(I.show=l.toValue(O,I.show));var N=x.distanceDisplayConditionProperty;if(!p.isConstant(N)){var F=p.getValueOrDefault(N,e,g,_);o.equals(F,I._lastDistanceDisplayCondition)||(I._lastDistanceDisplayCondition=o.clone(F,I._lastDistanceDisplayCondition),I.distanceDisplayCondition=a.toValue(F,I.distanceDisplayCondition))}var B=x.terrainOffsetProperty;if(!p.isConstant(B)){var k=p.getValueOrDefault(B,e,v,y);t.equals(k,I._lastOffset)||(I._lastOffset=t.clone(k,I._lastOffset),I.offset=s.toValue(k,I.offset))}}this.updateShows(m)}else n(m)&&!m.ready&&(f=!1);return f},f.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var o=t[r],a=o.entity,s=this.geometry.get(o.id),u=this.attributes.get(s.id.id);n(u)||(u=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,u));var c=a.isShowing;c!==(1===u.show[0])&&(u.show=l.toValue(c,u.show),s.attributes.show.value[0]=u.show[0])}this.showsUpdated.removeAll()},f.prototype.contains=function(e){return this.updaters.contains(e.id)},f.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return c.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!n(r)||!n(r.boundingSphere)||n(r.show)&&0===r.show[0]?c.FAILED:(r.boundingSphere.clone(t),c.DONE)},f.prototype.destroy=function(){var e=this.primitive,t=this.primitives;n(e)&&t.remove(e);var i=this.oldPrimitive;n(i)&&t.remove(i),this.removeMaterialSubscription()},m.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 f(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(e,t),i.push(a)},m.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}}},m.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<i.length;t++)l=i[t].update(e)&&l;return l},m.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 c.FAILED},m.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0},m}),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,n,o){this.primitives=t,this.zIndex=o,this.classificationType=i,this.color=r,this.key=n,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,i){this._batches=new e,this._primitives=t,this._classificationType=i}var d=new t,h=new r,p=new r;u.prototype.add=function(e,t){var i=e.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(e.id,e)}))}else this.updatersWithAttributes.set(i,e)},u.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);return i(r)&&(r(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var f=new Array(4);return u.prototype.update=function(e){var s,u=!0,c=0,m=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values;if(g.length>0)i(m)&&(i(this.oldPrimitive)?_.remove(m):this.oldPrimitive=m),m=new a({show:!1,asynchronous:!0,geometryInstances:g,classificationType:this.classificationType}),_.add(m,this.zIndex),u=!1;else{i(m)&&(_.remove(m),m=void 0);var v=this.oldPrimitive;i(v)&&(_.remove(v),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(m)&&m.ready){m.show=!0,i(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var y=this.updatersWithAttributes.values,C=y.length,b=this.waitingOnCreate;for(s=0;s<C;s++){var S=y[s],T=this.geometry.get(S.id),E=this.attributes.get(T.id.id);if(i(E)||(E=m.getGeometryInstanceAttributes(T.id),this.attributes.set(T.id.id,E)),!S.fillMaterialProperty.isConstant||b){var A=S.fillMaterialProperty.color,w=l.getValueOrDefault(A,e,t.WHITE,d);if(!t.equals(E._lastColor,w)){E._lastColor=t.clone(w,E._lastColor);var x=this.color,P=w.toBytes(f);x[0]===P[0]&&x[1]===P[1]&&x[2]===P[2]&&x[3]===P[3]||(this.itemsToRemove[c++]=S)}}var D=S.entity.isShowing&&(S.hasConstantFill||S.isFilled(e)),I=1===E.show[0];D!==I&&(E.show=o.toValue(D,E.show));var M=S.distanceDisplayConditionProperty;if(!l.isConstant(M)){var R=l.getValueOrDefault(M,e,p,h);r.equals(R,E._lastDistanceDisplayCondition)||(E._lastDistanceDisplayCondition=r.clone(R,E._lastDistanceDisplayCondition),E.distanceDisplayCondition=n.toValue(R,E.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else i(m)&&!m.ready&&(u=!1);return this.itemsToRemove.length=c,u},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.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;u!==(1===l.show[0])&&(l.show=o.toValue(u,l.show),s.attributes.show.value[0]=l.show[0])}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.entity);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=l.getValueOrDefault(t.zIndex,0),a=new Uint32Array(r.attributes.color.value.buffer)[0]+":"+o;return n.contains(a)?i=n.get(a):(i=new u(this._primitives,this._classificationType,r.attributes.color.value,a,o),n.set(a,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/StaticGroundGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Core/RectangleCollisionChecker","../Scene/ClassificationType","../Scene/GroundPrimitive","../Scene/ShadowVolumeAppearance","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,i,r,n,o,s){this.primitives=t,this.classificationType=i,this.appearanceType=r,this.materialProperty=n,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(f.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e,this.usingSphericalTextureCoordinates=o,this.zIndex=s,this.rectangleCollisionCheck=new a}function m(e,t,i){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=i}var _=new r,g=new r;return f.prototype.onMaterialChanged=function(){this.invalidated=!0},f.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},f.prototype.isMaterial=function(e){var t=this.materialProperty,r=e.fillMaterialProperty;return r===t||r instanceof d&&t instanceof d||i(t)&&t.equals(r)},f.prototype.add=function(e,t,i){var r=t.id;if(this.updaters.set(r,t),this.geometry.set(r,i),this.rectangleCollisionCheck.insert(r,i.geometry.rectangle),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&p.isConstant(t.distanceDisplayConditionProperty)){var n=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener(function(e,i,r,o){"isShowing"===i&&n.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},f.prototype.remove=function(e){var t=e.id,r=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,r.geometry.rectangle),this.updatersWithAttributes.remove(t);var n=this.subscriptions.get(t);return i(n)&&(n(),this.subscriptions.remove(t)),!0}return!1},f.prototype.update=function(e){var t,a=!0,s=this.primitive,u=this.primitives,c=this.geometry.values;if(this.createPrimitive){if(c.length>0)i(s)&&(i(this.oldPrimitive)?u.remove(s):this.oldPrimitive=s),this.material=h.getValue(e,this.materialProperty,this.material),s=new l({show:!1,asynchronous:!0,geometryInstances:c,appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),u.add(s,this.zIndex),a=!1;else{i(s)&&(u.remove(s),s=void 0);var d=this.oldPrimitive;i(d)&&(u.remove(d),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=s,this.createPrimitive=!1}else if(i(s)&&s.ready){s.show=!0,i(this.oldPrimitive)&&(u.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=h.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var f=this.updatersWithAttributes.values,m=f.length;for(t=0;t<m;t++){var v=f[t],y=v.entity,C=this.geometry.get(v.id),b=this.attributes.get(C.id.id);i(b)||(b=s.getGeometryInstanceAttributes(C.id),this.attributes.set(C.id.id,b));var S=y.isShowing&&(v.hasConstantFill||v.isFilled(e)),T=1===b.show[0];S!==T&&(b.show=o.toValue(S,b.show));var E=v.distanceDisplayConditionProperty;if(!p.isConstant(E)){var A=p.getValueOrDefault(E,e,g,_);r.equals(A,b._lastDistanceDisplayCondition)||(b._lastDistanceDisplayCondition=r.clone(A,b._lastDistanceDisplayCondition),b.distanceDisplayCondition=n.toValue(A,b.distanceDisplayCondition))}}this.updateShows(s)}else i(s)&&!s.ready&&(a=!1);return a},f.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var a=t[n],s=a.entity,l=this.geometry.get(a.id),u=this.attributes.get(l.id.id);i(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing;c!==(1===u.show[0])&&(u.show=o.toValue(c,u.show),l.attributes.show.value[0]=u.show[0])}this.showsUpdated.removeAll()},f.prototype.contains=function(e){return this.updaters.contains(e.id)},f.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return c.PENDING;var n=r.getGeometryInstanceAttributes(e.entity);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?c.FAILED:(n.boundingSphere.clone(t),c.DONE)},f.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),this.removeMaterialSubscription()},m.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),o=u.shouldUseSphericalCoordinates(n.geometry.rectangle),a=p.getValueOrDefault(t.zIndex,0),s=0;s<r;++s){var l=i[s];if(l.isMaterial(t)&&l.usingSphericalTextureCoordinates===o&&l.zIndex===a&&!l.overlapping(n.geometry.rectangle))return void l.add(e,t,n)}var c=new f(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,a);c.add(e,t,n),i.push(c)},m.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}}},m.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<i.length;t++)l=i[t].update(e)&&l;return l},m.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 c.FAILED},m.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0},m}),define("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/OffsetGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(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 f(t,i,r){this._primitives=t,this._scene=i,this._shadows=r,this._solidBatches=new e,this._translucentBatches=new e}var m=new i,_=new o,g=new o,v=t.ZERO,y=new t;return p.prototype.add=function(e,t){var i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&h.isConstant(e.distanceDisplayConditionProperty)&&h.isConstant(e.terrainOffsetProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(i,e)},p.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return n(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},p.prototype.update=function(e){var d,p=!0,f=0,C=this.primitive,b=this.primitives;if(this.createPrimitive){var S=this.geometry.values;if(S.length>0)n(C)&&(n(this.oldPrimitive)?b.remove(C):this.oldPrimitive=C),C=new c({show:!1,asynchronous:!0,geometryInstances:S,appearance:new u({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),b.add(C),p=!1;else{n(C)&&(b.remove(C),C=void 0);var T=this.oldPrimitive;n(T)&&(b.remove(T),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=C,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(n(C)&&C.ready){C.show=!0,n(this.oldPrimitive)&&(b.remove(this.oldPrimitive),this.oldPrimitive=void 0);var E=this.updatersWithAttributes.values,A=E.length,w=this.waitingOnCreate;for(d=0;d<A;d++){var x=E[d],P=this.geometry.get(x.id),D=this.attributes.get(P.id.id);if(n(D)||(D=C.getGeometryInstanceAttributes(P.id),this.attributes.set(P.id.id,D)),!x.outlineColorProperty.isConstant||w){var I=x.outlineColorProperty,M=h.getValueOrDefault(I,e,i.WHITE,m);i.equals(D._lastColor,M)||(D._lastColor=i.clone(M,D._lastColor),D.color=r.toValue(M,D.color),(this.translucent&&255===D.color[3]||!this.translucent&&255!==D.color[3])&&(this.itemsToRemove[f++]=x))}var R=x.entity.isShowing&&(x.hasConstantOutline||x.isOutlineVisible(e)),O=1===D.show[0];R!==O&&(D.show=l.toValue(R,D.show));var L=x.distanceDisplayConditionProperty;if(!h.isConstant(L)){var N=h.getValueOrDefault(L,e,g,_);o.equals(N,D._lastDistanceDisplayCondition)||(D._lastDistanceDisplayCondition=o.clone(N,D._lastDistanceDisplayCondition),D.distanceDisplayCondition=a.toValue(N,D.distanceDisplayCondition))}var F=x.terrainOffsetProperty;if(!h.isConstant(F)){var B=h.getValueOrDefault(F,e,v,y);t.equals(B,D._lastOffset)||(D._lastOffset=t.clone(B,D._lastOffset),D.offset=s.toValue(B,D.offset))}}this.updateShows(C),this.waitingOnCreate=!1}else n(C)&&!C.ready&&(p=!1);return this.itemsToRemove.length=f,p},p.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var o=t[r],a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);n(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));var u=o.entity.isShowing;u!==(1===s.show[0])&&(s.show=l.toValue(u,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},p.prototype.contains=function(e){return this.updaters.contains(e.id)},p.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return d.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!n(r)||!n(r.boundingSphere)||n(r.show)&&0===r.show[0]?d.FAILED:(r.boundingSphere.clone(t),d.DONE)},p.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;n(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;n(i)&&(e.remove(i),this.oldPrimitive=void 0)},f.prototype.add=function(e,t){var i,r,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(i=this._solidBatches,r=i.get(a),n(r)||(r=new p(this._primitives,!1,a,this._shadows),i.set(a,r)),r.add(t,o)):(i=this._translucentBatches,r=i.get(a),n(r)||(r=new p(this._primitives,!0,a,this._shadows),i.set(a,r)),r.add(t,o))},f.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},f.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},f.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 d.FAILED},f.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()},f}),define("DataSources/WallGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(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 v(e,t){m.call(this,{entity:e,scene:t,geometryOptions:new g(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function y(e,t,i){f.call(this,e,t,i)}var C=new t;return r(Object.create)&&(v.prototype=Object.create(m.prototype),v.prototype.constructor=v),v.prototype.createFillGeometryInstance=function(e){var n,s,c=this._entity,d=c.isAvailable(e),h=new l(d&&c.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),f=this._distanceDisplayConditionProperty.getValue(e),m=o.fromDistanceDisplayCondition(f);if(this._materialProperty instanceof p){var _;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(_=this._materialProperty.color.getValue(e,C)),r(_)||(_=t.WHITE),s=i.fromColor(_),n={show:h,distanceDisplayCondition:m,color:s}}else n={show:h,distanceDisplayCondition:m};return new a({id:c,geometry:new u(this._options),attributes:n})},v.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),s=_.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,C),u=this._distanceDisplayConditionProperty.getValue(e);return new a({id:r,geometry:new c(this._options),attributes:{show:new l(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(s),distanceDisplayCondition:o.fromDistanceDisplayCondition(u)}})},v.prototype._isHidden=function(e,t){return!r(t.positions)||m.prototype._isHidden.call(this,e,t)},v.prototype._getIsClosed=function(e){return!1},v.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&_.isConstant(t.minimumHeights)&&_.isConstant(t.maximumHeights)&&_.isConstant(t.outlineWidth)&&_.isConstant(t.granularity))},v.prototype._setStaticOptions=function(e,t){var i=t.minimumHeights,n=t.maximumHeights,o=t.granularity,a=this._materialProperty instanceof p,l=this._options;l.vertexFormat=a?h.VERTEX_FORMAT:d.MaterialSupport.TEXTURED.vertexFormat,l.positions=t.positions.getValue(s.MINIMUM_VALUE,l.positions),l.minimumHeights=r(i)?i.getValue(s.MINIMUM_VALUE,l.minimumHeights):void 0,l.maximumHeights=r(n)?n.getValue(s.MINIMUM_VALUE,l.maximumHeights):void 0,l.granularity=r(o)?o.getValue(s.MINIMUM_VALUE):void 0},v.DynamicGeometryUpdater=y,r(Object.create)&&(y.prototype=Object.create(f.prototype),y.prototype.constructor=y),y.prototype._isHidden=function(e,t,i){return!r(this._options.positions)||f.prototype._isHidden.call(this,e,t,i)},y.prototype._setOptions=function(e,t,i){var r=this._options;r.positions=_.getValueOrUndefined(t.positions,i,r.positions),r.minimumHeights=_.getValueOrUndefined(t.minimumHeights,i,r.minimumHeights),r.maximumHeights=_.getValueOrUndefined(t.maximumHeights,i,r.maximumHeights),r.granularity=_.getValueOrUndefined(t.granularity,i)},v}),define("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Check","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Event","../Core/EventHelper","../Scene/ClassificationType","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/ShadowMode","./BoundingSphereState","./BoxGeometryUpdater","./ColorMaterialProperty","./CorridorGeometryUpdater","./CylinderGeometryUpdater","./DynamicGeometryBatch","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./Entity","./PlaneGeometryUpdater","./PolygonGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticGroundGeometryPerMaterialBatch","./StaticOutlineGeometryBatch","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I){"use strict";function M(e,t){function i(e){n.raiseEvent(e)}this.entity=e,this.scene=t;for(var r=new Array(L.length),n=new a,o=new s,l=0;l<r.length;l++){var u=new L[l](e,t);o.add(u.geometryChanged,i),r[l]=u}this.updaters=r,this.geometryChanged=n,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(M.prototype._onEntityPropertyChanged,this)}function R(t,i,n,o){n=r(n,t.primitives),o=r(o,t.groundPrimitives),this._scene=t,this._primitives=n,this._groundPrimitives=o,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var a=d.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(2*a),this._closedColorBatches=new Array(2*a),this._closedMaterialBatches=new Array(2*a),this._openColorBatches=new Array(2*a),this._openMaterialBatches=new Array(2*a)
- ;var s=C.supportsMaterialsforEntitiesOnTerrain(t);this._supportsMaterialsforEntitiesOnTerrain=s;var h;for(h=0;h<a;++h)this._outlineBatches[h]=new D(n,t,h,!1),this._outlineBatches[a+h]=new D(n,t,h,!0),this._closedColorBatches[h]=new A(n,c,void 0,!0,h,!0),this._closedColorBatches[a+h]=new A(n,c,void 0,!0,h,!1),this._closedMaterialBatches[h]=new w(n,u,void 0,!0,h,!0),this._closedMaterialBatches[a+h]=new w(n,u,void 0,!0,h,!1),this._openColorBatches[h]=new A(n,c,void 0,!1,h,!0),this._openColorBatches[a+h]=new A(n,c,void 0,!1,h,!1),this._openMaterialBatches[h]=new w(n,u,void 0,!1,h,!0),this._openMaterialBatches[a+h]=new w(n,u,void 0,!1,h,!1);var p=l.NUMBER_OF_CLASSIFICATION_TYPES,f=new Array(p),m=[];if(s)for(h=0;h<p;++h)m.push(new P(o,h,u)),f[h]=new P(o,h,c);else for(h=0;h<p;++h)f[h]=new x(o,h);this._groundColorBatches=f,this._groundMaterialBatches=m,this._dynamicBatch=new g(n,o),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new e,this._updaterSets=new e,this._entityCollection=i,i.collectionChanged.addEventListener(R.prototype._onCollectionChanged,this),this._onCollectionChanged(i,i.values,O)}var O=[],L=[p,_,m,v,y,b,S,T,E,I];M.prototype._onEntityPropertyChanged=function(e,t,i,r){for(var n=this.updaters,o=0;o<n.length;o++)n[o]._onEntityPropertyChanged(e,t,i,r)},M.prototype.forEach=function(e){for(var t=this.updaters,i=0;i<t.length;i++)e(t[i])},M.prototype.destroy=function(){this.eventHelper.removeAll();for(var e=this.updaters,t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),o(this)},R.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,d=this;for(t=c.length-1;t>-1;t--)i=c[t],r=i.id,n=this._updaterSets.get(r),n.entity===i?n.forEach(function(t){d._removeUpdater(t),d._insertUpdaterIntoBatch(e,t)}):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaterSets.get(r),n.forEach(this._removeUpdater.bind(this)),n.destroy(),this._updaterSets.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 M(i,this._scene),this._updaterSets.set(r,n),n.forEach(function(t){d._insertUpdaterIntoBatch(e,t)}),this._subscriptions.set(r,n.geometryChanged.addEventListener(R._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,p=this._batches,f=p.length;for(t=0;t<f;t++)h=p[t].update(e)&&h;return h};var N=[],F=new t;return R.prototype.getBoundingSphere=function(e,i){for(var r=N,n=F,o=0,a=h.DONE,s=this._batches,l=s.length,u=e.id,c=this._updaterSets.get(u).updaters,d=0;d<c.length;d++)for(var p=c[d],f=0;f<l;f++){if((a=s[f].getBoundingSphere(p,n))===h.PENDING)return h.PENDING;a===h.DONE&&(r[o]=t.clone(n,r[o]),o++)}return 0===o?h.FAILED:(r.length=o,t.fromBoundingSpheres(r,i),h.DONE)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(R.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 r=this._subscriptions.values;for(i=r.length,e=0;e<i;e++)r[e]();this._subscriptions.removeAll();var n=this._updaterSets.values;for(i=n.length,e=0;e<i;e++)n[e].destroy();return this._updaterSets.removeAll(),o(this)},R.prototype._removeUpdater=function(e){for(var t=this._batches,i=t.length,r=0;r<i;r++)t[r].remove(e)},R.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic)return void this._dynamicBatch.add(e,t);var i;(t.outlineEnabled||t.fillEnabled)&&(i=t.shadowsProperty.getValue(e));var r=d.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(n(t.terrainOffsetProperty)?this._outlineBatches[r+i].add(e,t):this._outlineBatches[i].add(e,t)),t.fillEnabled)if(t.onTerrain){var o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof f?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof f?n(t.terrainOffsetProperty)?this._closedColorBatches[r+i].add(e,t):this._closedColorBatches[i].add(e,t):n(t.terrainOffsetProperty)?this._closedMaterialBatches[r+i].add(e,t):this._closedMaterialBatches[i].add(e,t):t.fillMaterialProperty instanceof f?n(t.terrainOffsetProperty)?this._openColorBatches[r+i].add(e,t):this._openColorBatches[i].add(e,t):n(t.terrainOffsetProperty)?this._openMaterialBatches[r+i].add(e,t):this._openMaterialBatches[i].add(e,t)},R._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,o=r.id;n(t.get(o))||n(i.get(o))||i.set(o,r)},R.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)},R}),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=h.FILL,C=r.WHITE,b=r.BLACK,S=new r(.165,.165,.165,.8),T=new t(7,5),E=t.ZERO,A=i.ZERO,w=c.NONE,x=d.CENTER,P=p.CENTER,D=new i,I=new r,M=new r,R=new r,O=new t,L=new i,N=new t,F=new u,B=new u,k=new u,z=new l;return g.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,n=0,a=t.length;n<a;n++){var s,l,u=t[n],c=u.entity,d=c._label,h=u.label,p=c.isShowing&&c.isAvailable(e)&&m.getValueOrDefault(d._show,e,!0);if(p&&(l=m.getValueOrUndefined(c._position,e,D),s=m.getValueOrUndefined(d._text,e),p=o(l)&&o(s)),p){m.isConstant(c._position)||(r._clusterDirty=!0);var f=!1,_=m.getValueOrDefault(d._heightReference,e,w);o(h)||(h=r.getLabel(c),h.id=c,u.label=h,f=i.equals(h.position,l)&&h.heightReference===_),h.show=!0,h.position=l,h.text=s,h.scale=m.getValueOrDefault(d._scale,e,1),h.font=m.getValueOrDefault(d._font,e,"30px sans-serif"),h.style=m.getValueOrDefault(d._style,e,y),h.fillColor=m.getValueOrDefault(d._fillColor,e,C,I),h.outlineColor=m.getValueOrDefault(d._outlineColor,e,b,M),h.outlineWidth=m.getValueOrDefault(d._outlineWidth,e,1),h.showBackground=m.getValueOrDefault(d._showBackground,e,!1),h.backgroundColor=m.getValueOrDefault(d._backgroundColor,e,S,R),h.backgroundPadding=m.getValueOrDefault(d._backgroundPadding,e,T,O),h.pixelOffset=m.getValueOrDefault(d._pixelOffset,e,E,N),h.eyeOffset=m.getValueOrDefault(d._eyeOffset,e,A,L),h.heightReference=_,h.horizontalOrigin=m.getValueOrDefault(d._horizontalOrigin,e,x),h.verticalOrigin=m.getValueOrDefault(d._verticalOrigin,e,P),h.translucencyByDistance=m.getValueOrUndefined(d._translucencyByDistance,e,F),h.pixelOffsetScaleByDistance=m.getValueOrUndefined(d._pixelOffsetScaleByDistance,e,B),h.scaleByDistance=m.getValueOrUndefined(d._scaleByDistance,e,k),h.distanceDisplayCondition=m.getValueOrUndefined(d._distanceDisplayCondition,e,z),h.disableDepthTestDistance=m.getValueOrUndefined(d._disableDepthTestDistance,e),f&&h._updateClamping()}else v(u,c,r)}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/GltfPipeline/addToArray",["../../Core/defaultValue"],function(e){"use strict";function t(t,i,r){if(r=e(r,!1)){var n=t.indexOf(i);if(n>-1)return n}return t.push(i),t.length-1}return t}),define("ThirdParty/GltfPipeline/hasExtension",["../../Core/defined"],function(e){"use strict";function t(t,i){return e(t.extensionsUsed)&&t.extensionsUsed.indexOf(i)>=0}return t}),define("ThirdParty/GltfPipeline/ForEach",["./hasExtension","../../Core/defined","../../Core/isArray"],function(e,t,i){"use strict";function r(){}return r.objectLegacy=function(e,i){if(t(e))for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=i(n,r);if(t(o))return o}},r.object=function(e,i){if(t(e))for(var r=e.length,n=0;n<r;n++){var o=e[n],a=i(o,n);if(t(a))return a}},r.topLevel=function(e,n,o){var a=e[n];return t(a)&&!i(a)?r.objectLegacy(a,o):r.object(a,o)},r.accessor=function(e,t){return r.topLevel(e,"accessors",t)},r.accessorWithSemantic=function(e,i,n){var o={};return r.mesh(e,function(e){return r.meshPrimitive(e,function(e){var a=r.meshPrimitiveAttribute(e,function(e,r){if(0===r.indexOf(i)&&!t(o[e])&&(o[e]=!0,a=n(e),t(a)))return a});return t(a)?a:r.meshPrimitiveTarget(e,function(e){return r.meshPrimitiveTargetAttribute(e,function(e,r){if(0===r.indexOf(i)&&!t(o[e])&&(o[e]=!0,a=n(e),t(a)))return a})})})})},r.accessorContainingVertexAttributeData=function(e,i){var n={};return r.mesh(e,function(e){return r.meshPrimitive(e,function(e){var o=r.meshPrimitiveAttribute(e,function(e){if(!t(n[e])&&(n[e]=!0,o=i(e),t(o)))return o});return t(o)?o:r.meshPrimitiveTarget(e,function(e){return r.meshPrimitiveTargetAttribute(e,function(e){if(!t(n[e])&&(n[e]=!0,o=i(e),t(o)))return o})})})})},r.accessorContainingIndexData=function(e,i){var n={};return r.mesh(e,function(e){return r.meshPrimitive(e,function(e){var r=e.indices;if(t(r)&&!t(n[r])){n[r]=!0;var o=i(r);if(t(o))return o}})})},r.animation=function(e,t){return r.topLevel(e,"animations",t)},r.animationChannel=function(e,t){var i=e.channels;return r.object(i,t)},r.animationSampler=function(e,t){var i=e.samplers;return r.object(i,t)},r.buffer=function(e,t){return r.topLevel(e,"buffers",t)},r.bufferView=function(e,t){return r.topLevel(e,"bufferViews",t)},r.camera=function(e,t){return r.topLevel(e,"cameras",t)},r.image=function(e,t){return r.topLevel(e,"images",t)},r.compressedImage=function(e,i){if(t(e.extras)){var r=e.extras.compressedImage3DTiles;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n],a=i(o,n);if(t(a))return a}}},r.material=function(e,t){return r.topLevel(e,"materials",t)},r.materialValue=function(e,i){var r=e.values;t(e.extensions)&&t(e.extensions.KHR_techniques_webgl)&&(r=e.extensions.KHR_techniques_webgl.values);for(var n in r)if(r.hasOwnProperty(n)){var o=i(r[n],n);if(t(o))return o}},r.mesh=function(e,t){return r.topLevel(e,"meshes",t)},r.meshPrimitive=function(e,i){var r=e.primitives;if(t(r))for(var n=r.length,o=0;o<n;o++){var a=r[o],s=i(a,o);if(t(s))return s}},r.meshPrimitiveAttribute=function(e,i){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=i(r[n],n);if(t(o))return o}},r.meshPrimitiveTarget=function(e,i){var r=e.targets;if(t(r))for(var n=r.length,o=0;o<n;++o){var a=i(r[o],o);if(t(a))return a}},r.meshPrimitiveTargetAttribute=function(e,i){for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=i(n,r);if(t(o))return o}},r.node=function(e,t){return r.topLevel(e,"nodes",t)},r.nodeInTree=function(e,i,n){var o=e.nodes;if(t(o))for(var a=i.length,s=0;s<a;s++){var l=i[s],u=o[l];if(t(u)){var c=n(u,l);if(t(c))return c;var d=u.children;if(t(d)&&(c=r.nodeInTree(e,d,n),t(c)))return c}}},r.nodeInScene=function(e,i,n){var o=i.nodes;if(t(o))return r.nodeInTree(e,o,n)},r.program=function(t,i){return e(t,"KHR_techniques_webgl")?r.object(t.extensions.KHR_techniques_webgl.programs,i):r.topLevel(t,"programs",i)},r.sampler=function(e,t){return r.topLevel(e,"samplers",t)},r.scene=function(e,t){return r.topLevel(e,"scenes",t)},r.shader=function(t,i){return e(t,"KHR_techniques_webgl")?r.object(t.extensions.KHR_techniques_webgl.shaders,i):r.topLevel(t,"shaders",i)},r.skin=function(e,t){return r.topLevel(e,"skins",t)},r.techniqueAttribute=function(e,i){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=i(r[n],n);if(t(o))return o}},r.techniqueUniform=function(e,i){var r=e.uniforms;for(var n in r)if(r.hasOwnProperty(n)){var o=i(r[n],n);if(t(o))return o}},r.techniqueParameter=function(e,i){var r=e.parameters;for(var n in r)if(r.hasOwnProperty(n)){var o=i(r[n],n);if(t(o))return o}},r.technique=function(t,i){return e(t,"KHR_techniques_webgl")?r.object(t.extensions.KHR_techniques_webgl.techniques,i):r.topLevel(t,"techniques",i)},r.texture=function(e,t){return r.topLevel(e,"textures",t)},r}),define("ThirdParty/GltfPipeline/numberOfComponentsForType",[],function(){"use strict";function e(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}return e}),define("ThirdParty/GltfPipeline/getAccessorByteStride",["./numberOfComponentsForType","../../Core/ComponentDatatype","../../Core/defined"],function(e,t,i){"use strict";function r(r,n){var o=n.bufferView;if(i(o)){var a=r.bufferViews[o];if(i(a.byteStride)&&a.byteStride>0)return a.byteStride}return t.getSizeInBytes(n.componentType)*e(n.type)}return r}),define("ThirdParty/GltfPipeline/addDefaults",["./addToArray","./ForEach","./getAccessorByteStride","../../Core/defaultValue","../../Core/defined","../../Core/WebGLConstants"],function(e,t,i,r,n,o){"use strict";function a(a){t.accessor(a,function(e){n(e.bufferView)&&(e.byteOffset=r(e.byteOffset,0))}),t.bufferView(a,function(e){n(e.buffer)&&(e.byteOffset=r(e.byteOffset,0))}),t.mesh(a,function(i){t.meshPrimitive(i,function(t){if(t.mode=r(t.mode,o.TRIANGLES),!n(t.material)){n(a.materials)||(a.materials=[]);var i={name:"default"};t.material=e(a.materials,i)}})}),t.accessorContainingVertexAttributeData(a,function(e){var t=a.accessors[e],s=t.bufferView;if(t.normalized=r(t.normalized,!1),n(s)){var l=a.bufferViews[s];l.byteStride=i(a,t),l.target=o.ARRAY_BUFFER}}),t.accessorContainingIndexData(a,function(e){var t=a.accessors[e],i=t.bufferView;if(n(i)){a.bufferViews[i].target=o.ELEMENT_ARRAY_BUFFER}}),t.material(a,function(e){var i=r(e.extensions,r.EMPTY_OBJECT),o=i.KHR_materials_common;if(n(o)){var a=o.technique,s=n(o.values)?o.values:{};return o.values=s,s.ambient=n(s.ambient)?s.ambient:[0,0,0,1],s.emission=n(s.emission)?s.emission:[0,0,0,1],s.transparency=r(s.transparency,1),s.transparent=r(s.transparent,!1),s.doubleSided=r(s.doubleSided,!1),void("CONSTANT"!==a&&(s.diffuse=n(s.diffuse)?s.diffuse:[0,0,0,1],"LAMBERT"!==a&&(s.specular=n(s.specular)?s.specular:[0,0,0,1],s.shininess=r(s.shininess,0))))}e.emissiveFactor=r(e.emissiveFactor,[0,0,0]),e.alphaMode=r(e.alphaMode,"OPAQUE"),e.doubleSided=r(e.doubleSided,!1),"MASK"===e.alphaMode&&(e.alphaCutoff=r(e.alphaCutoff,.5));var u=i.KHR_techniques_webgl;n(u)&&t.materialValue(e,function(e){n(e.index)&&l(e)}),l(e.emissiveTexture),l(e.normalTexture),l(e.occlusionTexture);var c=e.pbrMetallicRoughness;n(c)&&(c.baseColorFactor=r(c.baseColorFactor,[1,1,1,1]),c.metallicFactor=r(c.metallicFactor,1),c.roughnessFactor=r(c.roughnessFactor,1),l(c.baseColorTexture),l(c.metallicRoughnessTexture));var d=i.pbrSpecularGlossiness;n(d)&&(d.diffuseFactor=r(d.diffuseFactor,[1,1,1,1]),d.specularFactor=r(d.specularFactor,[1,1,1]),d.glossinessFactor=r(d.glossinessFactor,1),l(d.specularGlossinessTexture))}),t.animation(a,function(e){t.animationSampler(e,function(e){e.interpolation=r(e.interpolation,"LINEAR")})});var u=s(a);return t.node(a,function(e,t){n(u[t])||n(e.translation)||n(e.rotation)||n(e.scale)?(e.translation=r(e.translation,[0,0,0]),e.rotation=r(e.rotation,[0,0,0,1]),e.scale=r(e.scale,[1,1,1])):e.matrix=r(e.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),t.sampler(a,function(e){e.wrapS=r(e.wrapS,o.REPEAT),e.wrapT=r(e.wrapT,o.REPEAT)}),n(a.scenes)&&!n(a.scene)&&(a.scene=0),a}function s(e){var i={};return t.animation(e,function(e){t.animationChannel(e,function(e){var t=e.target,r=t.node,n=t.path;"translation"!==n&&"rotation"!==n&&"scale"!==n||(i[r]=!0)})}),i}function l(e){n(e)&&(e.texCoord=r(e.texCoord,0))}return a}),define("ThirdParty/GltfPipeline/addPipelineExtras",["./ForEach","../../Core/defined"],function(e,t){"use strict";function i(t){return e.shader(t,function(e){r(e)}),e.buffer(t,function(e){r(e)}),e.image(t,function(t){r(t),e.compressedImage(t,function(e){r(e)})}),r(t),t}function r(e){e.extras=t(e.extras)?e.extras:{},e.extras._pipeline=t(e.extras._pipeline)?e.extras._pipeline:{}}return i}),define("ThirdParty/GltfPipeline/removeExtensionsRequired",["../../Core/defined"],function(e){"use strict";function t(t,i){var r=t.extensionsRequired;if(e(r)){var n=r.indexOf(i);n>=0&&r.splice(n,1),0===r.length&&delete t.extensionsRequired}}return t}),define("ThirdParty/GltfPipeline/removeExtensionsUsed",["./removeExtensionsRequired","../../Core/defined"],function(e,t){"use strict";function i(i,r){var n=i.extensionsUsed;if(t(n)){var o=n.indexOf(r);o>=0&&n.splice(o,1),e(i,r),0===n.length&&delete i.extensionsUsed}}return i}),define("ThirdParty/GltfPipeline/parseGlb",["./addPipelineExtras","./removeExtensionsUsed","../../Core/defaultValue","../../Core/defined","../../Core/getMagic","../../Core/getStringFromTypedArray","../../Core/RuntimeError"],function(e,t,i,r,n,o,a){"use strict";function s(e){if("glTF"!==n(e))throw new a("File is not valid binary glTF");var t=l(e,0,5),i=t[1];if(1!==i&&2!==i)throw new a("Binary glTF version is not 1 or 2");return 1===i?u(e,t):c(e,t)}function l(e,t,i){for(var r=new DataView(e.buffer),n=new Array(i),o=0;o<i;++o)n[o]=r.getUint32(e.byteOffset+t+o*d,!0);return n}function u(n,s){var l=s[2],u=s[3];if(0!==s[4])throw new a("Binary glTF scene format is not JSON");var c=20+u,d=o(n,20,u),h=JSON.parse(d);e(h);var p=n.subarray(c,l),f=h.buffers;if(r(f)&&Object.keys(f).length>0){var m=i(f.binary_glTF,f.KHR_binary_glTF);r(m)&&(m.extras._pipeline.source=p)}return t(h,"KHR_binary_glTF"),h}function c(t,i){for(var n,a,s=i[2],u=12;u<s;){var c=l(t,u,2),d=c[0],h=c[1];u+=8;var p=t.subarray(u,u+d);if(u+=d,1313821514===h){var f=o(p);n=JSON.parse(f),e(n)}else 5130562===h&&(a=p)}if(r(n)&&r(a)){var m=n.buffers;if(r(m)&&m.length>0){m[0].extras._pipeline.source=a}}return n}var d=4;return s}),define("ThirdParty/GltfPipeline/removePipelineExtras",["./ForEach","../../Core/defined"],function(e,t){"use strict";function i(t){return e.shader(t,function(e){r(e)}),e.buffer(t,function(e){r(e)}),e.image(t,function(t){r(t),e.compressedImage(t,function(e){r(e)})}),r(t),t}function r(e){t(e.extras)&&(t(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}return i}),define("ThirdParty/GltfPipeline/addExtensionsUsed",["./addToArray","../../Core/defined"],function(e,t){"use strict";function i(i,r){var n=i.extensionsUsed;t(n)||(n=[],i.extensionsUsed=n),e(n,r,!0)}return i}),define("ThirdParty/GltfPipeline/getComponentReader",["../../Core/ComponentDatatype"],function(e){"use strict";function t(t){switch(t){case e.BYTE:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getInt8(t+o*r)};case e.UNSIGNED_BYTE:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getUint8(t+o*r)};case e.SHORT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getInt16(t+o*r,!0)};case e.UNSIGNED_SHORT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getUint16(t+o*r,!0)};case e.INT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getInt32(t+o*r,!0)};case e.UNSIGNED_INT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getUint32(t+o*r,!0)};case e.FLOAT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getFloat32(t+o*r,!0)};case e.DOUBLE:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getFloat64(t+o*r,!0)}}}return t}),define("ThirdParty/GltfPipeline/findAccessorMinMax",["./getAccessorByteStride","./getComponentReader","./numberOfComponentsForType","../../Core/arrayFill","../../Core/ComponentDatatype","../../Core/defined"],function(e,t,i,r,n,o){"use strict";function a(a,s){var l=a.bufferViews,u=a.buffers,c=s.bufferView,d=i(s.type);if(!o(s.bufferView))return{min:r(new Array(d),0),max:r(new Array(d),0)};for(var h=r(new Array(d),Number.POSITIVE_INFINITY),p=r(new Array(d),Number.NEGATIVE_INFINITY),f=l[c],m=f.buffer,_=u[m],g=_.extras._pipeline.source,v=s.count,y=e(a,s),C=s.byteOffset+f.byteOffset+g.byteOffset,b=s.componentType,S=n.getSizeInBytes(b),T=new DataView(g.buffer),E=new Array(d),A=t(b),w=0;w<v;w++){A(T,C,d,S,E);for(var x=0;x<d;x++){var P=E[x];h[x]=Math.min(h[x],P),p[x]=Math.max(p[x],P)}C+=y}return{min:h,max:p}}return a}),define("ThirdParty/GltfPipeline/moveTechniqueRenderStates",["./addExtensionsUsed","./ForEach","../../Core/defaultValue","../../Core/defined","../../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e,t){var i=e.enable;return!!r(i)&&i.indexOf(t)>-1}function a(e,t){if(!r(e))return t;for(var i=0;i<4;i++)if(-1===c.indexOf(e[i]))return t;return e}function s(s){var c={},d={},h=s.techniques;return r(h)?(t.technique(s,function(e,t){var s=e.states;if(r(s)){var h=d[t]={};if(o(s,n.BLEND)){h.alphaMode="BLEND";var p=s.functions;r(p)&&(r(p.blendEquationSeparate)||r(p.blendFuncSeparate))&&(c[t]={blendEquation:i(p.blendEquationSeparate,l),blendFactors:a(p.blendFuncSeparate,u)})}o(s,n.CULL_FACE)||(h.doubleSided=!0),delete e.states}}),Object.keys(c).length>0&&(r(s.extensions)||(s.extensions={}),e(s,"KHR_blend")),t.material(s,function(e){if(r(e.technique)){var i=d[e.technique];t.objectLegacy(i,function(t,i){e[i]=t});var n=c[e.technique];r(n)&&(r(e.extensions)||(e.extensions={}),e.extensions.KHR_blend=n)}}),s):s}var l=[n.FUNC_ADD,n.FUNC_ADD],u=[n.ONE,n.ZERO,n.ONE,n.ZERO],c=[n.ZERO,n.ONE,n.SRC_COLOR,n.ONE_MINUS_SRC_COLOR,n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.DST_ALPHA,n.ONE_MINUS_DST_ALPHA,n.DST_COLOR,n.ONE_MINUS_DST_COLOR];return s});define("ThirdParty/GltfPipeline/addExtensionsRequired",["./addExtensionsUsed","./addToArray","../../Core/defined"],function(e,t,i){"use strict";function r(r,n){var o=r.extensionsRequired;i(o)||(o=[],r.extensionsRequired=o),t(o,n,!0),e(r,n)}return r}),define("ThirdParty/GltfPipeline/moveTechniquesToExtension",["./addExtensionsUsed","./addExtensionsRequired","./addToArray","./ForEach","../../Core/defined"],function(e,t,i,r,n){"use strict";function o(o){var a=o.techniques,s={},l={};if(n(a)){var u={programs:[],shaders:[],techniques:[]},c=o.glExtensionsUsed;delete o.glExtensionsUsed,r.technique(o,function(e,t){var n,a={name:e.name,program:void 0,attributes:{},uniforms:{}};r.techniqueAttribute(e,function(t,i){n=e.parameters[t],a.attributes[i]={semantic:n.semantic}}),r.techniqueUniform(e,function(t,i){n=e.parameters[t],a.uniforms[i]={count:n.count,node:n.node,type:n.type,semantic:n.semantic,value:n.value},s[t]=i});var d=o.programs[e.program],h={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:c},p=o.shaders[d.fragmentShader];h.fragmentShader=i(u.shaders,p,!0);var f=o.shaders[d.vertexShader];h.vertexShader=i(u.shaders,f,!0),a.program=i(u.programs,h),l[t]=i(u.techniques,a)}),u.techniques.length>0&&(n(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=u,e(o,"KHR_techniques_webgl"),t(o,"KHR_techniques_webgl"))}return r.material(o,function(e){if(n(e.technique)){var t={technique:l[e.technique]};r.objectLegacy(e.values,function(e,i){n(t.values)||(t.values={});var r=s[i];t.values[r]=e}),n(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=t}delete e.technique,delete e.values}),delete o.techniques,delete o.programs,delete o.shaders,o}return o}),define("ThirdParty/GltfPipeline/removeUnusedElements",["./ForEach","./hasExtension","../../Core/defined"],function(e,t,i){"use strict";function r(e){return n(e,"accessor"),n(e,"bufferView"),n(e,"buffer"),e}function n(e,t){var r=s[t],n=e[r];if(i(n))for(var l=0,u=a[t](e),c=n.length,d=0;d<c;++d)u[d]||(o[t](e,d-l),l++)}function o(){}function a(){}var s={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews"};return o.accessor=function(t,r){t.accessors.splice(r,1),e.mesh(t,function(t){e.meshPrimitive(t,function(t){e.meshPrimitiveAttribute(t,function(e,i){e>r&&t.attributes[i]--}),e.meshPrimitiveTarget(t,function(t){e.meshPrimitiveTargetAttribute(t,function(e,i){e>r&&t[i]--})});var n=t.indices;i(n)&&n>r&&t.indices--})}),e.skin(t,function(e){i(e.inverseBindMatrices)&&e.inverseBindMatrices>r&&e.inverseBindMatrices--}),e.animation(t,function(t){e.animationSampler(t,function(e){i(e.input)&&e.input>r&&e.input--,i(e.output)&&e.output>r&&e.output--})})},o.buffer=function(t,r){t.buffers.splice(r,1),e.bufferView(t,function(e){i(e.buffer)&&e.buffer>r&&e.buffer--})},o.bufferView=function(r,n){r.bufferViews.splice(n,1),e.accessor(r,function(e){i(e.bufferView)&&e.bufferView>n&&e.bufferView--}),e.shader(r,function(e){i(e.bufferView)&&e.bufferView>n&&e.bufferView--}),e.image(r,function(t){i(t.bufferView)&&t.bufferView>n&&t.bufferView--,e.compressedImage(t,function(e){var t=e.bufferView;i(t)&&t>n&&e.bufferView--})}),t(r,"KHR_draco_mesh_compression")&&e.mesh(r,function(t){e.meshPrimitive(t,function(e){i(e.extensions)&&i(e.extensions.KHR_draco_mesh_compression)&&e.extensions.KHR_draco_mesh_compression.bufferView>n&&e.extensions.KHR_draco_mesh_compression.bufferView--})})},a.accessor=function(t){var r={};return e.mesh(t,function(t){e.meshPrimitive(t,function(t){e.meshPrimitiveAttribute(t,function(e){r[e]=!0}),e.meshPrimitiveTarget(t,function(t){e.meshPrimitiveTargetAttribute(t,function(e){r[e]=!0})});var n=t.indices;i(n)&&(r[n]=!0)})}),e.skin(t,function(e){i(e.inverseBindMatrices)&&(r[e.inverseBindMatrices]=!0)}),e.animation(t,function(t){e.animationSampler(t,function(e){i(e.input)&&(r[e.input]=!0),i(e.output)&&(r[e.output]=!0)})}),r},a.buffer=function(t){var r={};return e.bufferView(t,function(e){i(e.buffer)&&(r[e.buffer]=!0)}),r},a.bufferView=function(r){var n={};return e.accessor(r,function(e){i(e.bufferView)&&(n[e.bufferView]=!0)}),e.shader(r,function(e){i(e.bufferView)&&(n[e.bufferView]=!0)}),e.image(r,function(t){i(t.bufferView)&&(n[t.bufferView]=!0),e.compressedImage(t,function(e){i(e.bufferView)&&(n[e.bufferView]=!0)})}),t(r,"KHR_draco_mesh_compression")&&e.mesh(r,function(t){e.meshPrimitive(t,function(e){i(e.extensions)&&i(e.extensions.KHR_draco_mesh_compression)&&(n[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),n},r}),define("ThirdParty/GltfPipeline/addBuffer",["./addToArray"],function(e){"use strict";function t(t,i){var r={byteLength:i.length,extras:{_pipeline:{source:i}}},n=e(t.buffers,r),o={buffer:n,byteOffset:0,byteLength:i.length};return e(t.bufferViews,o)}return t}),define("ThirdParty/GltfPipeline/readAccessorPacked",["./getAccessorByteStride","./getComponentReader","./numberOfComponentsForType","../../Core/arrayFill","../../Core/ComponentDatatype","../../Core/defined"],function(e,t,i,r,n,o){"use strict";function a(a,s){var l=e(a,s),u=n.getSizeInBytes(s.componentType),c=i(s.type),d=s.count,h=new Array(c*d);if(!o(s.bufferView))return r(h,0),h;for(var p=a.bufferViews[s.bufferView],f=a.buffers[p.buffer].extras._pipeline.source,m=s.byteOffset+p.byteOffset+f.byteOffset,_=new DataView(f.buffer),g=new Array(c),v=t(s.componentType),y=0;y<d;++y){v(_,m,c,u,g);for(var C=0;C<c;++C)h[y*c+C]=g[C];m+=l}return h}return a}),define("ThirdParty/GltfPipeline/updateAccessorComponentTypes",["./addBuffer","./ForEach","./readAccessorPacked","../../Core/ComponentDatatype","../../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){var i;return t.accessorWithSemantic(e,"JOINTS_0",function(t){var o=e.accessors[t];i=o.componentType,i===n.BYTE?a(e,o,r.UNSIGNED_BYTE):i!==n.UNSIGNED_BYTE&&i!==n.UNSIGNED_SHORT&&a(e,o,r.UNSIGNED_SHORT)}),t.accessorWithSemantic(e,"WEIGHTS_0",function(t){var o=e.accessors[t];i=o.componentType,i===n.BYTE?a(e,o,r.UNSIGNED_BYTE):i===n.SHORT&&a(e,o,r.UNSIGNED_SHORT)}),e}function a(t,n,o){var a=r.createTypedArray(o,i(t,n)),s=new Uint8Array(a.buffer);n.bufferView=e(t,s),n.componentType=o,n.byteOffset=0}return o}),define("ThirdParty/GltfPipeline/updateVersion",["./addExtensionsUsed","./addToArray","./findAccessorMinMax","./ForEach","./getAccessorByteStride","./numberOfComponentsForType","./moveTechniqueRenderStates","./moveTechniquesToExtension","./removeUnusedElements","./updateAccessorComponentTypes","../../Core/Cartesian3","../../Core/Cartesian4","../../Core/clone","../../Core/ComponentDatatype","../../Core/defaultValue","../../Core/defined","../../Core/isArray","../../Core/Matrix4","../../Core/Quaternion","../../Core/WebGLConstants"],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){t=f(t,f.EMPTY_OBJECT);var i=t.targetVersion,r=e.version;e.asset=f(e.asset,{version:"1.0"}),e.asset.version=f(e.asset.version,"1.0"),r=f(r,e.asset.version).toString(),X.hasOwnProperty(r)||(m(r)&&(r=r.substring(0,3)),X.hasOwnProperty(r)||(r="1.0"));for(var n=X[r];m(n)&&r!==i;)n(e,t),r=e.asset.version,n=X[r];return e}function b(e){var t=e.materials;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i],n=r.instanceTechnique;m(n)&&(r.technique=n.technique,r.values=n.values,delete r.instanceTechnique)}}function S(e){var t=e.meshes;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i],n=r.primitives;if(m(n))for(var o=n.length,a=0;a<o;++a){var s=n[a],l=f(s.primitive,y.TRIANGLES);s.mode=f(s.mode,l),delete s.primitive}}}function T(e){var t=e.nodes,i=new c,r=new v;for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];if(m(o.rotation)){var a=o.rotation;c.fromArray(a,0,i),v.fromAxisAngle(i,a[3],r),o.rotation=[r.x,r.y,r.z,r.w]}var s=o.instanceSkin;m(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function E(e){var t=e.animations,i=e.accessors,r=e.bufferViews,n=e.buffers,a={},s=new c,l=new v;for(var u in t)if(t.hasOwnProperty(u)){var d=t[u],h=d.channels,f=d.parameters,_=d.samplers;if(m(h))for(var g=h.length,y=0;y<g;++y){var C=h[y];if("rotation"===C.target.path){var b=f[_[C.sampler].output];if(m(a[b]))continue;a[b]=!0;for(var S=i[b],T=r[S.bufferView],E=n[T.buffer],A=E.extras._pipeline.source,w=A.byteOffset+T.byteOffset+S.byteOffset,x=S.componentType,P=S.count,D=o(S.type),I=S.count*D,M=p.createArrayBufferView(x,A.buffer,w,I),R=0;R<P;R++){var O=R*D;c.unpack(M,O,s);var L=M[O+3];v.fromAxisAngle(s,L,l),v.pack(l,M,O)}}}}}function A(e){var t=e.techniques;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i],n=r.passes;if(m(n)){var o=f(r.pass,"defaultPass");if(n.hasOwnProperty(o)){var a=n[o],s=a.instanceProgram;r.attributes=f(r.attributes,s.attributes),r.program=f(r.program,s.program),r.uniforms=f(r.uniforms,s.uniforms),r.states=f(r.states,a.states)}delete r.passes,delete r.pass}}}function w(t){m(t.asset)||(t.asset={});var i=t.asset;if(i.version="1.0","string"==typeof i.profile){var r=i.profile.split(" ");i.profile={api:r[0],version:r[1]}}else i.profile={};if(m(t.version)&&delete t.version,b(t),S(t),T(t),E(t),A(t),m(t.allExtensions)&&(t.extensionsUsed=t.allExtensions,delete t.allExtensions),m(t.lights)){var n=f(t.extensions,{});t.extensions=n;var o=f(n.KHR_materials_common,{});n.KHR_materials_common=o,o.lights=t.lights,delete t.lights,e(t,"KHR_materials_common")}}function x(e){var t=e.animations;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i],n=r.parameters;if(m(n)){var o=r.samplers;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];s.input=n[s.input],s.output=n[s.output]}
- delete r.parameters}}}function P(e,t){var i=[];for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];t[r]=i.length,i.push(n),m(n.name)||(n.name=r)}return i}function D(e){var i,n,o={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},a={},s=e.nodes;for(var l in s)s.hasOwnProperty(l)&&(n=s[l].jointName,m(n)&&(a[n]=l));for(var u in e)if(e.hasOwnProperty(u)&&m(o[u])){var c={},d=e[u];e[u]=P(d,c),o[u]=c}for(n in a)a.hasOwnProperty(n)&&(a[n]=o.nodes[a[n]]);m(e.scene)&&(e.scene=o.scenes[e.scene]),r.bufferView(e,function(e){m(e.buffer)&&(e.buffer=o.buffers[e.buffer])}),r.accessor(e,function(e){m(e.bufferView)&&(e.bufferView=o.bufferViews[e.bufferView])}),r.shader(e,function(e){var t=e.extensions;if(m(t)){var i=t.KHR_binary_glTF;m(i)&&(e.bufferView=o.bufferViews[i.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}),r.program(e,function(e){m(e.vertexShader)&&(e.vertexShader=o.shaders[e.vertexShader]),m(e.fragmentShader)&&(e.fragmentShader=o.shaders[e.fragmentShader])}),r.technique(e,function(e){m(e.program)&&(e.program=o.programs[e.program]),r.techniqueParameter(e,function(e){m(e.node)&&(e.node=o.nodes[e.node]);var t=e.value;"string"==typeof t&&(e.value={index:o.textures[t]})})}),r.mesh(e,function(e){r.meshPrimitive(e,function(e){m(e.indices)&&(e.indices=o.accessors[e.indices]),r.meshPrimitiveAttribute(e,function(t,i){e.attributes[i]=o.accessors[t]}),m(e.material)&&(e.material=o.materials[e.material])})}),r.node(e,function(r){var n=r.children;if(m(n)){var a=n.length;for(i=0;i<a;++i)n[i]=o.nodes[n[i]]}if(m(r.meshes)){var s=r.meshes,l=s.length;if(l>0)for(r.mesh=o.meshes[s[0]],i=1;i<l;++i){var u={mesh:o.meshes[s[i]]},c=t(e.nodes,u);m(n)||(n=[],r.children=n),n.push(c)}delete r.meshes}if(m(r.camera)&&(r.camera=o.cameras[r.camera]),m(r.skin)&&(r.skin=o.skins[r.skin]),m(r.skeletons)){var d=r.skeletons;if(d.length>0&&m(r.skin)){e.skins[r.skin].skeleton=o.nodes[d[0]]}delete r.skeletons}m(r.jointName)&&delete r.jointName}),r.skin(e,function(e){m(e.inverseBindMatrices)&&(e.inverseBindMatrices=o.accessors[e.inverseBindMatrices]);var t=e.jointNames;if(m(t)){var r=[],n=t.length;for(i=0;i<n;++i)r[i]=a[t[i]];e.joints=r,delete e.jointNames}}),r.scene(e,function(e){var t=e.nodes;if(m(t)){var r=t.length;for(i=0;i<r;++i)t[i]=o.nodes[t[i]]}}),r.animation(e,function(e){var t={};e.samplers=P(e.samplers,t),r.animationSampler(e,function(e){e.input=o.accessors[e.input],e.output=o.accessors[e.output]}),r.animationChannel(e,function(e){e.sampler=t[e.sampler];var i=e.target;m(i)&&(i.node=o.nodes[i.id],delete i.id)})}),r.material(e,function(e){m(e.technique)&&(e.technique=o.techniques[e.technique]),r.materialValue(e,function(t,i){"string"==typeof t&&(e.values[i]={index:o.textures[t]})});var t=e.extensions;if(m(t)){var i=t.KHR_materials_common;m(i)&&r.materialValue(i,function(e,t){"string"==typeof e&&(i.values[t]={index:o.textures[e]})})}}),r.image(e,function(e){var t=e.extensions;if(m(t)){var i=t.KHR_binary_glTF;m(i)&&(e.bufferView=o.bufferViews[i.bufferView],e.mimeType=i.mimeType,delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}r.compressedImage(e,function(e){var i=e.extensions;if(m(i)){var r=i.KHR_binary_glTF;m(r)&&(e.bufferView=o.bufferViews[r.bufferView],e.mimeType=r.mimeType,delete i.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}})}),r.texture(e,function(e){m(e.sampler)&&(e.sampler=o.samplers[e.sampler]),m(e.source)&&(e.source=o.images[e.source])})}function I(e){r.animation(e,function(e){r.animationSampler(e,function(e){delete e.name})})}function M(e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];_(i)&&0===i.length&&delete e[t]}r.node(e,function(e){m(e.children)&&0===e.children.length&&delete e.children})}function R(e){var t=e.asset;delete t.profile,delete t.premultipliedAlpha}function O(e){var t=e.extensionsUsed;if(e.extensionsRequired=f(e.extensionsRequired,[]),m(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];m(Q[n])&&e.extensionsRequired.push(n)}}function L(e){r.buffer(e,function(e){delete e.type})}function N(e){r.texture(e,function(e){delete e.format,delete e.internalFormat,delete e.target,delete e.type})}function F(e){r.mesh(e,function(e){r.meshPrimitive(e,function(e){r.meshPrimitiveAttribute(e,function(t,i){"TEXCOORD"===i?e.attributes.TEXCOORD_0=t:"COLOR"===i&&(e.attributes.COLOR_0=t)}),delete e.attributes.TEXCOORD,delete e.attributes.COLOR})}),r.technique(e,function(e){r.techniqueParameter(e,function(e){var t=e.semantic;m(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))})})}function B(e){var t={};r.mesh(e,function(e){r.meshPrimitive(e,function(e){r.meshPrimitiveAttribute(e,function(e,i){if("_"!==i.charAt(0)){var r=i.search(/_[0-9]+/g),n=i,o="_0";r>=0&&(n=i.substring(0,r),o=i.substring(r));var a,s=Z[n];m(s)?(a=s+o,t[i]=a):m(K[n])||(a="_"+i,t[i]=a)}});for(var i in t)if(t.hasOwnProperty(i)){var n=t[i],o=e.attributes[i];m(o)&&(delete e.attributes[i],e.attributes[n]=o)}})}),r.technique(e,function(e){r.techniqueParameter(e,function(e){var i=t[e.semantic];m(i)&&(e.semantic=i)})})}function k(e){r.camera(e,function(e){var t=e.perspective;if(m(t)){var i=t.aspectRatio;m(i)&&0===i&&delete t.aspectRatio;var r=t.yfov;m(r)&&0===r&&(t.yfov=1)}})}function z(e,t){return m(t.byteStride)&&0!==t.byteStride?t.byteStride:n(e,t)}function V(e){r.buffer(e,function(e){m(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)}),r.accessor(e,function(t){var i=t.bufferView;if(m(i)){var r=e.bufferViews[i],n=z(e,t),o=t.byteOffset+t.count*n;r.byteLength=Math.max(f(r.byteLength,0),o)}})}function U(e){var i,n,o,a=e.bufferViews,s={};r.accessorContainingVertexAttributeData(e,function(t){var i=e.accessors[t];m(i.bufferView)&&(s[i.bufferView]=!0)});var u={};r.accessor(e,function(e){m(e.bufferView)&&(u[e.bufferView]=f(u[e.bufferView],[]),u[e.bufferView].push(e))});for(var c in u)if(u.hasOwnProperty(c)){o=a[c];var d=u[c];d.sort(function(e,t){return e.byteOffset-t.byteOffset});var p=0,_=0,g=d.length;for(i=0;i<g;++i){var v=d[i],y=z(e,v),C=v.byteOffset,b=v.count*y;delete v.byteStride;var S=i<g-1,T=S?z(e,d[i+1]):void 0;if(y!==T){var E=h(o,!0);s[c]&&(E.byteStride=y),E.byteOffset+=p,E.byteLength=C+b-p;var A=t(a,E);for(n=_;n<=i;++n)v=d[n],v.bufferView=A,v.byteOffset=v.byteOffset-p;p=S?d[i+1].byteOffset:void 0,_=i+1}}}l(e)}function G(e){r.accessorWithSemantic(e,"POSITION",function(t){var r=e.accessors[t];if(!m(r.min)||!m(r.max)){var n=i(e,r);r.min=n.min,r.max=n.max}})}function H(e){return(!m(e.children)||0===e.children.length)&&(!m(e.meshes)||0===e.meshes.length)&&!m(e.camera)&&!m(e.skin)&&!m(e.skeletons)&&!m(e.jointName)&&(!m(e.translation)||c.fromArray(e.translation).equals(c.ZERO))&&(!m(e.scale)||c.fromArray(e.scale).equals(new c(1,1,1)))&&(!m(e.rotation)||d.fromArray(e.rotation).equals(new d(0,0,0,1)))&&(!m(e.matrix)||g.fromColumnMajorArray(e.matrix).equals(g.IDENTITY))&&!m(e.extensions)&&!m(e.extras)}function W(e,t){r.scene(e,function(e){var i=e.nodes;if(m(i))for(var r=i.length,n=r;n>=0;--n)if(i[n]===t)return void i.splice(n,1)}),r.node(e,function(i,r){if(m(i.children)){var n=i.children.indexOf(t);n>-1&&(i.children.splice(n,1),H(i)&&W(e,r))}}),delete e.nodes[t]}function q(e){return r.node(e,function(t,i){H(t)&&W(e,i)}),e}function Y(e){r.animation(e,function(t){r.animationSampler(t,function(t){var r=e.accessors[t.input];if(!m(r.min)||!m(r.max)){var n=i(e,r);r.min=n.min,r.max=n.max}})})}function j(e){e.asset=f(e.asset,{}),e.asset.version="2.0",b(e),x(e),q(e),D(e),I(e),R(e),O(e),V(e),U(e),G(e),Y(e),L(e),N(e),F(e),B(e),u(e),k(e),a(e),s(e),M(e)}var X={.8:w,"1.0":j,"2.0":void 0},Q={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0},K={POSITION:!0,NORMAL:!0,TANGENT:!0},Z={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};return C}),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/ClippingPlane",["../Core/Cartesian3","../Core/Check","../Core/defined","../Core/defineProperties"],function(e,t,i,r){"use strict";function n(e,t){this._distance=t,this._normal=new o(e,this),this.onChangeCallback=void 0,this.index=-1}function o(t,i){this._clippingPlane=i,this._cartesian3=e.clone(t)}return r(n.prototype,{distance:{get:function(){return this._distance},set:function(e){i(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(t){i(this.onChangeCallback)&&!e.equals(this._normal._cartesian3,t)&&this.onChangeCallback(this.index),e.clone(t,this._normal._cartesian3)}}}),n.fromPlane=function(e,t){return i(t)?(t.normal=e.normal,t.distance=e.distance):t=new n(e.normal,e.distance),t},n.clone=function(e,t){return i(t)?(t.normal=e.normal,t.distance=e.distance,t):new n(e.normal,e.distance)},r(o.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){i(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){i(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){i(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}}),n}),define("Scene/ClippingPlaneCollection",["../Core/AttributeCompression","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Intersect","../Core/Matrix4","../Core/PixelFormat","../Core/Plane","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ClippingPlane"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E){"use strict";function A(e){e=a(e,a.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=a(e.enabled,!0),this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this.edgeColor=o.clone(a(e.edgeColor,o.WHITE)),this.edgeWidth=a(e.edgeWidth,0),this.planeAdded=new h,this.planeRemoved=new h,this._owner=void 0;var t=a(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?w:x,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;var i=e.planes;if(s(i))for(var r=i.length,n=0;n<r;++n)this.add(i[n])}function w(e){return e===p.OUTSIDE}function x(e){return e===p.INSIDE}function P(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||-1!==e._dirtyIndex&&e._dirtyIndex!==t,e._dirtyIndex=t}function D(e,t){for(var i=e.length,r=0;r<i;++r)if(_.equals(e[r],t))return r;return-1}function I(t,i,n){for(var o=t._uint8View,a=t._planes,s=0,l=i;l<n;++l){var u=a[l],c=e.octEncodeToCartesian4(u.normal,L);o[s]=c.x,o[s+1]=c.y,o[s+2]=c.z,o[s+3]=c.w;var d=r.packFloat(u.distance,O);o[s+4]=d.x,o[s+5]=d.y,o[s+6]=d.z,o[s+7]=d.w,s+=8}}function M(e,t,i){for(var r=e._float32View,n=e._planes,o=0,a=t;a<i;++a){var s=n[a],l=s.normal;r[o]=l.x,r[o+1]=l.y,r[o+2]=l.z,r[o+3]=s.distance,o+=4}}function R(e,t){var i=g.maximumTextureSize;return t.x=Math.min(e,i),t.y=Math.ceil(e/t.x),t}l(A.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?w:x)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}}),A.prototype.add=function(e){var t=this._planes.length,i=this;e.onChangeCallback=function(e){P(i,e)},e.index=t,P(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)},A.prototype.get=function(e){return this._planes[e]},A.prototype.contains=function(e){return-1!==D(this._planes,e)},A.prototype.remove=function(e){var t=this._planes,i=D(t,e);if(-1===i)return!1;e instanceof E&&(e.onChangeCallback=void 0,e.index=-1);for(var r=t.length-1,n=i;n<r;++n){var o=t[n+1];t[n]=o,o instanceof E&&(o.index=n)}return this._multipleDirtyPlanes=!0,t.length=r,this.planeRemoved.raiseEvent(e,i),!0},A.prototype.removeAll=function(){for(var e=this._planes,t=e.length,i=0;i<t;++i){var r=e[i];r instanceof E&&(r.onChangeCallback=void 0,r.index=-1),this.planeRemoved.raiseEvent(r,i)}this._multipleDirtyPlanes=!0,this._planes=[]};var O=new r,L=new r,N=new t;A.prototype.update=function(e){var t=this._clippingPlanesTexture,i=e.context,r=A.useFloatTexture(i),n=r?this.length:2*this.length;if(s(t)){var o=t.width*t.height;(o<n||n<.25*o)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(0!==this.length){if(!s(t)){var a=R(n,N);a.y*=2;var l=new y({wrapS:T.CLAMP_TO_EDGE,wrapT:T.CLAMP_TO_EDGE,minificationFilter:S.NEAREST,magnificationFilter:b.NEAREST});r?(t=new C({context:i,width:a.x,height:a.y,pixelFormat:m.RGBA,pixelDatatype:v.FLOAT,sampler:l,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new C({context:i,width:a.x,height:a.y,pixelFormat:m.RGBA,pixelDatatype:v.UNSIGNED_BYTE,sampler:l,flipY:!1}),this._uint8View=new Uint8Array(a.x*a.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}var u=this._dirtyIndex;if(this._multipleDirtyPlanes||-1!==u){if(this._multipleDirtyPlanes)r?(M(this,0,this._planes.length),t.copyFrom({width:t.width,height:t.height,arrayBufferView:this._float32View})):(I(this,0,this._planes.length),t.copyFrom({width:t.width,height:t.height,arrayBufferView:this._uint8View}));else{var c=0,d=0;r?(d=Math.floor(u/t.width),c=Math.floor(u-d*t.width),M(this,u,u+1),t.copyFrom({width:1,height:1,arrayBufferView:this._float32View},c,d)):(d=Math.floor(2*u/t.width),c=Math.floor(2*u-d*t.width),I(this,u,u+1),t.copyFrom({width:2,height:1,arrayBufferView:this._uint8View},c,d))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}}};var F=new f,B=new _(i.UNIT_X,0);return A.prototype.computeIntersectionWithBoundingVolume=function(e,t){var i=this._planes,r=i.length,n=this.modelMatrix;s(t)&&(n=f.multiply(t,n,F));var o=p.INSIDE;!this.unionClippingRegions&&r>0&&(o=p.OUTSIDE);for(var a=0;a<r;++a){var l=i[a];_.transform(l,n,B);var u=e.intersectPlane(B);if(u===p.INTERSECTING)o=u;else if(this._testIntersection(u))return u}return o},A.setOwner=function(e,t,i){e!==t[i]&&(t[i]=t[i]&&t[i].destroy(),s(e)&&(e._owner=t,t[i]=e))},A.useFloatTexture=function(e){return e.floatingPointTexture},A.getTextureResolution=function(e,t,i){var r=e.texture;if(s(r))return i.x=r.width,i.y=r.height,i;var n=A.useFloatTexture(t)?e.length:2*e.length,o=R(n,i);return o.y*=2,o},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),c(this)},A}),define("Scene/DracoLoader",["../Core/arraySlice","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/TaskProcessor","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(){}function l(e,t){var i="runtime."+Object.keys(e.createdBufferViews).length,r=e.buffers,n=Object.keys(r).length;return r[n]=t,e.createdBufferViews[i]={buffer:n,byteOffset:0,byteLength:t.byteLength},i}function u(e,t,i){var r=t._loadResources,n=l(r,e);return r.vertexBuffersToCreate.enqueue(n),n}function c(e,i,r){var n=e.typedArray,o=i._loadResources,a=l(o,n);return o.indexBuffersToCreate.enqueue({id:a,componentType:t.fromTypedArray(n)}),{bufferViewId:a,numberOfIndices:e.numberOfIndices}}function d(e,t,r,n){if(s._taskProcessorReady){var o=r.primitivesToDecode.peek();if(i(o)){var a=e.scheduleTask(o,[o.array.buffer]);if(i(a))return r.activeDecodingTasks++,r.primitivesToDecode.dequeue(),a.then(function(e){r.activeDecodingTasks--;var i=c(e.indexArray,t,n),a={},s=e.attributeData;for(var l in s)if(s.hasOwnProperty(l)){var d=s[l],h=d.array,p=u(h,t,n),f=d.data;f.bufferView=p,a[l]=f}t._decodedData[o.mesh+".primitive."+o.primitive]={bufferView:i.bufferViewId,numberOfIndices:i.numberOfIndices,attributes:a}})}}}return s._maxDecodingConcurrency=Math.max(r.hardwareConcurrency-1,1),s._decoderTaskProcessor=void 0,s._taskProcessorReady=!1,s._getDecoderTaskProcessor=function(){if(!i(s._decoderTaskProcessor)){var e=new n("decodeDraco",s._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then(function(){s._taskProcessorReady=!0}),s._decoderTaskProcessor=e}return s._decoderTaskProcessor},s.hasExtension=function(e){return i(e.extensionsRequired.KHR_draco_mesh_compression)||i(e.extensionsUsed.KHR_draco_mesh_compression)},s._decodedModelResourceCache=void 0,s.parse=function(t,r){if(s.hasExtension(t)){var n=t._loadResources,a=t.cacheKey;if(i(a)){i(s._decodedModelResourceCache)||(i(r.cache.modelDecodingCache)||(r.cache.modelDecodingCache={}),s._decodedModelResourceCache=r.cache.modelDecodingCache);var l=s._decodedModelResourceCache[a];if(i(l))return l.count++,void(n.pendingDecodingCache=!0)}var u=t._dequantizeInShader,c=t.gltf;o.mesh(c,function(t,r){o.meshPrimitive(t,function(t,o){if(i(t.extensions)){var a=t.extensions.KHR_draco_mesh_compression;if(i(a)){var s=c.bufferViews[a.bufferView],l=e(c.buffers[s.buffer].extras._pipeline.source,s.byteOffset,s.byteOffset+s.byteLength);n.primitivesToDecode.enqueue({mesh:r,primitive:o,array:l,bufferView:s,compressedAttributes:a.attributes,dequantizeInShader:u})}}})})}},s.decodeModel=function(e,t){if(!s.hasExtension(e))return a.resolve();var r=e._loadResources,n=e.cacheKey;if(i(n)&&i(s._decodedModelResourceCache)){var o=s._decodedModelResourceCache[n];if(i(o)&&r.pendingDecodingCache)return a(o.ready,function(){e._decodedData=o.data,r.pendingDecodingCache=!1});s._decodedModelResourceCache[n]={ready:!1,count:1,data:void 0}}if(0===r.primitivesToDecode.length)return a.resolve();for(var l=s._getDecoderTaskProcessor(),u=[],c=d(l,e,r,t);i(c);)u.push(c),c=d(l,e,r,t);return a.all(u)},s.decodePointCloud=function(e){var t=s._getDecoderTaskProcessor();if(s._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},s.cacheDataForModel=function(e){var t=e.cacheKey;if(i(t)&&i(s._decodedModelResourceCache)){var r=s._decodedModelResourceCache[t];i(r)&&(r.ready=!0,r.data=e._decodedData)}},s.destroyCachedDataForModel=function(e){var t=e.cacheKey;if(i(t)&&i(s._decodedModelResourceCache)){var r=s._decodedModelResourceCache[t];i(r)&&0==--r.count&&delete s._decodedModelResourceCache[t]}},s}),define("Scene/getClipAndStyleCode",["../Core/Check"],function(e){"use strict";function t(e,t,i){return" float clipDistance = clip(gl_FragCoord, "+e+", "+t+"); \n vec4 clippingPlanesEdgeColor = vec4(1.0); \n clippingPlanesEdgeColor.rgb = "+i+".rgb; \n float clippingPlanesEdgeWidth = "+i+".a; \n if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n { \n gl_FragColor = clippingPlanesEdgeColor;\n } \n"}return t}),define("Scene/getClippingFunction",["../Core/Cartesian2","../Core/Check","../Renderer/PixelDatatype","./ClippingPlaneCollection"],function(e,t,i,r){"use strict";function n(e,t){var i=e.unionClippingRegions,n=e.length,c=r.useFloatTexture(t),d=r.getTextureResolution(e,t,u),h=d.x,p=d.y,f=c?s(h,p):l(h,p);return f+="\n",f+=i?o(n):a(n)}function o(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount;\n float pixelWidth = czm_metersPerPixel(position);\n bool breakAndDiscard = false;\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0)\n {\n breakAndDiscard = true;\n break;\n }\n }\n if (breakAndDiscard) {\n discard;\n }\n return clipAmount;\n}\n"}function a(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n bool clipped = true;\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount = 0.0;\n float pixelWidth = czm_metersPerPixel(position);\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n }\n if (clipped)\n {\n discard;\n }\n return clipAmount;\n}\n"}function s(e,t){var i=1/e,r=1/t,n=i+"";-1===n.indexOf(".")&&(n+=".0");var o=r+"";return-1===o.indexOf(".")&&(o+=".0"),"vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int pixY = clippingPlaneNumber / "+e+";\n int pixX = clippingPlaneNumber - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+n+";\n float v = (float(pixY) + 0.5) * "+o+";\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n"}function l(e,t){var i=1/e,r=1/t,n=i+"";-1===n.indexOf(".")&&(n+=".0");var o=r+"";return-1===o.indexOf(".")&&(o+=".0"),"vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n int pixY = clippingPlaneStartIndex / "+e+";\n int pixX = clippingPlaneStartIndex - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+n+";\n float v = (float(pixY) + 0.5) * "+o+";\n vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + "+n+", v)));\n return czm_transformPlane(plane, transform);\n}\n"}var u=new e;return n}),define("Scene/JobType",["../Core/freezeObject"],function(e){"use strict";return e({TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3})}),define("Scene/AttributeType",["../Core/freezeObject"],function(e){"use strict";return e({SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"})}),define("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","../Core/WeightSpline","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType","./AttributeType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(){}function f(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,l=t.count*d(t.type),u=g.test(a.uri)?"":a.uri;return e.cacheKey+"//"+u+"/"+s+"/"+l}function m(e,t,i){return e.cacheKey+"//"+t+"/"+i}function _(e){this._value=e}var g=/^data\:/i,v={};p.getAnimationParameterValues=function(n,o){var s=f(n,o),l=v[s];if(!r(l)){var u=n.gltf,h=u.buffers,p=u.bufferViews,m=p[o.bufferView],_=m.buffer,g=h[_],y=g.extras._pipeline.source,C=o.componentType,b=o.type,S=d(b),T=o.count,E=c(u,o);l=new Array(T);for(var A=i(o.byteOffset,0),w=m.byteOffset+A,x=0;x<T;x++){var P=t.createArrayBufferView(C,y.buffer,y.byteOffset+w,S);"SCALAR"===b?l[x]=P[0]:"VEC3"===b?l[x]=e.fromArray(P):"VEC4"===b&&(l[x]=a.unpack(P)),w+=E}r(n.cacheKey)&&(v[s]=l)}return l};var y={};_.prototype.evaluate=function(e,t){return this._value},_.prototype.wrapTime=function(e){return 0},_.prototype.clampTime=function(e){return 0},p.getAnimationSpline=function(e,t,i,o,a,l,c,d){var h=m(e,t,o),p=y[h];if(!r(p)){var f=l,g=d;1===f.length&&1===g.length?p=new _(g[0]):"LINEAR"===a.interpolation&&("translation"===c||"scale"===c?p=new n({times:f,points:g}):"rotation"===c?p=new s({times:f,points:g}):"weights"===c&&(p=new u({times:f,weights:g}))),r(e.cacheKey)&&(y[h]=p)}return p};var C={};return p.getSkinInverseBindMatrices=function(e,i){var n=f(e,i),a=C[n];if(!r(a)){var s=e.gltf,u=s.buffers,p=s.bufferViews,m=i.bufferView,_=p[m],g=_.buffer,v=u[g],y=v.extras._pipeline.source,b=i.componentType,S=i.type,T=i.count,E=c(s,i),A=_.byteOffset+i.byteOffset,w=d(S);if(a=new Array(T),b===l.FLOAT&&S===h.MAT4)for(var x=0;x<T;++x){var P=t.createArrayBufferView(b,y.buffer,y.byteOffset+A,w);a[x]=o.fromArray(P),A+=E}C[n]=a}return a},p}),define("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,REPEAT:1,MIRRORED_REPEAT:2})}),define("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),define("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/defined","../Core/deprecationWarning","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){this._name=r.name,this._startTime=o.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._multiplier=e(t.multiplier,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,a.NONE),this.start=new n,this.update=new n,this.stop=new n,this._state=s.STOPPED,this._runtimeAnimation=r,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(i,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(i,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(i,l)}}return t(l.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}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),l}),define("Scene/ModelAnimationCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../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,i){var r=e._model,n=r._runtime.animations,o=n[t],a=new l(i,r,o);return e._scheduledAnimations.push(a),e.animationAdded.raiseEvent(r,a),a}function p(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}function f(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}i(d.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),d.prototype.add=function(i){i=e(i,e.EMPTY_OBJECT);var r=this._model,n=r._runtime.animations;if(t(i.index))return h(this,i.index,i);for(var o,a=n.length,s=0;s<a;++s)if(n[s].name===i.name){o=s;break}return h(this,o,i)},d.prototype.addAll=function(t){t=e(t,e.EMPTY_OBJECT);for(var i=[],r=this._model,n=r._runtime.animations,o=n.length,a=0;a<o;++a)i.push(h(this,a,t));return i},d.prototype.remove=function(e){if(t(e)){var i=this._scheduledAnimations,r=i.indexOf(e);if(-1!==r)return i.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!!t(e)&&-1!==this._scheduledAnimations.indexOf(e)},d.prototype.get=function(e){return this._scheduledAnimations[e]};var m=[];return d.prototype.update=function(i){var r=this._scheduledAnimations,n=r.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(i.time,this._previousTime))return!1;this._previousTime=a.clone(i.time,this._previousTime);for(var o=!1,l=i.time,d=this._model,h=0;h<n;++h){var _=r[h],g=_._runtimeAnimation;t(_._computedStartTime)||(_._computedStartTime=a.addSeconds(e(_.startTime,l),_.delay,new a)),t(_._duration)||(_._duration=g.stopTime*(1/_.multiplier));var v=_._computedStartTime,y=_._duration,C=_.stopTime,b=0!==y?a.secondsDifference(l,v)/y:0,S=b>=0,T=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT;if((S||T&&!t(_.startTime))&&(b<=1||T)&&(!t(C)||a.lessThanOrEquals(l,C))){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&i.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)b-=Math.floor(b);else if(_.loop===u.MIRRORED_REPEAT){var E=Math.floor(b),A=b-E;b=E%2==1?1-A:A}_.reverse&&(b=1-b);var w=b*y*_.multiplier;w=s.clamp(w,g.startTime,g.stopTime),p(g,w),_.update.numberOfListeners>0&&(_._updateEventTime=w,i.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&i.afterRender.push(_._raiseStopEvent),_.removeOnStop&&m.push(_))}n=m.length;for(var x=0;x<n;++x){var P=m[x];r.splice(r.indexOf(P),1),i.afterRender.push(f(this,d,P))}return m.length=0,o},d}),define("Scene/ModelLoadResources",["../Core/Queue"],function(e){"use strict";function t(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new e,this.indexBuffersToCreate=new e,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new e,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new e,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new e,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.createdBufferViews={},this.primitivesToDecode=new e,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function i(e,t,i){return e.subarray(t,t+i)}return t.prototype.getBuffer=function(e){return i(this.buffers[e.buffer],e.byteOffset,e.byteLength)},t.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},t.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},t.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},
- t.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},t.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return this.finishedDecoding()&&e&&t},t.prototype.finishedDecoding=function(){return 0===this.primitivesToDecode.length&&0===this.activeDecodingTasks&&!this.pendingDecodingCache},t.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},t}),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],this._technique=void 0,this._program=void 0,this._values=void 0}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var i="u_"+e,r=this._uniformMap.values[i];r.value=r.clone(t,r.value)},r.prototype.getValue=function(t){var i="u_"+t,r=this._uniformMap.values[i];if(e(r))return r.value},r}),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),this._originalMatrix=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}},originalMatrix:{get:function(){return this._originalMatrix}}}),i.prototype.setMatrix=function(e){t.clone(e,this._matrix)},i}),define("Scene/ModelUtility",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/clone","../Core/defined","../Core/defineProperties","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/FeatureDetection","../Core/RuntimeError","../Core/WebGLConstants","../Renderer/ShaderSource","../ThirdParty/GltfPipeline/addToArray","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/hasExtension","./AttributeType","./Axis"],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){return _.techniqueAttribute(e,function(e,i){if(e.semantic===t)return i})}function b(e,t){var i=e.accessors,r=e.materials,n=e.extensions.KHR_techniques_webgl,a=n.techniques,s=n.programs,l=n.shaders,u=t.targets,c=t.attributes;for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];for(var p in h)"extras"!==p&&(c[p+"_"+d]=h[p])}var f=r[t.material],m=a[f.extensions.KHR_techniques_webgl.technique],_=s[m.program],g=l[_.vertexShader];for(var v in c)if(c.hasOwnProperty(v)&&!o(C(m,v))){var y=c[v],b=i[y],S=v.toLowerCase();"_"===S.charAt(0)&&(S=S.slice(1));var T="a_"+S;m.attributes[T]={semantic:v,type:b.componentType};var E=g.extras._pipeline,A=E.source;A="attribute "+B.getShaderVariable(b.type)+" "+T+";\n"+A,E.source=A}}function S(e,t,i,r){return g(e,"KHR_techniques_webgl")?function(e,t){if(!(e.semantic!==i||r&&o(e.node)))return t}:function(e,n){var a=t.parameters[e];if(!(a.semantic!==i||r&&o(a.node)))return n}}function T(e,t,i){t+="(?!\\w)",t=new RegExp(t,"g");var r=e.search(t);return e.replace(t,function(e,t){return r===t?e:i})}function E(e,t){var i=e.accessors[t],r=i.extensions;if(o(r))return r.WEB3D_quantized_attributes}function A(e,t,i){var r=t.material,n=e.materials[r];if(g(e,"KHR_techniques_webgl")&&o(n.extensions)&&o(n.extensions.KHR_techniques_webgl)){var a=n.extensions.KHR_techniques_webgl.technique,s=e.extensions.KHR_techniques_webgl,l=s.techniques[a];return _.techniqueAttribute(l,function(e,t){if(e.semantic===i)return t})}}function w(e){var t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function x(e){var i={value:t.fromArray(e),clone:t.clone,func:function(){return i.value}};return i}function P(e){var t={value:i.fromArray(e),clone:i.clone,func:function(){return t.value}};return t}function D(e){var t={value:r.fromArray(e),clone:r.clone,func:function(){return t.value}};return t}function I(e){var t={value:s.fromColumnMajorArray(e),clone:s.clone,func:function(){return t.value}};return t}function M(e){var t={value:l.fromColumnMajorArray(e),clone:l.clone,func:function(){return t.value}};return t}function R(e){var t={value:u.fromColumnMajorArray(e),clone:u.clone,func:function(){return t.value}};return t}function O(e,t,i){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=i}function L(e,t,i){var r=new O(e,t,i);return r.func=function(){return r.value},r}function N(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 F(e){return[e[20],e[21],e[22],e[23]]}var B={};B.updateForwardAxis=function(e){var t=e.gltf.extras.sourceVersion;(o(t)&&"2.0"!==t||"2.0"!==B.getAssetVersion(e.gltf))&&(e._gltfForwardAxis=y.X)},B.getAssetVersion=function(e){return o(e.asset)&&o(e.asset.version)?e.asset.version:"1.0"},B.splitIncompatibleMaterials=function(e){var t=e.accessors,i=e.materials,r={};return _.mesh(e,function(e){_.meshPrimitive(e,function(e){var a,s,l=e.material,u=i[l],c=e.attributes.JOINTS_0;if(o(c)){var d=t[c];a=d.componentType,s=d.type}var h=o(c),p=o(e.attributes.COLOR_0),f=o(e.targets),_=o(e.attributes.NORMAL),g=o(e.attributes.TANGENT),v=o(e.attributes.TEXCOORD_0),y=r[l];if(o(y)){if(y.skinning.skinned!==h||y.skinning.type!==s||y.hasVertexColors!==p||y.hasMorphTargets!==f||y.hasNormals!==_||y.hasTangents!==g||y.hasTexCoords!==v){var C=n(u,!0);l=m(i,C),e.material=l,r[l]={skinning:{skinned:h,componentType:a,type:s},hasVertexColors:p,hasMorphTargets:f,hasNormals:_,hasTangents:g,hasTexCoords:v}}}else r[l]={skinning:{skinned:h,componentType:a,type:s},hasVertexColors:p,hasMorphTargets:f,hasNormals:_,hasTangents:g,hasTexCoords:v}})}),r},B.getShaderVariable=function(e){return"SCALAR"===e?"float":e.toLowerCase()},B.ModelState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},B.getFailedLoadFunction=function(e,t,i){return function(r){e._state=B.ModelState.FAILED;var n="Failed to load "+t+": "+i;o(r)&&(n+="\n"+r.message),e._readyPromise.reject(new h(n))}},B.parseBuffers=function(e,t){var i=e._loadResources;_.buffer(e.gltf,function(r,n){if(o(r.extras._pipeline.source))i.buffers[n]=r.extras._pipeline.source;else if(o(t)){var a=e._resource.getDerivedResource({url:r.uri});++i.pendingBufferLoads,a.fetchArrayBuffer().then(t(e,n)).otherwise(B.getFailedLoadFunction(e,"buffer",a.url))}})};var k=new i,z=new i;B.computeBoundingSphere=function(t){for(var r=t.gltf,n=r.nodes,a=r.meshes,s=r.scenes[r.scene].nodes,l=s.length,c=[],d=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),h=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),p=0;p<l;++p){var f=n[s[p]];for(f._transformToRoot=B.getTransform(f),c.push(f);c.length>0;){f=c.pop();var m=f._transformToRoot,_=f.mesh;if(o(_))for(var g=a[_],v=g.primitives,C=v.length,b=0;b<C;++b){var S=v[b].attributes.POSITION;if(o(S)){var T=B.getAccessorMinMax(r,S),E=i.fromArray(T.min,0,k),A=i.fromArray(T.max,0,z);o(d)&&o(h)&&(u.multiplyByPoint(m,E,E),u.multiplyByPoint(m,A,A),i.minimumByComponent(d,E,d),i.maximumByComponent(h,A,h))}}var w=f.children;if(o(w))for(var x=w.length,P=0;P<x;++P){var D=n[w[P]];D._transformToRoot=B.getTransform(D),u.multiplyTransformation(m,D._transformToRoot,D._transformToRoot),c.push(D)}delete f._transformToRoot}}var I=e.fromCornerPoints(d,h);return t._forwardAxis===y.Z&&e.transformWithoutScale(I,y.Z_UP_TO_X_UP,I),t._upAxis===y.Y?e.transformWithoutScale(I,y.Y_UP_TO_Z_UP,I):t._upAxis===y.X&&e.transformWithoutScale(I,y.X_UP_TO_Z_UP,I),I},B.ensureSemanticExistence=function(e){return _.mesh(e,function(t){_.meshPrimitive(t,function(t){b(e,t)})}),e},B.createAttributeLocations=function(e,t){var i={},r=!1,n=1;if(_.techniqueAttribute(e,function(e,t){/pos/i.test(t)&&!r?(i[t]=0,r=!0):i[t]=n++}),o(t))for(var a in t)t.hasOwnProperty(a)&&(i[a]=n++);return i},B.getAccessorMinMax=function(e,t){var i=e.accessors[t],r=i.extensions,n=i.min,a=i.max;if(o(r)){var s=r.WEB3D_quantized_attributes;o(s)&&(n=s.decodedMin,a=s.decodedMax)}return{min:n,max:a}},B.getAttributeOrUniformBySemantic=function(e,t,i,r){return _.technique(e,function(n){if(!o(i)||n.program===i){var a=_.techniqueAttribute(n,S(e,n,t,r));return o(a)?a:_.techniqueUniform(n,S(e,n,t,r))}})},B.getDiffuseAttributeOrUniform=function(e,t){var i=B.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return o(i)||(i=B.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),i};var V=new i,U=new c,G=new i;B.getTransform=function(e,t){return o(e.matrix)?u.fromColumnMajorArray(e.matrix,t):u.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,V),c.unpack(e.rotation,0,U),i.fromArray(e.scale,0,G),t)},B.getUsedExtensions=function(e){var t=e.extensionsUsed,i={};if(o(t))for(var r=t.length,n=0;n<r;n++){var a=t[n];i[a]=!0}return i},B.getRequiredExtensions=function(e){var t=e.extensionsRequired,i={};if(o(t))for(var r=t.length,n=0;n<r;n++){var a=t[n];i[a]=!0}return i},B.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0},B.checkSupportedExtensions=function(e,t){for(var i in e)if(e.hasOwnProperty(i)){if(!B.supportedExtensions[i])throw new h("Unsupported glTF Extension: "+i);if("EXT_texture_webp"===i&&!1===t)throw new h("Loaded model requires WebP but browser does not support it.")}},B.checkSupportedGlExtensions=function(e,t){if(o(e))for(var i=e.length,r=0;r<i;r++){var n=e[r];if("OES_element_index_uint"!==n)throw new h("Unsupported WebGL Extension: "+n);if(!t.elementIndexUint)throw new h("OES_element_index_uint WebGL extension is not enabled.")}},B.modifyShaderForDracoQuantizedAttributes=function(e,t,i,r){var n={};for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],l=s.quantization;if(!o(l))continue;var u=A(e,t,a);"_"===a.charAt(0)&&(a=a.substring(1));var c="gltf_u_dec_"+a.toLowerCase();if(!o(n[c])){var d="gltf_decoded_"+a,h=u.replace("a_","gltf_a_dec_"),p=s.componentsPerAttribute;i=T(i,u,h);var m;m=l.octEncoded?"vec3":p>1?"vec"+p:"float",i=m+" "+h+";\n"+i;var _=3===p&&"COLOR_0"===a;_&&(i=T(i,h,"vec4("+h+", 1.0)"));var g="";if(l.octEncoded){var v=c+"_rangeConstant";i="uniform float "+v+";\n"+i,g="\nvoid main() {\n "+h+" = czm_octDecode("+u+".xy, "+v+").zxy;\n "+d+"();\n}\n"}else{var y=c+"_normConstant",C=c+"_min";i="uniform float "+y+";\nuniform "+m+" "+C+";\n"+i;var b=_?".xyz":"";g="\nvoid main() {\n "+h+" = "+C+" + "+u+b+" * "+y+";\n "+d+"();\n}\n"}i=f.replaceMain(i,d),i+=g}}return{shader:i}},B.modifyShaderForQuantizedAttributes=function(e,t,i){var r={},n=t.attributes;for(var a in n)if(n.hasOwnProperty(a)){var s=A(e,t,a),l=t.attributes[a];"_"===a.charAt(0)&&(a=a.substring(1));var u="gltf_u_dec_"+a.toLowerCase(),c=u+"_scale",d=u+"_translate";if(!o(r[u])&&!o(r[c])){var h=E(e,l);if(o(h)){var p=h.decodeMatrix,m="gltf_decoded_"+a,_=s.replace("a_","gltf_a_dec_"),g=Math.floor(Math.sqrt(p.length));i=T(i,s,_);var v;v=g>2?"vec"+(g-1):"float",i=v+" "+_+";\n"+i;var y="";5===g?(i="uniform mat4 "+c+";\n"+i,i="uniform vec4 "+d+";\n"+i,y="\nvoid main() {\n "+_+" = "+c+" * "+s+" + "+d+";\n "+m+"();\n}\n",r[c]={mat:4},r[d]={vec:4}):(i="uniform mat"+g+" "+u+";\n"+i,y="\nvoid main() {\n "+_+" = "+v+"("+u+" * vec"+g+"("+s+",1.0));\n "+m+"();\n}\n",r[u]={mat:g}),i=f.replaceMain(i,m),i+=y}}}return{shader:i,uniforms:r}},B.toClipCoordinatesGLSL=function(e,t){var i=B.getAttributeOrUniformBySemantic(e,"POSITION"),r=i.replace("a_","gltf_a_dec_");-1!==t.indexOf(r)&&(i=r);var n=B.getAttributeOrUniformBySemantic(e,"MODELVIEWPROJECTION",void 0,!0);if(!o(n)||-1===t.indexOf(n)){var a=B.getAttributeOrUniformBySemantic(e,"PROJECTION",void 0,!0),s=B.getAttributeOrUniformBySemantic(e,"MODELVIEW",void 0,!0);-1!==t.indexOf("czm_instanced_modelView ")?s="czm_instanced_modelView":o(s)||(s=B.getAttributeOrUniformBySemantic(e,"CESIUM_RTC_MODELVIEW",void 0,!0)),n=a+" * "+s}return n+" * vec4("+i+".xyz, 1.0)"},B.modifyFragmentShaderForLogDepth=function(e){return e=f.replaceMain(e,"czm_depth_main"),e+="\nvoid main() \n{ \n czm_depth_main(); \n czm_writeLogDepth(); \n} \n"},B.modifyVertexShaderForLogDepth=function(e,t){return e=f.replaceMain(e,"czm_depth_main"),e+="\nvoid main() \n{ \n czm_depth_main(); \n czm_vertexLogDepth("+t+"); \n} \n"},a(O.prototype,{value:{get:function(){if(!o(this._value)){var e=this._textures[this._textureId];if(!o(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),O.prototype.clone=function(e){return e},O.prototype.func=void 0;var H={};H[p.FLOAT]=w,H[p.FLOAT_VEC2]=x,H[p.FLOAT_VEC3]=P,H[p.FLOAT_VEC4]=D,H[p.INT]=w,H[p.INT_VEC2]=x,H[p.INT_VEC3]=P,H[p.INT_VEC4]=D,H[p.BOOL]=w,H[p.BOOL_VEC2]=x,H[p.BOOL_VEC3]=P,H[p.BOOL_VEC4]=D,H[p.FLOAT_MAT2]=I,H[p.FLOAT_MAT3]=M,H[p.FLOAT_MAT4]=R,H[p.SAMPLER_2D]=L,B.createUniformFunction=function(e,t,i,r){return H[e](t,i,r)},B.createUniformsForDracoQuantizedAttributes=function(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i],n=r.quantization;if(!o(n))continue;"_"===i.charAt(0)&&(i=i.substring(1));var a="gltf_u_dec_"+i.toLowerCase();if(n.octEncoded){var s=a+"_rangeConstant",l=(1<<n.quantizationBits)-1;t[s]=w(l).func;continue}var u=a+"_normConstant",c=n.range/(1<<n.quantizationBits);t[u]=w(c).func;var d=a+"_min";switch(r.componentsPerAttribute){case 1:t[d]=w(n.minValues).func;break;case 2:t[d]=x(n.minValues).func;break;case 3:t[d]=P(n.minValues).func;break;case 4:t[d]=D(n.minValues).func}}return t},B.createUniformsForQuantizedAttributes=function(e,t,i){var r=e.accessors,n={},a={},c=t.attributes;for(var d in c)if(c.hasOwnProperty(d)){var h=c[d],p=r[h],f=p.extensions;if("_"===d.charAt(0)&&(d=d.substring(1)),o(f)){var m=f.WEB3D_quantized_attributes;if(o(m)){var _=m.decodeMatrix,g="gltf_u_dec_"+d.toLowerCase();switch(p.type){case v.SCALAR:a[g]=I(_).func,n[g]=!0;break;case v.VEC2:a[g]=M(_).func,n[g]=!0;break;case v.VEC3:a[g]=R(_).func,n[g]=!0;break;case v.VEC4:var y=g+"_scale",C=g+"_translate";a[y]=R(N(_)).func,a[C]=D(F(_)).func,n[y]=!0,n[C]=!0}}}}for(var b in i)if(i.hasOwnProperty(b)&&!n[b]){var S=i[b];o(S.mat)&&(2===S.mat?a[b]=I(s.IDENTITY).func:3===S.mat?a[b]=M(l.IDENTITY).func:4===S.mat&&(a[b]=R(u.IDENTITY).func)),o(S.vec)&&4===S.vec&&(a[b]=D([0,0,0,0]).func)}return a};var W=new i,q={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 u;return function(){return o(t._rtcCenter)?(u.getTranslation(e.model,W),i.add(W,t._rtcCenter,W),u.multiplyByPoint(e.view,W,W),u.setTranslation(e.modelView,W,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}}};return B.getGltfSemanticUniforms=function(){return q},B}),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/OctahedralProjectionAtlasFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\nvoid main()\n{\nvec2 uv = v_textureCoordinates;\nvec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\nvec2 pixel = 1.0 / textureSize;\nfloat mipLevel = 0.0;\nif (uv.x - pixel.x > (textureSize.y / textureSize.x))\n{\nmipLevel = 1.0;\nif (uv.y - pixel.y > yMipLevel1)\n{\nmipLevel = 2.0;\nif (uv.y - pixel.y * 3.0 > yMipLevel2)\n{\nmipLevel = 3.0;\nif (uv.y - pixel.y * 5.0 > yMipLevel3)\n{\nmipLevel = 4.0;\nif (uv.y - pixel.y * 7.0 > yMipLevel4)\n{\nmipLevel = 5.0;\n}\n}\n}\n}\n}\nif (mipLevel > 0.0)\n{\nfloat scale = pow(2.0, mipLevel);\nuv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\nuv.x *= ((textureSize.x - 2.0) / textureSize.y);\nuv.x -= 1.0 + pixel.x;\nuv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\nuv *= scale;\n}\nelse\n{\nuv.x *= (textureSize.x / textureSize.y);\n}\nif(mipLevel == 0.0)\n{\ngl_FragColor = texture2D(texture0, uv);\n}\nelse if(mipLevel == 1.0)\n{\ngl_FragColor = texture2D(texture1, uv);\n}\nelse if(mipLevel == 2.0)\n{\ngl_FragColor = texture2D(texture2, uv);\n}\nelse if(mipLevel == 3.0)\n{\ngl_FragColor = texture2D(texture3, uv);\n}\nelse if(mipLevel == 4.0)\n{\ngl_FragColor = texture2D(texture4, uv);\n}\nelse if(mipLevel == 5.0)\n{\ngl_FragColor = texture2D(texture5, uv);\n}\nelse\n{\ngl_FragColor = vec4(0.0);\n}\n}\n"}),define("Shaders/OctahedralProjectionFS",[],function(){"use strict";return"varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\nvoid main()\n{\nvec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);\nfloat m = rgbm.a * 16.0;\nvec3 r = rgbm.rgb * m;\ngl_FragColor = vec4(r * r, 1.0);\n}\n"}),define("Shaders/OctahedralProjectionVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\nvarying vec3 v_cubeMapCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_cubeMapCoordinates = cubeMapCoordinates;\n}\n"}),define("Scene/OctahedralProjectedCubeMap",["../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/loadKTX","../Core/PixelFormat","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/CubeMap","../Renderer/PixelDatatype","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/OctahedralProjectionAtlasFS","../Shaders/OctahedralProjectionFS","../Shaders/OctahedralProjectionVS","../ThirdParty/when"],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._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._readyPromise=y.defer()}function b(e){var i=l.createVertexBuffer({context:e,typedArray:N,usage:u.STATIC_DRAW}),r=l.createVertexBuffer({context:e,typedArray:R,usage:u.STATIC_DRAW}),n=l.createIndexBuffer({context:e,typedArray:F,usage:u.STATIC_DRAW,indexDatatype:o.UNSIGNED_SHORT}),a=[{index:0,vertexBuffer:i,componentsPerAttribute:2,componentDatatype:t.FLOAT},{index:1,vertexBuffer:r,componentsPerAttribute:3,componentDatatype:t.FLOAT}];return new m({context:e,attributes:a,indexBuffer:n})}function S(e){return function(){return e}}function T(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();var t,r,n=e._cubeMaps;if(i(n))for(r=n.length,t=0;t<r;++t)n[t].destroy();var o=e._mipTextures;if(i(o))for(r=o.length,t=0;t<r;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}r(C.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),C.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};for(var E=new e(1,0,0),A=new e(0,0,1),w=new e(-1,0,0),x=new e(0,0,-1),P=new e(0,1,0),D=new e(0,-1,0),I=[P,w,A,D,E,P,x,P,P],M=I.length,R=new Float32Array(3*M),O=0,L=0;L<M;++L,O+=3)e.pack(I[L],R,O);var N=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),F=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);return C.prototype.update=function(e){var t=e.context;if(C.isSupported(t)&&(i(this._texture)&&i(this._va)&&T(this),!i(this._texture))){if(!i(this._texture)&&!this._loading){var r=t.textureCache.getTexture(this._url);if(i(r))return T(this),this._texture=r,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,void this._readyPromise.resolve()}var n=this._cubeMapBuffers;if(!i(n)&&!this._loading){var o=this;a(this._url).then(function(e){o._cubeMapBuffers=e,o._loading=!1}),this._loading=!0}if(i(this._cubeMapBuffers)){this._va=b(t),this._sp=p.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:g,attributeLocations:{position:0,cubeMapCoordinates:1}});var l=Math.min(n.length,6);this._maximumMipmapLevel=l-1;for(var u=this._cubeMaps=new Array(l),m=this._mipTextures=new Array(l),y=2*n[0].positiveX.width,E={originalSize:function(){return y}},A=t.halfFloatingPointTexture?h.HALF_FLOAT:h.FLOAT,w=s.RGBA,x=0;x<l;++x){var P=n[x].positiveY;n[x].positiveY=n[x].negativeY,n[x].negativeY=P;var D=u[x]=new d({context:t,source:n[x]}),I=2*u[x].width,M=m[x]=new f({context:t,width:I,height:I,pixelDatatype:A,pixelFormat:w}),R=new c({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:S(D)},outputTexture:M,persists:!0,owner:this});e.commandList.push(R),E["texture"+x]=S(M)}this._texture=new f({context:t,width:1.5*y+2,height:y,pixelDatatype:A,pixelFormat:w}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);var O=new c({fragmentShaderSource:_,uniformMap:E,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(O),this._ready=!0,this._readyPromise.resolve()}}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return T(this),this._texture=this._texture&&this._texture.destroy(),n(this)},C}),define("Scene/processModelMaterialsCommon",["./ModelUtility","../Core/defined","../Core/defaultValue","../Core/WebGLConstants","../Core/webGLConstantToGlslType","../ThirdParty/GltfPipeline/addToArray","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/hasExtension","../ThirdParty/GltfPipeline/numberOfComponentsForType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n){if(n=i(n,{}),t(r)&&s(r,"KHR_materials_common")){s(r,"KHR_techniques_webgl")||(t(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},r.extensionsUsed.push("KHR_techniques_webgl"),r.extensionsRequired.push("KHR_techniques_webgl"));var o=r.extensions.KHR_techniques_webgl;f(r);var l=c(r),u=e.splitIncompatibleMaterials(r),h={},m=!1;return a.material(r,function(e,i){if(t(e.extensions)&&t(e.extensions.KHR_materials_common)){var a=e.extensions.KHR_materials_common,s=u[i],c=p(a,s),f=h[c];t(f)||(f=d(r,o,s,a,l,n.addBatchIdToGeneratedShaders),h[c]=f,m=!0);var _,g={},v=a.values;for(var y in v)v.hasOwnProperty(y)&&"transparent"!==y&&"doubleSided"!==y&&(_="u_"+y.toLowerCase(),g[_]=v[y]);e.extensions.KHR_techniques_webgl={technique:f,values:g},e.alphaMode="OPAQUE",a.transparent&&(e.alphaMode="BLEND"),a.doubleSided&&(e.doubleSided=!0)}}),m?(e.ensureSemanticExistence(r),r):r}}function c(e){var i,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(i=e.extensions.KHR_materials_common.lights),t(i)){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(i[l])&&(i[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in i)if(i.hasOwnProperty(c)){var d=i[c],h=d.type;if("ambient"!==h&&!t(d.node)){delete i[c];continue}var p="light"+u.toString();switch(d.baseName=p,h){case"ambient":var f=d.ambient;n[p+"Color"]={type:r.FLOAT_VEC3,value:f.color};break;case"directional":var m=d.directional;n[p+"Color"]={type:r.FLOAT_VEC3,value:m.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:r.FLOAT_MAT4});break;case"point":var _=d.point;n[p+"Color"]={type:r.FLOAT_VEC3,value:_.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:r.FLOAT_MAT4}),n[p+"Attenuation"]={type:r.FLOAT_VEC3,value:[_.constantAttenuation,_.linearAttenuation,_.quadraticAttenuation]};break;case"spot":var g=d.spot;n[p+"Color"]={type:r.FLOAT_VEC3,value:g.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:r.FLOAT_MAT4},n[p+"InverseTransform"]={node:d.node,semantic:"MODELVIEWINVERSE",type:r.FLOAT_MAT4,useInFragment:!0}),n[p+"Attenuation"]={type:r.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]},n[p+"FallOff"]={type:r.FLOAT_VEC2,value:[g.fallOffAngle,g.fallOffExponent]}}++u}}return n}function d(a,u,c,d,p,f){t(d)||(d={}),f=i(f,!1);var m,_=u.techniques,g=u.shaders,v=u.programs,y=d.technique.toUpperCase();t(a.extensions)&&t(a.extensions.KHR_materials_common)&&(m=a.extensions.KHR_materials_common.lights);var C,b=d.values,S=i(d.jointCount,0),T=!1,E=!1;t(c)&&(C=c.skinning,T=C.skinned,E=c.hasVertexColors);var A="precision highp float;\n",w="precision highp float;\n",x="CONSTANT"!==y,P={u_modelViewMatrix:{semantic:s(a,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:r.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:r.FLOAT_MAT4}};x&&(P.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:r.FLOAT_MAT3}),T&&(P.u_jointMatrix={count:S,semantic:"JOINTMATRIX",type:r.FLOAT_MAT4});var D,I=!1;for(var M in b)if(b.hasOwnProperty(M)&&"transparent"!==M&&"doubleSided"!==M){var R=h(M,b[M]);D="u_"+M.toLowerCase(),I||R!==r.SAMPLER_2D||(I=!0),P[D]={type:R}}if(t(P.u_diffuse)&&(P.u_diffuse.semantic="_3DTILESDIFFUSE"),t(p))for(var O in p)p.hasOwnProperty(O)&&(D="u_"+O,P[D]=p[O]);for(D in P)if(P.hasOwnProperty(D)){var L=P[D],N=t(L.count)?"["+L.count+"]":"";L.type!==r.FLOAT_MAT3&&L.type!==r.FLOAT_MAT4||L.useInFragment?(w+="uniform "+n(L.type)+" "+D+N+";\n",delete L.useInFragment):A+="uniform "+n(L.type)+" "+D+N+";\n"}var F="";if(T){var B,k,z=l(C.type),V=!1;if(0===C.type.indexOf("MAT")&&(V=!0,z=Math.sqrt(z)),V)for(B=0;B<z;B++)for(k=0;k<z;k++)F+=0===B&&0===k?" mat4 skinMat = ":" skinMat += ",F+="a_weight["+B+"]["+k+"] * u_jointMatrix[int(a_joint["+B+"]["+k+"])];\n";else for(B=0;B<z;B++)F+=0===B?" mat4 skinMat = ":" skinMat += ",F+="a_weight["+B+"] * u_jointMatrix[int(a_joint["+B+"])];\n"}var U={a_position:{semantic:"POSITION"}};A+="attribute vec3 a_position;\n",A+="varying vec3 v_positionEC;\n",F+=T?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",F+=" v_positionEC = pos.xyz;\n",F+=" gl_Position = u_projectionMatrix * pos;\n",w+="varying vec3 v_positionEC;\n",x&&(U.a_normal={semantic:"NORMAL"},A+="attribute vec3 a_normal;\n",A+="varying vec3 v_normal;\n",F+=T?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",w+="varying vec3 v_normal;\n");var G;if(I&&(U.a_texcoord_0={semantic:"TEXCOORD_0"},G="v_texcoord_0",A+="attribute vec2 a_texcoord_0;\n",A+="varying vec2 "+G+";\n",F+=" "+G+" = a_texcoord_0;\n",w+="varying vec2 "+G+";\n"),T){var H=e.getShaderVariable(C.type);U.a_joint={semantic:"JOINT"},U.a_weight={semantic:"WEIGHT"},A+="attribute "+H+" a_joint;\n",A+="attribute "+H+" a_weight;\n"}E&&(U.a_vertexColor={semantic:"COLOR_0"},A+="attribute vec4 a_vertexColor;\n",A+="varying vec4 v_vertexColor;\n",F+=" v_vertexColor = a_vertexColor;\n",w+="varying vec4 v_vertexColor;\n"),f&&(U.a_batchId={semantic:"_BATCHID"},A+="attribute float a_batchId;\n");var W=x&&("BLINN"===y||"PHONG"===y)&&t(P.u_specular)&&t(P.u_shininess)&&P.u_shininess>0,q=!1,Y=!1,j="";for(var X in m)if(m.hasOwnProperty(X)){var Q=m[X],K=Q.type.toLowerCase(),Z=Q.baseName;j+=" {\n";var J,$,ee="u_"+Z+"Color";"ambient"===K?(Y=!0,j+=" ambientLight += "+ee+";\n"):x&&(q=!0,J="v_"+Z+"Direction",$="v_"+Z+"Position","point"!==K&&(A+="varying vec3 "+J+";\n",w+="varying vec3 "+J+";\n",F+=" "+J+" = mat3(u_"+Z+"Transform) * vec3(0.,0.,1.);\n","directional"===K&&(j+=" vec3 l = normalize("+J+");\n")),"directional"!==K?(A+="varying vec3 "+$+";\n",w+="varying vec3 "+$+";\n",F+=" "+$+" = u_"+Z+"Transform[3].xyz;\n",j+=" vec3 VP = "+$+" - v_positionEC;\n",j+=" vec3 l = normalize(VP);\n",j+=" float range = length(VP);\n",j+=" float attenuation = 1.0 / (u_"+Z+"Attenuation.x + ",j+="(u_"+Z+"Attenuation.y * range) + ",j+="(u_"+Z+"Attenuation.z * range * range));\n"):j+=" float attenuation = 1.0;\n","spot"===K&&(j+=" float spotDot = dot(l, normalize("+J+"));\n",j+=" if (spotDot < cos(u_"+Z+"FallOff.x * 0.5))\n",j+=" {\n",j+=" attenuation = 0.0;\n",j+=" }\n",j+=" else\n",j+=" {\n",j+=" attenuation *= max(0.0, pow(spotDot, u_"+Z+"FallOff.y));\n",j+=" }\n"),j+=" diffuseLight += "+ee+"* max(dot(normal,l), 0.) * attenuation;\n",W&&("BLINN"===y?(j+=" vec3 h = normalize(l + viewDir);\n",j+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(j+=" vec3 reflectDir = reflect(-l, normal);\n",j+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),j+=" specularLight += "+ee+" * specularIntensity;\n")),j+=" }\n"}if(Y||(j+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),!q&&"CONSTANT"!==y){j+=" vec3 l = normalize(czm_sunDirectionEC);\n";j+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.2);\n",W&&("BLINN"===y?(j+=" vec3 h = normalize(l + viewDir);\n",j+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(j+=" vec3 reflectDir = reflect(-l, normal);\n",j+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),j+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")}A+="void main(void) {\n",A+=F,A+="}\n",w+="void main(void) {\n";var te=" vec3 color = vec3(0.0, 0.0, 0.0);\n";x&&(w+=" vec3 normal = normalize(v_normal);\n",d.doubleSided&&(w+=" if (gl_FrontFacing == false)\n",w+=" {\n",w+=" normal = -normal;\n",w+=" }\n"));var ie
- ;"CONSTANT"!==y?(t(P.u_diffuse)&&(P.u_diffuse.type===r.SAMPLER_2D?w+=" vec4 diffuse = texture2D(u_diffuse, "+G+");\n":w+=" vec4 diffuse = u_diffuse;\n",w+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",te+=" color += diffuse.rgb * diffuseLight;\n"),W&&(P.u_specular.type===r.SAMPLER_2D?w+=" vec3 specular = texture2D(u_specular, "+G+").rgb;\n":w+=" vec3 specular = u_specular.rgb;\n",w+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",te+=" color += specular * specularLight;\n"),ie=t(P.u_transparency)?" gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):ie=t(P.u_transparency)?" gl_FragColor = vec4(color * u_transparency, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",E&&(te+=" color *= v_vertexColor.rgb;\n"),t(P.u_emission)&&(P.u_emission.type===r.SAMPLER_2D?w+=" vec3 emission = texture2D(u_emission, "+G+").rgb;\n":w+=" vec3 emission = u_emission.rgb;\n",te+=" color += emission;\n"),(t(P.u_ambient)||"CONSTANT"!==y)&&(t(P.u_ambient)?P.u_ambient.type===r.SAMPLER_2D?w+=" vec3 ambient = texture2D(u_ambient, "+G+").rgb;\n":w+=" vec3 ambient = u_ambient.rgb;\n":w+=" vec3 ambient = diffuse.rgb;\n",te+=" color += ambient * ambientLight;\n"),w+=" vec3 viewDir = -normalize(v_positionEC);\n",w+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",w+=j,w+=te,w+=ie,w+="}\n";var re=o(g,{type:r.VERTEX_SHADER,extras:{_pipeline:{source:A,extension:".glsl"}}}),ne=o(g,{type:r.FRAGMENT_SHADER,extras:{_pipeline:{source:w,extension:".glsl"}}}),oe=o(v,{fragmentShader:ne,vertexShader:re});return o(_,{attributes:U,program:oe,uniforms:P})}function h(e,i){var n;switch(n=t(i.value)?i.value:t(i.index)?[i.index]:i,e){case"ambient":case"diffuse":case"emission":case"specular":return 1===n.length?r.SAMPLER_2D:r.FLOAT_VEC4;case"shininess":case"transparency":return r.FLOAT;case"transparent":case"doubleSided":return r.BOOL}}function p(e,r){var n="";n+="technique:"+e.technique+";";for(var o=e.values,a=Object.keys(o).sort(),s=a.length,l=0;l<s;++l){var u=a[l];o.hasOwnProperty(u)&&(n+=u+":"+h(u,o[u]),n+=";")}var c=i(e.jointCount,0);if(n+=c.toString()+";",t(r)){var d=r.skinning;c>0&&(n+=d.type+";"),n+=r.hasVertexColors}return n}function f(e){var r=e.extensions.KHR_materials_common;if(t(r)&&t(r.lights))for(var n=r.lights,o=n.length,a=0;a<o;a++){var s=n[a];if("ambient"===s.type){t(s.ambient)||(s.ambient={});var l=s.ambient;t(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){t(s.directional)||(s.directional={});var u=s.directional;t(u.color)||(u.color=[1,1,1])}else if("point"===s.type){t(s.point)||(s.point={});var c=s.point;t(c.color)||(c.color=[1,1,1]),c.constantAttenuation=i(c.constantAttenuation,1),c.linearAttenuation=i(c.linearAttenuation,0),c.quadraticAttenuation=i(c.quadraticAttenuation,0)}else if("spot"===s.type){t(s.spot)||(s.spot={});var d=s.spot;t(d.color)||(d.color=[1,1,1]),d.constantAttenuation=i(d.constantAttenuation,1),d.fallOffAngle=i(d.fallOffAngle,3.14159265),d.fallOffExponent=i(d.fallOffExponent,0),d.linearAttenuation=i(d.linearAttenuation,0),d.quadraticAttenuation=i(d.quadraticAttenuation,0)}}}return u}),define("Scene/processPbrMaterials",["./ModelUtility","../Core/defined","../Core/defaultValue","../Core/WebGLConstants","../Core/webGLConstantToGlslType","../ThirdParty/GltfPipeline/addToArray","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/hasExtension","../ThirdParty/GltfPipeline/numberOfComponentsForType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n){if(n=i(n,{}),s(r,"KHR_techniques_webgl"))return r;if(!t(r.materials)||0===r.materials.length)return r;t(r.extensions)||(r.extensions={}),t(r.extensionsUsed)||(r.extensionsUsed=[]),t(r.extensionsRequired)||(r.extensionsRequired=[]),r.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},r.extensionsUsed.push("KHR_techniques_webgl"),r.extensionsRequired.push("KHR_techniques_webgl");var o=e.splitIncompatibleMaterials(r);return a.material(r,function(e,i){var a={},s=p(r,e,i,a,o,n);t(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={values:a,technique:s}}),e.ensureSemanticExistence(r),r}function c(e){return t(e.extensions)&&t(e.extensions.KHR_materials_pbrSpecularGlossiness)}function d(e,i,n,o,a){var s;if(t(n[i+"Offset"])){var l=n[i].index,u=e.samplers[e.textures[l].sampler],c=u.wrapS===r.REPEAT?"true":"false",d=u.wrapT===r.REPEAT?"true":"false";s=i+"Coord",a.fragmentShaderMain+=" vec2 "+s+" = computeTexCoord("+o+", "+i+"Offset, "+i+"Rotation, "+i+"Scale, "+c+", "+d+");\n"}else s=o;return s}function h(e,r,n){if(-1!==e.indexOf("Texture")&&t(r.extensions)&&t(r.extensions.KHR_texture_transform)){var o="u_"+e,a=r.extensions.KHR_texture_transform;n[o+"Offset"]=i(a.offset,m),n[o+"Rotation"]=i(a.rotation,_),n[o+"Scale"]=i(a.scale,g),t(r.texCoord)&&t(a.texCoord)&&(n[o].texCoord=a.texCoord)}}function p(u,p,m,_,g,v){var y,C,b,S=i(v.addBatchIdToGeneratedShaders,!1),T=u.extensions.KHR_techniques_webgl,E=T.techniques,A=T.shaders,w=T.programs,x=c(p),P=p.pbrMetallicRoughness;if(t(P)&&!x)for(C in P)P.hasOwnProperty(C)&&(b=P[C],y="u_"+C,_[y]=b,h(C,b,_));if(x){var D=p.extensions.KHR_materials_pbrSpecularGlossiness;for(C in D)D.hasOwnProperty(C)&&(b=D[C],y="u_"+C,_[y]=b,h(C,b,_))}for(var I in p)p.hasOwnProperty(I)&&(I.indexOf("Texture")>=0||I.indexOf("Factor")>=0)&&(b=p[I],y="u_"+I,_[y]=b,h(I,b,_));var M,R="precision highp float;\n",O="precision highp float;\n";t(u.skins)&&(M=u.skins[0]);var L,N=t(M)?M.joints:[],F=N.length,B=g[m],k=!1,z=!1,V=!1,U=!1,G=!1,H=!1,W=!1;t(B)&&(L=B.skinning,k=L.skinned&&N.length>0,z=B.hasVertexColors,V=B.hasMorphTargets,U=B.hasNormals,G=B.hasTangents,H=B.hasTexCoords);var q;V&&a.mesh(u,function(e){a.meshPrimitive(e,function(e){if(e.material===m){var i=e.targets;t(i)&&(q=i)}})});var Y={u_modelViewMatrix:{semantic:s(u,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:r.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:r.FLOAT_MAT4}};t(p.extensions)&&t(p.extensions.KHR_materials_unlit)&&(W=!0,U=!1,G=!1),U&&(Y.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:r.FLOAT_MAT3}),k&&(Y.u_jointMatrix={count:F,semantic:"JOINTMATRIX",type:r.FLOAT_MAT4}),V&&(Y.u_morphWeights={count:q.length,semantic:"MORPHWEIGHTS",type:r.FLOAT});var j=p.alphaMode;t(j)&&"MASK"===j&&(Y.u_alphaCutoff={semantic:"ALPHACUTOFF",type:r.FLOAT});for(y in _)_.hasOwnProperty(y)&&(Y[y]={type:f(y)});var X=i(Y.u_baseColorTexture,Y.u_baseColorFactor);t(X)&&(X.semantic="_3DTILESDIFFUSE");for(y in Y)if(Y.hasOwnProperty(y)){var Q=Y[y],K=t(Q.count)?"["+Q.count+"]":"";Q.type!==r.FLOAT_MAT3&&Q.type!==r.FLOAT_MAT4&&"u_morphWeights"!==y||Q.useInFragment?(O+="uniform "+n(Q.type)+" "+y+K+";\n",delete Q.useInFragment):R+="uniform "+n(Q.type)+" "+y+K+";\n"}var Z="";if(k){var J,$,ee=l(L.type),te=!1;if(0===L.type.indexOf("MAT")&&(te=!0,ee=Math.sqrt(ee)),te)for(J=0;J<ee;J++)for($=0;$<ee;$++)Z+=0===J&&0===$?" mat4 skinMatrix = ":" skinMatrix += ",Z+="a_weight["+J+"]["+$+"] * u_jointMatrix[int(a_joint["+J+"]["+$+"])];\n";else for(J=0;J<ee;J++)Z+=0===J?" mat4 skinMatrix = ":" skinMatrix += ",Z+="a_weight["+J+"] * u_jointMatrix[int(a_joint["+J+"])];\n"}var ie={a_position:{semantic:"POSITION"}};if(R+="attribute vec3 a_position;\n",U&&(R+="varying vec3 v_positionEC;\n"),Z+=" vec3 weightedPosition = a_position;\n",U&&(Z+=" vec3 weightedNormal = a_normal;\n"),G&&(Z+=" vec4 weightedTangent = a_tangent;\n"),V)for(var re=0;re<q.length;re++){var ne=q[re];for(var oe in ne)if(ne.hasOwnProperty(oe)&&"extras"!==oe){var ae="a_"+oe+"_"+re;ie[ae]={semantic:oe+"_"+re},R+="attribute vec3 "+ae+";\n","POSITION"===oe?Z+=" weightedPosition += u_morphWeights["+re+"] * "+ae+";\n":"NORMAL"===oe?Z+=" weightedNormal += u_morphWeights["+re+"] * "+ae+";\n":G&&"TANGENT"===oe&&(Z+=" weightedTangent.xyz += u_morphWeights["+re+"] * "+ae+";\n")}}Z+=k?" vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":" vec4 position = vec4(weightedPosition, 1.0);\n",Z+=" position = u_modelViewMatrix * position;\n",U&&(Z+=" v_positionEC = position.xyz;\n"),Z+=" gl_Position = u_projectionMatrix * position;\n",U&&(ie.a_normal={semantic:"NORMAL"},R+="attribute vec3 a_normal;\n",R+="varying vec3 v_normal;\n",Z+=k?" v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":" v_normal = u_normalMatrix * weightedNormal;\n",O+="varying vec3 v_normal;\n",O+="varying vec3 v_positionEC;\n"),G&&(ie.a_tangent={semantic:"TANGENT"},R+="attribute vec4 a_tangent;\n",R+="varying vec4 v_tangent;\n",Z+=" v_tangent.xyz = u_normalMatrix * weightedTangent.xyz;\n",Z+=" v_tangent.w = weightedTangent.w;\n",O+="varying vec4 v_tangent;\n");var se,le,ue,ce,de,he,pe,fe,me="";if(H){ie.a_texcoord_0={semantic:"TEXCOORD_0"},se="v_texcoord_0",R+="attribute vec2 a_texcoord_0;\n",R+="varying vec2 "+se+";\n",Z+=" "+se+" = a_texcoord_0;\n",O+="varying vec2 "+se+";\n";var _e={fragmentShaderMain:me};le=d(u,"u_normalTexture",_,se,_e),ue=d(u,"u_baseColorTexture",_,se,_e),ce=d(u,"u_specularGlossinessTexture",_,se,_e),de=d(u,"u_diffuseTexture",_,se,_e),he=d(u,"u_metallicRoughnessTexture",_,se,_e),pe=d(u,"u_occlusionTexture",_,se,_e),fe=d(u,"u_emmissiveTexture",_,se,_e),me=_e.fragmentShaderMain}if(k){var ge=e.getShaderVariable(L.type);ie.a_joint={semantic:"JOINTS_0"},ie.a_weight={semantic:"WEIGHTS_0"},R+="attribute "+ge+" a_joint;\n",R+="attribute "+ge+" a_weight;\n"}z&&(ie.a_vertexColor={semantic:"COLOR_0"},R+="attribute vec4 a_vertexColor;\n",R+="varying vec4 v_vertexColor;\n",Z+=" v_vertexColor = a_vertexColor;\n",O+="varying vec4 v_vertexColor;\n"),S&&(ie.a_batchId={semantic:"_BATCHID"},R+="attribute float a_batchId;\n"),R+="void main(void) \n{\n",R+=Z,R+="}\n",U&&(O+="const float M_PI = 3.141592653589793;\n",O+="vec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor / M_PI;\n}\n\n",O+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",O+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",O+="float smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",O+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",O+="float GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\n\n"),O+="vec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\n\n",O+="vec4 SRGBtoLINEAR4(vec4 srgbIn) \n{\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n\n",O+="vec3 LINEARtoSRGB(vec3 linearIn) \n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else \n return linearIn;\n#endif \n}\n\n",O+="vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale, bool repeatS, bool repeatT) \n{\n rotation = -rotation; \n mat3 transform = mat3(\n cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, \n -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, \n offset.x, offset.y, 1.0); \n vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; \n transformedTexCoords.x = repeatS ? fract(transformedTexCoords.x) : clamp(transformedTexCoords.x, 0.0, 1.0); \n transformedTexCoords.y = repeatT ? fract(transformedTexCoords.y) : clamp(transformedTexCoords.y, 0.0, 1.0); \n return transformedTexCoords; \n}\n\n",O+="#ifdef USE_IBL_LIGHTING \n",O+="uniform vec2 gltf_iblFactor; \n",O+="#endif \n",O+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",O+="uniform vec3 gltf_lightColor; \n",O+="#endif \n",O+="void main(void) \n{\n",O+=me,U&&(O+=" vec3 ng = normalize(v_normal);\n",O+=" vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\n",t(_.u_normalTexture)?G?(O+=" vec3 t = normalize(v_tangent.xyz);\n",O+=" vec3 b = normalize(cross(ng, t) * v_tangent.w);\n",O+=" mat3 tbn = mat3(t, b, ng);\n",O+=" vec3 n = texture2D(u_normalTexture, "+le+").rgb;\n",O+=" n = normalize(tbn * (2.0 * n - 1.0));\n"):(O="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+O,O+="#ifdef GL_OES_standard_derivatives\n",O+=" vec3 pos_dx = dFdx(v_positionEC);\n",O+=" vec3 pos_dy = dFdy(v_positionEC);\n",O+=" vec3 tex_dx = dFdx(vec3("+le+",0.0));\n",O+=" vec3 tex_dy = dFdy(vec3("+le+",0.0));\n",O+=" vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",O+=" t = normalize(t - ng * dot(ng, t));\n",O+=" vec3 b = normalize(cross(ng, t));\n",O+=" mat3 tbn = mat3(t, b, ng);\n",O+=" vec3 n = texture2D(u_normalTexture, "+le+").rgb;\n",O+=" n = normalize(tbn * (2.0 * n - 1.0));\n",O+="#else\n",O+=" vec3 n = ng;\n",O+="#endif\n"):O+=" vec3 n = ng;\n",p.doubleSided&&(O+=" if (!gl_FrontFacing)\n",O+=" {\n",O+=" n = -n;\n",O+=" }\n")),t(_.u_baseColorTexture)?(O+=" vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, "+ue+"));\n",t(_.u_baseColorFactor)&&(O+=" baseColorWithAlpha *= u_baseColorFactor;\n")):t(_.u_baseColorFactor)?O+=" vec4 baseColorWithAlpha = u_baseColorFactor;\n":O+=" vec4 baseColorWithAlpha = vec4(1.0);\n",z&&(O+=" baseColorWithAlpha *= v_vertexColor;\n"),O+=" vec3 baseColor = baseColorWithAlpha.rgb;\n",U?(x?(t(_.u_specularGlossinessTexture)?(O+=" vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, "+ce+"));\n",O+=" vec3 specular = specularGlossiness.rgb;\n",O+=" float glossiness = specularGlossiness.a;\n",t(_.u_specularFactor)&&(O+=" specular *= u_specularFactor;\n"),t(_.u_glossinessFactor)&&(O+=" glossiness *= u_glossinessFactor;\n")):(t(_.u_specularFactor)?O+=" vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n":O+=" vec3 specular = vec3(1.0);\n",t(_.u_glossinessFactor)?O+=" float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n":O+=" float glossiness = 1.0;\n"),t(_.u_diffuseTexture)?(O+=" vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, "+de+"));\n",t(_.u_diffuseFactor)&&(O+=" diffuse *= u_diffuseFactor;\n")):t(_.u_diffuseFactor)?O+=" vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n":O+=" vec4 diffuse = vec4(1.0);\n"):t(_.u_metallicRoughnessTexture)?(O+=" vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, "+he+").rgb;\n",O+=" float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",O+=" float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",t(_.u_metallicFactor)&&(O+=" metalness *= u_metallicFactor;\n"),t(_.u_roughnessFactor)&&(O+=" roughness *= u_roughnessFactor;\n")):(t(_.u_metallicFactor)?O+=" float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":O+=" float metalness = 1.0;\n",t(_.u_roughnessFactor)?O+=" float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":O+=" float roughness = 1.0;\n"),O+=" vec3 v = -normalize(v_positionEC);\n",O+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",O+=" vec3 lightColor = vec3(1.5, 1.4, 1.2);\n",O+="#else \n",O+=" vec3 lightColor = gltf_lightColor;\n",O+="#endif \n",O+=" vec3 l = normalize(czm_sunDirectionEC);\n",O+=" vec3 h = normalize(v + l);\n",O+=" float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",O+=" float NdotV = abs(dot(n, v)) + 0.001;\n",O+=" float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",O+=" float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",O+=" float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",O+=" vec3 f0 = vec3(0.04);\n",x?(O+=" float roughness = 1.0 - glossiness;\n",O+=" vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b));\n",O+=" vec3 specularColor = specular;\n"):(O+=" vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n",O+=" vec3 specularColor = mix(f0, baseColor, metalness);\n"),O+=" float alpha = roughness * roughness;\n",O+=" float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",O+=" vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",O+=" vec3 r0 = specularColor.rgb;\n",O+=" vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",O+=" float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",O+=" float D = GGX(alpha, NdotH);\n",O+=" vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n",O+=" vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",O+=" vec3 color = NdotL * lightColor * (diffuseContribution + specularContribution);\n",O+="#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) \n",O+=" vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",O+=" float vertexRadius = length(positionWC);\n",O+=" float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n",O+=" float reflectionDotNadir = dot(r, normalize(positionWC));\n",O+=" r.x = -r.x;\n",O+=" r = -normalize(czm_temeToPseudoFixed * r);\n",O+=" r.x = -r.x;\n",O+=" float inverseRoughness = 1.04 - roughness;\n",O+=" inverseRoughness *= inverseRoughness;\n",O+=" vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",O+=" float atmosphereHeight = 0.05;\n",O+=" float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",O+=" float blendRegionOffset = roughness * -1.0;\n",O+=" float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n",O+=" float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",O+=" float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",O+=" float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",O+=" vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n",O+=" vec3 nadirColor = belowHorizonColor * 0.5;\n",O+=" vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n",O+=" vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n",O+=" vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",O+=" vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n",O+=" float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n",O+=" float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n",O+=" vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n",O+=" float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n",O+=" vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n",O+=" specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",O+=" specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",O+="#ifdef USE_SUN_LUMINANCE \n",O+=" float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\n",O+=" float S = acos(LdotZenith);\n",O+=" float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n",O+=" float gamma = acos(NdotL);\n",O+=" float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n",O+=" float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n",O+=" float luminance = gltf_luminanceAtZenith * (numerator / denominator);\n",O+="#endif \n",O+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\n",O+=" vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y);\n",O+="#ifdef USE_SUN_LUMINANCE \n",O+=" color += IBLColor * luminance;\n",O+="#else \n",O+=" color += IBLColor; \n",O+="#endif \n",O+="#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) \n",O+=" mat3 fixedToENU = mat3(gltf_clippingPlanesMatrix[0][0], gltf_clippingPlanesMatrix[1][0], gltf_clippingPlanesMatrix[2][0], \n",O+=" gltf_clippingPlanesMatrix[0][1], gltf_clippingPlanesMatrix[1][1], gltf_clippingPlanesMatrix[2][1], \n",O+=" gltf_clippingPlanesMatrix[0][2], gltf_clippingPlanesMatrix[1][2], gltf_clippingPlanesMatrix[2][2]); \n",O+=" const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); \n",O+=" vec3 cubeDir = normalize(yUpToZUp * fixedToENU * normalize(reflect(-v, n))); \n",O+="#ifdef DIFFUSE_IBL \n",O+="#ifdef CUSTOM_SPHERICAL_HARMONICS \n",O+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); \n",O+="#else \n",O+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n",O+="#endif \n",O+="#else \n",O+=" vec3 diffuseIrradiance = vec3(0.0); \n",O+="#endif \n",O+="#ifdef SPECULAR_IBL \n",O+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",O+="#ifdef CUSTOM_SPECULAR_IBL \n",O+=" vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD);\n",O+="#else \n",O+=" vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n",O+="#endif \n",O+=" specularIBL *= F * brdfLut.x + brdfLut.y;\n",O+="#else \n",O+=" vec3 specularIBL = vec3(0.0); \n",O+="#endif \n",O+=" color += diffuseIrradiance * diffuseColor + specularColor * specularIBL;\n",O+="#endif \n"):O+=" vec3 color = baseColor;\n",W||(t(_.u_occlusionTexture)&&(O+=" color *= texture2D(u_occlusionTexture, "+pe+").r;\n"),t(_.u_emissiveTexture)?(O+=" vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, "+fe+").rgb);\n",t(_.u_emissiveFactor)&&(O+=" emissive *= u_emissiveFactor;\n"),O+=" color += emissive;\n"):t(_.u_emissiveFactor)&&(O+=" color += u_emissiveFactor;\n")),O+=" color = LINEARtoSRGB(color);\n",t(j)?"MASK"===j?(O+=" if (baseColorWithAlpha.a < u_alphaCutoff) {\n",O+=" discard;\n",O+=" }\n",O+=" gl_FragColor = vec4(color, 1.0);\n"):O+="BLEND"===j?" gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":" gl_FragColor = vec4(color, 1.0);\n":O+=" gl_FragColor = vec4(color, 1.0);\n",O+="}\n";var ve=o(A,{type:r.VERTEX_SHADER,extras:{_pipeline:{source:R,extension:".glsl"}}}),ye=o(A,{type:r.FRAGMENT_SHADER,extras:{_pipeline:{source:O,extension:".glsl"}}}),Ce=o(w,{fragmentShader:ye,vertexShader:ve});return o(E,{attributes:ie,program:Ce,uniforms:Y})}function f(e){if(-1!==e.indexOf("Offset"))return r.FLOAT_VEC2;if(-1!==e.indexOf("Rotation"))return r.FLOAT;if(-1!==e.indexOf("Scale"))return r.FLOAT_VEC2;if(-1!==e.indexOf("Texture"))return r.SAMPLER_2D;switch(e){case"u_baseColorFactor":return r.FLOAT_VEC4;case"u_metallicFactor":case"u_roughnessFactor":return r.FLOAT;case"u_emissiveFactor":return r.FLOAT_VEC3;case"u_diffuseFactor":return r.FLOAT_VEC4;case"u_specularFactor":return r.FLOAT_VEC3;case"u_glossinessFactor":return r.FLOAT}}var m=[0,0],_=[0],g=[1,1];return u}),define("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Check","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/isArray","../Core/loadCRN","../Core/loadImageFromTypedArray","../Core/loadKTX","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Core/Quaternion","../Core/Resource","../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/GltfPipeline/addDefaults","../ThirdParty/GltfPipeline/addPipelineExtras","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/hasExtension","../ThirdParty/GltfPipeline/numberOfComponentsForType","../ThirdParty/GltfPipeline/parseGlb","../ThirdParty/GltfPipeline/removePipelineExtras","../ThirdParty/GltfPipeline/updateVersion","../ThirdParty/when","./Axis","./BlendingState","./ClippingPlaneCollection","./ColorBlendMode","./DracoLoader","./getClipAndStyleCode","./getClippingFunction","./HeightReference","./JobType","./ModelAnimationCache","./ModelAnimationCollection","./ModelLoadResources","./ModelMaterial","./ModelMesh","./ModelNode","./ModelUtility","./OctahedralProjectedCubeMap","./processModelMaterialsCommon","./processPbrMaterials","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,be,Se){"use strict";function Te(e,t){e._cachedGltf=t}function Ee(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function Ae(r){r=c(r,c.EMPTY_OBJECT);var n=r.cacheKey;this._cacheKey=n,this._cachedGltf=void 0,this._releaseGltfJson=c(r.releaseGltfJson,!1);var o;if(d(n)&&d(wi[n])&&wi[n].ready)o=wi[n],++o.count;else{var a=r.gltf;if(d(a)){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),a instanceof Uint8Array){o=new Ee({gltf:J(a),ready:!0})}else o=new Ee({gltf:r.gltf,ready:!0});o.count=1,d(n)&&(wi[n]=o)}}Te(this,o);var l=c(r.basePath,"");this._resource=M.createIfNeeded(l),this.show=c(r.show,!0),this.silhouetteColor=c(r.silhouetteColor,s.RED),this._silhouetteColor=new s,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=c(r.silhouetteSize,0),this.modelMatrix=x.clone(c(r.modelMatrix,x.IDENTITY)),this._modelMatrix=x.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=c(r.scale,1),this._scale=this.scale,this.minimumPixelSize=c(r.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=r.maximumScale,this._maximumScale=this.maximumScale,this.id=r.id,this._id=r.id,this.heightReference=c(r.heightReference,ue.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var u=r.scene;this._scene=u,d(u)&&d(u.terrainProviderChanged)&&(this._terrainProviderChangedCallback=u.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=r.pickObject,this._allowPicking=c(r.allowPicking,!0),this._ready=!1,this._readyPromise=te.defer(),this.activeAnimations=new he(this),this.clampAnimations=c(r.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=c(r.incrementallyLoadTextures,!0),this._asynchronous=c(r.asynchronous,!0),this.shadows=c(r.shadows,Se.ENABLED),this._shadows=this.shadows,this.color=c(r.color,s.WHITE),this._color=new s,this._colorPreviousAlpha=1,this.colorBlendMode=c(r.colorBlendMode,oe.HIGHLIGHT),this.colorBlendAmount=c(r.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=r.clippingPlanes,this._clippingPlanesState=0,this.clippingPlanesOriginMatrix=void 0,this.debugShowBoundingVolume=c(r.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=c(r.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=r.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=r.addBatchIdToGeneratedShaders,this._precreatedAttributes=r.precreatedAttributes,this._vertexShaderLoaded=r.vertexShaderLoaded,this._fragmentShaderLoaded=r.fragmentShaderLoaded,this._uniformMapLoaded=r.uniformMapLoaded,this._pickIdLoaded=r.pickIdLoaded,this._ignoreCommands=c(r.ignoreCommands,!1),this._requestType=r.requestType,this._upAxis=c(r.upAxis,ie.Y),this._gltfForwardAxis=ie.Z,this._forwardAxis=r.forwardAxis,this.cull=c(r.cull,!0),this.opaquePass=c(r.opaquePass,B.OPAQUE),this._computedModelMatrix=new x,this._clippingPlaneModelViewMatrix=x.clone(x.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=Ei.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,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey: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._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._dequantizeInShader=c(r.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._imageBasedLightingFactor=new t(1,1),t.clone(r.imageBasedLightingFactor,this._imageBasedLightingFactor),this._lightColor=i.clone(r.lightColor),this._luminanceAtZenith=void 0,this.luminanceAtZenith=c(r.luminanceAtZenith,.5),this._sphericalHarmonicCoefficients=r.sphericalHarmonicCoefficients,this._specularEnvironmentMaps=r.specularEnvironmentMaps,this._shouldUpdateSpecularMapAtlas=!0,this._specularEnvironmentMapAtlas=void 0,this._useDefaultSphericalHarmonics=!1,this._useDefaultSpecularMaps=!1,this._shouldRegenerateShaders=!1}function we(e){return e.stencilBuffer}function xe(e){return!s.equals(e.color,s.WHITE)||e.colorBlendMode!==oe.HIGHLIGHT}function Pe(e){var t=e._clippingPlanes;return d(t)&&t.enabled&&0!==t.length}function De(e){return"glTF"===v(e)}function Ie(e,t,i){return e._runtime[t][i]}function Me(e,t){var i,r=e.currentValue,n=Pi;switch(e.type){case"xRotate":i=w.fromRotationX(A.toRadians(r),Di),x.multiplyByMatrix3(t,i,t);break;case"yRotate":i=w.fromRotationY(A.toRadians(r),Di),x.multiplyByMatrix3(t,i,t);break;case"zRotate":i=w.fromRotationZ(A.toRadians(r),Di),x.multiplyByMatrix3(t,i,t);break;case"xTranslate":n.x=r,n.y=0,n.z=0,x.multiplyByTranslation(t,n,t);break;case"yTranslate":n.x=0,n.y=r,n.z=0,x.multiplyByTranslation(t,n,t);break;case"zTranslate":n.x=0,n.y=0,n.z=r,x.multiplyByTranslation(t,n,t);break;case"xScale":n.x=r,n.y=1,n.z=1,x.multiplyByScale(t,n,t);break;case"yScale":n.x=1,n.y=r,n.z=1,x.multiplyByScale(t,n,t);break;case"zScale":
- n.x=1,n.y=1,n.z=r,x.multiplyByScale(t,n,t);break;case"uniformScale":x.multiplyByUniformScale(t,r,t)}return t}function Re(e){var t=e.gltf,i=e._loadResources;X.buffer(t,function(e,t){i.buffers[t]=e.extras._pipeline.source})}function Oe(e,t){return function(i){var r=e._loadResources,n=new Uint8Array(i);--r.pendingBufferLoads,e.gltf.buffers[t].extras._pipeline.source=n}}function Le(e){var t=e.gltf.bufferViews,i=e._loadResources.vertexBuffersToCreate;X.bufferView(e.gltf,function(e,t){e.target===O.ARRAY_BUFFER&&i.enqueue(t)});var r=e._loadResources.indexBuffersToCreate,n={};X.accessor(e.gltf,function(e){var i=e.bufferView;if(d(i)){t[i].target!==O.ELEMENT_ARRAY_BUFFER||d(n[i])||(n[i]=!0,r.enqueue({id:i,componentType:e.componentType}))}})}function Ne(e){var t=e.gltf;if(K(t,"KHR_techniques_webgl")){var i=e._sourcePrograms,r=e._sourceTechniques,n=t.extensions.KHR_techniques_webgl.programs;X.technique(t,function(e,t){r[t]=a(e);var o=e.program;d(i[o])||(i[o]=a(n[o]))})}}function Fe(e,t,i){return function(r){var n=e._loadResources;n.shaders[i]={source:r,type:t,bufferView:void 0},--n.pendingShaderLoads,e._rendererResources.sourceShaders[i]=r}}function Be(e){var t=e.gltf,i=t.buffers,r=t.bufferViews,n=e._rendererResources.sourceShaders;X.shader(t,function(t,o){if(d(t.bufferView)){var a=t.bufferView,s=r[a],l=s.buffer,u=i[l],c=y(u.extras._pipeline.source,s.byteOffset,s.byteLength);n[o]=c}else if(d(t.extras._pipeline.source))n[o]=t.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;var h=e._resource.getDerivedResource({url:t.uri});h.fetchText().then(Fe(e,t.type,o)).otherwise(ge.getFailedLoadFunction(e,"shader",h.url))}})}function ke(e){var t=e._sourceTechniques;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];e._loadResources.programsToCreate.enqueue({programId:r.program,techniqueId:i})}}function ze(e){var t={},i={},r={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=i,e._runtime.stagesByKey=r;var n=e.gltf;if(K(n,"AGI_articulations")&&d(n.extensions)&&d(n.extensions.AGI_articulations)){var o=n.extensions.AGI_articulations.articulations;if(d(o))for(var s=o.length,l=0;l<s;++l){var u=a(o[l]);u.nodes=[],u.isDirty=!0,t[u.name]=u;for(var c=u.stages.length,h=0;h<c;++h){var p=u.stages[h];p.currentValue=p.initialValue;var f=u.name+" "+p.name;i[f]=u,r[f]=p}}}}function Ve(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 Ue(e,t,i){var r,n=e.gltf,o=n.images;X.texture(n,function(n,a){var s=n.source;d(n.extensions)&&d(n.extensions.EXT_texture_webp)&&i&&(s=n.extensions.EXT_texture_webp.source);var l=o[s],u=l.extras,c=l.bufferView,h=l.mimeType;if(r=l.uri,d(u)&&d(u.compressedImage3DTiles)){var p=u.compressedImage3DTiles.crunch,f=u.compressedImage3DTiles.s3tc,m=u.compressedImage3DTiles.pvrtc1,_=u.compressedImage3DTiles.etc1;t.s3tc&&d(p)?(h=p.mimeType,d(p.bufferView)?c=p.bufferView:r=p.uri):t.s3tc&&d(f)?(h=f.mimeType,d(f.bufferView)?c=f.bufferView:r=f.uri):t.pvrtc&&d(m)?(h=m.mimeType,d(m.bufferView)?c=m.bufferView:r=m.uri):t.etc1&&d(_)&&(h=_.mimeType,d(_.bufferView)?c=_.bufferView:r=_.uri)}if(d(c))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:c,mimeType:h});else{++e._loadResources.pendingTextureLoads;var g,v=e._resource.getDerivedResource({url:r});g=Mi.test(r)?E(v):Ri.test(r)?S(v):v.fetchImage(),g.then(Ve(e,a,s)).otherwise(ge.getFailedLoadFunction(e,"image",v.url))}})}function Ge(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds,o=e._runtime.articulationsByName;X.node(e.gltf,function(a,s){var l={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new x,computedMatrix:new x,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:a.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(l.publicNode=new _e(e,a,l,s,ge.getTransform(a)),t[s]=l,i[a.name]=l,d(a.skin)&&(n.push(s),r.push(l)),d(a.extensions)&&d(a.extensions.AGI_articulations)){var u=a.extensions.AGI_articulations.articulationName;if(d(u)){var c=x.clone(l.publicNode.originalMatrix,Oi),h=o[u];h.nodes.push(l.publicNode);for(var p=h.stages.length,f=0;f<p;++f){c=Me(h.stages[f],c)}l.publicNode.matrix=c}}}),e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function He(e){var t=e.gltf,i=e._sourceTechniques,r={},n={},o=e._uniformMaps;X.material(t,function(t,s){o[s]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};var l=new fe(e,t,s);if(d(t.extensions)&&d(t.extensions.KHR_techniques_webgl)){var u=t.extensions.KHR_techniques_webgl.technique;l._technique=u,l._program=i[u].program,X.materialValue(t,function(e,t){d(l._values)||(l._values={}),l._values[t]=a(e)})}r[t.name]=l,n[s]=l}),e._runtime.materialsByName=r,e._runtime.materialsById=n}function We(e){var t={},i=e._runtime.materialsById;X.mesh(e.gltf,function(r,n){t[r.name]=new me(r,i,n),(d(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&X.meshPrimitive(r,function(t,i){var r=Xe(e,t),o=e._programPrimitives[r];d(o)||(o={},e._programPrimitives[r]=o),o[n+".primitive."+i]=t})}),e._runtime.meshesByName=t}function qe(e,t,i){var r=t._loadResources,n=t.gltf.bufferViews,o=n[e];d(o)||(o=r.createdBufferViews[e]);var a=L.createVertexBuffer({context:i,typedArray:r.getBuffer(o),usage:N.STATIC_DRAW});a.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=a,t._geometryByteLength+=a.sizeInBytes}function Ye(e,t,i,r){var n=i._loadResources,o=i.gltf.bufferViews,a=o[e];d(a)||(a=n.createdBufferViews[e]);var s=L.createIndexBuffer({context:r,typedArray:n.getBuffer(a),usage:N.STATIC_DRAW,indexDatatype:t});s.vertexArrayDestroyable=!1,i._rendererResources.buffers[e]=s,i._geometryByteLength+=s.sizeInBytes}function je(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){var r,n=t.context,o=i.vertexBuffersToCreate,a=i.indexBuffersToCreate;if(e.asynchronous){for(;o.length>0&&(Fi.set(o.peek(),e,n),t.jobScheduler.execute(Fi,ce.BUFFER));)o.dequeue();for(;a.length>0&&(r=a.peek(),Bi.set(r.id,r.componentType,e,n),t.jobScheduler.execute(Bi,ce.BUFFER));)a.dequeue()}else{for(;o.length>0;)qe(o.dequeue(),e,n);for(;a.length>0;)r=a.dequeue(),Ye(r.id,r.componentType,e,n)}}}function Xe(e,t){var i=e._runtime.materialsById[t.material];if(d(i))return i._program}function Qe(e,t,i){var r,n=i._programPrimitives[t];if(!d(n))return e;var o;for(o in n)if(n.hasOwnProperty(o)&&(r=n[o],Xe(i,r)===t))break;i._programPrimitives[t]=void 0;var a;if(i.extensionsUsed.WEB3D_quantized_attributes)a=ge.modifyShaderForQuantizedAttributes(i.gltf,r,e),i._quantizedUniforms[t]=a.uniforms;else{var s=i._decodedData[o];if(!d(s))return e;a=ge.modifyShaderForDracoQuantizedAttributes(i.gltf,r,e,s.attributes)}return a.shader}function Ke(e){return e=U.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n 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 d(i)&&(e=i(e,t)),e}function Je(e,t,i){var r=e.programId,n=e.techniqueId,o=t._sourcePrograms[r],a=t._rendererResources.sourceShaders,s=a[o.vertexShader],l=a[o.fragmentShader],u=t._quantizedVertexShaders,c=t._toClipCoordinatesGLSL[r];if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){var h=u[r];d(h)||(h=Qe(s,r,t),u[r]=h),s=h}var p=Ze(s,r,t._vertexShaderLoaded),f=Ze(l,r,t._fragmentShaderLoaded);_.isInternetExplorer()||(p=ge.modifyVertexShaderForLogDepth(p,c),f=ge.modifyFragmentShaderForLogDepth(f)),d(t._uniformMapLoaded)||(f="uniform vec4 czm_pickColor;\n"+f);var m=t._imageBasedLightingFactor.x>0||t._imageBasedLightingFactor.y>0;if(m&&(f="#define USE_IBL_LIGHTING \n\n"+f),d(t._lightColor)&&(f="#define USE_CUSTOM_LIGHT_COLOR \n\n"+f),("2.0"!==t._sourceVersion||t._sourceKHRTechniquesWebGL)&&(f=U.replaceMain(f,"non_gamma_corrected_main"),f+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),ve.isSupported(i)){var g=d(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,v=d(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps;(g||v||m)&&(f="uniform mat4 gltf_clippingPlanesMatrix; \n"+f),d(t._sphericalHarmonicCoefficients)?f="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+f:t._useDefaultSphericalHarmonics&&(f="#define DIFFUSE_IBL \n"+f),d(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?f="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+f:t._useDefaultSpecularMaps&&(f="#define SPECULAR_IBL \n"+f)}d(t._luminanceAtZenith)&&(f="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+f),et(r,n,f,p,t,i)}function $e(e,t,i){var r=e.programId,n=e.techniqueId,o=t._sourcePrograms[r],a=t._rendererResources.sourceShaders,s=t._quantizedVertexShaders,l=t._toClipCoordinatesGLSL[r],u=t.clippingPlanes,c=Pe(t),h=a[o.vertexShader],p=a[o.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(h=s[r]);var f=p;xe(t)&&(f=Ae._modifyShaderForColor(f)),c&&(f=ui(f,u,i));var m=Ze(h,r,t._vertexShaderLoaded),g=Ze(f,r,t._fragmentShaderLoaded);_.isInternetExplorer()||(m=ge.modifyVertexShaderForLogDepth(m,l),g=ge.modifyFragmentShaderForLogDepth(g)),d(t._uniformMapLoaded)||(g="uniform vec4 czm_pickColor;\n"+g);var v=t._imageBasedLightingFactor.x>0||t._imageBasedLightingFactor.y>0;if(v&&(g="#define USE_IBL_LIGHTING \n\n"+g),d(t._lightColor)&&(g="#define USE_CUSTOM_LIGHT_COLOR \n\n"+g),("2.0"!==t._sourceVersion||t._sourceKHRTechniquesWebGL)&&(g=U.replaceMain(g,"non_gamma_corrected_main"),g+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),ve.isSupported(i)){var y=d(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,C=d(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps;!c&&(y||C||v)&&(g="uniform mat4 gltf_clippingPlanesMatrix; \n"+g),d(t._sphericalHarmonicCoefficients)?g="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+g:t._useDefaultSphericalHarmonics&&(g="#define DIFFUSE_IBL \n"+g),d(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?g="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+g:t._useDefaultSpecularMaps&&(g="#define SPECULAR_IBL \n"+g)}d(t._luminanceAtZenith)&&(g="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+g),et(r,n,g,m,t,i)}function et(e,t,i,r,n,o){var a=n._sourceTechniques[t],s=ge.createAttributeLocations(a,n._precreatedAttributes);n._rendererResources.programs[e]=V.fromCache({context:o,vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:s})}function tt(e,t){var i=e._loadResources,r=i.programsToCreate;if(0===i.pendingShaderLoads&&0===i.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;r.length>0&&(zi.set(r.peek(),e,n),t.jobScheduler.execute(zi,ce.PROGRAM));)r.dequeue();else for(;r.length>0;)Je(r.dequeue(),e,n)}}function it(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function rt(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=r.textures[i.id].source,a=ge.getFailedLoadFunction(e,"image","id: "+i.id+", bufferView: "+i.bufferView);if("image/ktx"===i.mimeType)E(t.getBuffer(n)).then(Ve(e,i.id,o)).otherwise(a),++e._loadResources.pendingTextureLoads;else if("image/crn"===i.mimeType)S(t.getBuffer(n)).then(Ve(e,i.id,o)).otherwise(a),++e._loadResources.pendingTextureLoads;else{var s=it(t,i);T({uint8Array:t.getBuffer(n),format:i.mimeType,flipY:!1}).then(s).otherwise(a),++t.pendingBufferViewToImage}}}function nt(e){var t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;var i=e._rendererResources.samplers;X.sampler(e.gltf,function(e,t){i[t]=new z({wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minFilter,magnificationFilter:e.magFilter})})}}function ot(e,t,i){var r=t.gltf.textures,n=r[e.id],o=t._rendererResources.samplers,a=o[n.sampler];d(a)||(a=new z({wrapS:W.REPEAT,wrapT:W.REPEAT}));for(var s=!1,l=t.gltf.materials,u=l.length,c=0;c<u;++c){var h=l[c];if(d(h.extensions)&&d(h.extensions.KHR_techniques_webgl)){var p=h.extensions.KHR_techniques_webgl.values;for(var f in p)if(p.hasOwnProperty(f)&&-1!==f.indexOf("Texture")){var m=p[f];if(m.index===e.id&&d(m.extensions)&&d(m.extensions.KHR_texture_transform)){s=!0;break}}}if(s)break}var _=a.wrapS,g=a.wrapT,v=a.minificationFilter;s&&v!==H.LINEAR&&v!==H.NEAREST&&(v=v===H.NEAREST_MIPMAP_NEAREST||v===H.NEAREST_MIPMAP_LINEAR?H.NEAREST:H.LINEAR,a=new z({wrapS:a.wrapS,wrapT:a.wrapT,textureMinificationFilter:v,textureMagnificationFilter:a.magnificationFilter}));var y,C=e.internalFormat,b=!(d(C)&&P.isCompressedFormat(C)||v!==H.NEAREST_MIPMAP_NEAREST&&v!==H.NEAREST_MIPMAP_LINEAR&&v!==H.LINEAR_MIPMAP_NEAREST&&v!==H.LINEAR_MIPMAP_LINEAR),S=b||_===W.REPEAT||_===W.MIRRORED_REPEAT||g===W.REPEAT||g===W.MIRRORED_REPEAT,T=e.image;if(d(C))y=new G({context:i,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:C,sampler:a});else if(d(T)){var E=!A.isPowerOfTwo(T.width)||!A.isPowerOfTwo(T.height);if(S&&E){var w=document.createElement("canvas");w.width=A.nextPowerOfTwo(T.width),w.height=A.nextPowerOfTwo(T.height);var x=w.getContext("2d");x.drawImage(T,0,0,T.width,T.height,0,0,w.width,w.height),T=w}y=new G({context:i,source:T,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1}),b&&y.generateMipmap()}d(y)&&(t._rendererResources.textures[e.id]=y,t._texturesByteLength+=y.sizeInBytes)}function at(e,t){var i=t.context,r=e._loadResources.texturesToCreate;if(e.asynchronous)for(;r.length>0&&(Ui.set(r.peek(),e,i),t.jobScheduler.execute(Ui,ce.TEXTURE));)r.dequeue();else for(;r.length>0;)ot(r.dequeue(),e,i)}function st(e,t){var i,r,n=e._sourceTechniques,o={},a=e._runtime.materialsById[t.material];if(!d(a))return o;var s=n[a._technique];if(!d(s))return o;var l=s.attributes,u=e._rendererResources.programs[s.program],c=u.vertexAttributes,h=u._attributeLocations;for(i in c)if(c.hasOwnProperty(i)){var p=l[i];d(p)&&(r=h[i],o[p.semantic]=r)}var f=e._precreatedAttributes;if(d(f))for(i in f)f.hasOwnProperty(i)&&(r=h[i],o[i]=r);return o}function lt(e,t){for(var i=e.length,r={},n=0;n<i;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=t[a];d(s)&&(r[a]=a);var l=s.children;if(d(l))for(var u=l.length,c=0;c<u;++c)o.push(l[c])}return r}function ut(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],c=o[u],h=n[u],p=t[h.skin];c.inverseBindMatrices=p.inverseBindMatrices,c.bindShapeMatrix=p.bindShapeMatrix;var f=[],m=r[h.skin];d(m.skeleton)&&f.push(m.skeleton);for(var _=lt(f,n),g=r[h.skin].joints,v=g.length,y=0;y<v;++y){var C=g[y],b=_[C],S=o[b];c.joints.push(S)}}}function ct(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n={};X.skin(i,function(t,i){var o,a=r[t.inverseBindMatrices];x.equals(t.bindShapeMatrix,x.IDENTITY)||(o=x.clone(t.bindShapeMatrix)),n[i]={inverseBindMatrices:de.getSkinInverseBindMatrices(e,a),bindShapeMatrix:o}}),ut(e,n)}}function dt(e,t,i,r){return function(n){d(r)&&(n=e.clampAnimations?r.clampTime(n):r.wrapTime(n),t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber)}}function ht(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations=[];var i=e._runtime.nodes,r=e.gltf.accessors;X.animation(e.gltf,function(t,n){for(var o=t.channels,a=t.samplers,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=o.length,c=new Array(u),d=0;d<u;++d){var h=o[d],p=h.target,f=p.path,m=a[h.sampler],_=de.getAnimationParameterValues(e,r[m.input]),g=de.getAnimationParameterValues(e,r[m.output]);s=Math.min(s,_[0]),l=Math.max(l,_[_.length-1]);var v=de.getAnimationSpline(e,n,t,h.sampler,m,_,f,g);c[d]=dt(e,i[p.node],p.path,v)}e._runtime.animations[n]={name:t.name,startTime:s,stopTime:l,channelEvaluators:c}})}}function pt(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;X.mesh(o,function(i,s){X.meshPrimitive(i,function(i,l){var u,c=[],h=st(e,i),p=e._decodedData[s+".primitive."+l];X.meshPrimitiveAttribute(i,function(e,t){if(u=h[t],d(u)){if(d(p)){var i=p.attributes;if(i.hasOwnProperty(t)){var n=i[t];return void c.push({index:u,vertexBuffer:r[n.bufferView],componentsPerAttribute:n.componentsPerAttribute,componentDatatype:n.componentDatatype,normalize:n.normalized,offsetInBytes:n.byteOffset,strideInBytes:n.byteStride})}}var s=a[e],l=d(s.normalized)&&s.normalized;c.push({index:u,vertexBuffer:r[s.bufferView],componentsPerAttribute:Z(s.type),componentDatatype:s.componentType,normalize:l,offsetInBytes:s.byteOffset,strideInBytes:Q(o,s)})}});var f,m,_=e._precreatedAttributes;if(d(_))for(m in _)_.hasOwnProperty(m)&&(u=h[m],d(u)&&(f=_[m],f.index=u,c.push(f)));var g;if(d(i.indices)){var v=a[i.indices],y=v.bufferView;d(p)&&(y=p.bufferView),g=r[y]}n[s+".primitive."+l]=new q({context:t,attributes:c,indexBuffer:g})})})}}function ft(e){var t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,X.material(e.gltf,function(t,i){mt(e,t,i)}))}function mt(e,t,i){var r=e._rendererResources.renderStates,n=[O.FUNC_ADD,O.FUNC_ADD],o=[O.ONE,O.ONE_MINUS_SRC_ALPHA,O.ONE,O.ONE_MINUS_SRC_ALPHA];d(t.extensions)&&d(t.extensions.KHR_blend)&&(n=t.extensions.KHR_blend.blendEquation,o=t.extensions.KHR_blend.blendFactors);var a=!t.doubleSided,s="BLEND"===t.alphaMode;r[i]=k.fromCache({cull:{enabled:a},depthTest:{enabled:!0},depthMask:!s,blending:{enabled:s,equationRgb:n[0],equationAlpha:n[1],functionSourceRgb:o[0],functionDestinationRgb:o[1],functionSourceAlpha:o[2],functionDestinationAlpha:o[3]}})}function _t(e,t,i,r){var n=t._runtime.nodes[e];return Gi[i](r,t,n)}function gt(e,t,i,r,n,o,a){var s,l,u={},h={};return X.techniqueUniform(i,function(i,p){var f;if(d(r)&&d(r[p]))f=ge.createUniformFunction(i.type,r[p],o,a),u[p]=f.func,h[p]=f;else if(d(i.node))u[p]=_t(i.node,e,i.semantic,n.uniformState);else if(d(i.semantic))if("JOINTMATRIX"===i.semantic)s=p;else if("MORPHWEIGHTS"===i.semantic)l=p;else if("ALPHACUTOFF"===i.semantic){var m=t.alphaMode;if(d(m)&&"MASK"===m){var _=c(t.alphaCutoff,.5);f=ge.createUniformFunction(i.type,_,o,a),u[p]=f.func,h[p]=f}}else u[p]=ge.getGltfSemanticUniforms()[i.semantic](n.uniformState,e);else if(d(i.value)){var g=ge.createUniformFunction(i.type,i.value,o,a);u[p]=g.func,h[p]=g}}),{map:u,values:h,jointMatrixUniformName:s,morphWeightsUniformName:l}}function vt(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=e._sourceTechniques,o=e._uniformMaps,a=e._rendererResources.textures,s=e._defaultTexture;X.material(r,function(i,r){var l=e._runtime.materialsById[r],u=n[l._technique],c=l._values,d=gt(e,i,u,c,t,a,s),h=o[r];h.uniformMap=d.map,h.values=d.values,h.jointMatrixUniformName=d.jointMatrixUniformName,h.morphWeightsUniformName=d.morphWeightsUniformName})}}function yt(e){return ge.createUniformsForDracoQuantizedAttributes(e.attributes)}function Ct(e,t){var i=Xe(e,t),r=e._quantizedUniforms[i];return ge.createUniformsForQuantizedAttributes(e.gltf,t,r)}function bt(e){return function(){return e}}function St(e){return function(){return e.computedJointMatrices}}function Tt(e){return function(){return e.weights}}function Et(e){return function(){return e.silhouetteColor}}function At(e){return function(){return e.silhouetteSize}}function wt(e){return function(){return e.color}}function xt(e){return function(){var t=e.clippingPlanes;if(!d(t)&&!d(e._sphericalHarmonicCoefficients)&&!d(e._specularEnvironmentMaps))return x.IDENTITY;var i=d(t)?t.modelMatrix:x.IDENTITY;return x.multiply(e._clippingPlaneModelViewMatrix,i,Hi)}}function Pt(e){return function(){var t=e.clippingPlanes;return d(t)&&t.enabled?t.texture:e._defaultTexture}}function Dt(e){return function(){var t=e.clippingPlanes;if(!d(t))return s.WHITE.withAlpha(0);var i=s.clone(t.edgeColor);return i.alpha=t.edgeWidth,i}}function It(e){return function(){return oe.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function Mt(e){return function(){return e._imageBasedLightingFactor}}function Rt(e){return function(){return e._lightColor}}function Ot(e){return function(){return e.luminanceAtZenith}}function Lt(e){return function(){return e._sphericalHarmonicCoefficients}}function Nt(e){return function(){return e._specularEnvironmentMapAtlas.texture}}function Ft(e){return function(){return e._specularEnvironmentMapAtlas.texture.dimensions}}function Bt(e){return function(){return e._specularEnvironmentMapAtlas.maximumMipmapLevel}}function kt(e,t){switch(e.mode){case D.TRIANGLES:return t/3;case D.TRIANGLE_STRIP:case D.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function zt(t,r,n,o,a){for(var s=t._nodeCommands,u=t._pickIds,c=t.allowPicking,h=t._runtime.meshesByName,p=t._rendererResources,f=p.vertexArrays,m=p.programs,_=p.renderStates,g=t._uniformMaps,v=t.gltf,y=v.accessors,b=v.meshes,S=r.mesh,T=b[S],E=T.primitives,A=E.length,w=0;w<A;++w){var P,D=E[w],I=y[D.indices],M=t._runtime.materialsById[D.material],R=M._program,O=t._decodedData[S+".primitive."+w],L=D.attributes.POSITION;if(d(L)){var N=ge.getAccessorMinMax(v,L);P=e.fromCornerPoints(i.fromArray(N.min),i.fromArray(N.max))}var k,z,V=f[S+".primitive."+w];if(d(O))z=O.numberOfIndices,k=0;else if(d(I))z=I.count,k=I.byteOffset/C.getSizeInBytes(I.componentType);else{var U=y[D.attributes.POSITION];z=U.count,k=0}t._trianglesLength+=kt(D,z);var G=g[D.material],H=G.uniformMap;if(d(G.jointMatrixUniformName)){var W={};W[G.jointMatrixUniformName]=St(n),H=l(H,W)}if(d(G.morphWeightsUniformName)){var q={};q[G.morphWeightsUniformName]=Tt(n),H=l(H,q)}H=l(H,{gltf_color:wt(t),gltf_colorBlend:It(t),gltf_clippingPlanes:Pt(t),gltf_clippingPlanesEdgeStyle:Dt(t),gltf_clippingPlanesMatrix:xt(t),gltf_iblFactor:Mt(t),gltf_lightColor:Rt(t),gltf_sphericalHarmonicCoefficients:Lt(t),gltf_specularMap:Nt(t),gltf_specularMapSize:Ft(t),gltf_maxSpecularLOD:Bt(t),gltf_luminanceAtZenith:Ot(t)}),d(t._uniformMapLoaded)&&(H=t._uniformMapLoaded(H,R,n));var Y={};t.extensionsUsed.WEB3D_quantized_attributes?Y=Ct(t,D):t._dequantizeInShader&&d(O)&&(Y=yt(O)),H=l(H,Y);var j=_[D.material],X=j.blending.enabled,Q=t._pickObject;d(Q)||(Q={primitive:t,id:t.id,node:n.publicNode,mesh:h[T.name]});var K,Z=Se.castShadows(t._shadows),J=Se.receiveShadows(t._shadows);if(c&&!d(t._uniformMapLoaded)){K=o.createPickId(Q),u.push(K);var $={czm_pickColor:bt(K.color)};H=l(H,$)}c&&(K=d(t._pickIdLoaded)&&d(t._uniformMapLoaded)?t._pickIdLoaded():"czm_pickColor");var ee,te=new F({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:D.mode,vertexArray:V,count:z,offset:k,shaderProgram:m[R],castShadows:Z,receiveShadows:J,uniformMap:H,renderState:j,owner:Q,pass:X?B.TRANSLUCENT:t.opaquePass,pickId:K});a||(ee=F.shallowClone(te),ee.boundingVolume=new e,ee.modelMatrix=new x);var ie={show:!0,boundingSphere:P,command:te,command2D:ee,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,programId:R};n.commands.push(ie),s.push(ie)}}function Vt(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,u=s.skins,c=s.scenes[s.scene],h=c.nodes,p=h.length,f=[],m={},_=0;_<p;++_){f.push({parentRuntimeNode:void 0,gltfNode:l[h[_]],id:h[_]});for(var g=[];f.length>0;){var v=f.pop();m[v.id]=!0;var y=v.parentRuntimeNode,C=v.gltfNode,b=a[v.id];if(0===b.parents.length)if(d(C.matrix))b.matrix=x.fromColumnMajorArray(C.matrix);else{var S=C.rotation;b.translation=i.fromArray(C.translation),b.rotation=I.unpack(S),b.scale=i.fromArray(C.scale)}d(y)?(y.children.push(b),b.parents.push(y)):o.push(b),d(C.mesh)&&zt(e,C,b,t,r);var T=C.children;if(d(T))for(var E=T.length,A=0;A<E;A++){var w=T[A];m[w]||f.push({parentRuntimeNode:b,gltfNode:l[w],id:T[A]})}var P=C.skin;if(d(P)&&g.push(u[P].skeleton),0===f.length)for(var D=0;D<g.length;D++){var M=g[D];m[M]||f.push({parentRuntimeNode:void 0,gltfNode:l[M],id:M})}}}e._runtime.rootNodes=o,e._runtime.nodes=a}}function Ut(e){var t=0;for(var i in e)e.hasOwnProperty(i)&&(t+=e[i].sizeInBytes);return t}function Gt(e){var t=0;for(var i in e)e.hasOwnProperty(i)&&(t+=e[i].sizeInBytes);return t}function Ht(e,t){var i=t.context,r=t.scene3DOnly,n=e._quantizedVertexShaders,o=e._toClipCoordinatesGLSL={},a=e._sourceTechniques,s=e._sourcePrograms,l=e._rendererResources,u=l.sourceShaders;e._loadRendererResourcesFromCache&&(u=l.sourceShaders=e._cachedRendererResources.sourceShaders);for(var c in a)if(a.hasOwnProperty(c)){var h=a[c].program,p=s[h],f=u[p.vertexShader];if(ge.checkSupportedGlExtensions(p.glExtensions,i),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){var m=n[h];d(m)||(m=Qe(f,h,e),n[h]=m),f=m}f=Ze(f,h,e._vertexShaderLoaded),o[h]=ge.toClipCoordinatesGLSL(e.gltf,f)}if(e._loadRendererResourcesFromCache){var _=e._cachedRendererResources;l.buffers=_.buffers,l.vertexArrays=_.vertexArrays,l.programs=_.programs,l.silhouettePrograms=_.silhouettePrograms,l.textures=_.textures,l.samplers=_.samplers,l.renderStates=_.renderStates,d(e._precreatedAttributes)&&pt(e,i),e._cachedGeometryByteLength+=Ut(_.buffers),e._cachedTexturesByteLength+=Gt(_.textures)}else je(e,t),tt(e,t),nt(e,i),rt(e),at(e,t);ct(e),ht(e),e._loadRendererResourcesFromCache||(pt(e,i),ft(e)),vt(e,i),Vt(e,i,r)}function Wt(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&d(r)?x.clone(r,t):d(e.matrix)?x.clone(e.matrix,t):(x.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}function qt(t,n,o,a){var s=t._maxDirtyNumber,l=t._runtime.rootNodes,u=l.length,c=Wi,h=t._computedModelMatrix;if(t._mode!==be.SCENE3D&&!t._ignoreCommands){var p=x.getColumn(h,3,qi);if(r.equals(p,r.UNIT_W)){var f=t.boundingSphere.center,m=R.wgs84To2DModelMatrix(a,f,Yi);h=x.multiply(m,h,Yi),d(t._rtcCenter)&&(x.setTranslation(h,r.UNIT_W,h),t._rtcCenter=t._rtcCenter2D)}else h=R.basisTo2D(a,h,Yi),t._rtcCenter=t._rtcCenter3D}for(var _=0;_<u;++_){var g=l[_];for(Wt(g,g.transformToRoot),c.push(g);c.length>0;){g=c.pop();var v=g.transformToRoot,y=g.commands;if(g.dirtyNumber===s||n||o){var C=x.multiplyTransformation(h,v,g.computedMatrix),b=y.length;if(b>0)for(var S=0;S<b;++S){var T=y[S],E=T.command;x.clone(C,E.modelMatrix),e.transform(T.boundingSphere,E.modelMatrix,E.boundingVolume),d(t._rtcCenter)&&i.add(t._rtcCenter,E.boundingVolume.center,E.boundingVolume.center),E=T.command2D,d(E)&&t._mode===be.SCENE2D&&(x.clone(C,E.modelMatrix),E.modelMatrix[13]-=2*A.sign(E.modelMatrix[13])*A.PI*a.ellipsoid.maximumRadius,e.transform(T.boundingSphere,E.modelMatrix,E.boundingVolume))}}var w=g.children;if(d(w))for(var P=w.length,D=0;D<P;++D){var I=w[D];I.dirtyNumber=Math.max(I.dirtyNumber,g.dirtyNumber),(I.dirtyNumber===s||o)&&(Wt(I,I.transformToRoot),x.multiplyTransformation(v,I.transformToRoot,I.transformToRoot)),c.push(I)}}}++t._maxDirtyNumber}function Yt(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];ji=x.inverseTransformation(n.transformToRoot,ji);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,u=l.length,c=0;c<u;++c)d(o[c])||(o[c]=new x),o[c]=x.multiplyTransformation(ji,a[c].transformToRoot,o[c]),o[c]=x.multiplyTransformation(o[c],l[c],o[c]),d(s)&&(o[c]=x.multiplyTransformation(o[c],s,o[c]))}}function jt(e){for(var t=e._runtime.rootNodes,i=t.length,r=Wi,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;var c=o.children;if(d(c))for(var h=c.length,p=0;p<h;++p){var f=c[p];f.computedShow=a&&f.publicNode.show,r.push(f)}}}}function Xt(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 Qt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?D.LINES:D.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function Kt(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 Zt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=Se.castShadows(e.shadows),i=Se.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,o=0;o<n;o++){var a=r[o];a.command.castShadows=t,a.command.receiveShadows=i}}}function Jt(e){var t=a(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=re.ALPHA_BLEND,k.fromCache(t)}function $t(e){var t=F.shallowClone(e);return t.pass=B.TRANSLUCENT,t.renderState=Jt(e.renderState),t}function ei(e,t,i){var r=t.scene3DOnly,n=e.color.alpha;if(n>0&&n<1){var o=e._nodeCommands,a=o.length;if(!d(o[0].translucentCommand)||i)for(var s=0;s<a;++s){var l=o[s],u=l.command;if(l.translucentCommand=$t(u),!r){var c=l.command2D;l.translucentCommand2D=$t(c)}}}}function ti(e,t){var i=e._rendererResources.programs;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t)return r}function ii(e,t,i){var r=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;r=U.replaceMain(r,"gltf_silhouette_main"),r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+o+"); \n n.x *= czm_projection[0][0]; \n n.y *= czm_projection[1][1]; \n vec4 clip = gl_Position; \n clip.xy += n.xy * clip.w * gltf_silhouetteSize / czm_viewport.z; \n gl_Position = clip; \n}";return V.fromCache({context:i.context,vertexShaderSource:r,fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = czm_gammaCorrect(gltf_silhouetteColor); \n}",attributeLocations:n})}function ri(e,t){return we(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&d(e._normalAttributeName)}function ni(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r){if(t[r].command.pass===B.TRANSLUCENT)return!0}return!1}function oi(e){return e.color.alpha>0&&e.color.alpha<1}function ai(e){return 0===e.color.alpha}function si(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function li(e,t){for(var i=++Xi%255,r=ni(e)||oi(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,o=t.scene3DOnly,s=e._nodeCommands,u=s.length,c=0;c<u;++c){var h=s[c],p=h.command,f=oi(e)?h.translucentCommand:p,m=F.shallowClone(f),_=a(f.renderState);_.stencilTest={enabled:!0,frontFunction:O.ALWAYS,backFunction:O.ALWAYS,reference:i,mask:-1,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.REPLACE},backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.REPLACE}},ai(e)&&(_.colorMask={red:!1,green:!1,blue:!1,alpha:!1},_.depthMask=!1),_=k.fromCache(_),m.renderState=_,h.silhouetteModelCommand=m;var g=F.shallowClone(p);_=a(p.renderState,!0),_.depthTest.enabled=!0,_.cull.enabled=!1,r&&(g.pass=B.TRANSLUCENT,
- _.depthMask=!1,_.blending=re.ALPHA_BLEND),_.stencilTest={enabled:!0,frontFunction:O.NOTEQUAL,backFunction:O.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.KEEP},backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.KEEP}},_=k.fromCache(_);var v=p.shaderProgram,y=ti(e,v),C=n[y];d(C)||(C=ii(e,v,t),n[y]=C);var b=l(p.uniformMap,{gltf_silhouetteColor:Et(e),gltf_silhouetteSize:At(e)});if(g.renderState=_,g.shaderProgram=C,g.uniformMap=b,g.castShadows=!1,g.receiveShadows=!1,h.silhouetteColorCommand=g,!o){var S=h.command2D,T=F.shallowClone(m);T.boundingVolume=S.boundingVolume,T.modelMatrix=S.modelMatrix,h.silhouetteModelCommand2D=T;var E=F.shallowClone(g);T.boundingVolume=S.boundingVolume,T.modelMatrix=S.modelMatrix,h.silhouetteColorCommand2D=E}}}function ui(e,t,i){return e=U.replaceMain(e,"gltf_clip_main"),e+=Ae._getClippingFunction(t,i)+"\n",e+="uniform sampler2D gltf_clippingPlanes; \nuniform mat4 gltf_clippingPlanesMatrix; \nuniform vec4 gltf_clippingPlanesEdgeStyle; \nvoid main() \n{ \n gltf_clip_main(); \n"+se("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")+"} \n"}function ci(e,t,i){if(ri(e,t)){var r=e._nodeCommands,n=si(e.color.alpha,e._colorPreviousAlpha)||si(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!d(r[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(n||i)&&li(e,t)}}function di(e,t){var i=e._clippingPlanes;d(i)&&i.owner===e&&i.enabled&&i.update(t)}function hi(e,t,i){return Qi.center=e,Qi.radius=t,i.camera.getPixelSize(Qi,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function pi(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=d(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Ki.x=a[12],Ki.y=a[13],Ki.z=a[14],d(e._rtcCenter)&&i.add(e._rtcCenter,Ki,Ki),e._mode!==be.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(Ki,Zi);s.project(l,Ki),i.fromElements(Ki.z,Ki.x,Ki.y,Ki)}var u=e.boundingSphere.radius,c=hi(Ki,u,t),h=1/c;Math.min(h*(2*u),o)<e.minimumPixelSize&&(r=e.minimumPixelSize*c/(2*e._initialRadius))}return d(e.maximumScale)?Math.min(e.maximumScale,r):r}function fi(e){d(e._cacheKey)&&d(e._cachedGltf)&&0==--e._cachedGltf.count&&delete wi[e._cacheKey],e._cachedGltf=void 0}function mi(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=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 _i(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function gi(e){_i(e.buffers),_i(e.vertexArrays),_i(e.programs),_i(e.silhouettePrograms),_i(e.textures)}function vi(e,t,i){return function(r){if(e.heightReference===ue.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(r,Zi);n.height+=i.height,t.cartographicToCartesian(n,r)}var o=e._clampedModelMatrix;x.clone(e.modelMatrix,o),o[12]=r.x,o[13]=r.y,o[14]=r.z,e._heightChanged=!0}}function yi(e){d(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!d(t)||!d(t.globe)||e.heightReference===ue.NONE)return void(e._clampedModelMatrix=void 0);var i=t.globe,r=i.ellipsoid,o=e.modelMatrix;Ki.x=o[12],Ki.y=o[13],Ki.z=o[14];var a=r.cartesianToCartographic(Ki);d(e._clampedModelMatrix)||(e._clampedModelMatrix=x.clone(o,new x));var s=i._surface;e._removeUpdateHeightCallback=s.updateHeight(a,vi(e,r,a));var l=i.getHeight(a);if(d(l)){var u=vi(e,r,a);n.clone(a,Zi),Zi.height=l,r.cartographicToCartesian(Zi,Ki),u(Ki)}}function Ci(e,t){var r,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===be.SCENE2D){r=.5*(t.camera.frustum.right-t.camera.frustum.left),r*=r}else{var s=x.getTranslation(e.modelMatrix,Ji);if(t.mode===be.COLUMBUS_VIEW){var l=t.mapProjection,u=l.ellipsoid,c=u.cartesianToCartographic(s,$i);s=l.project(c,s),i.fromElements(s.z,s.x,s.y,s)}r=i.distanceSquared(s,t.camera.positionWC)}return r>=o&&r<=a}function bi(e,t){e.programs!==t.programs&&_i(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&_i(e.silhouettePrograms)}function Si(e,t){var i=e._rendererResources,r=e._cachedRendererResources;bi(i,r);var n;if(Pe(e)||xe(e)||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,i.programs={},i.silhouettePrograms={};var o,a={},s=e._sourceTechniques;for(var l in s)s.hasOwnProperty(l)&&(o=s[l],n=o.program,a[n]||(a[n]=!0,$e({programId:n,techniqueId:l},e,t.context)))}else i.programs=r.programs,i.silhouettePrograms=r.silhouettePrograms;for(var u=i.programs,c=e._nodeCommands,h=c.length,p=0;p<h;++p){var f=c[p];n=f.programId;var m=u[n];f.command.shaderProgram=m,d(f.command2D)&&(f.command2D.shaderProgram=m)}ei(e,t,!0),ci(e,t,!0)}if(!_.supportsTypedArrays())return{};var Ti=new i,Ei=ge.ModelState,Ai=A.EPSILON16;h(Ee.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),Ee.prototype.makeReady=function(e){this.gltf=e;for(var t=this.modelsToLoad,i=t.length,r=0;r<i;++r){var n=t[r];n.isDestroyed()||Te(n,this)}this.modelsToLoad=void 0,this.ready=!0};var wi={},xi={};h(Ae.prototype,{gltf:{get:function(){return d(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._resource.url}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==ue.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=x.getScale(e,Ti),r=d(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,d(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 d(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=m.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return d(this._extensionsUsed)||(this._extensionsUsed=ge.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return d(this._extensionsRequired)||(this._extensionsRequired=ge.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return d(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&ne.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){var i=this._imageBasedLightingFactor;e===i||t.equals(e,i)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLightingFactor.x>0&&0===e.x||0===this._imageBasedLightingFactor.x&&e.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLightingFactor.y>0&&0===e.y||0===this._imageBasedLightingFactor.y&&e.y>0,t.clone(e,this._imageBasedLightingFactor))}},lightColor:{get:function(){return this._lightColor},set:function(e){var t=this._lightColor;e===t||i.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||d(t)&&!d(e)||d(e)&&!d(t),this._lightColor=i.clone(e,t))}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){var t=this._luminanceAtZenith;e!==t&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||d(t)&&!d(e)||d(e)&&!d(t),this._luminanceAtZenith=e)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){e!==this._sphericalHarmonicCoefficients&&(this._sphericalHarmonicCoefficients=e,this._shouldRegenerateShaders=!0)}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){this._shouldUpdateSpecularMapAtlas=this._shouldUpdateSpecularMapAtlas||e!==this._specularEnvironmentMaps,this._specularEnvironmentMaps=e}}}),Ae.silhouetteSupported=function(e){return we(e.context)},Ae.fromGltf=function(e){var t=e.url;e=a(e);var i=M.createIfNeeded(t),r=c(e.basePath,i.clone()),n=M.createIfNeeded(r),o=c(e.cacheKey,xi[g(i.url)]);d(o)||(o=u(),xi[g(i.url)]=o),d(e.basePath)&&!d(e.cacheKey)&&(o+=n.url),e.cacheKey=o,e.basePath=n;var s=new Ae(e),l=wi[o];return d(l)?l.ready||(++l.count,l.modelsToLoad.push(s)):(l=new Ee({ready:!1}),l.count=1,l.modelsToLoad.push(s),Te(s,l),wi[o]=l,d(i.headers.Accept)||(i.headers.Accept="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01"),i.fetchArrayBuffer().then(function(e){var t=new Uint8Array(e);if(De(t)){var i=J(t);l.makeReady(i)}else{var r=y(t);l.makeReady(JSON.parse(r))}}).otherwise(ge.getFailedLoadFunction(s,"model",i.url))),s},Ae._gltfCache=wi,Ae.prototype.getNode=function(e){var t=Ie(this,"nodesByName",e);return d(t)?t.publicNode:void 0},Ae.prototype.getMesh=function(e){return Ie(this,"meshesByName",e)},Ae.prototype.getMaterial=function(e){return Ie(this,"materialsByName",e)},Ae.prototype.setArticulationStage=function(e,t){var i=Ie(this,"stagesByKey",e),r=Ie(this,"articulationsByStageKey",e);d(i)&&d(r)&&(t=A.clamp(t,i.minimumValue,i.maximumValue),A.equalsEpsilon(i.currentValue,t,Ai)||(i.currentValue=t,r.isDirty=!0))};var Pi=new i,Di=new w,Ii=new x;Ae.prototype.applyArticulations=function(){var e=this._runtime.articulationsByName;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];if(i.isDirty){i.isDirty=!1;for(var r=i.nodes.length,n=0;n<r;++n){for(var o=i.nodes[n],a=x.clone(o.originalMatrix,Ii),s=i.stages.length,l=0;l<s;++l){var u=i.stages[l];a=Me(u,a)}o.matrix=a}}}};var Mi=/(^data:image\/ktx)|(\.ktx$)/i,Ri=/(^data:image\/crn)|(\.crn$)/i,Oi=new x,Li=function(){this.id=void 0,this.model=void 0,this.context=void 0};Li.prototype.set=function(e,t,i){this.id=e,this.model=t,this.context=i},Li.prototype.execute=function(){qe(this.id,this.model,this.context)};var Ni=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};Ni.prototype.set=function(e,t,i,r){this.id=e,this.componentType=t,this.model=i,this.context=r},Ni.prototype.execute=function(){Ye(this.id,this.componentType,this.model,this.context)};var Fi=new Li,Bi=new Ni,ki=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};ki.prototype.set=function(e,t,i){this.programToCreate=e,this.model=t,this.context=i},ki.prototype.execute=function(){Je(this.programToCreate,this.model,this.context)};var zi=new ki,Vi=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};Vi.prototype.set=function(e,t,i){this.gltfTexture=e,this.model=t,this.context=i},Vi.prototype.execute=function(){ot(this.gltfTexture,this.model,this.context)};var Ui=new Vi,Gi={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new x;return function(){return x.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r),x.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new w;return function(){return x.inverse(i.computedMatrix,r),x.getRotation(r,n),w.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new x,o=new w;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n),x.getRotation(n,o),w.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},Hi=new x,Wi=[],qi=new r,Yi=new x,ji=new x,Xi=0,Qi=new e,Ki=new i,Zi=new n;mi.prototype.release=function(){if(0==--this.count)return d(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],gi(this),p(this)};var Ji=new i,$i=new n;return Ae.prototype.update=function(e){if(e.mode!==be.MORPHING){if(!_.supportsWebP.initialized)return void _.supportsWebP.initialize();var t=_.supportsWebP(),r=e.context;if(this._defaultTexture=r.defaultTexture,this._state===Ei.NEEDS_LOAD&&d(this.gltf)){var n,o=this.cacheKey;if(d(o)){r.cache.modelRendererResourceCache=c(r.cache.modelRendererResourceCache,{});var a=r.cache.modelRendererResourceCache;if(n=a[this.cacheKey],d(n)){if(!n.ready)return;++n.count,this._loadRendererResourcesFromCache=!0}else n=new mi(r,o),n.count=1,a[this.cacheKey]=n;this._cachedRendererResources=n}else n=new mi(r),n.count=1,this._cachedRendererResources=n;if(this._state=Ei.LOADING,this._state!==Ei.FAILED){var s=this.gltf.extensions;if(d(s)&&d(s.CESIUM_RTC)){var l=i.fromArray(s.CESIUM_RTC.center);if(!i.equals(l,i.ZERO)){this._rtcCenter3D=l;var u=e.mapProjection,h=u.ellipsoid,p=h.cartesianToCartographic(this._rtcCenter3D),f=u.project(p);i.fromElements(f.z,f.x,f.y,f),this._rtcCenter2D=f,this._rtcCenterEye=new i,this._rtcCenter=this._rtcCenter3D}}j(this.gltf),this._loadResources=new pe,this._loadRendererResourcesFromCache||ge.parseBuffers(this,Oe)}}var m=this._loadResources,g=this._incrementallyLoadTextures,v=!1;if(this._state===Ei.LOADING){if(0===m.pendingBufferLoads){if(!m.initialized){if(e.brdfLutGenerator.update(e),ge.checkSupportedExtensions(this.extensionsRequired,t),ge.updateForwardAxis(this),!d(this.gltf.extras.sourceVersion)){var y=this.gltf;y.extras.sourceVersion=ge.getAssetVersion(y),y.extras.sourceKHRTechniquesWebGL=d(ge.getUsedExtensions(y).KHR_techniques_webgl),this._sourceVersion=y.extras.sourceVersion,this._sourceKHRTechniquesWebGL=y.extras.sourceKHRTechniquesWebGL,ee(y),Y(y);var C={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};ye(y,C),Ce(y,C)}this._sourceVersion=this.gltf.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltf.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&ae.hasExtension(this),Re(this),ze(this),Ne(this),this._loadRendererResourcesFromCache||(Le(this),Be(this),ke(this),Ue(this,r,t)),He(this),We(this),Ge(this),ae.parse(this,r),m.initialized=!0}m.finishedDecoding()||ae.decodeModel(this,r).otherwise(ge.getFailedLoadFunction(this,"model",this.basePath)),m.finishedDecoding()&&!m.resourcesParsed&&(this._boundingSphere=ge.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,ae.cacheDataForModel(this),m.resourcesParsed=!0),m.resourcesParsed&&0===m.pendingShaderLoads&&Ht(this,e)}(m.finished()||g&&m.finishedEverythingButTextureCreation())&&(this._state=Ei.LOADED,v=!0)}if(d(m)&&this._state===Ei.LOADED&&(g&&!v&&Ht(this,e),m.finished())){this._loadResources=void 0;var b=this._rendererResources,S=this._cachedRendererResources;S.buffers=b.buffers,S.vertexArrays=b.vertexArrays,S.programs=b.programs,S.sourceShaders=b.sourceShaders,S.silhouettePrograms=b.silhouettePrograms,S.textures=b.textures,S.samplers=b.samplers,S.renderStates=b.renderStates,S.ready=!0,this._normalAttributeName=ge.getAttributeOrUniformBySemantic(this.gltf,"NORMAL"),d(this._precreatedAttributes)&&(S.vertexArrays={}),this.releaseGltfJson&&fi(this)}var T=ve.isSupported(r);if(this._shouldUpdateSpecularMapAtlas&&T){if(this._shouldUpdateSpecularMapAtlas=!1,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._specularEnvironmentMapAtlas=void 0,d(this._specularEnvironmentMaps)){this._specularEnvironmentMapAtlas=new ve(this._specularEnvironmentMaps);var E=this;this._specularEnvironmentMapAtlas.readyPromise.then(function(){E._shouldRegenerateShaders=!0})}this._shouldRegenerateShaders=!0}d(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);var w=!d(this._specularEnvironmentMapAtlas)&&d(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,P=!d(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,D=!d(this._sphericalHarmonicCoefficients)&&d(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,I=!d(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||w||P||D||I,this._useDefaultSpecularMaps=!d(this._specularEnvironmentMapAtlas)&&d(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!d(this._sphericalHarmonicCoefficients)&&d(e.sphericalHarmonicCoefficients);var M=ri(this,e),R=oi(this),O=ai(this),L=!d(this.distanceDisplayCondition)||Ci(this,e),N=this.show&&L&&0!==this.scale&&(!O||M);if(N&&this._state===Ei.LOADED||v){var F=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var B=this.modelMatrix,k=e.mode!==this._mode;this._mode=e.mode;var z=!x.equals(this._modelMatrix,B)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||k;if(z||v){x.clone(B,this._modelMatrix),yi(this),d(this._clampedModelMatrix)&&(B=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var V=pi(this,e),U=this._computedModelMatrix;x.multiplyByUniformScale(B,V,U),this._upAxis===ie.Y?x.multiplyTransformation(U,ie.Y_UP_TO_Z_UP,U):this._upAxis===ie.X&&x.multiplyTransformation(U,ie.X_UP_TO_Z_UP,U),this.forwardAxis===ie.Z&&x.multiplyTransformation(U,ie.Z_UP_TO_X_UP,U)}(F||z||v)&&(qt(this,z,v,e.mapProjection),this._dirty=!0,(F||v)&&Yt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,jt(this)),Xt(this,r),Qt(this),Kt(this),Zt(this),di(this,e);var G=this._clippingPlanes,H=0,W=d(G)&&G.enabled&&G.length>0,q=d(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics,X=d(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps;if(W||q||X){var Q=c(this.clippingPlanesOriginMatrix,B);x.multiply(r.uniformState.view3D,Q,this._clippingPlaneModelViewMatrix)}W&&(H=G.clippingPlanesState);var K=this._shouldRegenerateShaders;K=K||this._clippingPlanesState!==H,this._clippingPlanesState=H;var Z=xe(this);Z!==this._colorShadingEnabled&&(this._colorShadingEnabled=Z,K=!0),K?Si(this,e):(ei(this,e,!1),ci(this,e,!1))}if(v){var J=this;return void e.afterRender.push(function(){J._ready=!0,J._readyPromise.resolve(J)})}if(N&&!this._ignoreCommands){var $,te,re,ne=e.commandList,oe=e.passes,se=this._nodeCommands,le=se.length,ue=e.mapProjection.ellipsoid.maximumRadius*A.PI;if(oe.render||oe.pick&&this.allowPicking){for($=0;$<le;++$)if(te=se[$],te.show){var ce=R?te.translucentCommand:te.command;if(ce=M?te.silhouetteModelCommand:ce,ne.push(ce),re=te.command.boundingVolume,e.mode===be.SCENE2D&&(re.center.y+re.radius>ue||re.center.y-re.radius<ue)){var de=R?te.translucentCommand2D:te.command2D;de=M?te.silhouetteModelCommand2D:de,ne.push(de)}}if(M&&!oe.pick)for($=0;$<le;++$)te=se[$],te.show&&(ne.push(te.silhouetteColorCommand),re=te.command.boundingVolume,e.mode===be.SCENE2D&&(re.center.y+re.radius>ue||re.center.y-re.radius<ue)&&ne.push(te.silhouetteColorCommand2D))}}}},Ae.prototype.isDestroyed=function(){return!1},Ae.prototype.destroy=function(){d(this._precreatedAttributes)&&_i(this._rendererResources.vertexArrays),d(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),d(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),d(this._cachedRendererResources)&&bi(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),ae.destroyCachedDataForModel(this);for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();fi(this),this._quantizedVertexShaders=void 0;var r=this._clippingPlanes;return d(r)&&!r.isDestroyed()&&r.owner===this&&r.destroy(),this._clippingPlanes=void 0,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),p(this)},Ae._getClippingFunction=le,Ae._modifyShaderForColor=Ke,Ae}),define("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/Resource","../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,f,m){"use strict";function _(t,i){i.collectionChanged.addEventListener(_.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 g(e,t,i,r){var o=i[t.id];n(o)&&(r.removeAndDestroy(o.modelPrimitive),delete i[t.id])}function v(e,t){var i=t[e.id];n(i)&&(i.nodeTransformationsScratch={},i.articulationsScratch={})}function y(e,t,i){e.readyPromise.otherwise(function(e){console.error(e),i[t.id].loadFail=!0})}var C=p.ENABLED,b=c.NONE,S=r.RED,T=r.WHITE,E=u.HIGHLIGHT,A=new i(1,1),w=new s,x=new s;return _.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._modelHash,r=this._primitives,o=0,a=t.length;o<a;o++){var u,c,p=t[o],f=p._model,_=i[p.id],g=p.isShowing&&p.isAvailable(e)&&m.getValueOrDefault(f._show,e,!0);if(g&&(c=p.computeModelMatrix(e,w),u=l.createIfNeeded(m.getValueOrUndefined(f._uri,e)),g=n(c)&&n(u)),g){var v=n(_)?_.modelPrimitive:void 0;if(n(v)&&u.url===_.url||(n(v)&&(r.removeAndDestroy(v),delete i[p.id]),v=d.fromGltf({url:u,incrementallyLoadTextures:m.getValueOrDefault(f._incrementallyLoadTextures,e,!0),scene:this._scene}),v.id=p,r.add(v),_={modelPrimitive:v,url:u.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFail:!1},i[p.id]=_,y(v,p,i)),v.show=!0,v.scale=m.getValueOrDefault(f._scale,e,1),v.minimumPixelSize=m.getValueOrDefault(f._minimumPixelSize,e,0),v.maximumScale=m.getValueOrUndefined(f._maximumScale,e),v.modelMatrix=s.clone(c,v.modelMatrix),v.shadows=m.getValueOrDefault(f._shadows,e,C),v.heightReference=m.getValueOrDefault(f._heightReference,e,b),v.distanceDisplayCondition=m.getValueOrUndefined(f._distanceDisplayCondition,e),v.silhouetteColor=m.getValueOrDefault(f._silhouetteColor,e,S,v._silhouetteColor),v.silhouetteSize=m.getValueOrDefault(f._silhouetteSize,e,0),v.color=m.getValueOrDefault(f._color,e,T,v._color),v.colorBlendMode=m.getValueOrDefault(f._colorBlendMode,e,E),v.colorBlendAmount=m.getValueOrDefault(f._colorBlendAmount,e,.5),v.clippingPlanes=m.getValueOrUndefined(f._clippingPlanes,e),v.clampAnimations=m.getValueOrDefault(f._clampAnimations,e,!0),v.imageBasedLightingFactor=m.getValueOrDefault(f._imageBasedLightingFactor,e,A),v.lightColor=m.getValueOrUndefined(f._lightColor,e),v.ready){var P=m.getValueOrDefault(f._runAnimations,e,!0);_.animationsRunning!==P&&(P?v.activeAnimations.addAll({loop:h.REPEAT}):v.activeAnimations.removeAll(),_.animationsRunning=P);var D=m.getValueOrUndefined(f._nodeTransformations,e,_.nodeTransformationsScratch);if(n(D))for(var I=Object.keys(D),M=0,R=I.length;M<R;++M){var O=I[M],L=D[O];if(n(L)){var N=v.getNode(O);if(n(N)){var F=s.fromTranslationRotationScale(L,x);N.matrix=s.multiply(N.originalMatrix,F,F)}}}var B=!1,k=m.getValueOrUndefined(f._articulations,e,_.articulationsScratch);if(n(k))for(var z=Object.keys(k),V=0,U=z.length;V<U;++V){var G=z[V],H=k[G];n(H)&&(B=!0,v.setArticulationStage(G,H))}B&&v.applyArticulations()}}else n(_)&&(_.modelPrimitive.show=!1)}return!0},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;r>-1;r--)g(this,e[r],t,i);return o(this)},_.prototype.getBoundingSphere=function(e,i){var r=this._modelHash[e.id];if(!n(r)||r.loadFail)return f.FAILED;var o=r.modelPrimitive;if(!n(o)||!o.show)return f.FAILED;if(!o.ready)return f.PENDING;if(o.heightReference===c.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!n(o._clampedModelMatrix))return f.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return f.DONE},_.prototype._onCollectionChanged=function(e,t,i,r){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],n(a._model)&&n(a._position)&&s.set(a.id,a);for(o=r.length-1;o>-1;o--)a=r[o],n(a._model)&&n(a._position)?(v(a,l),s.set(a.id,a)):(g(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],g(this,a,l,u),s.remove(a.id)},_}),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 v_pickColor;\nvarying float v_polylineAngle;\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, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nv_pickColor = pickColor;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(czm_modelViewProjectionRelativeToEye * p);\n#endif\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){e!==this._width&&(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)}},pickId:{get:function(){return this._pickId}},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=u.clone(e,this._modelMatrix),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/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/FeatureDetection","../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/Texture","../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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k){"use strict";function z(e){e=l(e,l.EMPTY_OBJECT),this.modelMatrix=v.clone(l(e.modelMatrix,v.IDENTITY)),this._modelMatrix=v.clone(v.IDENTITY),this.debugShowBoundingVolume=l(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(se),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:S.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,this._useHighlightColor=!1,this._highlightColor=o.clone(o.WHITE);var t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}function V(e,t){u(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:s.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:s.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:s.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:s.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:s.FLOAT,componentsPerAttribute:2}];e._batchTable=new L(t,i,e._polylines.length)}function U(t,i,r,n){for(var o=i.context,s=i.commandList,l=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,b=0;b<C;++b){for(var S,T,w,x,P=y[b],D=P.offset,I=P.bucket.shaderProgram,M=P.bucket.polylines,R=M.length,O=0,L=0;L<R;++L){var N=M[L],F=q(N._material);if(F!==S){if(u(S)&&O>0){var B=T.isTranslucent();c>=l?(w=new E({owner:t}),r.push(w)):w=r[c],++c,x=a(m(T._uniforms),t._uniformMap),w.boundingVolume=e.clone(he,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=I,w.vertexArray=v.va,w.renderState=B?t._translucentRS:t._opaqueRS,w.pass=B?A.TRANSLUCENT:A.OPAQUE,w.debugShowBoundingVolume=p,w.pickId="v_pickColor",w.uniformMap=x,w.count=O,w.offset=D,D+=O,O=0,d=!0,s.push(w)}T=N._material,T.update(o),S=F}for(var z=N._locatorBuckets,V=z.length,U=0;U<V;++U){var G=z[U];G.locator===P&&(O+=G.count)}var H;i.mode===k.SCENE3D?H=N._boundingVolumeWC:i.mode===k.COLUMBUS_VIEW?H=N._boundingVolume2D:i.mode===k.SCENE2D?u(N._boundingVolume2D)&&(H=e.clone(N._boundingVolume2D,pe),H.center.x=0):u(N._boundingVolumeWC)&&u(N._boundingVolume2D)&&(H=e.union(N._boundingVolumeWC,N._boundingVolume2D,pe)),d?(d=!1,e.clone(H,he)):e.union(H,he,he)}u(S)&&O>0&&(c>=l?(w=new E({owner:t}),r.push(w)):w=r[c],++c,x=a(m(T._uniforms),t._uniformMap),w.boundingVolume=e.clone(he,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=I,w.vertexArray=v.va,w.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,w.pass=T.isTranslucent()?A.TRANSLUCENT:A.OPAQUE,w.debugShowBoundingVolume=p,w.pickId="v_pickColor",w.uniformMap=x,w.count=O,w.offset=D,d=!0,s.push(w)),S=void 0}r.length=c}function G(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[re]?r.bufferUsage!==S.STREAM_DRAW?(t=!0,r.bufferUsage=S.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==S.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=S.STATIC_DRAW):r.frameCount--),t}function H(e,t,i){e._createVertexArray=!1,Q(e),K(e),Y(e);var r,n,o=[[]],a=o[0],l=e._batchTable,c=e._useHighlightColor,d=[0],h=0,p=[[]],f=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,l,c),f+=n.lengthOfPositions);if(f>0){var v,y=e._mode,C=new Float32Array(6*f*3),T=new Float32Array(4*f),E=0,A=0,w=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(C,T,E,A,w,l,t,i),y===k.MORPHING&&(u(v)||(v=new Float32Array(6*f*3)),n.writeForMorph(v,E));var x=n.lengthOfPositions;E+=6*x*3,A+=4*x,w+=4*x,h=n.updateIndices(o,d,p,h)}var P=e._positionBufferUsage.bufferUsage,D=S.STATIC_DRAW;e._positionBuffer=b.createVertexBuffer({context:t,typedArray:C,usage:P});var M;u(v)&&(M=b.createVertexBuffer({context:t,typedArray:v,usage:P})),e._texCoordExpandAndBatchIndexBuffer=b.createVertexBuffer({context:t,typedArray:T,usage:D});for(var R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,N=o.length,F=0;F<N;++F)if(a=o[F],a.length>0){var B=new Uint16Array(a),z=b.createIndexBuffer({context:t,typedArray:B,usage:S.STATIC_DRAW,indexDatatype:m.UNSIGNED_SHORT});L+=d[F];var V,U,G,H,W=6*(F*(R*g.SIXTY_FOUR_KILOBYTES)-L*R),q=R+W,j=R+q,X=R+j,Z=R+X,J=R+Z,$=F*(O*g.SIXTY_FOUR_KILOBYTES)-L*O,ee=[{index:le.position3DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:W,strideInBytes:6*R},{index:le.position3DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:q,strideInBytes:6*R},{index:le.position2DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:W,strideInBytes:6*R},{index:le.position2DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:q,strideInBytes:6*R},{index:le.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:le.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:X,strideInBytes:6*R},{index:le.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:le.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:X,strideInBytes:6*R},{index:le.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:Z,strideInBytes:6*R},{index:le.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:J,strideInBytes:6*R},{index:le.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:Z,strideInBytes:6*R},{index:le.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:J,strideInBytes:6*R},{index:le.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:s.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:$}];y===k.SCENE3D?(V=e._positionBuffer,U="vertexBuffer",G=fe,H="value"):y===k.SCENE2D||y===k.COLUMBUS_VIEW?(V=fe,U="value",G=e._positionBuffer,H="vertexBuffer"):(V=M,U="vertexBuffer",G=e._positionBuffer,H="vertexBuffer"),ee[0][U]=V,ee[1][U]=V,ee[2][H]=G,ee[3][H]=G,ee[4][U]=V,ee[5][U]=V,ee[6][H]=G,ee[7][H]=G,ee[8][U]=V,ee[9][U]=V,ee[10][H]=G,ee[11][H]=G;var te=new I({context:t,attributes:ee,indexBuffer:z});e._vertexArrays.push({va:te,buckets:p[F]})}}}function W(e,t){return t instanceof D?t.id:t}function q(e){var t=F._uniformList[e.type],i=t.length;me.length=2*i;for(var r=0,n=0;n<i;++n){var o=t[n];me[r]=o,me[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(me,W)}function Y(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 l=s.material,c=r[l.type];u(c)||(c=r[l.type]=new $(l,t,i)),c.addPolyline(s)}}}function j(e,t){var i=t.mode;e._mode===i&&v.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=v.clone(e.modelMatrix),e._createVertexArray=!0)}function X(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];u(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(u(t[r])){var n=t[r]._bucket;u(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function K(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function Z(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)u(t[r])&&t[r]._destroy()}function J(e,t,i){this.count=e,this.offset=t,this.bucket=i}function $(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=i}function ee(e){return i.dot(i.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(y.ORIGIN_ZX_PLANE)===_.INTERSECTING}var te=B.SHOW_INDEX,ie=B.WIDTH_INDEX,re=B.POSITION_INDEX,ne=B.MATERIAL_INDEX,oe=B.POSITION_SIZE_INDEX,ae=B.DISTANCE_DISPLAY_CONDITION,se=B.NUMBER_OF_PROPERTIES,le={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};c(z.prototype,{length:{get:function(){return X(this),this._polylines.length}}}),z.prototype.add=function(e){var t=new B(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},z.prototype.remove=function(e){if(this.contains(e)){this._polylines[e._index]=void 0;var t=this._polylinesToUpdate.indexOf(e);if(-1!==t&&this._polylinesToUpdate.splice(t,1),this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,u(e._bucket)){var i=e._bucket;i.shaderProgram=i.shaderProgram&&i.shaderProgram.destroy()}return e._destroy(),!0}return!1},z.prototype.removeAll=function(){Q(this),Z(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},z.prototype.contains=function(e){return u(e)&&e._polylineCollection===this},z.prototype.get=function(e){return X(this),this._polylines[e]};var ue=new p,ce=new r,de=new t;z.prototype.update=function(e){if(X(this),0!==this._polylines.length){j(this,e);var i,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===T.maximumVertexTextureImageUnits)throw new C("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");V(this,n),this._createBatchTable=!1}if(this._createVertexArray||G(this))H(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==k.SCENE3D)for(var l=s.length,c=0;c<l;++c)i=s[c],i.update();if(a[oe]||a[ne])H(this,n,o);else for(var d=s.length,h=this._polylineBuckets,f=0;f<d;++f){i=s[f],a=i._propertiesChanged;var m=i._bucket,_=0;for(var g in h)if(h.hasOwnProperty(g)){if(h[g]===m){a[re]&&m.writeUpdate(_,i,this._positionBuffer,o);break}_+=h[g].lengthOfPositions}if((a[te]||a[ie])&&this._batchTable.setBatchedAttribute(i._index,0,new t(i._width,i._show)),this._batchTable.attributes.length>2){if(a[re]||a[oe]){var y=e.mode===k.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,b=p.fromCartesian(y.center,ue),S=r.fromElements(b.low.x,b.low.y,b.low.z,y.radius,ce);this._batchTable.setBatchedAttribute(i._index,2,b.high),this._batchTable.setBatchedAttribute(i._index,3,S)}if(a[ae]){var E=de;E.x=0,E.y=Number.MAX_VALUE;var A=i.distanceDisplayCondition;u(A)&&(E.x=A.near,E.y=A.far),this._batchTable.setBatchedAttribute(i._index,4,E)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var x=0;x<se;++x)a[x]=0;var P=v.IDENTITY;e.mode===k.SCENE3D&&(P=this.modelMatrix);var D=e.passes,I=0!==e.morphTime;if(u(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===I||(this._opaqueRS=w.fromCache({depthMask:I,depthTest:{enabled:I}})),u(this._translucentRS)&&this._translucentRS.depthTest.enabled===I||(this._translucentRS=w.fromCache({blending:N.ALPHA_BLEND,depthMask:!I,depthTest:{enabled:I}})),this._batchTable.update(e),D.render||D.pick){U(this,e,this._colorCommands,P)}}};var he=new e,pe=new e;z.prototype.isDestroyed=function(){return!1},z.prototype.destroy=function(){return K(this),Q(this),Z(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),d(this)};var fe=[0,0,0],me=[];z.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},$.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},$.prototype.updateShader=function(e,t,i){if(!u(this.shaderProgram)){var r=["DISTANCE_DISPLAY_CONDITION"];i&&r.push("VECTOR_TILE"),-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&r.push("POLYLINE_DASH"),f.isInternetExplorer()||r.push("CLIP_POLYLINE");var n=new P({defines:r,sources:["varying vec4 v_pickColor;\n",this.material.shaderSource,R]}),o=t.getVertexShaderCallback()(O),a=new P({defines:r,sources:[M,o]});this.shaderProgram=x.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:n,attributeLocations:le})}},$.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===k.SCENE3D||!ee(e))return 4*(t=e._actualPositions.length)-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 _e=new i,ge=new i,ve=new i,ye=new i,Ce=new r,be=new t;$.prototype.write=function(e,t,n,a,s,l,c,d){for(var h=this.mode,f=d.ellipsoid.maximumRadius*g.PI,m=this.polylines,_=m.length,v=0;v<_;++v){for(var y,C=m[v],b=C.width,S=C.show&&b>0,T=C._index,E=this.getSegments(C,d),A=E.positions,w=E.lengths,x=A.length,P=C.getPickId(c).color,D=0,I=0,M=0;M<x;++M){0===M?C._loop?y=A[x-2]:(y=ye,i.subtract(A[0],A[1],y),i.add(A[0],y,y)):y=A[M-1],i.clone(y,ge),i.clone(A[M],_e),M===x-1?C._loop?y=A[1]:(y=ye,i.subtract(A[x-1],A[x-2],y),i.add(A[x-1],y,y)):y=A[M+1],i.clone(y,ve);var R=w[D];M===I+R&&(I+=R,++D);var O=M-I==0,L=M===I+w[D]-1;h===k.SCENE2D&&(ge.z=0,_e.z=0,ve.z=0),h!==k.SCENE2D&&h!==k.MORPHING||(O||L)&&f-Math.abs(_e.x)<1&&((_e.x<0&&ge.x>0||_e.x>0&&ge.x<0)&&i.clone(_e,ge),(_e.x<0&&ve.x>0||_e.x>0&&ve.x<0)&&i.clone(_e,ve));for(var N=O?2:0,F=L?2:4,B=N;B<F;++B){p.writeElements(_e,e,n),p.writeElements(ge,e,n+6),p.writeElements(ve,e,n+12);var z=B-2<0?-1:1;t[s]=M/(x-1),t[s+1]=B%2*2-1,t[s+2]=z,t[s+3]=T,n+=18,s+=4}}var V=Ce;V.x=o.floatToByte(P.red),V.y=o.floatToByte(P.green),V.z=o.floatToByte(P.blue),V.w=o.floatToByte(P.alpha);var U=be;U.x=b,U.y=S?1:0;var G=h===k.SCENE2D?C._boundingVolume2D:C._boundingVolumeWC,H=p.fromCartesian(G.center,ue),W=H.high,q=r.fromElements(H.low.x,H.low.y,H.low.z,G.radius,ce),Y=de;Y.x=0,Y.y=Number.MAX_VALUE;var j=C.distanceDisplayCondition;u(j)&&(Y.x=j.near,Y.y=j.far),l.setBatchedAttribute(T,0,U),l.setBatchedAttribute(T,1,V),l.attributes.length>2&&(l.setBatchedAttribute(T,2,W),l.setBatchedAttribute(T,3,q),l.setBatchedAttribute(T,4,Y))}};var Se=new i,Te=new i,Ee=new i,Ae=new i;$.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,h=0,f=0;f<c;++f){var m;0===f?s._loop?m=l[c-2]:(m=Ae,i.subtract(l[0],l[1],m),i.add(l[0],m,m)):m=l[f-1],m=v.multiplyByPoint(r,m,Te);var _,g=v.multiplyByPoint(r,l[f],Se);f===c-1?s._loop?_=l[1]:(_=Ae,i.subtract(l[c-1],l[c-2],_),i.add(l[c-1],_,_)):_=l[f+1],_=v.multiplyByPoint(r,_,Ee);var y=u[d];f===h+y&&(h+=y,++d);for(var C=f-h==0,b=f===h+u[d]-1,S=C?2:0,T=b?2:4,E=S;E<T;++E)p.writeElements(g,e,t),p.writeElements(m,e,t+6),p.writeElements(_,e,t+12),t+=18}};var we=new Array(1);$.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new J(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===k.SCENE3D){p=we;var f=h._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=h._segments.lengths;var m=p.length;if(m>0){for(var _=0,v=0;v<m;++v)for(var y=p[v]-1,C=0;C<y;++C)l+4>g.SIXTY_FOUR_KILOBYTES&&(h._locatorBuckets.push({locator:o,count:_}),_=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new J(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),_+=6,a+=6,r+=6,l+=4;h._locatorBuckets.push({locator:o,count:_}),l+4>g.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new J(0,0,this),i[++n]=[o])}h._clean()}return o.count=a,r},$.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 xe={positions:void 0,lengths:void 0},Pe=new Array(1),De=new i,Ie=new n;$.prototype.getSegments=function(t,r){var n=t._actualPositions;if(this.mode===k.SCENE3D)return Pe[0]=n.length,xe.positions=n,xe.lengths=Pe,xe;ee(t)&&(n=t._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=De,d=0;d<u;++d)o=n[d],c=v.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,Ie)));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 xe.positions=s,xe.lengths=t._segments.lengths,xe};var Me;return $.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*g.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var l=Me,c=6*s*3;!u(l)||l.length<c?l=Me=new Float32Array(c):l.length>c&&(l=new Float32Array(l.buffer,0,c));var d,h=this.getSegments(t,n),f=h.positions,m=h.lengths,_=0,v=0,y=0;s=f.length;for(var C=0;C<s;++C){0===C?t._loop?d=f[s-2]:(d=ye,i.subtract(f[0],f[1],d),i.add(f[0],d,d)):d=f[C-1],i.clone(d,ge),i.clone(f[C],_e),C===s-1?t._loop?d=f[1]:(d=ye,i.subtract(f[s-1],f[s-2],d),i.add(f[s-1],d,d)):d=f[C+1],i.clone(d,ve);var b=m[v];C===y+b&&(y+=b,++v);var S=C-y==0,T=C===y+m[v]-1;o===k.SCENE2D&&(ge.z=0,_e.z=0,ve.z=0),o!==k.SCENE2D&&o!==k.MORPHING||(S||T)&&a-Math.abs(_e.x)<1&&((_e.x<0&&ge.x>0||_e.x>0&&ge.x<0)&&i.clone(_e,ge),(_e.x<0&&ve.x>0||_e.x>0&&ve.x<0)&&i.clone(_e,ve));for(var E=S?2:0,A=T?2:4,w=E;w<A;++w)p.writeElements(_e,l,_),p.writeElements(ge,l,_+6),p.writeElements(ve,l,_+12),_+=18}r.copyFromArrayView(l,18*Float32Array.BYTES_PER_ELEMENT*e)}},z}),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 b(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,b=!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&&!b){var S=n[g+1],T=o.secondsDifference(S,y);b=T>l,b&&(p=Math.ceil(T/l),f=0,m=T/Math.max(p,2),p=Math.max(p-1,1))}if(b&&f<p){y=o.addSeconds(y,m,new o),f++;continue}}b=!1,g++,y=n[g]}return d=e.getValueInReferenceFrame(r,s,c[h]),i(d)&&(c[h++]=d),h}function T(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 E(e,t,r,n,a,s,l,c){O.start=t,O.stop=r;for(var d=l,h=e.intervals,p=0;p<h.length;p++){var f=h.get(p);if(!u.intersect(f,O,M).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 A(e,t,r,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return i(u)&&(l[s++]=u),s}function w(e,t,i,r,n,a,s,l){R.start=t,R.stop=i;for(var c=s,d=e.intervals,h=0;h<d.length;h++){var p=d.get(h);if(!u.intersect(p,R,M).isEmpty){var f=p.start,m=p.stop,_=t;o.greaterThan(f,_)&&(_=f);var g=i;o.lessThan(m,g)&&(g=m),c=x(p.data,_,g,r,n,a,c,l)}}return c}function x(e,t,i,r,n,o,a,s){for(;e instanceof g;)e=e.resolvedProperty;if(e instanceof v){a=S(e,t,i,e._property._times,r,n,o,a,s)}else a=e instanceof p?w(e,t,i,r,n,o,a,s):e instanceof C?E(e,t,i,r,n,o,a,s):e instanceof f||e instanceof y&&_.isConstant(e)?A(e,t,i,r,n,o,a,s):T(e,t,i,r,n,o,a,s);return a}function P(e,t,r,n,o,a,s){i(s)||(s=[]);var l=x(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 I(t,i){i.collectionChanged.addEventListener(I.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}var M=new u,R=new u,O=new u,L=new a;return D.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var r=c.computeIcrfToFixedMatrix(e,L);i(r)||(r=c.computeTemeToPseudoFixedMatrix(e,L)),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,b=f.stop;y&&!o.greaterThan(C,r)||(r=C),v&&!o.lessThan(b,n)||(n=b)}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;if(S.length>0){var T=S.pop();c=this._polylineCollection.get(T),t.index=T}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var E=_.getValueOrDefault(s._resolution,e,60);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,E,c.positions.slice()),c.material=m.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,1),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)},I.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},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(I.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return r(this)},I.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 b(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 b(a)):(s=l.get(a.id),i(s)&&(i(s.updater)&&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))},I._subSample=P,I}),define("Scene/createBillboardPointCallback",[],function(){"use strict";function e(e,t,i,r,n){return function(){var o=document.createElement("canvas"),a=n+2*r;o.height=o.width=a;var s=o.getContext("2d");return s.clearRect(0,0,a,a),0!==r&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=i,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}}return e}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/createBillboardPointCallback","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function p(t,i){i.collectionChanged.addEventListener(p.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function f(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))}}var m=i.WHITE,_=i.BLACK,g=new i,v=new t,y=new i,C=new s,b=new s,S=new a;return p.prototype.update=function(e){for(var n=this._items.values,o=this._cluster,a=0,s=n.length;a<s;a++){var c,h=n[a],p=h.entity,T=p._point,E=h.pointPrimitive,A=h.billboard,w=d.getValueOrDefault(T._heightReference,e,u.NONE),x=p.isShowing&&p.isAvailable(e)&&d.getValueOrDefault(T._show,e,!0);if(x&&(c=d.getValueOrUndefined(p._position,e,v),x=r(c)),x){d.isConstant(p._position)||(o._clusterDirty=!0);var P=!1,D=!1;if(w===u.NONE||r(A)?w!==u.NONE||r(E)||(r(A)&&(f(h,p,o),A=void 0),E=o.getPoint(p),E.id=p,h.pointPrimitive=E):(r(E)&&(f(h,p,o),E=void 0),A=o.getBillboard(p),A.id=p,A.image=void 0,h.billboard=A,P=!0,D=t.equals(A.position,c)&&A.heightReference===w),r(E))E.show=!0,E.position=c,E.scaleByDistance=d.getValueOrUndefined(T._scaleByDistance,e,C),E.translucencyByDistance=d.getValueOrUndefined(T._translucencyByDistance,e,b),E.color=d.getValueOrDefault(T._color,e,m,g),E.outlineColor=d.getValueOrDefault(T._outlineColor,e,_,y),E.outlineWidth=d.getValueOrDefault(T._outlineWidth,e,0),E.pixelSize=d.getValueOrDefault(T._pixelSize,e,1),E.distanceDisplayCondition=d.getValueOrUndefined(T._distanceDisplayCondition,e,S),E.disableDepthTestDistance=d.getValueOrDefault(T._disableDepthTestDistance,e,0);else if(r(A)){A.show=!0,A.position=c,A.scaleByDistance=d.getValueOrUndefined(T._scaleByDistance,e,C),A.translucencyByDistance=d.getValueOrUndefined(T._translucencyByDistance,e,b),A.distanceDisplayCondition=d.getValueOrUndefined(T._distanceDisplayCondition,e,S),A.disableDepthTestDistance=d.getValueOrDefault(T._disableDepthTestDistance,e,0),A.heightReference=w;var I=d.getValueOrDefault(T._color,e,m,g),M=d.getValueOrDefault(T._outlineColor,e,_,y),R=Math.round(d.getValueOrDefault(T._outlineWidth,e,0)),O=Math.max(1,Math.round(d.getValueOrDefault(T._pixelSize,e,1)));if(R>0?(A.scale=1,P=P||R!==h.outlineWidth||O!==h.pixelSize||!i.equals(I,h.color)||!i.equals(M,h.outlineColor)):(A.scale=O/50,O=50,P=P||R!==h.outlineWidth||!i.equals(I,h.color)||!i.equals(M,h.outlineColor)),P){h.color=i.clone(I,h.color),h.outlineColor=i.clone(M,h.outlineColor),h.pixelSize=O,h.outlineWidth=R;var L=I.alpha,N=I.toCssColorString(),F=M.toCssColorString(),B=JSON.stringify([N,O,F,R])
- ;A.setImage(B,l(L,N,F,R,O))}D&&A._updateClamping()}}else f(h,p,o)}return!0},p.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return c.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return c.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,c.DONE},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},p.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new h(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new h(a)):(f(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],f(s.get(a.id),a,l),s.remove(a.id)},p}),define("DataSources/PolylineGeometryUpdater",["../Core/ArcType","../Core/BoundingSphere","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/GroundPolylineGeometry","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../DataSources/Entity","../Scene/ClassificationType","../Scene/GroundPolylinePrimitive","../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,b,S,T,E,A,w,x,P,D,I,M){"use strict";function R(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function O(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function L(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(L.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new R,this._groundGeometryOptions=new O,this._id="polyline-"+e.id,this._clampToGround=!1,this._supportsPolylinesOnTerrain=C.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function N(e,t,i){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=i,this._positions=[]}function F(e){if(a(e._line))return e._line;var t=e._geometryUpdater._scene.id,i=k[t],r=e._primitives;!a(i)||i.isDestroyed()?(i=new T,k[t]=i,r.add(i)):r.contains(i)||r.add(i);var n=i.add();return n.id=e._geometryUpdater._entity,e._line=n,n}var B=new D(0),k={},z=new r,V=new P(r.WHITE),U=new D(!0),G=new D(w.DISABLED),H=new D(new c),W=new D(b.BOTH);s(L.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!a(this._entity.availability)&&M.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}}),L.prototype.isOutlineVisible=function(e){return!1},L.prototype.isFilled=function(e){var t=this._entity,i=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return o(i,!1)},L.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,o=i.isAvailable(e),s=new y(o&&i.isShowing&&this._showProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),u=d.fromDistanceDisplayCondition(l),c={show:s,distanceDisplayCondition:u};return this._materialProperty instanceof P&&(a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(t=this._materialProperty.color.getValue(e,z)),a(t)||(t=r.WHITE),c.color=n.fromColor(t)),this.clampToGround?new p({id:i,geometry:new f(this._groundGeometryOptions),attributes:c}):(a(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof P&&(a(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||o)&&(t=this._depthFailMaterialProperty.color.getValue(e,z)),a(t)||(t=r.WHITE),c.depthFailColor=n.fromColor(t)),new p({id:i,geometry:new g(this._geometryOptions),attributes:c}))},L.prototype.createOutlineGeometryInstance=function(e){},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){this._entitySubscription(),l(this)},L.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"polyline"===t){var n=this._entity.polyline;if(!a(n))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=n.positions,l=n.show;if(a(l)&&l.isConstant&&!l.getValue(m.MINIMUM_VALUE)||!a(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=n.zIndex,c=o(n.material,V),d=c instanceof P;this._materialProperty=c,this._depthFailMaterialProperty=n.depthFailMaterial,this._showProperty=o(l,U),this._shadowsProperty=o(n.shadows,G),this._distanceDisplayConditionProperty=o(n.distanceDisplayCondition,H),this._classificationTypeProperty=o(n.classificationType,W),this._fillEnabled=!0,this._zIndex=o(u,B);var h=n.width,p=n.arcType,f=n.clampToGround,g=n.granularity;if(s.isConstant&&M.isConstant(h)&&M.isConstant(p)&&M.isConstant(g)&&M.isConstant(f)&&M.isConstant(u)){var v=this._geometryOptions,y=s.getValue(m.MINIMUM_VALUE,v.positions);if(!a(y)||y.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var C;C=d&&(!a(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof P)?E.VERTEX_FORMAT:A.VERTEX_FORMAT,v.vertexFormat=C,v.positions=y,v.width=a(h)?h.getValue(m.MINIMUM_VALUE):void 0,v.arcType=a(p)?p.getValue(m.MINIMUM_VALUE):void 0,v.granularity=a(g)?g.getValue(m.MINIMUM_VALUE):void 0;var b=this._groundGeometryOptions;b.positions=y,b.width=v.width,b.arcType=v.arcType,b.granularity=v.granularity,this._clampToGround=!!a(f)&&f.getValue(m.MINIMUM_VALUE),!this._clampToGround&&a(u)&&_("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},L.prototype.createDynamicUpdater=function(e,t){return new N(e,t,this)};var q={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return N.prototype.update=function(t){var i=this._geometryUpdater,r=i._entity,n=r.polyline,o=n.positions,s=M.getValueOrUndefined(o,t,this._positions);i._clampToGround=M.getValueOrDefault(n._clampToGround,t,!1),i._groundGeometryOptions.positions=s,i._groundGeometryOptions.width=M.getValueOrDefault(n._width,t,1),i._groundGeometryOptions.arcType=M.getValueOrDefault(n._arcType,t,e.GEODESIC),i._groundGeometryOptions.granularity=M.getValueOrDefault(n._granularity,t,9999);var l=this._groundPrimitives;if(a(this._groundPolylinePrimitive)&&(l.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),i.clampToGround){if(!r.isShowing||!r.isAvailable(t)||!M.getValueOrDefault(n._show,t,!0))return;if(!a(s)||s.length<2)return;var u,c=i.fillMaterialProperty;if(c instanceof P)u=new E;else{var d=I.getValue(t,c,this._material);u=new A({material:d,translucent:d.isTranslucent()}),this._material=d}return this._groundPolylinePrimitive=l.add(new S({geometryInstances:i.createFillGeometryInstance(t),appearance:u,classificationType:i.classificationTypeProperty.getValue(t),asynchronous:!1}),M.getValueOrUndefined(i.zIndex,t)),void(a(this._line)&&(this._line.show=!1))}var h=F(this);if(!r.isShowing||!r.isAvailable(t)||!M.getValueOrDefault(n._show,t,!0))return void(h.show=!1);if(!a(s)||s.length<2)return void(h.show=!1);var p=e.GEODESIC;p=M.getValueOrDefault(n._arcType,t,p);var f=i._scene.globe;p!==e.NONE&&a(f)&&(q.ellipsoid=f.ellipsoid,q.positions=s,q.granularity=M.getValueOrUndefined(n._granularity,t),q.height=v.extractHeights(s,f.ellipsoid),s=v.generateCartesianArc(q)),h.show=!0,h.positions=s.slice(),h.material=I.getValue(t,i.fillMaterialProperty,h.material),h.width=M.getValueOrDefault(n._width,t,1),h.distanceDisplayCondition=M.getValueOrUndefined(n._distanceDisplayCondition,t,h.distanceDisplayCondition)},N.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){var i=this._groundPolylinePrimitive;if(a(i)&&i.show&&i.ready){var r=i.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(a(r)&&a(r.boundingSphere))return t.clone(r.boundingSphere,e),x.DONE}return a(i)&&!i.ready?x.PENDING:x.DONE}var n=F(this);return n.show&&n.positions.length>0?(t.fromPoints(n.positions,e),x.DONE):x.FAILED},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=k[t];a(i)&&(i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete k[t])),a(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),l(this)},L}),define("DataSources/StaticGroundPolylinePerMaterialBatch",["../Core/defaultValue","../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPolylinePrimitive","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,i,r,n,o){var a;a=r instanceof h?u:c,this.orderedGroundPrimitives=e,this.classificationType=i,this.appearanceType=a,this.materialProperty=r,this.updaters=new t,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new t,this.material=void 0,this.updatersWithAttributes=new t,this.attributes=new t,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(m.prototype.onMaterialChanged,this),this.subscriptions=new t,this.showsUpdated=new t,this.zIndex=n,this._asynchronous=o}function _(t,i,r){this._items=[],this._orderedGroundPrimitives=t,this._classificationType=i,this._asynchronous=e(r,!0)}var g=new i,v=new o,y=new o;return m.prototype.onMaterialChanged=function(){this.invalidated=!0},m.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof h&&t instanceof h||n(t)&&t.equals(i)},m.prototype.add=function(e,t,i){var r=t.id;if(this.updaters.set(r,t),this.geometry.set(r,i),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&f.isConstant(t.distanceDisplayConditionProperty)){var n=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener(function(e,i,r,o){"isShowing"===i&&n.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},m.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return n(i)&&(i(),this.subscriptions.remove(t)),!0}return!1},m.prototype.update=function(e){var t,u=!0,d=this.primitive,h=this.orderedGroundPrimitives,m=this.geometry.values;if(this.createPrimitive){if(m.length>0)n(d)&&(n(this.oldPrimitive)?h.remove(d):this.oldPrimitive=d),d=new l({show:!1,asynchronous:this._asynchronous,geometryInstances:m,appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===c&&(this.material=p.getValue(e,this.materialProperty,this.material),d.appearance.material=this.material),h.add(d,this.zIndex),u=!1;else{n(d)&&(h.remove(d),d=void 0);var _=this.oldPrimitive;n(_)&&(h.remove(_),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=d,this.createPrimitive=!1}else if(n(d)&&d.ready){d.show=!0,n(this.oldPrimitive)&&(h.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===c&&(this.material=p.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);var C=this.updatersWithAttributes.values,b=C.length;for(t=0;t<b;t++){var S=C[t],T=S.entity,E=this.geometry.get(S.id),A=this.attributes.get(E.id.id);if(n(A)||(A=d.getGeometryInstanceAttributes(E.id),this.attributes.set(E.id.id,A)),!S.fillMaterialProperty.isConstant){var w=S.fillMaterialProperty.color,x=f.getValueOrDefault(w,e,i.WHITE,g);i.equals(A._lastColor,x)||(A._lastColor=i.clone(x,A._lastColor),A.color=r.toValue(x,A.color))}var P=T.isShowing&&(S.hasConstantFill||S.isFilled(e)),D=1===A.show[0];P!==D&&(A.show=s.toValue(P,A.show));var I=S.distanceDisplayConditionProperty;if(!f.isConstant(I)){var M=f.getValueOrDefault(I,e,y,v);o.equals(M,A._lastDistanceDisplayCondition)||(A._lastDistanceDisplayCondition=o.clone(M,A._lastDistanceDisplayCondition),A.distanceDisplayCondition=a.toValue(M,A.distanceDisplayCondition))}}this.updateShows(d)}else n(d)&&!d.ready&&(u=!1);return u},m.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var o=t[r],a=o.entity,l=this.geometry.get(o.id),u=this.attributes.get(l.id.id);n(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=a.isShowing;c!==(1===u.show[0])&&(u.show=s.toValue(c,u.show),l.attributes.show.value[0]=u.show[0])}this.showsUpdated.removeAll()},m.prototype.contains=function(e){return this.updaters.contains(e.id)},m.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return d.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!n(r)||!n(r.boundingSphere)||n(r.show)&&0===r.show[0]?d.FAILED:(r.boundingSphere.clone(t),d.DONE)},m.prototype.destroy=function(){var e=this.primitive,t=this.orderedGroundPrimitives;n(e)&&t.remove(e);var i=this.oldPrimitive;n(i)&&t.remove(i),this.removeMaterialSubscription()},_.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),o=f.getValueOrDefault(t.zIndex,0),a=0;a<r;++a){var s=i[a];if(s.isMaterial(t)&&s.zIndex===o)return void s.add(e,t,n)}var l=new m(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);l.add(e,t,n),i.push(l)},_.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}}},_.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<i.length;t++)l=i[t].update(e)&&l;return l},_.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 d.FAILED},_.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0},_}),define("DataSources/PolylineVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Check","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Scene/ClassificationType","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./DynamicGeometryBatch","./PolylineGeometryUpdater","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundPolylinePerMaterialBatch"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function v(e,t,i){if(i.isDynamic)return void e._dynamicBatch.add(t,i);if(i.clampToGround&&i.fillEnabled){var r=i.classificationTypeProperty.getValue(t);return void e._groundBatches[r].add(t,i)}var o;i.fillEnabled&&(o=i.shadowsProperty.getValue(t));var a=0;n(i.depthFailMaterialProperty)&&(a=i.depthFailMaterialProperty instanceof d?1:2);var s;n(o)&&(s=o+a*u.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.fillMaterialProperty instanceof d?e._colorBatches[s].add(t,i):e._materialBatches[s].add(t,i))}function y(t,i,n,o){o=r(o,t.groundPrimitives),n=r(n,t.primitives),this._scene=t,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var c,d=u.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(3*d),this._materialBatches=new Array(3*d),c=0;c<d;++c)this._colorBatches[c]=new f(n,s,void 0,!1,c),this._materialBatches[c]=new m(n,l,void 0,!1,c),this._colorBatches[c+d]=new f(n,s,s,!1,c),this._materialBatches[c+d]=new m(n,l,s,!1,c),this._colorBatches[c+2*d]=new f(n,s,l,!1,c),this._materialBatches[c+2*d]=new m(n,l,l,!1,c);this._dynamicBatch=new h(n,o);var p=a.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(p),c=0;c<p;++c)this._groundBatches[c]=new _(o,c);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new e,this._updaters=new e,this._entityCollection=i,i.collectionChanged.addEventListener(y.prototype._onCollectionChanged,this),this._onCollectionChanged(i,i.values,C)}var C=[];y.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?(g(this,n),v(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),g(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 p(i,this._scene),this._updaters.set(r,n),v(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(y._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,f=h.length;for(t=0;t<f;t++)d=h[t].update(e)&&d;return d};var b=[],S=new t;return y.prototype.getBoundingSphere=function(e,i){for(var r=b,n=S,o=0,a=c.DONE,s=this._batches,l=s.length,u=this._updaters.get(e.id),d=0;d<l;d++){if((a=s[d].getBoundingSphere(u,n))===c.PENDING)return c.PENDING;a===c.DONE&&(r[o]=t.clone(n,r[o]),o++)}return 0===o?c.FAILED:(r.length=o,t.fromBoundingSpheres(r,i),c.DONE)},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(y.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 r=this._subscriptions.values;for(i=r.length,e=0;e<i;e++)r[e]();return this._subscriptions.removeAll(),o(this)},y._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,o=r.id;n(t.get(o))||n(i.get(o))||i.set(o,r)},y.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)},y}),define("DataSources/DataSourceDisplay",["../Core/ApproximateTerrainHeights","../Core/BoundingSphere","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Scene/GroundPolylinePrimitive","../Scene/GroundPrimitive","../Scene/OrderedGroundPrimitiveCollection","../Scene/PrimitiveCollection","./BillboardVisualizer","./BoundingSphereState","./CustomDataSource","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolylineVisualizer"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function b(e){u.initializeTerrainHeights(),l.initializeTerrainHeights();var t=e.scene,i=e.dataSourceCollection;this._eventHelper=new s,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(i.dataSourceMoved,this._onDataSourceMoved,this),this._dataSourceCollection=i,this._scene=t,this._visualizersCallback=r(e.visualizersCallback,b.defaultVisualizersCallback);var n=!1,o=new d,a=new d;i.length>0&&(t.primitives.add(o),t.groundPrimitives.add(a),n=!0),this._primitives=o,this._groundPrimitives=a;for(var c=0,h=i.length;c<h;c++)this._onDataSourceAdded(i,i.get(c));var p=new f;this._onDataSourceAdded(void 0,p),this._defaultDataSource=p;var m,_;if(!n){var g=this,v=function(){t.primitives.add(o),t.groundPrimitives.add(a),m(),_(),g._removeDefaultDataSoureListener=void 0,g._removeDataSourceCollectionListener=void 0};m=p.entities.collectionChanged.addEventListener(v),_=i.dataSourceAdded.addEventListener(v)}this._removeDefaultDataSoureListener=m,this._removeDataSourceCollectionListener=_,this._ready=!1}b.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new h(t,r),new m(e,r,i._primitives,i._groundPrimitives),new _(t,r),new g(e,r),new y(t,r),new v(e,r),new C(e,r,i._primitives,i._groundPrimitives)]},o(b.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}}}),b.prototype.isDestroyed=function(){return!1},b.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._removeDefaultDataSoureListener)?(this._removeDefaultDataSoureListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),a(this)},b.prototype.update=function(t){if(!e.initialized)return this._ready=!1,!1;var i,r,o,a,s=!0,l=this._dataSourceCollection,u=l.length;for(i=0;i<u;i++){var c=l.get(i);for(n(c.update)&&(s=c.update(t)&&s),o=c._visualizers,a=o.length,r=0;r<a;r++)s=o[r].update(t)&&s}for(o=this._defaultDataSource._visualizers,a=o.length,r=0;r<a;r++)s=o[r].update(t)&&s;return this._ready=s,s};var S=[],T=new t;return b.prototype.getBoundingSphere=function(e,i,r){if(!this._ready)return p.PENDING;var o,a,s=this._defaultDataSource;if(!s.entities.contains(e)){s=void 0;var l=this._dataSourceCollection;for(a=l.length,o=0;o<a;o++){var u=l.get(o);if(u.entities.contains(e)){s=u;break}}}if(!n(s))return p.FAILED;var c=S,d=T,h=0,f=p.DONE,m=s._visualizers,_=m.length;for(o=0;o<_;o++){var g=m[o];if(n(g.getBoundingSphere)){if(f=m[o].getBoundingSphere(e,d),!i&&f===p.PENDING)return p.PENDING;f===p.DONE&&(c[h]=t.clone(d,c[h]),h++)}}return 0===h?p.FAILED:(c.length=h,t.fromBoundingSpheres(c,r),p.DONE)},b.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=this._primitives,n=this._groundPrimitives,o=r.add(new d),a=n.add(new c);t._primitives=o,t._groundPrimitives=a;var s=t.clustering;s._initialize(i),o.add(s),t._visualizers=this._visualizersCallback(i,s,t)},b.prototype._onDataSourceRemoved=function(e,t){var i=this._primitives,r=this._groundPrimitives,n=t._primitives,o=t._groundPrimitives,a=t.clustering;n.remove(a);for(var s=t._visualizers,l=s.length,u=0;u<l;u++)s[u].destroy();i.remove(n),r.remove(o),t._visualizers=void 0},b.prototype._onDataSourceMoved=function(e,t,i){var r=this._primitives,n=this._groundPrimitives,o=e._primitives,a=e._groundPrimitives;t===i+1?(r.raise(o),n.raise(a)):t===i-1?(r.lower(o),n.lower(a)):0===t?(r.lowerToBottom(o),n.lowerToBottom(a),r.raise(o),n.raise(a)):(r.raiseToTop(o),n.raiseToTop(a))},b}),define("DataSources/EntityView",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../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,i,n,o,a,c,p){var f=t.scene.mode,x=a.getValue(c,t._lastCartesian);if(r(x)){var P,D,I,M=!1,R=!1;if(f===h.SCENE3D){s.addSeconds(c,.001,A);var O=a.getValue(A,y);if(r(O)||(s.addSeconds(c,-.001,A),O=a.getValue(A,y),R=!0),r(O)){var L,N=d.computeFixedToIcrfMatrix(c,m),F=d.computeFixedToIcrfMatrix(A,_);r(N)&&r(F)?L=u.transpose(N,g):(L=d.computeTemeToPseudoFixedMatrix(c,g),N=u.transpose(L,m),F=d.computeTemeToPseudoFixedMatrix(A,_),u.transpose(F,F));var B=u.multiplyByVector(N,x,T),k=u.multiplyByVector(F,O,E);e.subtract(B,k,S);var z=1e3*e.magnitude(S),V=l.GRAVITATIONALPARAMETER,U=-V/(z*z-2*V/e.magnitude(B));U<0||U>w*p.maximumRadius?(P=C,e.normalize(x,P),e.negate(P,P),I=e.clone(e.UNIT_Z,b),D=e.cross(I,P,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(P,P),e.normalize(D,D),I=e.cross(P,D,b),e.normalize(I,I),M=!0)):e.equalsEpsilon(x,O,l.EPSILON7)||(I=C,e.normalize(B,I),e.normalize(k,k),D=e.cross(I,k,b),R&&(D=e.multiplyByScalar(D,-1,D)),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(P=e.cross(D,I,y),u.multiplyByVector(L,P,P),u.multiplyByVector(L,D,D),u.multiplyByVector(L,I,I),e.normalize(P,P),e.normalize(D,D),e.normalize(I,I),M=!0))}}r(t.boundingSphere)&&(x=t.boundingSphere.center);var G,H,W;o&&(G=e.clone(i.position,S),H=e.clone(i.direction,T),W=e.clone(i.up,E));var q=v;M?(q[0]=P.x,q[1]=P.y,q[2]=P.z,q[3]=0,q[4]=D.x,q[5]=D.y,q[6]=D.z,q[7]=0,q[8]=I.x,q[9]=I.y,q[10]=I.z,q[11]=0,q[12]=x.x,q[13]=x.y,q[14]=x.z,q[15]=0):d.eastNorthUpToFixedFrame(x,p,q),i._setTransform(q),o&&(e.clone(G,i.position),e.clone(H,i.direction),e.clone(W,i.up),e.cross(H,W,i.right))}if(n){var Y=f===h.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;i.lookAtTransform(i.transform,Y)}}function f(t,r,n){this.entity=t,this.scene=r,this.ellipsoid=i(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,b=new e,S=new e,T=new e,E=new e,A=new s,w=1.25;n(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 x=new a,P=new e;return f.prototype.update=function(t,i){var n=this.scene,o=this.ellipsoid,a=n.mode;if(a!==h.MORPHING){var s=this.entity,u=s.position;if(r(u)){var c=s!==this._lastEntity,d=a!==this._mode,m=n.camera,_=c||d,g=!0;if(c){var v=s.viewFrom,y=r(v);if(!y&&r(i)){x.pitch=-l.PI_OVER_FOUR,x.range=0;var C=u.getValue(t,P);if(r(C)){var b=2-1/Math.max(1,e.magnitude(C)/o.maximumRadius);x.pitch*=b}m.viewBoundingSphere(i,x),this.boundingSphere=i,_=!1,g=!1}else y&&r(v.getValue(t,this._offset3D))||e.clone(f._defaultOffset3D,this._offset3D)}else d||this._mode===h.SCENE2D||e.clone(m.position,this._offset3D);this._lastEntity=s,this._mode=a,p(this,m,_,g,u,t,o)}}},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/ArcType","../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Resource","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./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,b,S,T,E,A,w,x){"use strict";function P(e){return t.fromDegrees(e[0],e[1],e[2])}function D(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||-1!==ae.indexOf(r))continue;var n=e[r];o(n)&&(i+="object"==typeof n?"<tr><th>"+r+"</th><td>"+D(n)+"</td></tr>":"<tr><th>"+r+"</th><td>"+n+"</td></tr>")}return i.length>0&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function I(e,t,i){var r;return function(n,a){return o(r)||(r=e(t,i)),r}}function M(e,t){return new y(I(D,e,t),!0)}function R(e,t,i){var n=e.id;if(o(n)&&"Feature"===e.type){for(var a=2,s=n;o(t.getById(s));)s=n+"_"+a,a++;n=s}else n=r();var l=t.getOrCreateEntity(n),u=e.properties;if(o(u)){l.properties=u;var c,d=u.title;if(o(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)}o(c)&&(l.name=u[c])}var m=u.description;null!==m&&(l.description=o(m)?new S(m):i(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 L(e,t,i,r,n){if(null===t.geometry)return void R(t,e._entityCollection,n.describe);if(!o(t.geometry))throw new p("feature.geometry is required.");var a=t.geometry.type,s=le[a];if(!o(s))throw new p("Unknown geometry type: "+a);s(e,t,t.geometry,r,n)}function N(e,t,i,r,n){for(var o=t.features,a=0,s=o.length;a<s;a++)L(e,o[a],void 0,r,n)}function F(e,t,i,r,n){for(var a=i.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,d=le[c];if(!o(d))throw new p("Unknown geometry type: "+c);d(e,t,u,r,n)}}function B(e,t,r,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,d=t.properties;if(o(d)){var h=d["marker-color"];o(h)&&(u=i.fromCssColorString(h)),c=n(oe[d["marker-size"]],c);var p=d["marker-symbol"];o(p)&&(l=p)}var _;_=o(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 v;y.verticalOrigin=new S(m.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=f.CLAMP_TO_GROUND);var C=R(t,e._entityCollection,s.describe);C.billboard=y,C.position=new b(r(a));var T=g(_).then(function(e){y.image=new S(e)}).otherwise(function(){y.image=new S(e._pinBuilder.fromColor(u,c))});e._promises.push(T)}function k(e,t,i,r,n){B(e,t,r,i.coordinates,n)}function z(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)B(e,t,r,o[a],n)}function V(t,r,n,a,s){var l=s.strokeMaterialProperty,u=s.strokeWidthProperty,c=r.properties;if(o(c)){var d=c["stroke-width"];o(d)&&(u=new S(d));var h,p=c.stroke;o(p)&&(h=i.fromCssColorString(p));var f=c["stroke-opacity"];o(f)&&1!==f&&(o(h)||(h=l.color.clone()),h.alpha=f),o(h)&&(l=new C(h))}var m=R(r,t._entityCollection,s.describe),_=new x;m.polyline=_,_.clampToGround=s.clampToGround,_.material=l,_.width=u,_.positions=new S(O(a,n)),_.arcType=e.RHUMB}function U(e,t,i,r,n){V(e,t,r,i.coordinates,n)}function G(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)V(e,t,r,o[a],n)}function H(t,r,n,a,s){if(0!==a.length&&0!==a[0].length){var l=s.strokeMaterialProperty.color,u=s.fillMaterialProperty,c=s.strokeWidthProperty,h=r.properties;if(o(h)){var p=h["stroke-width"];o(p)&&(c=new S(p));var f,m=h.stroke;o(m)&&(f=i.fromCssColorString(m));var _=h["stroke-opacity"];o(_)&&1!==_&&(o(f)||(f=s.strokeMaterialProperty.color.clone()),f.alpha=_),o(f)&&(l=new S(f));var g,v=h.fill;o(v)&&(g=i.fromCssColorString(v),g.alpha=u.color.alpha),_=h["fill-opacity"],o(_)&&_!==u.color.alpha&&(o(g)||(g=u.color.clone()),g.alpha=_),o(g)&&(u=new C(g))}var y=new w;y.outline=new S(!0),y.outlineColor=l,y.outlineWidth=c,y.material=u,y.arcType=e.RHUMB;for(var b=[],T=1,E=a.length;T<E;T++)b.push(new d(O(a[T],n)));var A=a[0];y.hierarchy=new S(new d(O(A,n),b)),A[0].length>2?y.perPositionHeight=new S(!0):s.clampToGround||(y.height=0);R(r,t._entityCollection,s.describe).polygon=y}}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 Y(e,t,i,r,n){for(var o in i.objects)if(i.objects.hasOwnProperty(o)){var a=_.feature(i,i.objects[o]),s=se[a.type];s(e,a,a,r,n)}}function j(e){this._name=e,this._changed=new l,this._error=new l,this._isLoading=!1,this._loading=new l,this._entityCollection=new A(this),this._promises=[],this._pinBuilder=new c,this._entityCluster=new E}function X(e,t,i,r){var n;o(r)&&(n=u(r)),o(n)&&e._name!==n&&(e._name=n,e._changed.raiseEvent(e));var a=se[t.type];if(!o(a))throw new p("Unsupported GeoJSON object type: "+t.type);var s=t.crs,l=null!==s?P:null;if(o(s)){if(!o(s.properties))throw new p("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(l=K[c.name],!o(l))throw new p("Unknown crs name: "+c.name)}else if("link"===s.type){var d=Z[c.href];if(o(d)||(d=J[c.type]),!o(d))throw new p("Unable to resolve crs link: "+JSON.stringify(c));l=d(c)}else{if("EPSG"!==s.type)throw new p("Unknown crs type: "+s.type);if(l=K["EPSG:"+c.code],!o(l))throw new p("Unknown crs EPSG code: "+c.code)}}return g(l,function(r){return e._entityCollection.removeAll(),null!==r&&a(e,t,t,r,i),g.all(e._promises,function(){return e._promises.length=0,T.setLoading(e,!1),e})})}var Q,K={"urn:ogc:def:crs:OGC:1.3:CRS84":P,"EPSG:4326":P,"urn:ogc:def:crs:EPSG::4326":P},Z={},J={},$=48,ee=i.ROYALBLUE,te=i.YELLOW,ie=2,re=i.fromBytes(255,255,0,100),ne=!1,oe={small:24,medium:48,large:64},ae=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],se={Feature:L,FeatureCollection:N,GeometryCollection:F,LineString:U,MultiLineString:G,MultiPoint:z,MultiPolygon:q,Point:k,Polygon:W,Topology:Y},le={GeometryCollection:F,LineString:U,MultiLineString:G,MultiPoint:z,MultiPolygon:q,Point:k,Polygon:W,Topology:Y};return j.load=function(e,t){return(new j).load(e,t)},a(j,{markerSize:{get:function(){return $},set:function(e){$=e}},markerSymbol:{get:function(){return Q},set:function(e){Q=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e}},strokeWidth:{get:function(){return ie},set:function(e){ie=e}},fill:{get:function(){return re},set:function(e){re=e}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return K}},crsLinkHrefs:{get:function(){return Z}},crsLinkTypes:{get:function(){return J}}}),a(j.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},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}}}),j.prototype.load=function(e,t){T.setLoading(this,!0);var i=e;t=n(t,n.EMPTY_OBJECT);var r=t.sourceUri;("string"==typeof e||e instanceof h)&&(e=h.createIfNeeded(e),i=e.fetchJson(),r=n(r,e.getUrlComponent())),t={describe:n(t.describe,M),markerSize:n(t.markerSize,$),markerSymbol:n(t.markerSymbol,Q),markerColor:n(t.markerColor,ee),strokeWidthProperty:new S(n(t.strokeWidth,ie)),strokeMaterialProperty:new C(n(t.stroke,te)),fillMaterialProperty:new C(n(t.fill,re)),clampToGround:n(t.clampToGround,ne)};var o=this;return g(i,function(e){return X(o,e,t,r)}).otherwise(function(e){return T.setLoading(o,!1),o._error.raiseEvent(o,e),console.log(e),g.reject(e)})},j}),define("DataSources/KmlCamera",[],function(){"use strict";function e(e,t){this.position=e,this.headingPitchRoll=t}return e}),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(!1!==i&&"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;return this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i?i:!1===i?t.getMatchedText():i instanceof e.HtmlTag?i.toAnchorString():this.getTagBuilder().build(t).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){return new e(i).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){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var i=this.getAttrs();return e.Util.assign(i,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);i=s.shift();)-1===o(a,i)&&a.push(i);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);a.length&&(i=s.shift());){var l=o(a,i);-1!==l&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",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){return new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())})},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var 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){if(")"===e.charAt(e.length-1)){var t=e.match(/\(/g),i=e.match(/\)/g);if((t&&t.length||0)<(i&&i.length||0))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)||-1!==e.indexOf("."))},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(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),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:V});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:V}),e()}function i(e,t){n=new Blob([n,P?e:e.buffer],{type:V}),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*B,p<n?t.readUint8Array(r+p,Math.min(B,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*B,d<n?t.readUint8Array(r+d,Math.min(B,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+z),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*B;r<n?e.readUint8Array(i+r,Math.min(B,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 b(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 T(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(I):((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(M):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function E(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,N)}function d(){s(t,L)}var h,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);if(1347093252!=l.view.getUint32(0))return void t(D);T(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,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){if(e.size<22)return void t(D);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);T(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=b(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=b(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 A(e){return unescape(encodeURIComponent(e))}function w(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function x(e,t,i){function r(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){r(t,O)}function a(){r(t,N)}var s,l={},u=[],c=0;return{add:function(d,h,p,f,m){function _(t){var r;T=m.lastModDate||new Date,b=o(26),l[d]={headerArray:b.array,directory:m.directory,filename:S,offset:c,comment:w(A(m.comment||""))},b.view.setUint32(0,335546376),m.version&&b.view.setUint8(0,m.version),i||0===m.level||m.directory||b.view.setUint16(4,2048),b.view.setUint16(6,(T.getHours()<<6|T.getMinutes())<<5|T.getSeconds()/2,!0),b.view.setUint16(8,(T.getFullYear()-1980<<4|T.getMonth()+1)<<5|T.getDate(),!0),b.view.setUint16(22,S.length,!0),r=o(30+S.length),r.view.setUint32(0,1347093252),r.array.set(b.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),void 0!==i&&(b.view.setUint32(10,i,!0),a.view.setUint32(4,i,!0)),h&&(a.view.setUint32(8,t,!0),b.view.setUint32(14,t,!0),a.view.setUint32(12,h.size,!0),b.view.setUint32(18,h.size,!0)),e.writeUint8Array(a.array,function(){c+=16,r(p)},n)}function C(){if(m=m||{},d=d.trim(),m.directory&&"/"!=d.charAt(d.length-1)&&(d+="/"),l.hasOwnProperty(d))return void t(F);S=w(A(d)),u.push(d),_(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 b,S,T;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.",I="File contains encrypted entry.",M="File is using Zip64 (4gb+ file size).",R="Error while reading zip file.",O="Error while writing zip file.",L="Error while writing file data.",N="Error while reading file data.",F="File already exists.",B=524288,k="inflate.js",z="deflate.js",V="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(E(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(x(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return void 0===G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),define("DataSources/KmlLookAt",[],function(){"use strict";function e(e,t){this.position=e,this.headingPitchRange=t}return e}),define("DataSources/KmlTour",["../Core/defined","../Core/Event"],function(e,t){"use strict";function i(e,i){this.id=i,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new t,this.tourEnd=new t,this.entryStart=new t,this.entryEnd=new t,this._activeEntries=[]}function r(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function n(t,i,r){var n=this.playlist[this.playlistIndex];if(n){var a=o.bind(this,t,i,r);if(this._activeEntries.push(n),this.entryStart.raiseEvent(n),n.blocking)n.play(a,t.scene.camera,i);else{var s=this;n.play(function(){s.entryEnd.raiseEvent(n);var e=s._activeEntries.indexOf(n);e>=0&&s._activeEntries.splice(e,1)}),a(t,i,r)}}else e(r)&&r(!1)}function o(e,t,i,r){var o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,r),r)i(r);else{var a=this._activeEntries.indexOf(o);a>=0&&this._activeEntries.splice(a,1),this.playlistIndex++,n.call(this,e,t,i)}}return i.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},i.prototype.play=function(e,t){this.tourStart.raiseEvent();var i=this;n.call(this,e,t,function(e){i.playlistIndex=0,e||r(i._activeEntries),i.tourEnd.raiseEvent(e)})},i.prototype.stop=function(){r(this._activeEntries)},i}),define("DataSources/KmlTourFlyTo",["../Core/BoundingSphere","../Core/combine","../Core/defined","../Core/EasingFunction"],function(e,t,i,r){"use strict";function n(e,t,i){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=i,this.flyToMode=t}return n.prototype.play=function(t,r,n){if(this.activeCamera=r,i(t)&&null!==t){var o=this;this.activeCallback=function(e){delete o.activeCallback,delete o.activeCamera,t(!i(e)&&e)}}var a=this.getCameraOptions(n);if(this.view.headingPitchRoll)r.flyTo(a);else if(this.view.headingPitchRange){var s=new e(this.view.position);r.flyToBoundingSphere(s,a)}},n.prototype.stop=function(){i(this.activeCamera)&&this.activeCamera.cancelFlight(),i(this.activeCallback)&&this.activeCallback(!0)},n.prototype.getCameraOptions=function(e){var n={duration:this.duration};return i(this.activeCallback)&&(n.complete=this.activeCallback),"smooth"===this.flyToMode&&(n.easingFunction=r.LINEAR_NONE),this.view.headingPitchRoll?(n.destination=this.view.position,n.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(n.offset=this.view.headingPitchRange),i(e)&&(n=t(n,e)),n},n}),define("DataSources/KmlTourWait",["../Core/defined"],function(e){"use strict";function t(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}return t.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},t.prototype.stop=function(){clearTimeout(this.timeout),e(this.activeCallback)&&this.activeCallback(!0)},t}),define("DataSources/KmlDataSource",["../Core/ArcType","../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/getExtensionFromUri","../Core/getFilenameFromUri","../Core/HeadingPitchRange","../Core/HeadingPitchRoll","../Core/Iso8601","../Core/JulianDate","../Core/Math","../Core/NearFarScalar","../Core/objectToQuery","../Core/oneTimeWarning","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/queryToObject","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./KmlCamera","./KmlLookAt","./KmlTour","./KmlTourFlyTo","./KmlTourWait","./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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce){"use strict";function de(e){var t=e.slice(0,Math.min(4,e.size)),i=V.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 he(e){var t=V.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 pe(e){var t,i,r,n,o={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(var a in o)o.hasOwnProperty(a)&&(r=RegExp("[< ]"+a+":"),n="xmlns:"+a+"=",r.test(e)&&-1===e.indexOf(n)&&(d(t)||(t=e.substr(0,e.indexOf("<kml")+4),i=e.substr(t.length)),t+=" "+n+'"'+o[a]+'"'));return d(t)&&(e=t+i),e}function fe(e){for(var t,i,r,n=e.indexOf("xmlns:"),o=e.indexOf(">",n);-1!==n&&n<o;)t=e.slice(n,e.indexOf('"',n)),i=n,n=e.indexOf(t,n+1),-1!==n?(r=e.indexOf('"',e.indexOf('"',n)+1),e=e.slice(0,n-1)+e.slice(r+1,e.length),n=e.indexOf("xmlns:",i-1)):n=e.indexOf("xmlns:",i+1);return e}function me(e,t,i){e.getData(new U.TextWriter,function(e){e=pe(e),e=fe(e),t.kml=Mt.parseFromString(e,"application/xml"),i.resolve()})}function _e(e,t,i){var r=c(It.detectFromFilename(e.filename),"application/octet-stream");e.getData(new U.Data64URIWriter(r),function(r){t[e.filename]=r,i.resolve()})}function ge(e,t,i,r){for(var n=r.keys,o=new z("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(i),c=new z(u).resolve(o).toString(),d=n.indexOf(c);if(-1!==d){var h=n[d];l.setAttribute(i,r[h]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",h)}}}function ve(e,t,i,r){for(var n=e.querySelectorAll(t),o=0;o<n.length;o++){var a=n[o],s=a.getAttribute(i),l=Me(s,r);a.setAttribute(i,l.url)}}function ye(e,t,i){var r=Ee(e,"id");r=d(r)&&0!==r.length?r:u(),d(i)&&(r=i+r);var n=t.getById(r);return d(n)&&(r=u(),d(i)&&(r=i+r)),n=t.add(new Y({id:r})),d(n.kml)||(n.addProperty("kml"),n.kml=new Dt),n}function Ce(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function be(e,t){if(!d(e))return n.fromDegrees(0,0,0,t);var i=e.match(/[^\s,\n]+/g);if(!d(i))return n.fromDegrees(0,0,0,t);var r=parseFloat(i[0]),o=parseFloat(i[1]),a=parseFloat(i[2]);return r=isNaN(r)?0:r,o=isNaN(o)?0:o,a=isNaN(a)?0:a,n.fromDegrees(r,o,a,t)}function Se(e,t){if(d(e)){var i=e.textContent.match(/[^\s\n]+/g);if(d(i)){for(var r=i.length,n=new Array(r),o=0,a=0;a<r;a++)n[o++]=be(i[a],t);return n}}}function Te(e,t){if(d(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function Ee(e,t){if(d(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function Ae(e,t,i){if(d(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function we(e,t,i){if(d(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function xe(e,t,i){if(!d(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function Pe(e,t,i){var r=Ae(e,t,i);if(d(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function De(e,t,i){var r=Ae(e,t,i);if(d(r))return r.textContent.trim()}function Ie(e,t,i){var r=Ae(e,t,i);if(d(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Me(e,t,i){if(d(e)){var r;if(d(i)){var n=i[e];if(d(n))r=new I({url:n});else{var o=new z(t.getUrlComponent());n=i[new z(e).resolve(o)],d(n)&&(r=new I({url:n}))}}return d(r)||(r=t.getDerivedResource({url:e})),r}}function Re(e,t){if(d(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?(Gt.maximumRed=o,Gt.red=void 0):(Gt.maximumRed=void 0,Gt.red=0),n>0?(Gt.maximumGreen=n,Gt.green=void 0):(Gt.maximumGreen=void 0,Gt.green=0),r>0?(Gt.maximumBlue=r,Gt.blue=void 0):(Gt.maximumBlue=void 0,Gt.blue=0),Gt.alpha=i,l.fromRandom(Gt)):new l(o,n,r,i)}}function Oe(e,t,i){var r=De(e,t,i);if(d(r))return Re(r,"random"===De(e,"colorMode",i))}function Le(e){var t=Ae(e,"TimeStamp",Ut.kmlgx),i=De(t,"when",Ut.kmlgx);if(d(t)&&d(i)&&0!==i.length){var r=b.fromIso8601(i),n=new O;return n.addInterval(new R({start:r,stop:C.MAXIMUM_VALUE})),n}}function Ne(e){var t=Ae(e,"TimeSpan",Ut.kmlgx);if(d(t)){var i,r=Ae(t,"begin",Ut.kmlgx),n=d(r)?b.fromIso8601(r.textContent):void 0,o=Ae(t,"end",Ut.kmlgx),a=d(o)?b.fromIso8601(o.textContent):void 0;if(d(n)&&d(a)){if(b.lessThan(a,n)){var s=n;n=a,a=s}i=new O,i.addInterval(new R({start:n,stop:a}))}else d(n)?(i=new O,i.addInterval(new R({start:n,stop:C.MAXIMUM_VALUE}))):d(a)&&(i=new O,i.addInterval(new R({start:C.MINIMUM_VALUE,stop:a})));return i}}function Fe(){var e=new G;return e.width=Ot,e.height=Ot,e.scaleByDistance=new T(Lt,Nt,Ft,Bt),e.pixelOffsetScaleByDistance=new T(Lt,Nt,Ft,Bt),e}function Be(){var e=new ie;return e.outline=!0,e.outlineColor=l.WHITE,e}function ke(){var e=new ee;return e.translucencyByDistance=new T(3e6,1,5e6,0),e.pixelOffset=new r(17,0),e.horizontalOrigin=N.LEFT,e.font="16px sans-serif",e.style=F.FILL_AND_OUTLINE,e}function ze(e,t,i,r,n){var o=De(e,"href",Ut.kml);if(d(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=c(Pe(e,"x",Ut.gx),0),l=c(Pe(e,"y",Ut.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+(8*l+s)+".png"}var u=Me(o,i,r);if(n){var h=De(e,"refreshMode",Ut.kml),p=De(e,"viewRefreshMode",Ut.kml);"onInterval"===h||"onExpire"===h?A("kml-refreshMode-"+h,"KML - Unsupported Icon refreshMode: "+h):"onStop"!==p&&"onRegion"!==p||A("kml-refreshMode-"+p,"KML - Unsupported Icon viewRefreshMode: "+p);var f=c(De(e,"viewBoundScale",Ut.kml),1),m="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=c(De(e,"viewFormat",Ut.kml),m),g=De(e,"httpQuery",Ut.kml);d(_)&&u.setQueryParameters(P(yt(_))),d(g)&&u.setQueryParameters(P(yt(g)));var v=t._ellipsoid;return Ct(u,t._camera,t._canvas,f,t._lastCameraView.bbox,v),u}return u}}function Ve(e,t,o,a,s){var l=Pe(t,"scale",Ut.kml),u=Pe(t,"heading",Ut.kml),h=Oe(t,"color",Ut.kml),p=Ae(t,"Icon",Ut.kml),f=ze(p,e,a,s,!1);d(p)&&!d(f)&&(f=!1);var m=Pe(p,"x",Ut.gx),_=Pe(p,"y",Ut.gx),g=Pe(p,"w",Ut.gx),v=Pe(p,"h",Ut.gx),y=Ae(t,"hotSpot",Ut.kml),C=Te(y,"x"),b=Te(y,"y"),T=Ee(y,"xunits"),E=Ee(y,"yunits"),A=o.billboard;d(A)||(A=Fe(),o.billboard=A),A.image=f,A.scale=l,A.color=h,(d(m)||d(_)||d(g)||d(v))&&(A.imageSubRegion=new i(m,_,g,v)),d(u)&&0!==u&&(A.rotation=S.toRadians(-u),A.alignedAxis=n.UNIT_Z),l=c(l,1);var w,x;d(C)&&("pixels"===T?w=-C*l:"insetPixels"===T?w=(C-Ot)*l:"fraction"===T&&(w=-C*Ot*l),w+=.5*Ot*l),d(b)&&("pixels"===E?x=b*l:"insetPixels"===E?x=(-b+Ot)*l:"fraction"===E&&(x=b*Ot*l),x-=.5*Ot*l),(d(w)||d(x))&&(A.pixelOffset=new r(w,x))}function Ue(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o<a;o++){var s=t.childNodes.item(o);if("IconStyle"===s.localName)Ve(e,s,i,r,n);else if("LabelStyle"===s.localName){var u=i.label;d(u)||(u=ke(),i.label=u),u.scale=c(Pe(s,"scale",Ut.kml),u.scale),u.fillColor=c(Oe(s,"color",Ut.kml),u.fillColor),u.text=i.name}else if("LineStyle"===s.localName){var h=i.polyline;d(h)||(h=new re,i.polyline=h),h.width=Pe(s,"width",Ut.kml),h.material=Oe(s,"color",Ut.kml),d(Oe(s,"outerColor",Ut.gx))&&A("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),d(Pe(s,"outerWidth",Ut.gx))&&A("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),d(Pe(s,"physicalWidth",Ut.gx))&&A("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),d(Ie(s,"labelVisibility",Ut.gx))&&A("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===s.localName){var p=i.polygon;d(p)||(p=Be(),i.polygon=p),p.material=c(Oe(s,"color",Ut.kml),p.material),p.fill=c(Ie(s,"fill",Ut.kml),p.fill),p.outline=c(Ie(s,"outline",Ut.kml),p.outline)}else if("BalloonStyle"===s.localName){var f=c(Re(De(s,"bgColor",Ut.kml)),l.WHITE),m=c(Re(De(s,"textColor",Ut.kml)),l.BLACK),_=De(s,"text",Ut.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:f,textColor:m,text:_}}else if("ListStyle"===s.localName){var g=De(s,"listItemType",Ut.kml);"radioFolder"!==g&&"checkOffOnly"!==g||A("kml-listStyle-"+g,"KML - Unsupported ListStyle with listItemType: "+g)}}}function Ge(e,t,i,r,n){for(var o,a=new Y,s=-1,l=t.childNodes,u=l.length,c=0;c<u;c++){var h=l[c];"Style"!==h.localName&&"StyleMap"!==h.localName||(s=c)}if(-1!==s){var p=l[s];if("Style"===p.localName)Ue(e,p,a,r,n);else for(var f=xe(p,"Pair",Ut.kml),m=0;m<f.length;m++){var _=f[m],g=De(_,"key",Ut.kml);if("normal"===g){var v=De(_,"styleUrl",Ut.kml);if(d(v))o=i.getById(v),d(o)||(o=i.getById("#"+v)),d(o)&&a.merge(o);else{var y=Ae(_,"Style",Ut.kml);Ue(e,y,a,r,n)}}else A("kml-styleMap-"+g,"KML - Unsupported StyleMap key: "+g)}}var C=De(t,"styleUrl",Ut.kml);if(d(C)){var b=C;if("#"!==C[0]&&-1!==C.indexOf("#")){var S=C.split("#"),T=S[0];b=r.getDerivedResource({url:T}).getUrlComponent()+"#"+S[1]}o=i.getById(b),d(o)||(o=i.getById("#"+b)),d(o)&&a.merge(o)}return a}function He(e,t,i){return t.fetchXML().then(function(r){return We(e,r,i,t,!0)})}function We(e,t,i,r,n,o){var a,s,l,u,c=we(t,"Style",Ut.kml);if(d(c)){var h=c.length;for(a=0;a<h;a++)u=c[a],s=Ee(u,"id"),d(s)&&(s="#"+s,n&&d(r)&&(s=r.getUrlComponent()+s),d(i.getById(s))||(l=new Y({id:s}),i.add(l),Ue(e,u,l,r,o)))}var p=we(t,"StyleMap",Ut.kml);if(d(p)){var f=p.length;for(a=0;a<f;a++){var m=p[a];if(s=Ee(m,"id"),d(s))for(var _=xe(m,"Pair",Ut.kml),g=0;g<_.length;g++){var v=_[g],y=De(v,"key",Ut.kml);if("normal"===y){if(s="#"+s,n&&d(r)&&(s=r.getUrlComponent()+s),!d(i.getById(s))){l=i.getOrCreateEntity(s);var C=De(v,"styleUrl",Ut.kml);if(d(C)){"#"!==C[0]&&(C="#"+C),n&&d(r)&&(C=r.getUrlComponent()+C);var b=i.getById(C);d(b)&&l.merge(b)}else u=Ae(v,"Style",Ut.kml),Ue(e,u,l,r,o)}}else A("kml-styleMap-"+y,"KML - Unsupported StyleMap key: "+y)}}}var S=[],T=t.getElementsByTagName("styleUrl"),E=T.length;for(a=0;a<E;a++){var w=T[a].textContent;if("#"!==w[0]){var x=w.split("#");if(2===x.length){var P=x[0],D=r.getDerivedResource({url:P});S.push(He(e,D,i))}}}return S}function qe(e,t,i){var r=new ae(e,t.id,["position"]),n=new le(t.position);t.polyline=d(i.polyline)?i.polyline.clone():new re,t.polyline.positions=new ne([r,n])}function Ye(e,t){return!d(e)&&!d(t)||"clampToGround"===e?L.CLAMP_TO_GROUND:"relativeToGround"===e?L.RELATIVE_TO_GROUND:"absolute"===e?L.NONE:"clampToSeaFloor"===t?(A("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),L.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(A("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),L.RELATIVE_TO_GROUND):(d(e)?A("kml-altitudeMode-unknown","KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):A("kml-gx:altitudeMode-unknown","KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),L.CLAMP_TO_GROUND)}function je(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((d(t)&&"clampToGround"!==t||d(i)&&"clampToSeaFloor"!==i)&&A("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+c(t,i)),new le(e))}function Xe(e,t,i,r){if(d(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(d(t)&&"clampToGround"!==t||d(i)&&"clampToSeaFloor"!==i)&&A("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+c(t,i));for(var n=e.length,o=0;o<n;o++){var a=e[o];r.scaleToGeodeticSurface(a,a)}return e}}function Qe(e,t,i,n){var o=t.label;d(o)||(o=d(i.label)?i.label.clone():ke(),t.label=o),o.text=t.name;var a=t.billboard;d(a)||(a=d(i.billboard)?i.billboard.clone():Fe(),t.billboard=a),d(a.image)?a.image.getValue()||(a.image=void 0):a.image=e._pinBuilder.fromColor(l.YELLOW,64);var s=1;d(a.scale)&&(s=a.scale.getValue(),0!==s?o.pixelOffset=new r(16*s+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),d(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Ke(e,t){var i=e.path;d(i)||(i=new te,i.leadTime=0,e.path=i);var r=t.polyline;d(r)&&(i.material=r.material,i.width=r.width)}function Ze(e,t,i,r,n){var o=De(i,"coordinates",Ut.kml),a=De(i,"altitudeMode",Ut.kml),s=De(i,"altitudeMode",Ut.gx),l=Ie(i,"extrude",Ut.kml),u=e._ellipsoid,c=be(o,u);return r.position=c,Qe(e,r,n,Ye(a,s)),l&&Ce(a,s)&&qe(t,r,n),!0}function Je(t,i,r,n,o){var a=Ae(r,"coordinates",Ut.kml),s=De(r,"altitudeMode",Ut.kml),u=De(r,"altitudeMode",Ut.gx),h=Ie(r,"extrude",Ut.kml),p=Ie(r,"tessellate",Ut.kml),f=Ce(s,u),m=Pe(r,"drawOrder",Ut.gx),_=t._ellipsoid,g=Se(a,_),v=o.polyline;if(f&&h){var y=new ce;n.wall=y,y.positions=g;var b=o.polygon;d(b)&&(y.fill=b.fill,y.material=b.material),y.outline=!0,d(v)?(y.outlineColor=d(v.material)?v.material.color:l.WHITE,y.outlineWidth=v.width):d(b)&&(y.outlineColor=d(b.material)?b.material.color:l.WHITE)}else if(t._clampToGround&&!f&&p){var S=new re;S.clampToGround=!0,n.polyline=S,S.positions=g,d(v)?(S.material=d(v.material)?v.material.color.getValue(C.MINIMUM_VALUE):l.WHITE,S.width=c(v.width,1)):(S.material=l.WHITE,S.width=1),S.zIndex=m}else d(m)&&A("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),v=d(v)?v.clone():new re,n.polyline=v,v.positions=Xe(g,s,u,_),p&&!f||(v.arcType=e.NONE);return!0}function $e(e,t,i,r,n){var o=Ae(i,"outerBoundaryIs",Ut.kml),a=Ae(o,"LinearRing",Ut.kml),s=Ae(a,"coordinates",Ut.kml),u=e._ellipsoid,c=Se(s,u),h=Ie(i,"extrude",Ut.kml),p=De(i,"altitudeMode",Ut.kml),f=De(i,"altitudeMode",Ut.gx),m=Ce(p,f),_=d(n.polygon)?n.polygon.clone():Be(),g=n.polyline;if(d(g)&&(_.outlineColor=d(g.material)?g.material.color:l.WHITE,_.outlineWidth=g.width),r.polygon=_,m?(_.perPositionHeight=!0,_.extrudedHeight=h?0:void 0):e._clampToGround||(_.height=0),d(c)){for(var v=new x(c),y=xe(i,"innerBoundaryIs",Ut.kml),C=0;C<y.length;C++){a=xe(y[C],"LinearRing",Ut.kml);for(var b=0;b<a.length;b++)s=Ae(a[b],"coordinates",Ut.kml),c=Se(s,u),d(c)&&v.holes.push(new x(c))}_.hierarchy=v}return!0}function et(e,t,i,r,n){var o=De(i,"altitudeMode",Ut.kml),a=De(i,"altitudeMode",Ut.gx),s=xe(i,"coord",Ut.gx),l=xe(i,"angles",Ut.gx),u=xe(i,"when",Ut.kml),c=Ie(i,"extrude",Ut.kml),d=Ce(o,a),h=e._ellipsoid;l.length>0&&A("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");for(var p=Math.min(s.length,u.length),f=[],m=[],_=0;_<p;_++){var g=be(s[_].textContent,h);f.push(g),m.push(b.fromIso8601(u[_].textContent))}var v=new se;return v.addSamples(m,f),r.position=v,Qe(e,r,n,Ye(o,a)),Ke(r,n),r.availability=new O,u.length>0&&r.availability.addInterval(new R({start:m[0],stop:m[m.length-1]})),d&&c&&qe(t,r,n),!0}function tt(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],d=new se;d.addSamples(e,t),i.intervals.addInterval(new R({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:je(d,a,s)})),r.addInterval(new R({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new R({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function it(e,t,i,r,n){for(var o,a,s,l=Ie(i,"interpolate",Ut.gx),u=xe(i,"Track",Ut.gx),c=!1,h=new ue,p=new O,f=new H,m=e._ellipsoid,_=0,g=u.length;_<g;_++){var v=u[_],y=xe(v,"when",Ut.kml),C=xe(v,"coord",Ut.gx),S=De(v,"altitudeMode",Ut.kml),T=De(v,"altitudeMode",Ut.gx),E=Ce(S,T),A=Ie(v,"extrude",Ut.kml),w=Math.min(C.length,y.length),x=[];o=[];for(var P=0;P<w;P++){var D=be(C[P].textContent,m);x.push(D),o.push(b.fromIso8601(y[P].textContent))}l&&(d(a)&&tt([a,o[0]],[s,x[0]],f,p,h,!1,"absolute",void 0,!1),a=o[w-1],s=x[x.length-1]),tt(o,x,f,p,h,E&&A,S,T,!0),c=c||E&&A}return r.availability=p,r.position=f,Qe(e,r,n),Ke(r,n),c&&(qe(t,r,n),r.polyline.show=h),!0}function rt(e,t,i,r,n,o){for(var a=i.childNodes,s=!1,l=0,u=a.length;l<u;l++){var c=a.item(l),h=Ht[c.localName];if(d(h)){var p=ye(c,t,o);p.parent=r,p.name=r.name,p.availability=r.availability,p.description=r.description,p.kml=r.kml,h(e,t,c,p,n)&&(s=!0)}}return s}function nt(e,t,i,r,n){return A("kml-unsupportedGeometry","KML - Unsupported geometry: "+i.localName),!1}function ot(e,t){var i=Ae(e,"ExtendedData",Ut.kml);if(d(i)){d(Ae(i,"SchemaData",Ut.kml))&&A("kml-schemaData","KML - SchemaData is unsupported"),d(Ee(i,"xmlns:prefix"))&&A("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");var r={},n=xe(i,"Data",Ut.kml);if(d(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=Ee(s,"name");d(l)&&(r[l]={displayName:De(s,"displayName",Ut.kml),value:De(s,"value",Ut.kml)})}t.kml.extendedData=r}}function at(e,t,i,r,n){var o,a,s,u=t.kml,h=u.extendedData,p=De(e,"description",Ut.kml),f=c(t.balloonStyle,i.balloonStyle),m=l.WHITE,_=l.BLACK,g=p;d(f)&&(m=c(f.bgColor,l.WHITE),_=c(f.textColor,l.BLACK),g=c(f.text,p));var v;if(d(g)){if(g=g.replace("$[name]",c(t.name,"")),g=g.replace("$[description]",c(p,"")),g=g.replace("$[address]",c(u.address,"")),g=g.replace("$[Snippet]",c(u.snippet,"")),g=g.replace("$[id]",t.id),g=g.replace("$[geDirections]",""),d(h)){var y=g.match(/\$\[.+?\]/g);if(null!==y)for(o=0;o<y.length;o++){var C=y[o],b=C.substr(2,C.length-3),S=/\/displayName$/.test(b);b=b.replace(/\/displayName$/,""),v=h[b],d(v)&&(v=S?v.displayName:v.value),d(v)&&(g=g.replace(C,c(v,"")))}}}else if(d(h)&&(s=Object.keys(h),s.length>0)){for(g='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<s.length;o++)a=s[o],v=h[a],g+="<tr><th>"+c(v.displayName,a)+"</th><td>"+c(v.value,"")+"</td></tr>";g+="</tbody></table>"}if(d(g)){g=Rt.link(g),Wt.innerHTML=g;var T=Wt.querySelectorAll("a");for(o=0;o<T.length;o++)T[o].setAttribute("target","_blank");d(r)&&r.keys.length>1&&(ge(Wt,"a","href",r),ge(Wt,"img","src",r)),ve(Wt,"a","href",n),ve(Wt,"img","src",n);var E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+="background-color:"+m.toCssColorString()+";",E+="color:"+_.toCssColorString()+";",E+='">',E+=Wt.innerHTML+"</div>",Wt.innerHTML="",t.description=E}}function st(e,t,i,r,n,o,a,s,l){function u(e){return!e||e.show&&u(e.parent)}var h=ye(i,r,l),p=h.kml,f=Ge(e,i,n,o,a),m=De(i,"name",Ut.kml);h.name=m,h.parent=t;var _=Ne(i);d(_)||(_=Le(i)),h.availability=_,xt(h);var g=Ie(i,"visibility",Ut.kml);h.show=u(t)&&c(g,!0);var v=Ae(i,"author",Ut.atom),y=p.author;y.name=De(v,"name",Ut.atom),y.uri=De(v,"uri",Ut.atom),y.email=De(v,"email",Ut.atom);var C=Ae(i,"link",Ut.atom),b=p.link;b.href=Ee(C,"href"),b.hreflang=Ee(C,"hreflang"),b.rel=Ee(C,"rel"),b.type=Ee(C,"type"),b.title=Ee(C,"title"),b.length=Ee(C,"length"),p.address=De(i,"address",Ut.kml),p.phoneNumber=De(i,"phoneNumber",Ut.kml),p.snippet=De(i,"Snippet",Ut.kml),ot(i,h),at(i,h,f,a,o);var S=e._ellipsoid;return _t(i,h,S),mt(i,h,S),d(Ae(i,"Region",Ut.kml))&&A("kml-region","KML - Placemark Regions are unsupported"),{entity:h,styleEntity:f}}function lt(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(qt),c=u.length,d=0;d<c;d++)for(var h=u[d],p=qt[h],f=i.childNodes,m=f.length,_=0;_<m;_++){var g=f[_];g.localName!==h||-1===Ut.kml.indexOf(g.namespaceURI)&&-1===Ut.gx.indexOf(g.namespaceURI)||p(e,t,g,r,n,o,a,s,l)}}function ut(e,t,i,r,n,o,a,s,l){lt(e,st(e,t,i,r,n,o,a,s,l).entity,i,r,n,o,a,s,l)}function ct(e,t,i,r,n,o,a,s,l){for(var u=st(e,t,i,r,n,o,a,s,l),c=u.entity,h=u.styleEntity,p=!1,f=i.childNodes,m=0,_=f.length;m<_&&!p;m++){var g=f.item(m),v=Ht[g.localName];d(v)&&(v(e,r,g,c,h,c.id),p=!0)}p||(c.merge(h),Qe(e,c,h))}function dt(e,t,i,r,n,o,a,s,l){var u=De(i,"name",Ut.kml),c=Ee(i,"id"),h=new Z(u,c),p=Ae(i,"Playlist",Ut.gx);if(p)for(var f=e._ellipsoid,m=p.childNodes,_=0;_<m.length;_++){var g=m[_];if(g.localName){var v=Yt[g.localName];v?v(h,g,f):console.log("Unknown KML Tour playlist entry type "+g.localName)}}d(e.kmlTours)||(e.kmlTours=[]),e.kmlTours.push(h)}function ht(e,t){A("KML Tour unsupported node "+t.localName)}function pt(e,t){var i=Pe(t,"duration",Ut.gx);e.addPlaylistEntry(new $(i))}function ft(e,t,i){var r=Pe(t,"duration",Ut.gx),n=De(t,"flyToMode",Ut.gx),o={kml:{}};_t(t,o,i),mt(t,o,i);var a=o.kml.lookAt||o.kml.camera,s=new J(r,n,a);e.addPlaylistEntry(s)}function mt(e,t,i){var r=Ae(e,"Camera",Ut.kml);if(d(r)){var o=c(Pe(r,"longitude",Ut.kml),0),a=c(Pe(r,"latitude",Ut.kml),0),s=c(Pe(r,"altitude",Ut.kml),0),l=c(Pe(r,"heading",Ut.kml),0),u=c(Pe(r,"tilt",Ut.kml),0),h=c(Pe(r,"roll",Ut.kml),0),p=n.fromDegrees(o,a,s,i),f=y.fromDegrees(l,u-90,h);t.kml.camera=new Q(p,f)}}function _t(e,t,i){var r=Ae(e,"LookAt",Ut.kml);if(d(r)){var o=c(Pe(r,"longitude",Ut.kml),0),a=c(Pe(r,"latitude",Ut.kml),0),s=c(Pe(r,"altitude",Ut.kml),0),l=Pe(r,"heading",Ut.kml),u=Pe(r,"tilt",Ut.kml),h=c(Pe(r,"range",Ut.kml),0);u=S.toRadians(c(u,0)),l=S.toRadians(c(l,0));var p=new v(l,u-S.PI_OVER_TWO,h),f=n.fromDegrees(o,a,s,i);t.kml.lookAt=new K(f,p)}}function gt(e,t,i,r,n,o,a,s,l){var u,c=st(e,t,i,r,n,o,a,s,l),h=c.entity,p=!1,f=e._ellipsoid,m=Se(Ae(i,"LatLonQuad",Ut.gx),f),_=Pe(i,"drawOrder",Ut.kml);if(d(m))u=Be(),u.hierarchy=new x(m),u.zIndex=_,h.polygon=u,p=!0;else{u=new oe,u.zIndex=_,h.rectangle=u;var g=Ae(i,"LatLonBox",Ut.kml);if(d(g)){var v=Pe(g,"west",Ut.kml),y=Pe(g,"south",Ut.kml),C=Pe(g,"east",Ut.kml),b=Pe(g,"north",Ut.kml);d(v)&&(v=S.negativePiToPi(S.toRadians(v))),d(y)&&(y=S.clampToLatitudeRange(S.toRadians(y))),d(C)&&(C=S.negativePiToPi(S.toRadians(C))),d(b)&&(b=S.clampToLatitudeRange(S.toRadians(b))),u.coordinates=new D(v,y,C,b);var T=Pe(g,"rotation",Ut.kml);if(d(T)){var E=S.toRadians(T);u.rotation=E,u.stRotation=E}}}var w=Ae(i,"Icon",Ut.kml),P=ze(w,e,o,a,!0);if(d(P)){p&&A("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");var I=Pe(w,"x",Ut.gx),M=Pe(w,"y",Ut.gx),R=Pe(w,"w",Ut.gx),O=Pe(w,"h",Ut.gx);(d(I)||d(M)||d(R)||d(O))&&A("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),u.material=P,u.material.color=Oe(i,"color",Ut.kml),u.material.transparent=!0}else u.material=Oe(i,"color",Ut.kml);var L=De(i,"altitudeMode",Ut.kml);d(L)?"absolute"===L?(u.height=Pe(i,"altitude",Ut.kml),u.zIndex=void 0):"clampToGround"!==L&&A("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+L):(L=De(i,"altitudeMode",Ut.gx),"relativeToSeaFloor"===L?(A("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),u.height=Pe(i,"altitude",Ut.kml),u.zIndex=void 0):"clampToSeaFloor"===L?A("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):d(L)&&A("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+L))}function vt(e,t,i,r,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,i,r,n,o,a),A("kml-unsupportedFeature-"+i.nodeName,"KML - Unsupported feature: "+i.nodeName)}function yt(e){if(!d(e)||0===e.length)return"";var t=e[0];return"&"!==t&&"?"!==t||(e=e.substring(1)),e}function Ct(e,t,i,r,o,a){function s(e){return e<-S.PI_OVER_TWO?-S.PI_OVER_TWO:e>S.PI_OVER_TWO?S.PI_OVER_TWO:e}function l(e){return e>S.PI?e-S.TWO_PI:e<-S.PI?e+S.TWO_PI:e}var u=E(e.queryParameters);if(u=u.replace(/%5B/g,"[").replace(/%5D/g,"]"),d(t)&&t._mode!==B.MORPHING){var h,p;if(o=c(o,Xt),d(i)&&(Kt.x=.5*i.clientWidth,Kt.y=.5*i.clientHeight,h=t.pickEllipsoid(Kt,a,Zt)),d(h)?p=a.cartesianToCartographic(h,Qt):(p=D.center(o,Qt),h=a.cartographicToCartesian(p)),d(r)&&!S.equalsEpsilon(r,1,S.EPSILON9)){var f=o.width*r*.5,m=o.height*r*.5;o=new D(l(p.longitude-f),s(p.latitude-m),l(p.longitude+f),s(p.latitude+m))}u=u.replace("[bboxWest]",S.toDegrees(o.west).toString()),
- u=u.replace("[bboxSouth]",S.toDegrees(o.south).toString()),u=u.replace("[bboxEast]",S.toDegrees(o.east).toString()),u=u.replace("[bboxNorth]",S.toDegrees(o.north).toString());var _=S.toDegrees(p.longitude).toString(),g=S.toDegrees(p.latitude).toString();u=u.replace("[lookatLon]",_),u=u.replace("[lookatLat]",g),u=u.replace("[lookatTilt]",S.toDegrees(t.pitch).toString()),u=u.replace("[lookatHeading]",S.toDegrees(t.heading).toString()),u=u.replace("[lookatRange]",n.distance(t.positionWC,h)),u=u.replace("[lookatTerrainLon]",_),u=u.replace("[lookatTerrainLat]",g),u=u.replace("[lookatTerrainAlt]",p.height.toString()),a.cartesianToCartographic(t.positionWC,Qt),u=u.replace("[cameraLon]",S.toDegrees(Qt.longitude).toString()),u=u.replace("[cameraLat]",S.toDegrees(Qt.latitude).toString()),u=u.replace("[cameraAlt]",S.toDegrees(Qt.height).toString());var v=t.frustum,y=v.aspectRatio,C="",b="";if(d(y)){var T=S.toDegrees(v.fov);y>1?(C=T,b=T/y):(b=T,C=T*y)}u=u.replace("[horizFov]",C.toString()),u=u.replace("[vertFov]",b.toString())}else u=u.replace("[bboxWest]","-180"),u=u.replace("[bboxSouth]","-90"),u=u.replace("[bboxEast]","180"),u=u.replace("[bboxNorth]","90"),u=u.replace("[lookatLon]",""),u=u.replace("[lookatLat]",""),u=u.replace("[lookatRange]",""),u=u.replace("[lookatTilt]",""),u=u.replace("[lookatHeading]",""),u=u.replace("[lookatTerrainLon]",""),u=u.replace("[lookatTerrainLat]",""),u=u.replace("[lookatTerrainAlt]",""),u=u.replace("[cameraLon]",""),u=u.replace("[cameraLat]",""),u=u.replace("[cameraAlt]",""),u=u.replace("[horizFov]",""),u=u.replace("[vertFov]","");d(i)?(u=u.replace("[horizPixels]",i.clientWidth),u=u.replace("[vertPixels]",i.clientHeight)):(u=u.replace("[horizPixels]",""),u=u.replace("[vertPixels]","")),u=u.replace("[terrainEnabled]","1"),u=u.replace("[clientVersion]","1"),u=u.replace("[kmlVersion]","2.2"),u=u.replace("[clientName]","Cesium"),u=u.replace("[language]","English"),e.setQueryParameters(P(u))}function bt(e,t,i,r,n,o,a,s,l){var h=st(e,t,i,r,n,o,a,s,l),p=h.entity,f=Ae(i,"Link",Ut.kml);if(d(f)||(f=Ae(i,"Url",Ut.kml)),d(f)){var m,_,g=De(f,"href",Ut.kml);if(d(g)){var v=g;if(g=Me(g,o,a),/^data:/.test(g.getUrlComponent()))/\.kmz/i.test(o.getUrlComponent())||(v=o.getDerivedResource({url:v}));else{v=g.clone(),m=De(f,"viewRefreshMode",Ut.kml),_=c(De(f,"viewBoundScale",Ut.kml),1);var y="onStop"===m?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=c(De(f,"viewFormat",Ut.kml),y),S=De(f,"httpQuery",Ut.kml);d(C)&&g.setQueryParameters(P(yt(C))),d(S)&&g.setQueryParameters(P(yt(S)));var T=e._ellipsoid;Ct(g,e._camera,e._canvas,_,e._lastCameraView.bbox,T)}var E={sourceUri:v,uriResolver:a,context:p.id},w=new X,x=At(e,w,g,E).then(function(t){var i=e._entityCollection,r=w.values;i.suspendEvents();for(var n=0;n<r.length;n++){var o=r[n];d(o.parent)||(o.parent=p,xt(o)),i.add(o)}i.resumeEvents();var a=De(f,"refreshMode",Ut.kml),s=c(Pe(f,"refreshInterval",Ut.kml),0);if("onInterval"===a&&s>0||"onExpire"===a||"onStop"===m){var l=Ae(t,"NetworkLinkControl",Ut.kml),h=d(l),v=b.now(),y={id:u(),href:g,cookie:{},lastUpdated:v,updating:!1,entity:p,viewBoundScale:_,needsUpdate:!1,cameraUpdateTime:v},C=0;if(h&&(y.cookie=P(c(De(l,"cookie",Ut.kml),"")),C=c(Pe(l,"minRefreshPeriod",Ut.kml),0)),"onInterval"===a)h&&(s=Math.max(C,s)),y.refreshMode=jt.INTERVAL,y.time=s;else if("onExpire"===a){var S;if(h&&(S=De(l,"expires",Ut.kml)),d(S))try{var T=b.fromIso8601(S),E=b.secondsDifference(T,v);E>0&&E<C&&b.addSeconds(v,C,T),y.refreshMode=jt.EXPIRE,y.time=T}catch(e){A("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else A("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(y.refreshMode=jt.STOP,y.time=c(Pe(f,"viewRefreshTime",Ut.kml),0)):A("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");d(y.refreshMode)&&e._networkLinks.set(y.id,y)}else"onRegion"===m&&A("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")}).otherwise(function(t){A("An error occured during loading "+g.url),e._error.raiseEvent(e,t)});s.push(x)}}}function St(e,t,i,r,n,o,a,s,l){var u=qt[t.localName];d(u)?u(e,i,t,r,n,o,a,s,l):vt(e,i,t,r,n,o,a,s,l)}function Tt(e,t,i,r,n,o){t.removeAll();var a=[],s=i.documentElement,l="Document"===s.localName?s:Ae(s,"Document",Ut.kml),u=De(l,"name",Ut.kml);d(u)||(u=g(r.getUrlComponent())),d(e._name)||(e._name=u);var c=new X(e);return V.all(We(e,i,c,r,!1,n)).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(d(qt[h.localName])){s=h;break}}return t.suspendEvents(),St(e,s,void 0,t,c,r,n,a,o),t.resumeEvents(),V.all(a).then(function(){return i.documentElement})})}function Et(e,t,i,r){var n=V.defer();return U.createReader(new U.BlobReader(i),function(i){i.getEntries(function(o){for(var a,s,l=[],u={},c=0;c<o.length;c++){var h=o[c];if(!h.directory){var p=V.defer();l.push(p.promise),/\.kml$/i.test(h.filename)?d(a)&&/\//i.test(h.filename)?_e(h,u,p):(d(a)&&_e(a,u,s),a=h,s=p):_e(h,u,p)}}d(a)&&me(a,u,s),V.all(l).then(function(){return i.close(),d(u.kml)?(u.keys=Object.keys(u),Tt(e,t,u.kml,r,u)):void n.reject(new M("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function At(e,t,i,r){r=c(r,c.EMPTY_OBJECT);var n=r.sourceUri,o=r.uriResolver,a=r.context,s=i;return"string"==typeof i||i instanceof I?(i=I.createIfNeeded(i),s=i.fetchBlob(),n=c(n,i.clone())):n=c(n,I.DEFAULT.clone()),n=I.createIfNeeded(n),V(s).then(function(i){return i instanceof Blob?de(i).then(function(r){return r?Et(e,t,i,n):he(i).then(function(i){i=pe(i),i=fe(i);var r,s;try{r=Mt.parseFromString(i,"application/xml")}catch(e){s=e.toString()}if(d(s)||r.body||"parsererror"===r.documentElement.tagName){var l=d(s)?s:r.documentElement.firstChild.nodeValue;throw l||(l=r.body.innerText),new M(l)}return Tt(e,t,r,n,o,a)})}):Tt(e,t,i,n,o,a)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),V.reject(t)})}function wt(e){e=c(e,{});var i=e.camera,r=e.canvas;this._changed=new m,this._error=new m,this._loading=new m,this._refresh=new m,this._unsupportedNode=new m,this._clock=void 0,this._entityCollection=new X(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new w,this._networkLinks=new t,this._entityCluster=new j,this._canvas=r,this._camera=i,this._lastCameraView={position:d(i)?n.clone(i.positionWC):void 0,direction:d(i)?n.clone(i.directionWC):void 0,up:d(i)?n.clone(i.upWC):void 0,bbox:d(i)?i.computeViewRectangle():D.clone(D.MAX_VALUE)},this._ellipsoid=c(e.ellipsoid,f.WGS84)}function xt(e){var t=e.parent;if(d(t)){var i=t.availability;if(d(i)){var r=e.availability;d(r)?r.intersect(i):e.availability=i}}}function Pt(e,t,i,r,n){return function(o){function a(e){y.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=Ae(o,"NetworkLinkControl",Ut.kml),u=d(l),h=0;if(u){if(d(Ae(l,"Update",Ut.kml)))return A("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void r.remove(t.id);t.cookie=P(c(De(l,"cookie",Ut.kml),"")),h=c(Pe(l,"minRefreshPeriod",Ut.kml),0)}var p=b.now(),f=t.refreshMode;if(f===jt.INTERVAL)d(l)&&(t.time=Math.max(h,t.time));else if(f===jt.EXPIRE){var m;if(d(l)&&(m=De(l,"expires",Ut.kml)),d(m))try{var _=b.fromIso8601(m),g=b.secondsDifference(_,p);g>0&&g<h&&b.addSeconds(p,h,_),t.time=_}catch(e){A("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else A("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var v=t.entity,y=e._entityCollection,S=i.values;y.suspendEvents();var T,E=y.values.slice();for(T=0;T<E.length;++T){var w=E[T];w.parent===v&&(w.parent=void 0,a(w))}for(y.resumeEvents(),y.suspendEvents(),T=0;T<S.length;T++){var x=S[T];d(x.parent)||(x.parent=v,xt(x)),y.add(x)}y.resumeEvents(),s?r.remove(t.id):t.lastUpdated=p;var D=y.computeAvailability(),I=D.start,M=D.stop,R=b.equals(I,C.MINIMUM_VALUE),O=b.equals(M,C.MAXIMUM_VALUE);if(!R||!O){var L=e._clock;L.startTime===I&&L.stopTime===M||(L.startTime=I,L.stopTime=M,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n.getUrlComponent(!0))}}}function Dt(){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 It={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),It[t]}},Mt=new DOMParser,Rt=new k({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),Ot=32,Lt=2414016,Nt=1,Ft=16093e3,Bt=.1,kt=[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"],zt=["http://www.google.com/kml/ext/2.2"],Vt=["http://www.w3.org/2005/Atom"],Ut={kml:kt,gx:zt,atom:Vt,kmlgx:kt.concat(zt)},Gt={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0},Ht={Point:Ze,LineString:Je,LinearRing:Je,Polygon:$e,Track:et,MultiTrack:it,MultiGeometry:rt,Model:nt},Wt=document.createElement("div"),qt={Document:lt,Folder:ut,Placemark:ct,NetworkLink:bt,GroundOverlay:gt,PhotoOverlay:vt,ScreenOverlay:vt,Tour:dt},Yt={FlyTo:ft,Wait:pt,SoundCue:ht,AnimatedUpdate:ht,TourControl:ht},jt={INTERVAL:0,EXPIRE:1,STOP:2},Xt=new D,Qt=new o,Kt=new r,Zt=new n;wt.load=function(e,t){return t=c(t,c.EMPTY_OBJECT),new wt(t).load(e,t)},h(wt.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}},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}}}),wt.prototype.load=function(e,t){t=c(t,{}),W.setLoading(this,!0);var i=this._name;this._name=void 0,this._clampToGround=c(t.clampToGround,!1);var r=this;return At(this,this._entityCollection,e,t).then(function(){var e,t=r._entityCollection.computeAvailability(),n=t.start,o=t.stop,l=b.equals(n,C.MINIMUM_VALUE),u=b.equals(o,C.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=b.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),o=b.fromDate(c)),e=new q,e.startTime=n,e.stopTime=o,e.currentTime=b.clone(n),e.clockRange=a.LOOP_STOP,e.clockStep=s.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(b.secondsDifference(o,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),W.setLoading(r,!1),r}).otherwise(function(e){return W.setLoading(r,!1),r._error.raiseEvent(r,e),console.log(e),V.reject(e)})};var Jt=new t;return wt.prototype.update=function(e){function i(e){for(var t=e._children,r=t.length,n=0;n<r;++n){var o=t[n];Jt.set(o.id,o),i(o)}}var r=this._networkLinks;if(0===r.length)return!0;var o=b.now(),a=this;Jt.removeAll();var s=!1,l=this._lastCameraView,u=this._camera;!d(u)||u.positionWC.equalsEpsilon(l.position,S.EPSILON7)&&u.directionWC.equalsEpsilon(l.direction,S.EPSILON7)&&u.upWC.equalsEpsilon(l.up,S.EPSILON7)||(l.position=n.clone(u.positionWC),l.direction=n.clone(u.directionWC),l.up=n.clone(u.upWC),l.bbox=u.computeViewRectangle(),s=!0);var h=new t,p=!1;return r.values.forEach(function(e){var t=e.entity;if(!Jt.contains(t.id)){if(!e.updating){var r=!1;if(e.refreshMode===jt.INTERVAL?b.secondsDifference(o,e.lastUpdated)>e.time&&(r=!0):e.refreshMode===jt.EXPIRE?b.greaterThan(o,e.time)&&(r=!0):e.refreshMode===jt.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&b.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new X,u=e.href.clone();u.setQueryParameters(e.cookie);var d=c(a._ellipsoid,f.WGS84);Ct(u,a._camera,a._canvas,e.viewBoundScale,l.bbox,d),At(a,n,u,{context:t.id}).then(Pt(a,e,n,h,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),p=!0}}h.set(e.id,e)}}),p&&(this._networkLinks=h,this._changed.raiseEvent(this)),!0},wt}),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("DataSources/exportKml",["./BillboardGraphics","./CompositePositionProperty","./ModelGraphics","./SampledPositionProperty","./SampledProperty","./ScaledPositionProperty","./RectangleGraphics","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/Math","../Core/Rectangle","../Core/ReferenceFrame","../Core/Resource","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","../ThirdParty/when","../ThirdParty/zip"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M){"use strict";function R(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}function O(e,t){return function(i){e._files[t]=i}}function L(e){this._time=e}function N(){this._ids={},this._styles={},this._count=0}function F(){this._ids={}}function B(e){e=h(e,h.EMPTY_OBJECT);var t=e.entities,i=h(e.kmz,!1),r=B._createState(e),n=t.values.filter(function(e){return!p(e.parent)}),o=r.kmlDoc,a=o.documentElement;a.setAttributeNS(se,"xmlns:gx",ae);var s=o.createElement("Document");a.appendChild(s),U(r,s,n),r.styleCache.save(s);var l=r.externalFileHandler;return l.promise.then(function(){var e=new XMLSerializer,t=e.serializeToString(r.kmlDoc);return i?k(t,l.files):{kml:t,externalFiles:l.files}})}function k(e,t){var i=I.defer();return M.createWriter(new M.BlobWriter,function(r){z(r,e).then(function(){var e=Object.keys(t);return V(r,e,t,0)}).then(function(){r.close(function(e){i.resolve({kmz:e})})})}),i.promise}function z(e,t){var i=I.defer();return e.add("doc.kml",new M.TextReader(t),function(){i.resolve()}),i.promise}function V(e,t,i,r){if(t.length!==r){var n=t[r],o=I.defer();return e.add(n,new M.BlobReader(i[n]),function(){o.resolve()}),o.promise.then(function(){return V(e,t,i,r+1)})}}function U(e,t,i){for(var r,n,o,a=e.kmlDoc,s=e.styleCache,l=e.valueGetter,u=e.idManager,c=i.length,d=0;d<c;++d){var h=i[d];r=[],n=[],o=[],G(e,h,n,o),Y(e,h.polyline,n,o),K(e,h.rectangle,n,o,r),K(e,h.polygon,n,o,r),$(e,h,h.model,n,o);var f,m=h.availability;p(m)&&(f=a.createElement("TimeSpan"),y.equals(m.start,v.MINIMUM_VALUE)||f.appendChild(re(a,"begin",y.toIso8601(m.start))),y.equals(m.stop,v.MAXIMUM_VALUE)||f.appendChild(re(a,"end",y.toIso8601(m.stop))));for(var _=0;_<r.length;++_){var g=r[_];g.setAttribute("id",u.get(h.id)),g.appendChild(re(a,"name",h.name)),g.appendChild(re(a,"visibility",h.show)),g.appendChild(re(a,"description",h.description)),p(f)&&g.appendChild(f),t.appendChild(g)}var C=n.length;if(C>0){var b=a.createElement("Placemark");b.setAttribute("id",u.get(h.id));var S=h.name,T=h.label;if(p(T)){var E=a.createElement("LabelStyle"),A=l.get(T.text);S=p(A)&&A.length>0?A:S;var w=l.getColor(T.fillColor);p(w)&&(E.appendChild(re(a,"color",w)),E.appendChild(re(a,"colorMode","normal")));var x=l.get(T.scale);p(x)&&E.appendChild(re(a,"scale",x)),o.push(E)}b.appendChild(re(a,"name",S)),b.appendChild(re(a,"visibility",h.show)),b.appendChild(re(a,"description",h.description)),p(f)&&b.appendChild(f),t.appendChild(b);var P=o.length;if(P>0){for(var D=a.createElement("Style"),I=0;I<P;++I)D.appendChild(o[I]);b.appendChild(re(a,"styleUrl",s.get(D)))}if(1===n.length)b.appendChild(n[0]);else if(n.length>1){for(var M=a.createElement("MultiGeometry"),R=0;R<C;++R)M.appendChild(n[R]);b.appendChild(M)}}var O=h._children;if(O.length>0){var L=a.createElement("Folder");L.setAttribute("id",u.get(h.id)),L.appendChild(re(a,"name",h.name)),L.appendChild(re(a,"visibility",h.show)),L.appendChild(re(a,"description",h.description)),t.appendChild(L),U(e,L,O)}}}function G(t,i,r,n){var o=t.kmlDoc,a=t.ellipsoid,s=t.valueGetter,l=h(i.billboard,i.point);if(p(l)||p(i.path)){var u=i.position;if(!u.isConstant)return void H(t,i,l,r,n);s.get(u,void 0,ue);var c=re(o,"coordinates",ie(ue,a)),d=o.createElement("Point"),f=o.createElement("altitudeMode");f.appendChild(te(t,l.heightReference)),d.appendChild(f),d.appendChild(c),r.push(d);var m=l instanceof e?q(t,l):W(t,l);n.push(m)}}function H(a,s,u,c,d){var f,m=a.kmlDoc,_=a.ellipsoid,g=a.valueGetter,v=s.position,C=!0;v instanceof t?(f=v.intervals,C=!1):f=h(s.availability,a.defaultAvailability);var b,T,E,A=u instanceof i,w=[];for(b=0;b<f.length;++b){var P=f.get(b),D=C?v:P.data,I=m.createElement("altitudeMode");D instanceof o?(D=D._value,I.appendChild(te(a,x.CLAMP_TO_GROUND))):p(u)?I.appendChild(te(a,u.heightReference)):I.appendChild(te(a,x.NONE));var M=[],R=[];if(D.isConstant){g.get(D,void 0,ue);var O=re(m,"coordinates",ie(ue,_));M.push(y.toIso8601(P.start)),R.push(O),M.push(y.toIso8601(P.stop)),R.push(O)}else if(D instanceof r)for(E=D._property._times,T=0;T<E.length;++T)M.push(y.toIso8601(E[T])),D.getValueInReferenceFrame(E[T],S.FIXED,ue),R.push(ie(ue,_));else if(D instanceof n){E=D._times;var L=D._values;for(T=0;T<E.length;++T)M.push(y.toIso8601(E[T])),l.fromArray(L,3*T,ue),R.push(ie(ue,_))}else{var N=a.sampleDuration;P.start.clone(de),P.isStartIncluded||y.addSeconds(de,N,de);for(var F=P.stop;y.lessThan(de,F);)D.getValue(de,ue),M.push(y.toIso8601(de)),R.push(ie(ue,_)),y.addSeconds(de,N,de);P.isStopIncluded&&y.equals(de,F)&&(D.getValue(de,ue),M.push(y.toIso8601(de)),R.push(ie(ue,_)))}var B=m.createElementNS(ae,"Track");B.appendChild(I);for(var k=0;k<M.length;++k){var z=re(m,"when",M[k]),V=re(m,"coord",R[k],ae);B.appendChild(z),B.appendChild(V)}A&&B.appendChild(J(a,u)),w.push(B)}if(1===w.length)c.push(w[0]);else if(w.length>1){var U=m.createElementNS(ae,"MultiTrack");for(b=0;b<w.length;++b)U.appendChild(w[b]);c.push(U)}if(p(u)&&!A){var G=u instanceof e?q(a,u):W(a,u);d.push(G)}var H=s.path;if(p(H)){var Y=g.get(H.width),j=H.material;if(p(j)||p(Y)){var X=m.createElement("LineStyle");p(Y)&&X.appendChild(re(m,"width",Y)),ee(a,j,X),d.push(X)}}}function W(e,t){var i=e.kmlDoc,r=e.valueGetter,n=i.createElement("IconStyle"),o=r.getColor(t.color);p(o)&&(n.appendChild(re(i,"color",o)),n.appendChild(re(i,"colorMode","normal")));var a=r.get(t.pixelSize);return p(a)&&n.appendChild(re(i,"scale",a/oe)),n}function q(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,o=i.createElement("IconStyle"),a=r.get(t.image);if(p(a)){a=n.texture(a);var u=i.createElement("Icon");u.appendChild(re(i,"href",a));var c=r.get(t.imageSubRegion);p(c)&&(u.appendChild(re(i,"x",c.x,ae)),u.appendChild(re(i,"y",c.y,ae)),u.appendChild(re(i,"w",c.width,ae)),u.appendChild(re(i,"h",c.height,ae))),o.appendChild(u)}var d=r.getColor(t.color);p(d)&&(o.appendChild(re(i,"color",d)),o.appendChild(re(i,"colorMode","normal")));var f=r.get(t.scale);p(f)&&o.appendChild(re(i,"scale",f));var m=r.get(t.pixelOffset);if(p(m)){f=h(f,1),s.divideByScalar(m,f,m);var _=r.get(t.width,oe),g=r.get(t.height,oe),v=r.get(t.horizontalOrigin,P.CENTER);v===P.CENTER?m.x-=.5*_:v===P.RIGHT&&(m.x-=_);var y=r.get(t.verticalOrigin,D.CENTER);y===D.TOP?m.y+=g:y===D.CENTER&&(m.y+=.5*g);var b=i.createElement("hotSpot");b.setAttribute("x",-m.x),b.setAttribute("y",m.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),o.appendChild(b)}var S=r.get(t.rotation),T=r.get(t.alignedAxis);return p(S)&&l.equals(l.UNIT_Z,T)&&(S=C.toDegrees(-S),0===S&&(S=360),o.appendChild(re(i,"heading",S))),o}function Y(e,t,i,r){var n=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter;if(p(t)){var s,l=n.createElement("LineString"),u=n.createElement("altitudeMode"),c=a.get(t.clampToGround,!1);c?(l.appendChild(re(n,"tessellate",!0)),s=n.createTextNode("clampToGround")):s=n.createTextNode("absolute"),u.appendChild(s),l.appendChild(u);var d=t.positions,h=a.get(d),f=re(n,"coordinates",ie(h,o));l.appendChild(f);var m=a.get(t.zIndex);c&&p(m)&&l.appendChild(re(n,"drawOrder",m,ae)),i.push(l);var _=n.createElement("LineStyle"),g=a.get(t.width);p(g)&&_.appendChild(re(n,"width",g)),ee(e,t.material,_),r.push(_)}}function j(e,t,i){var r,n=e.kmlDoc,o=e.valueGetter,a=o.get(t.height,0);i>0&&(a=i);for(var s=t.coordinates,l=o.get(s),u=[],c=[b.northeast,b.southeast,b.southwest,b.northwest],d=0;d<4;++d)c[d](l,ce),u.push(C.toDegrees(ce.longitude)+","+C.toDegrees(ce.latitude)+","+a);r=re(n,"coordinates",u.join(" "));var h=n.createElement("outerBoundaryIs"),p=n.createElement("LinearRing");return p.appendChild(r),h.appendChild(p),[h]}function X(e,t,i,r){for(var n=e.kmlDoc,o=e.ellipsoid,a=[],s=t.length,l=0;l<s;++l)u.fromCartesian(t[l],o,ce),a.push(C.toDegrees(ce.longitude)+","+C.toDegrees(ce.latitude)+","+(r?ce.height:i));var c=re(n,"coordinates",a.join(" ")),d=n.createElement("LinearRing");return d.appendChild(c),d}function Q(e,t,i){var r=e.kmlDoc,n=e.valueGetter,o=n.get(t.height,0),a=n.get(t.perPositionHeight,!1);!a&&i>0&&(o=i);var s=[],l=t.hierarchy,u=n.get(l),c=g(u)?u:u.positions,d=r.createElement("outerBoundaryIs");d.appendChild(X(e,c,o,a)),s.push(d);var h=u.holes;if(p(h))for(var f=h.length,m=0;m<f;++m){var _=r.createElement("innerBoundaryIs");_.appendChild(X(e,h[m].positions,o,a)),s.push(_)}return s}function K(e,t,i,r,n){var o=e.kmlDoc,s=e.valueGetter;if(p(t)){var l=t instanceof a;if(l&&"Image"===s.getMaterialType(t.material))return void Z(e,t,n);var u=o.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&u.appendChild(re(o,"extrude",!0));for(var h=l?j(e,t,d):Q(e,t,d),f=h.length,m=0;m<f;++m)u.appendChild(h[m]);var _=o.createElement("altitudeMode");_.appendChild(te(e,t.heightReference)),u.appendChild(_),i.push(u);var g=o.createElement("PolyStyle"),v=s.get(t.fill,!1);v&&g.appendChild(re(o,"fill",v)),ee(e,t.material,g);var y=s.get(t.outline,!1);if(y){g.appendChild(re(o,"outline",y));var C=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);C.appendChild(re(o,"width",b));var S=s.getColor(t.outlineColor,c.BLACK);C.appendChild(re(o,"color",S)),C.appendChild(re(o,"colorMode","normal")),r.push(C)}r.push(g)}}function Z(e,t,i){var r=e.kmlDoc,n=e.valueGetter,o=e.externalFileHandler,a=r.createElement("GroundOverlay"),s=r.createElement("altitudeMode");s.appendChild(te(e,t.heightReference)),a.appendChild(s);var l=n.get(t.height);p(l)&&a.appendChild(re(r,"altitude",l));var u=n.get(t.coordinates),c=r.createElement("LatLonBox");c.appendChild(re(r,"north",C.toDegrees(u.north))),c.appendChild(re(r,"south",C.toDegrees(u.south))),c.appendChild(re(r,"east",C.toDegrees(u.east))),c.appendChild(re(r,"west",C.toDegrees(u.west))),a.appendChild(c);var d=n.get(t.material),h=o.texture(d.image),f=r.createElement("Icon");f.appendChild(re(r,"href",h)),a.appendChild(f);var m=d.color;p(m)&&a.appendChild(re(r,"color",ne(d.color))),i.push(a)}function J(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,o=i.createElement("Model"),a=r.get(t.scale);if(p(a)){var s=i.createElement("scale");s.appendChild(re(i,"x",a)),s.appendChild(re(i,"y",a)),s.appendChild(re(i,"z",a)),o.appendChild(s)}var l=i.createElement("Link"),u=n.model(t,e.time);return l.appendChild(re(i,"href",u)),o.appendChild(l),o}function $(e,t,i,r,n){var o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(p(i)){var l=t.position;if(!l.isConstant)return void H(e,t,i,r,n);var c=J(e,i),d=o.createElement("altitudeMode");d.appendChild(te(e,i.heightReference)),c.appendChild(d),s.get(l,void 0,ue),u.fromCartesian(ue,a,ce);var h=o.createElement("Location");h.appendChild(re(o,"longitude",C.toDegrees(ce.longitude))),h.appendChild(re(o,"latitude",C.toDegrees(ce.latitude))),h.appendChild(re(o,"altitude",ce.height)),c.appendChild(h),r.push(c)}}function ee(e,t,i){var r=e.kmlDoc,n=e.valueGetter;if(p(t)){var o=n.get(t);if(p(o)){var a;switch(n.getMaterialType(t)){case"Image":a=ne(c.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=ne(o.color);break;case"PolylineOutline":a=ne(o.color);var s=ne(o.outlineColor),l=o.outlineWidth;i.appendChild(re(r,"outerColor",s,ae)),i.appendChild(re(r,"outerWidth",l,ae));break;case"Stripe":a=ne(o.oddColor)}p(a)&&(i.appendChild(re(r,"color",a)),i.appendChild(re(r,"colorMode","normal")))}}}function te(e,t){var i,r=e.kmlDoc,n=e.valueGetter,o=n.get(t,x.NONE);switch(o){case x.NONE:i=r.createTextNode("absolute");break;case x.CLAMP_TO_GROUND:i=r.createTextNode("clampToGround");break;case x.RELATIVE_TO_GROUND:i=r.createTextNode("relativeToGround")}return i}function ie(e,t){g(e)||(e=[e]);for(var i=e.length,r=[],n=0;n<i;++n)u.fromCartesian(e[n],t,ce),r.push(C.toDegrees(ce.longitude)+","+C.toDegrees(ce.latitude)+","+ce.height);return r.join(" ")}function re(e,t,i,r){"boolean"==typeof(i=h(i,""))&&(i=i?"1":"0");var n=p(r)?e.createElementNS(r,t):e.createElement(t),o="string"===i&&-1!==i.indexOf("<")?e.createCDATASection(i):e.createTextNode(i);return n.appendChild(o),n}function ne(e){for(var t="",i=e.toBytes(),r=3;r>=0;--r)t+=i[r]<16?"0"+i[r].toString(16):i[r].toString(16);return t}var oe=32,ae="http://www.google.com/kml/ext/2.2",se="http://www.w3.org/2000/xmlns/",le=/^data:image\/([^,;]+)/;R.prototype.texture=function(e){var t,i=this;if("string"==typeof e||e instanceof T){if(e=T.createIfNeeded(e),!e.isDataUri)return e.url;var r=e.url.match(le);t="texture_"+ ++this._count,p(r)&&(t+="."+r[1]);var n=e.fetchBlob().then(function(e){i._files[t]=e});return this._promises.push(n),t}if(e instanceof HTMLCanvasElement){var o=I.defer();return this._promises.push(o.promise),t="texture_"+ ++this._count+".png",e.toBlob(function(e){i._files[t]=e,o.resolve()}),t}return""},R.prototype.model=function(e,t){var i=this._modelCallback;if(!p(i))throw new E("Encountered a model entity while exporting to KML, but no model callback was supplied.");var r={},n=i(e,t,r);for(var o in r)if(r.hasOwnProperty(o)){var a=I(r[o]);this._promises.push(a),a.then(O(this,o))}return n},f(R.prototype,{promise:{get:function(){return I.all(this._promises)}},files:{get:function(){return this._files}}}),L.prototype.get=function(e,t,i){var r;return p(e)&&(r=p(e.getValue)?e.getValue(this._time,i):e),h(r,t)},L.prototype.getColor=function(e,t){var i=this.get(e,t);if(p(i))return ne(i)},L.prototype.getMaterialType=function(e){if(p(e))return e.getType(this._time)},N.prototype.get=function(e){var t=this._ids,i=e.innerHTML;if(p(t[i]))return t[i];var r="style-"+ ++this._count;return e.setAttribute("id",r),r="#"+r,t[i]=r,this._styles[i]=e,r},N.prototype.save=function(e){var t=this._styles,i=e.childNodes[0];for(var r in t)t.hasOwnProperty(r)&&e.insertBefore(t[r],i)},F.prototype.get=function(e){if(!p(e))return this.get(d());var t=this._ids;return p(t[e])?e.toString()+"-"+ ++t[e]:(t[e]=0,e)},B._createState=function(e){var t=e.entities,i=new N,r=t.computeAvailability(),n=p(e.time)?e.time:r.start,o=h(e.defaultAvailability,r),a=h(e.sampleDuration,60);o.start===v.MINIMUM_VALUE?o.stop===v.MAXIMUM_VALUE?o=new A:y.addSeconds(o.stop,-10*a,o.start):o.stop===v.MAXIMUM_VALUE&&y.addSeconds(o.start,10*a,o.stop);var s=new R(e.modelCallback);return{kmlDoc:document.implementation.createDocument("http://www.opengis.net/kml/2.2","kml"),ellipsoid:h(e.ellipsoid,_.WGS84),idManager:new F,styleCache:i,externalFileHandler:s,time:n,valueGetter:new L(n),sampleDuration:a,defaultAvailability:new w([o])}};var ue=new l,ce=new u,de=new y;return B}),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,this.pass=e.pass}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("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/Check","../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,h){"use strict";function p(e){this._context=e}function f(e,t){return new c({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function _(t,i){return r(g)&&g.viewport.width===t&&g.viewport.height===i||(g=d.fromCache({viewport:new e(0,0,t,i)})),g}var g,v=new u({primitiveType:a.TRIANGLES}),y=new l({color:new i(0,0,0,0)});return p.prototype.execute=function(e){r(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,n=t.height,o=this._context,a=r(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=r(e.shaderProgram)?e.shaderProgram:m(o,e.fragmentShaderSource),l=f(o,t),u=_(i,n),c=e.uniformMap,d=y;d.framebuffer=l,d.renderState=u,d.execute(o);var h=v;h.vertexArray=a,h.renderState=u,h.shaderProgram=s,h.uniformMap=c,h.framebuffer=l,h.execute(o),l.destroy(),e.persists||(s.destroy(),r(e.vertexArray)&&a.destroy()),r(e.postExecute)&&e.postExecute(t)},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return n(this)},p}),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/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;a(e,e._shaders[o])}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(this._context),u=o.createCombinedFragmentShader(this._context),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.replaceDerivedShaderProgram=function(t,i,r){var n=t._cachedShader,o=i+n.keyword,s=this._shaders[o];if(e(s)){a(this,s);var l=n.derivedKeywords.indexOf(i);l>-1&&n.derivedKeywords.splice(l,1)}return this.createDerivedShaderProgram(t,i,r)},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=this._context,d=s.createCombinedVertexShader(c),h=l.createCombinedFragmentShader(c),p=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:s,vertexShaderText:d,fragmentShaderSource:l,fragmentShaderText:h,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/TextureCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject"],function(e,t,i){"use strict";function r(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}return t(r.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}}),r.prototype.getTexture=function(t){var i=this._textures[t];if(e(i))return delete this._texturesToRelease[t],++i.count,i.texture},r.prototype.addTexture=function(e,t){var i={texture:t,count:1};t.finalDestroy=t.destroy;var r=this;t.destroy=function(){0==--i.count&&(r._texturesToRelease[e]=i)},this._textures[e]=i,++this._numberOfTextures},r.prototype.destroyReleasedTextures=function(){var e=this._texturesToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._textures[t],i.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){var e=this._textures;for(var t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return i(this)},r}),define("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode","./Sampler"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=h.clone(h.IDENTITY),this._viewportTransformation=h.clone(h.IDENTITY),this._model=h.clone(h.IDENTITY),this._view=h.clone(h.IDENTITY),this._inverseView=h.clone(h.IDENTITY),this._projection=h.clone(h.IDENTITY),this._infiniteProjection=h.clone(h.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._log2FarDistance=void 0,this._log2FarPlusOne=void 0,this._log2NearDistance=void 0,this._frameState=void 0,this._temeToPseudoFixed=d.clone(h.IDENTITY),this._view3DDirty=!0,this._view3D=new h,this._inverseView3DDirty=!0,this._inverseView3D=new h,this._inverseModelDirty=!0,this._inverseModel=new h,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new d,this._viewRotation=new d,this._inverseViewRotation=new d,this._viewRotation3D=new d,this._inverseViewRotation3D=new d,this._inverseProjectionDirty=!0,this._inverseProjection=new h,this._modelViewDirty=!0,this._modelView=new h,this._modelView3DDirty=!0,this._modelView3D=new h,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new h,this._inverseModelViewDirty=!0,this._inverseModelView=new h,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new h,this._viewProjectionDirty=!0,this._viewProjection=new h,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new h,this._modelViewProjectionDirty=!0,this._modelViewProjection=new h,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new h,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new h,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new h,this._normalDirty=!0,this._normal=new d,this._normal3DDirty=!0,this._normal3D=new d,this._inverseNormalDirty=!0,this._inverseNormal=new d,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new d,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new u,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._sunColor=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._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new t,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}function y(e,t){h.clone(t,e._view),h.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 C(e,t){h.clone(t,e._inverseView),h.getRotation(t,e._inverseViewRotation)}function b(e,t){h.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function S(e,t){h.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function T(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 E(e,t){s(m.computeIcrfToFixedMatrix(t.time,Y))||(Y=m.computeTemeToPseudoFixedMatrix(t.time,Y));var r=f.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);d.multiplyByVector(Y,r,r),i.normalize(r,e._sunDirectionWC),r=d.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=f.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),d.multiplyByVector(Y,r,r),d.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,o=n.ellipsoid,a=o.cartesianToCartographic(e._sunPositionWC,j);n.project(a,e._sunPositionColumbusView)}function A(e){if(e._viewportDirty){var t=e._viewport;h.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),h.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function w(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===_.SCENE2D||e._mode===_.MORPHING||e._orthographicIn3D?h.clone(h.ZERO,e._inverseProjection):h.inverse(e._projection,e._inverseProjection))}function x(e){e._modelViewDirty&&(e._modelViewDirty=!1,h.multiplyTransformation(e._view,e._model,e._modelView))}function P(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,h.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function D(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,h.inverse(e.modelView,e._inverseModelView))}function I(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,h.inverse(e.modelView3D,e._inverseModelView3D))}function M(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,h.multiply(e._projection,e._view,e._viewProjection))}function R(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,h.inverse(e.viewProjection,e._inverseViewProjection))}function O(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,h.multiply(e._projection,e.modelView,e._modelViewProjection))}function L(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 N(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,h.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function F(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,h.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function B(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,h.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function k(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;h.getRotation(e.inverseModelView,t),d.transpose(t,t)}}function z(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;h.getRotation(e.inverseModelView3D,t),d.transpose(t,t)}}function V(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,h.getRotation(e.inverseModelView,e._inverseNormal))}function U(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,h.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function G(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,h.multiplyByPoint(e.inverseModel,e._cameraPosition,Q),u.fromCartesian(Q,e._encodedCameraPositionMC))}function H(e,t,r,n,o,a,l,u){var d=K;d.x=e.y,d.y=e.z,d.z=e.x;var p=Z;p.x=r.y,p.y=r.z,p.z=r.x;var f=J;f.x=n.y,f.y=n.z,f.z=n.x;var g=$;g.x=t.y,g.y=t.z,g.z=t.x,a===_.SCENE2D&&(d.z=.5*o);var v=l.unproject(d,ee);v.longitude=c.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=c.clamp(v.latitude,-c.PI_OVER_TWO,c.PI_OVER_TWO);var y=l.ellipsoid,C=y.cartographicToCartesian(v,te),b=m.eastNorthUpToFixedFrame(C,y,ie);return h.multiplyByPointAsVector(b,p,p),h.multiplyByPointAsVector(b,f,f),h.multiplyByPointAsVector(b,g,g),s(u)||(u=new h),u[0]=p.x,u[1]=f.x,u[2]=-g.x,u[3]=0,u[4]=p.y,u[5]=f.y,u[6]=-g.y,u[7]=0,u[8]=p.z,u[9]=f.z,u[10]=-g.z,u[11]=0,u[12]=-i.dot(p,C),u[13]=-i.dot(f,C),u[14]=i.dot(g,C),u[15]=1,u}function W(e){e._view3DDirty&&(e._mode===_.SCENE3D?h.clone(e._view,e._view3D):H(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),h.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function q(e){e._inverseView3DDirty&&(h.inverseTransformation(e.view3D,e._inverseView3D),h.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}l(v.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 A(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return A(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){h.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,h.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,h.getRotation(this.inverseModel,e),d.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return W(this),this._view3D}},viewRotation:{get:function(){return W(this),this._viewRotation}},viewRotation3D:{get:function(){return W(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return q(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return q(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return w(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return x(this),this._modelView}},modelView3D:{get:function(){return P(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return L(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return D(this),this._inverseModelView}},inverseModelView3D:{get:function(){return I(this),this._inverseModelView3D}},viewProjection:{get:function(){return M(this),this._viewProjection}},inverseViewProjection:{get:function(){return R(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return O(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return N(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return F(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return B(this),this._modelViewInfiniteProjection}},normal:{get:function(){return k(this),this._normal}},normal3D:{get:function(){return z(this),this._normal3D}},inverseNormal:{get:function(){return V(this),this._inverseNormal}},inverseNormal3D:{get:function(){return U(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},log2FarDistance:{get:function(){return this._log2FarDistance}},log2FarPlusOne:{get:function(){return this._log2FarPlusOne}},log2NearDistance:{get:function(){return this._log2NearDistance}},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}},sunColor:{get:function(){return this._sunColor}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return G(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return G(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}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}}});var Y=new d,j=new n;v.prototype.updateCamera=function(e){y(this,e.viewMatrix),C(this,e.inverseViewMatrix),T(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==_.SCENE2D&&e.frustum instanceof p},v.prototype.updateFrustum=function(e){b(this,e.projectionMatrix),s(e.infiniteProjectionMatrix)&&S(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._log2FarDistance=2/c.log2(e.far+1),this._log2FarPlusOne=c.log2(e.far+1),this._log2NearDistance=c.log2(e.near),s(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},v.prototype.updatePass=function(e){this._pass=e};var X=[];v.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var r=e.context._canvas;this._resolutionScale=r.width/r.clientWidth;var n=e.camera;this.updateCamera(n),e.mode===_.SCENE2D?(this._frustum2DWidth=n.frustum.right-n.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),E(this,e),this._sunColor=i.clone(e.sunColor,this._sunColor);var l=e.brdfLutGenerator,u=s(l)?l.colorTexture:void 0;this._brdfLut=u,this._environmentMap=a(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=a(e.sphericalHarmonicCoefficients,X),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,s(this._specularEnvironmentMaps)&&t.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=m.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*e.context.drawingBufferWidth;var c,d=n.frustum.fov,h=this._viewport;c=h.height>h.width?2*Math.tan(.5*d)/h.height:2*Math.tan(.5*d)/h.width,this._geometricToleranceOverMeter=c*e.maximumScreenSpaceError,o.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var Q=new i,K=new i,Z=new i,J=new i,$=new i,ee=new n,te=new i,ie=new h;return v}),define("Renderer/Context",["../Core/Check","../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/PixelFormat","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PixelDatatype","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./TextureCache","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M){"use strict";function R(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 O(e,t,i,r){for(var n=R(e,r)+": "+t.name+"(",o=0;o<i.length;++o)0!==o&&(n+=", "),n+=i[o];return n+=");"}function L(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new m(O(e,t,i,r))}function N(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 F(e,t){if(!a(t))return e;var i={};for(var r in e){var n=e[r];n instanceof Function?i[r]=function(i){return function(){var r=i.apply(e,arguments);return t(e,i,arguments),r}}(n):Object.defineProperty(i,r,N(e,r,t))}return i}function B(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function k(e,r){if("undefined"==typeof WebGLRenderingContext)throw new m("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=e,r=t(r,!0),r=o(r,{}),r.allowTextureFilterAnisotropic=o(r.allowTextureFilterAnisotropic,!0);var s=o(r.webgl,{});s.alpha=o(s.alpha,!1),s.stencil=o(s.stencil,!0);var l,u=o(r.requestWebgl2,!1)&&"undefined"!=typeof WebGL2RenderingContext,c=!1,d=r.getWebGLStub;if(a(d))l=d(e,s);else if(u&&(l=e.getContext("webgl2",s)||e.getContext("experimental-webgl2",s)||void 0,a(l)&&(c=!0)),a(l)||(l=e.getContext("webgl",s)||e.getContext("experimental-webgl",s)||void 0),!a(l))throw new m("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._gl=l,this._webgl2=c,this._id=n(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new w(this),this._textureCache=new D;var h=l;this._stencilBits=h.getParameter(h.STENCIL_BITS),C._maximumCombinedTextureImageUnits=h.getParameter(h.MAX_COMBINED_TEXTURE_IMAGE_UNITS),C._maximumCubeMapSize=h.getParameter(h.MAX_CUBE_MAP_TEXTURE_SIZE),C._maximumFragmentUniformVectors=h.getParameter(h.MAX_FRAGMENT_UNIFORM_VECTORS),C._maximumTextureImageUnits=h.getParameter(h.MAX_TEXTURE_IMAGE_UNITS),C._maximumRenderbufferSize=h.getParameter(h.MAX_RENDERBUFFER_SIZE),C._maximumTextureSize=h.getParameter(h.MAX_TEXTURE_SIZE),C._maximumVaryingVectors=h.getParameter(h.MAX_VARYING_VECTORS),C._maximumVertexAttributes=h.getParameter(h.MAX_VERTEX_ATTRIBS),C._maximumVertexTextureImageUnits=h.getParameter(h.MAX_VERTEX_TEXTURE_IMAGE_UNITS),C._maximumVertexUniformVectors=h.getParameter(h.MAX_VERTEX_UNIFORM_VECTORS);var p=h.getParameter(h.ALIASED_LINE_WIDTH_RANGE);C._minimumAliasedLineWidth=p[0],C._maximumAliasedLineWidth=p[1];var f=h.getParameter(h.ALIASED_POINT_SIZE_RANGE);C._minimumAliasedPointSize=f[0],C._maximumAliasedPointSize=f[1];var g=h.getParameter(h.MAX_VIEWPORT_DIMS);C._maximumViewportWidth=g[0],C._maximumViewportHeight=g[1];var v=h.getShaderPrecisionFormat(h.FRAGMENT_SHADER,h.HIGH_FLOAT);C._highpFloatSupported=0!==v.precision;var y=h.getShaderPrecisionFormat(h.FRAGMENT_SHADER,h.HIGH_INT);C._highpIntSupported=0!==y.rangeMax,this._antialias=h.getContextAttributes().antialias,this._standardDerivatives=!!B(h,["OES_standard_derivatives"]),this._blendMinmax=!!B(h,["EXT_blend_minmax"]),this._elementIndexUint=!!B(h,["OES_element_index_uint"]),this._depthTexture=!!B(h,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!B(h,["EXT_frag_depth"]),this._debugShaders=B(h,["WEBGL_debug_shaders"]),this._textureFloat=!!B(h,["OES_texture_float"]),this._textureHalfFloat=!!B(h,["OES_texture_half_float"]),this._textureFloatLinear=!!B(h,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!B(h,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!B(h,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._colorBufferHalfFloat=!!B(h,["EXT_color_buffer_half_float"]),this._s3tc=!!B(h,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!B(h,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!B(h,["WEBGL_compressed_texture_etc1"]);var b=r.allowTextureFilterAnisotropic?B(h,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=b,C._maximumTextureFilterAnisotropy=a(b)?h.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var S,E,x,P,M,R,O,L,N,F;if(c){var k=this;S=function(){return k._gl.createVertexArray()},E=function(e){k._gl.bindVertexArray(e)},x=function(e){k._gl.deleteVertexArray(e)},P=function(e,t,i,r,n){h.drawElementsInstanced(e,t,i,r,n)},M=function(e,t,i,r){h.drawArraysInstanced(e,t,i,r)},R=function(e,t){h.vertexAttribDivisor(e,t)},O=function(e){h.drawBuffers(e)}}else L=B(h,["OES_vertex_array_object"]),a(L)&&(S=function(){return L.createVertexArrayOES()},E=function(e){L.bindVertexArrayOES(e)},x=function(e){L.deleteVertexArrayOES(e)}),N=B(h,["ANGLE_instanced_arrays"]),a(N)&&(P=function(e,t,i,r,n){N.drawElementsInstancedANGLE(e,t,i,r,n)},M=function(e,t,i,r){N.drawArraysInstancedANGLE(e,t,i,r)},R=function(e,t){N.vertexAttribDivisorANGLE(e,t)}),F=B(h,["WEBGL_draw_buffers"]),a(F)&&(O=function(e){F.drawBuffersWEBGL(e)});this.glCreateVertexArray=S,this.glBindVertexArray=E,this.glDeleteVertexArray=x,this.glDrawElementsInstanced=P,this.glDrawArraysInstanced=M,this.glVertexAttribDivisor=R,this.glDrawBuffers=O,this._vertexArrayObject=!!L,this._instancedArrays=!!N,this._drawBuffers=!!F,C._maximumDrawBuffers=this.drawBuffers?h.getParameter(_.MAX_DRAW_BUFFERS):1,C._maximumColorAttachments=this.drawBuffers?h.getParameter(_.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new i(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var z=new I,V=new T(this),U=A.fromCache();this._defaultPassState=V,this._defaultRenderState=U,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=z,this._currentRenderState=U,this._currentPassState=V,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;G<C._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=r,this.cache={},A.apply(h,U,V)}function z(e){}function V(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,A.partialApply(e._gl,n,t,o,i,r)}function U(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=Y;if(a(t))t._bind(),z(e),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}function G(e,t,i,r,n){U(e,t),V(e,n,i,!1),r._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,r.maximumTextureUnitIndex)}function H(e,t,i,r){var n=t._primitiveType,s=t._vertexArray,l=t._offset,u=t._count,c=t.instanceCount;e._us.model=o(t._modelMatrix,h.IDENTITY),i._setUniforms(r,e._us,e.validateShaderProgram),s._bind();var d=s.indexBuffer;a(d)?(l*=d.bytesPerIndex,u=o(u,d.numberOfIndices),0===c?e._gl.drawElements(n,u,d.indexDatatype,l):e.glDrawElementsInstanced(n,u,d.indexDatatype,l,c)):(u=o(u,s.numberOfVertices),0===c?e._gl.drawArrays(n,l,u):e.glDrawArraysInstanced(n,l,u,c)),s._unBind()}function W(e,t,i){this._pickObjects=e,this.key=t,this.color=i}var q={};s(k.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}},textureCache:{get:function(){return this._textureCache}},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||this._webgl2}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},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||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},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=F(this._originalGLContext,e?L:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new P({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),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 b({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return q}}});var Y;"undefined"!=typeof WebGLRenderingContext&&(Y=[_.BACK]);var j=new y
- ;k.prototype.clear=function(e,t){e=o(e,j),t=o(t,this._defaultPassState);var r=this._gl,n=0,s=e.color,l=e.depth,u=e.stencil;a(s)&&(i.equals(this._clearColor,s)||(i.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),n|=r.COLOR_BUFFER_BIT),a(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),n|=r.DEPTH_BUFFER_BIT),a(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),n|=r.STENCIL_BUFFER_BIT),V(this,o(e.renderState,this._defaultRenderState),t,!0),U(this,o(e.framebuffer,t.framebuffer)),r.clear(n)},k.prototype.draw=function(e,t,i,r){t=o(t,this._defaultPassState);var n=o(e._framebuffer,t.framebuffer),a=o(e._renderState,this._defaultRenderState);i=o(i,e._shaderProgram),r=o(r,e._uniformMap),G(this,n,t,i,a),H(this,e,i,r)},k.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=Y;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)},k.prototype.readPixels=function(e){var t=this._gl;e=o(e,o.EMPTY_OBJECT);var i=Math.max(o(e.x,0),0),r=Math.max(o(e.y,0),0),n=o(e.width,t.drawingBufferWidth),s=o(e.height,t.drawingBufferHeight),l=e.framebuffer,u=E.UNSIGNED_BYTE;a(l)&&l.numberOfColorAttachments>0&&(u=l.getColorTexture(0).pixelDatatype);var c=p.createTypedArray(p.RGBA,u,n,s);return U(this,l),t.readPixels(i,r,n,s,p.RGBA,u,c),c};var X={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!a(e)){var t=new c({attributes:{position:new d({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new d({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:f.TRIANGLES});e=M.fromGeometry({context:this,geometry:t,attributeLocations:X,bufferUsage:v.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=o(t,o.EMPTY_OBJECT),new S({vertexArray:this.getViewportQuadVertexArray(),primitiveType:f.TRIANGLES,renderState:t.renderState,shaderProgram:x.fromCache({context:this,vertexShaderSource:g,fragmentShaderSource:e,attributeLocations:X}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},s(W.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),W.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new m("Out of unique Pick IDs.");return this._pickObjects[t]=e,new W(this._pickObjects,t,i.fromRgba(t))},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];a(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),l(this)},k}),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/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=(a.maximumRenderbufferSize,t(e.format,s.RGBA4)),l=i(e.width)?e.width:n.drawingBufferWidth,u=i(e.height)?e.height:n.drawingBufferHeight;this._gl=n,this._format=o,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,o,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return r(l.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),l.prototype._getRenderbuffer=function(){return this._renderbuffer},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),n(this)},l}),define("Renderer/loadCubeMap",["../Core/Check","../Core/defined","../Core/DeveloperError","../Core/Resource","../ThirdParty/when","./CubeMap"],function(e,t,i,r,n,o){"use strict";function a(e,t){var i={flipY:!0,preferImageBitmap:!0},a=[r.createIfNeeded(t.positiveX).fetchImage(i),r.createIfNeeded(t.negativeX).fetchImage(i),r.createIfNeeded(t.positiveY).fetchImage(i),r.createIfNeeded(t.negativeY).fetchImage(i),r.createIfNeeded(t.positiveZ).fetchImage(i),r.createIfNeeded(t.negativeZ).fetchImage(i)];return n.all(a,function(t){return new o({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return a}),define("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/Resource"],function(e,t,i,r,n){"use strict";function o(i){function o(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];n[4*d.x+d.y*a+3]>0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function a(){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 s=n.createIfNeeded(i.missingImageUrl),l=this;s.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(o).otherwise(a)}return o.prototype.isReady=function(){return this._isReady},o.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},o}),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/Check","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadCRN","../Core/loadKTX","../Core/Resource"],function(e,t,i,r,n,o,a){"use strict";function s(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,r.throwInstantiationError()}i(s.prototype,{ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},rectangle:{get:r.throwInstantiationError},tileWidth:{get:r.throwInstantiationError},tileHeight:{get:r.throwInstantiationError},maximumLevel:{get:r.throwInstantiationError},minimumLevel:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},tileDiscardPolicy:{get:r.throwInstantiationError},errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},proxy:{get:r.throwInstantiationError},hasAlphaChannel:{get:r.throwInstantiationError}}),s.prototype.getTileCredits=r.throwInstantiationError,s.prototype.requestImage=r.throwInstantiationError,s.prototype.pickFeatures=r.throwInstantiationError;var l=/\.ktx$/i,u=/\.crn$/i;return s.loadImage=function(e,i){var r=a.createIfNeeded(i);return l.test(r)?o(r):u.test(r)?n(r):t(e.tileDiscardPolicy)?r.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):r.fetchImage({preferImageBitmap:!0,flipY:!0})},s}),define("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/Math","../Core/Rectangle","../Core/Resource","../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,b){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(S._tileWidth=a.rows,S._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)S._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(b=m.handleError(b,S,S._errorEvent,s,void 0,void 0,void 0,u))}S._tilingScheme=new c({ellipsoid:i.ellipsoid})}if(S._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,p=l.unproject(new t(Math.max(d.xmin,-S._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(d.ymin,-S._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),f=l.unproject(new t(Math.min(d.xmax,S._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(d.ymax,S._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));S._rectangle=new h(p.longitude,p.latitude,f.longitude,f.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var v="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(b=m.handleError(b,S,S._errorEvent,v,void 0,void 0,void 0,u))}S._rectangle=h.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else S._rectangle=S._tilingScheme.rectangle;o(S._tileDiscardPolicy)||(S._tileDiscardPolicy=new y({missingImageUrl:T(S,0,0,S._maximumLevel).url,pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),S._useTiles=!0}else S._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(S._credit=new r(n.copyrightText)),S._ready=!0,S._readyPromise.resolve(!0),m.handleSuccess(b)}function s(e){var t="An error occurred while accessing "+S._resource.url+".";b=m.handleError(b,S,S._errorEvent,t,void 0,void 0,void 0,u),S._readyPromise.reject(new f(t))}function u(){var e=S._resource.getDerivedResource({queryParameters:{f:"json"}}),t=e.fetchJsonp();v(t,a,s)}i=n(i,{});var d=p.createIfNeeded(i.url);d.appendForwardSlash(),o(i.token)&&d.setQueryParameters({token:i.token}),this._resource=d,this._tileDiscardPolicy=i.tileDiscardPolicy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new c({ellipsoid:i.ellipsoid})),this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers;var C=i.credit;"string"==typeof C&&(C=new r(C)),this._credit=C,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var b,S=this;this._useTiles?u():(this._ready=!0,this._readyPromise.resolve(!0))}function T(e,t,i,r,n){var o;if(e._useTiles)o=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n});else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+","+a.south+","+a.east+","+a.north,l={bbox:s,size:e._tileWidth+","+e._tileHeight,format:"png",transparent:!0,f:"image"};e._tilingScheme.projection instanceof u?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers="show:"+e.layers),o=e._resource.getDerivedResource({url:"export",request:n,queryParameters:l})}return o}return a(S.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.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,r){return b.loadImage(this,T(this,e,t,i,r))},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,c,h,p=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme.projection instanceof u)l=d.toDegrees(a),c=d.toDegrees(s),h="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,c=f.y,h="3857"}var m="visible";o(this._layers)&&(m+=":"+this._layers);var g={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:l+","+c,mapExtent:p.west+","+p.south+","+p.east+","+p.north,imageDisplay:this._tileWidth+","+this._tileHeight+",96",sr:h,layers:m};return this._resource.getDerivedResource({url:"identify",queryParameters:g}).fetchJson().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/AutoExposure",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=void 0,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new e,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}function _(e){var t=e._framebuffers;if(r(t)){for(var i=t.length,n=0;n<i;++n)t[n].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}}function g(e,t){_(e);for(var i=e._width,r=e._height,n=a.RGBA,o=t.halfFloatingPointTexture?u.HALF_FLOAT:u.FLOAT,s=new c({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.NEAREST,magnificationFilter:h.NEAREST}),m=Math.ceil(Math.log(Math.max(i,r))/Math.log(3)),g=new Array(m),v=0;v<m;++v)i=Math.max(Math.ceil(i/3),1),r=Math.max(Math.ceil(r/3),1),g[v]=new l({context:t,colorTextures:[new d({context:t,width:i,height:r,pixelFormat:n,pixelDatatype:o,sampler:s})]});var y=g[m-1].getColorTexture(0);e._previousLuminance=new l({context:t,colorTextures:[new d({context:t,width:y.width,height:y.height,pixelFormat:n,pixelDatatype:o,sampler:s})]}),e._framebuffers=g}function v(e){var t=e._commands;if(r(t)){for(var i=t.length,n=0;n<i;++n)t[n].shaderProgram.destroy();e._commands=void 0}}function y(e,t){var i;if(0===t)i={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{var r=e._framebuffers[t-1].getColorTexture(0);i={colorTexture:function(){return r},colorTextureDimensions:function(){return r.dimensions}}}return i.minMaxLuminance=function(){return e._minMaxLuminance},i.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},i}function C(e,t){var i="uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates; \nfloat sampleTexture(vec2 offset) { \n";return i+=0===e?" vec4 color = texture2D(colorTexture, v_textureCoordinates + offset); \n return czm_luminance(color.rgb); \n":" return texture2D(colorTexture, v_textureCoordinates + offset).r; \n",i+="}\n\n",i+="uniform vec2 colorTextureDimensions; \nuniform vec2 minMaxLuminance; \nuniform sampler2D previousLuminance; \nvoid main() { \n float color = 0.0; \n float xStep = 1.0 / colorTextureDimensions.x; \n float yStep = 1.0 / colorTextureDimensions.y; \n int count = 0; \n for (int i = 0; i < 3; ++i) { \n for (int j = 0; j < 3; ++j) { \n vec2 offset; \n offset.x = -xStep + float(i) * xStep; \n offset.y = -yStep + float(j) * yStep; \n if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \n continue; \n } \n color += sampleTexture(offset); \n ++count; \n } \n } \n if (count > 0) { \n color /= float(count); \n } \n",e===t-1&&(i+=" float previous = texture2D(previousLuminance, vec2(0.5)).r; \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n color = previous + (color - previous) / (60.0 * 1.5); \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n"),i+=" gl_FragColor = vec4(color); \n} \n"}function b(e,t){v(e);for(var i=e._framebuffers,r=i.length,n=new Array(r),o=0;o<r;++o)n[o]=t.createViewportQuadCommand(C(o,r),{framebuffer:i[o],uniformMap:y(e,o)});e._commands=n}return n(m.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){var e=this._framebuffers;if(r(e))return e[e.length-1].getColorTexture(0)}}}),m.prototype.clear=function(e){var i=this._framebuffers;if(r(i)){var n=this._clearCommand;r(n)||(n=this._clearCommand=new s({color:new t(0,0,0,0),framebuffer:void 0}));for(var o=i.length,a=0;a<o;++a)n.framebuffer=i[a],n.execute(e)}},m.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;t===this._width&&i===this._height||(this._width=t,this._height=i,g(this,e),b(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;var r=this._framebuffers,n=r[r.length-1];r[r.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance,this._previousLuminance=n},m.prototype.execute=function(e,t){this._colorTexture=t;var i=this._commands;if(r(i))for(var n=i.length,o=0;o<n;++o)i[o].execute(e)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return _(this),v(this),o(this)},m}),define("Scene/Cesium3DTileColorBlendMode",["../Core/freezeObject"],function(e){"use strict";return e({HIGHLIGHT:0,REPLACE:1,MIX:2})}),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/Cesium3DTileBatchTable",["../Core/arrayFill","../Core/Cartesian2","../Core/Cartesian4","../Core/Check","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/RuntimeError","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","./AttributeType","./BlendingState","./Cesium3DTileColorBlendMode","./CullFace","./getBinaryAccessor","./StencilConstants","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L){"use strict";function N(e,r,n,o,a){this.featuresLength=r,this._translucentFeaturesLength=0;var s;u(n)&&(s=n.extensions),this._extensions=l(s,{});var c=F(n);this._properties=c,this._batchTableHierarchy=B(this,n,o),this._batchTableBinaryProperties=z(r,c,o),this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],this._content=e,this._colorChangedCallback=a;var d,h;if(r>0){var p=Math.min(r,g.maximumTextureSize),f=Math.ceil(r/g.maximumTextureSize),m=1/p,_=.5*m,v=1/f,y=.5*v;d=new t(p,f),h=new i(m,_,v,y)}this._textureDimensions=d,this._textureStep=h}function F(e){var t={};if(!u(e))return t;for(var i in e)e.hasOwnProperty(i)&&"HIERARCHY"!==i&&"extensions"!==i&&"extras"!==i&&(t[i]=n(e[i],!0));return t}function B(e,t,i){if(u(t)){var r=e._extensions["3DTILES_batch_table_hierarchy"],n=t.HIERARCHY;if(u(n)&&(N._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=n,r=n),u(r))return k(r,i)}}function k(t,i){var r,n,o,c=t.instancesLength,d=t.classes,h=t.classIds,p=t.parentCounts,f=t.parentIds,m=c;u(h.byteOffset)&&(h.componentType=l(h.componentType,s.UNSIGNED_SHORT),h.type=x.SCALAR,o=M(h),h=o.createArrayBufferView(i.buffer,i.byteOffset+h.byteOffset,c));var _;if(u(p))for(u(p.byteOffset)&&(p.componentType=l(p.componentType,s.UNSIGNED_SHORT),p.type=x.SCALAR,o=M(p),p=o.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,c)),_=new Uint16Array(c),m=0,r=0;r<c;++r)_[r]=m,m+=p[r];u(f)&&u(f.byteOffset)&&(f.componentType=l(f.componentType,s.UNSIGNED_SHORT),f.type=x.SCALAR,o=M(f),f=o.createArrayBufferView(i.buffer,i.byteOffset+f.byteOffset,m));var g=d.length;for(r=0;r<g;++r){var v=d[r].length,y=d[r].instances,C=z(v,y,i);d[r].instances=a(C,y)}var b=e(new Array(g),0),S=new Uint16Array(c);for(r=0;r<c;++r)n=h[r],S[r]=b[n],++b[n];return{classes:d,classIds:h,classIndexes:S,parentCounts:p,parentIndexes:_,parentIds:f}}function z(e,t,i){var r;for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],a=o.byteOffset;if(u(a)){var s=o.componentType,l=o.type;if(!u(s))throw new _("componentType is required.");if(!u(l))throw new _("type is required.");if(!u(i))throw new _("Property "+n+" requires a batch table binary.");var c=M(o),d=c.componentsPerAttribute,h=c.classType,p=c.createArrayBufferView(i.buffer,i.byteOffset+a,e);u(r)||(r={}),r[n]={typedArray:p,componentCount:d,type:h}}}return r}function V(e){var t=e._textureDimensions;return t.x*t.y*4}function U(t){if(!u(t._batchValues)){var i=V(t),r=new Uint8Array(i);e(r,255),t._batchValues=r}return t._batchValues}function G(t){if(!u(t._showAlphaProperties)){var i=2*t.featuresLength,r=new Uint8Array(i);e(r,255),t._showAlphaProperties=r}return t._showAlphaProperties}function H(e,t){var i=e.typedArray,r=e.componentCount;return 1===r?i[t]:e.type.unpack(i,t*r)}function W(e,t,i){var r=e.typedArray,n=e.componentCount;1===n?r[t]=i:e.type.pack(i,r,t*n)}function q(e,t,i){var r=e.classIds,n=e.parentCounts,o=e.parentIds,a=e.parentIndexes,s=r.length,l=ye;l.length=Math.max(l.length,s);var c=++be,d=Ce;for(d.length=0,d.push(t);d.length>0;)if(t=d.pop(),l[t]!==c){l[t]=c;var h=i(e,t);if(u(h))return h;for(var p=n[t],f=a[t],m=0;m<p;++m){var _=o[f+m];_!==t&&d.push(_)}}}function Y(e,t,i){for(var r=!0;r;){var n=i(e,t);if(u(n))return n;var o=e.parentIds[t];r=o!==t,t=o}}function j(e,t,i){var r=e.parentCounts,n=e.parentIds;return u(n)?u(r)?q(e,t,i):Y(e,t,i):i(e,t)}function X(e,t,i){var r=e._batchTableHierarchy,n=j(r,t,function(e,t){var r=e.classIds[t],n=e.classes[r].instances;if(u(n[i]))return!0});return u(n)}function Q(e,t,i){j(e._batchTableHierarchy,t,function(e,t){var r=e.classIds[t],n=e.classes[r].instances;for(var o in n)n.hasOwnProperty(o)&&-1===i.indexOf(o)&&i.push(o)})}function K(e,t,i){return j(e._batchTableHierarchy,t,function(e,t){var r=e.classIds[t],o=e.classes[r],a=e.classIndexes[t],s=o.instances[i];if(u(s))return u(s.typedArray)?H(s,a):n(s[a],!0)})}function Z(e,t,i,r){var o=e._batchTableHierarchy,a=j(o,t,function(e,t){var o=e.classIds[t],a=e.classes[o],s=e.classIndexes[t],l=a.instances[i];if(u(l))return u(l.typedArray)?W(l,s,r):l[s]=n(r,!0),!0});return u(a)}function J(e){return 1===e._textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function $(e,t){return e=T.replaceMain(e,"tile_main"),t?e+"uniform float tile_colorBlend; \nvoid tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n":e+"void tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n} \n"}function ee(e,t){for(var i,r="texture2D("+t,n=0,o=e.indexOf(r,n);o>-1;){for(var a=0,s=o;s<e.length;++s){var l=e.charAt(s);if("("===l)++a;else if(")"===l&&0===--a){i=s+1;break}}var u=e.slice(o,i),c="tile_diffuse_final("+u+", tile_diffuse)";e=e.slice(0,o)+c+e.slice(i),n=o+c.length,o=e.indexOf(r,n)}return e}function te(e,t,i){if(!u(t))return $(e,i);var r=new RegExp("(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+"+t+";"),n=e.match(r);if(!u(n))return $(e,i);var o=n[0],a=n[2];e=T.replaceMain(e,"tile_main"),e=e.replace(o,"");var s;if("vec3"===a||"vec4"===a){var l="vec3"===a?"vec4("+t+", 1.0)":t,c="vec3"===a?"tile_diffuse.xyz":"tile_diffuse";r=new RegExp(t,"g"),e=e.replace(r,c),s=" vec4 source = "+l+"; \n tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n tile_main(); \n"}else"sampler2D"===a&&(e=ee(e,t),s=" tile_diffuse = tile_featureColor; \n tile_main(); \n");return e="uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nbool isWhite(vec3 color) \n{ \n return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n"+o+"\n"+e+"\nvoid tile_color(vec4 tile_featureColor) \n{ \n"+s,i&&(e+=" tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}function ie(e){var t=e._content.tileset,i=t.colorBlendMode,r=t.colorBlendAmount;return i===D.HIGHLIGHT?0:i===D.REPLACE?1:i===D.MIX?f.clamp(r,f.EPSILON4,1):void 0}function re(e){var t=e._translucentFeaturesLength;return 0===t?Se.ALL_OPAQUE:t===e.featuresLength?Se.ALL_TRANSLUCENT:Se.OPAQUE_AND_TRANSLUCENT}function ne(e){var t=v.shallowClone(e),i=t.pass===y.TRANSLUCENT;return t.uniformMap=u(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return i},t}function oe(e){var t=v.shallowClone(e);return t.pass=y.TRANSLUCENT,t.renderState=de(e.renderState),t}function ae(e){var t=v.shallowClone(e);return t.renderState=he(e.renderState),t}function se(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!u(i)){var r=t.fragmentShaderSource.clone();r.defines=u(r.defines)?r.defines.slice(0):[],r.defines.push("DISABLE_LOG_DEPTH_FRAGMENT_WRITE"),i=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:t._attributeLocations})}return i}function le(e,t){var i=v.shallowClone(t),r=n(i.renderState,!0);return r.cull.enabled=!0,r.cull.face=I.FRONT,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.polygonOffset={enabled:!0,factor:5,units:5},r.stencilTest=R.setCesium3DTileBit(),r.stencilMask=R.CESIUM_3D_TILE_MASK,i.renderState=b.fromCache(r),i.castShadows=!1,i.receiveShadows=!1,i.shaderProgram=se(e,t.shaderProgram),i}function ue(e,t){var i=v.shallowClone(e),r=n(i.renderState,!0);return r.stencilTest.enabled=!0,r.stencilTest.mask=R.SKIP_LOD_MASK,r.stencilTest.reference=R.CESIUM_3D_TILE_MASK|t<<R.SKIP_LOD_BIT_SHIFT,r.stencilTest.frontFunction=O.GREATER_OR_EQUAL,r.stencilTest.frontOperation.zPass=L.REPLACE,r.stencilTest.backFunction=O.GREATER_OR_EQUAL,r.stencilTest.backOperation.zPass=L.REPLACE,r.stencilMask=R.CESIUM_3D_TILE_MASK|R.SKIP_LOD_MASK,i.renderState=b.fromCache(r),i}function ce(e){return(e.renderState.stencilTest.reference&R.SKIP_LOD_MASK)>>>R.SKIP_LOD_BIT_SHIFT}function de(e){var t=n(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=P.ALPHA_BLEND,b.fromCache(t)}function he(e){var t=n(e,!0);return t.stencilTest=R.setCesium3DTileBit(),t.stencilMask=R.CESIUM_3D_TILE_MASK,b.fromCache(t)}function pe(e,t,i){var r=e._textureDimensions;return new E({context:t,pixelFormat:m.RGBA,pixelDatatype:C.UNSIGNED_BYTE,source:{width:r.x,height:r.y,arrayBufferView:i},flipY:!1,sampler:new S({minificationFilter:w.NEAREST,magnificationFilter:A.NEAREST})})}function fe(e,t){var i=e.featuresLength;if(!u(e._pickTexture)&&i>0){for(var r=e._pickIds,n=V(e),a=new Uint8Array(n),s=e._content,l=0;l<i;++l){
- var c=t.createPickId(s.getFeature(l));r.push(c);var d=c.color,h=4*l;a[h]=o.floatToByte(d.red),a[h+1]=o.floatToByte(d.green),a[h+2]=o.floatToByte(d.blue),a[h+3]=o.floatToByte(d.alpha)}e._pickTexture=pe(e,t,a),s.tileset._statistics.batchTableByteLength+=e._pickTexture.sizeInBytes}}function me(e){var t=e._textureDimensions;e._batchTexture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}var _e=o.WHITE;N._deprecationWarning=d,c(N.prototype,{memorySizeInBytes:{get:function(){var e=0;return u(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),u(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}}}),N.getBinaryProperties=function(e,t,i){return z(e,t,i)},N.prototype.setShow=function(e,t){if(!t||u(this._showAlphaProperties)){var i=G(this),r=2*e,n=t?255:0;if(i[r]!==n){i[r]=n;U(this)[4*e+3]=t?i[r+1]:0,this._batchValuesDirty=!0}}},N.prototype.setAllShow=function(e){for(var t=this.featuresLength,i=0;i<t;++i)this.setShow(i,e)},N.prototype.getShow=function(e){if(!u(this._showAlphaProperties))return!0;var t=2*e;return 255===this._showAlphaProperties[t]};var ge=new Array(4);N.prototype.setColor=function(e,t){if(!o.equals(t,_e)||u(this._batchValues)){var i=t.toBytes(ge),r=i[3],n=U(this),a=4*e,s=G(this),l=2*e;if(n[a]!==i[0]||n[a+1]!==i[1]||n[a+2]!==i[2]||s[l+1]!==r){n[a]=i[0],n[a+1]=i[1],n[a+2]=i[2];var c=255!==s[l+1],d=0!==s[l];n[a+3]=d?r:0,s[l+1]=r;var h=255!==r;h&&!c?++this._translucentFeaturesLength:!h&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,u(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}}},N.prototype.setAllColor=function(e){for(var t=this.featuresLength,i=0;i<t;++i)this.setColor(i,e)},N.prototype.getColor=function(e,t){if(!u(this._batchValues))return o.clone(_e,t);var i=this._batchValues,r=4*e,n=this._showAlphaProperties,a=2*e;return o.fromBytes(i[r],i[r+1],i[r+2],n[a+1],t)},N.prototype.getPickColor=function(e){return this._pickIds[e]};var ve=new o;N.prototype.applyStyle=function(e){if(!u(e))return this.setAllColor(_e),void this.setAllShow(!0);for(var t=this._content,i=this.featuresLength,r=0;r<i;++r){var n=t.getFeature(r),o=u(e.color)?e.color.evaluateColor(n,ve):_e,a=!u(e.show)||e.show.evaluate(n);this.setColor(r,o),this.setShow(r,a)}};var ye=[],Ce=[],be=0;N.prototype.isClass=function(e,t){var i=this._batchTableHierarchy;if(!u(i))return!1;var r=j(i,e,function(e,i){var r=e.classIds[i];if(e.classes[r].name===t)return!0});return u(r)},N.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t},N.prototype.getExactClassName=function(e){var t=this._batchTableHierarchy;if(u(t)){var i=t.classIds[e];return t.classes[i].name}},N.prototype.hasProperty=function(e,t){return u(this._properties[t])||u(this._batchTableHierarchy)&&X(this,e,t)},N.prototype.getPropertyNames=function(e,t){t=u(t)?t:[],t.length=0;var i=Object.keys(this._properties);return t.push.apply(t,i),u(this._batchTableHierarchy)&&Q(this,e,t),t},N.prototype.getProperty=function(e,t){if(u(this._batchTableBinaryProperties)){var i=this._batchTableBinaryProperties[t];if(u(i))return H(i,e)}var r=this._properties[t];if(u(r))return n(r[e],!0);if(u(this._batchTableHierarchy)){var o=K(this,e,t);if(u(o))return o}},N.prototype.setProperty=function(e,t,i){var r=this.featuresLength;if(u(this._batchTableBinaryProperties)){var o=this._batchTableBinaryProperties[t];if(u(o))return void W(o,e,i)}if(!u(this._batchTableHierarchy)||!Z(this,e,t,i)){var a=this._properties[t];u(a)||(this._properties[t]=new Array(r),a=this._properties[t]),a[e]=n(i,!0)}},N.prototype.getVertexShaderCallback=function(e,t,i){if(0!==this.featuresLength){var r=this;return function(n){var o,a=te(n,i,!1);return g.maximumVertexTextureImageUnits>0?(o="",e&&(o+="uniform bool tile_translucentCommand; \n"),o+="uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec2 st = computeSt("+t+"); \n vec4 featureProperties = texture2D(tile_batchTexture, st); \n tile_color(featureProperties); \n float show = ceil(featureProperties.a); \n gl_Position *= show; \n",e&&(o+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),o+=" tile_featureColor = featureProperties; \n tile_featureSt = st; \n}"):o="varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_color(vec4(1.0)); \n tile_featureSt = computeSt("+t+"); \n}",a+"\n"+J(r)+o}}},N.prototype.getFragmentShaderCallback=function(e,t){if(0!==this.featuresLength)return function(i){return i=te(i,t,!0),g.maximumVertexTextureImageUnits>0?i+="uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n}":(e&&(i+="uniform bool tile_translucentCommand; \n"),i+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",e&&(i+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),i+=" tile_color(featureProperties); \n} \n"),i}},N.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=T.replaceMain(e,"tile_main"),g.maximumVertexTextureImageUnits>0?e+="uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n gl_FragColor = tile_featureColor; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n gl_FragColor = featureProperties; \n} \n",e}},N.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){var e=this;return function(t){return a(t,{tile_batchTexture:function(){return l(e._batchTexture,e._defaultTexture)},tile_textureDimensions:function(){return e._textureDimensions},tile_textureStep:function(){return e._textureStep},tile_colorBlend:function(){return ie(e)},tile_pickTexture:function(){return e._pickTexture}})}}},N.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};var Se={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return N.prototype.addDerivedCommands=function(e,t){for(var i=e.commandList,r=i.length,n=this._content._tile,o=n._finalResolution,a=n.tileset,s=a._skipLevelOfDetail&&a._hasMixedContent&&e.context.stencilBuffer,l=re(this),c=t;c<r;++c){var d=i[c],h=d.derivedCommands.tileset;u(h)&&!d.dirty||(h={},d.derivedCommands.tileset=h,h.originalCommand=ne(d),d.dirty=!1);var p=h.originalCommand;l!==Se.ALL_OPAQUE&&d.pass!==y.TRANSLUCENT&&(u(h.translucent)||(h.translucent=oe(p))),l!==Se.ALL_TRANSLUCENT&&d.pass!==y.TRANSLUCENT&&(u(h.opaque)||(h.opaque=ae(p)),s&&(o||(u(h.zback)||(h.zback=le(e.context,p)),a._backfaceCommands.push(h.zback)),u(h.stencil)&&n._selectionDepth===ce(h.stencil)||(d.renderState.depthMask?h.stencil=ue(p,n._selectionDepth):h.stencil=h.opaque)));var f=s?h.stencil:h.opaque,m=h.translucent;d.pass!==y.TRANSLUCENT?(l===Se.ALL_OPAQUE&&(i[c]=f),l===Se.ALL_TRANSLUCENT&&(i[c]=m),l===Se.OPAQUE_AND_TRANSLUCENT&&(i[c]=f,i.push(m))):i[c]=p}},N.prototype.update=function(e,t){var i=t.context;this._defaultTexture=i.defaultTexture;var r=t.passes;(r.pick||r.postProcess)&&fe(this,i),this._batchValuesDirty&&(this._batchValuesDirty=!1,u(this._batchTexture)||(this._batchTexture=pe(this,i,this._batchValues),e._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes),me(this))},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return h(this)},N}),define("Scene/Cesium3DTileFeature",["../Core/Color","../Core/defined","../Core/defineProperties"],function(e,t,i){"use strict";function r(e,t){this._content=e,this._batchId=t,this._color=void 0}return i(r.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return t(this._color)||(this._color=new e),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}}),r.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},r.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},r.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},r.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},r.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},r.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},r.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},r}),define("Scene/Cesium3DTileFeatureTable",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined"],function(e,t,i){"use strict";function r(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function n(t,r,n,o,a,s){var l=t._cachedTypedArrays,u=l[r];return i(u)||(u=e.createArrayBufferView(n,t.buffer.buffer,t.buffer.byteOffset+s,a*o),l[r]=u),u}function o(t,r,n,o){var a=t._cachedTypedArrays,s=a[r];return i(s)||(s=e.createTypedArray(n,o),a[r]=s),s}return r.prototype.getGlobalProperty=function(r,o,a){var s=this.json[r];if(i(s))return i(s.byteOffset)?(o=t(o,e.UNSIGNED_INT),a=t(a,1),n(this,r,o,a,1,s.byteOffset)):s},r.prototype.getPropertyArray=function(t,r,a){var s=this.json[t];if(i(s))return i(s.byteOffset)?(i(s.componentType)&&(r=e.fromName(s.componentType)),n(this,t,r,a,this.featuresLength,s.byteOffset)):o(this,t,r,s)},r.prototype.getProperty=function(e,t,r,n,o){var a=this.json[e];if(i(a)){var s=this.getPropertyArray(e,t,r);if(1===r)return s[n];for(var l=0;l<r;++l)o[l]=s[r*n+l];return o}},r}),define("Scene/Vector3DTileBatch",[],function(){"use strict";function e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}return e}),define("Shaders/VectorTileVS",[],function(){"use strict";return"attribute vec3 position;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelViewProjection;\nvoid main()\n{\ngl_Position = czm_depthClampFarPlane(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n"}),define("ThirdParty/jsep",[],function(){if(function(e){"use strict";var t=function(e,t){var i=new Error(e+" at character "+t);throw i.index=t,i.description=e,i},i={"-":!0,"!":!0,"~":!0,"+":!0},r={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},n=function(e){var t,i=0;for(var r in e)(t=r.length)>i&&e.hasOwnProperty(r)&&(i=t);return i},o=n(i),a=n(r),s={true:!0,false:!1,null:null},l=function(e){return r[e]||0},u=function(e,t,i){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:i}},c=function(e){return e>=48&&e<=57},d=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!r[String.fromCharCode(e)]},h=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!r[String.fromCharCode(e)]},p=function(e){for(var n,p,f=0,m=e.charAt,_=e.charCodeAt,g=function(t){return m.call(e,t)},v=function(t){return _.call(e,t)},y=e.length,C=function(){for(var e=v(f);32===e||9===e;)e=v(++f)},b=function(){var e,i,r=T();return C(),63!==v(f)?r:(f++,e=b(),e||t("Expected expression",f),C(),58===v(f)?(f++,i=b(),i||t("Expected expression",f),{type:"ConditionalExpression",test:r,consequent:e,alternate:i}):void t("Expected :",f))},S=function(){C();for(var t=e.substr(f,a),i=t.length;i>0;){if(r.hasOwnProperty(t))return f+=i,t;t=t.substr(0,--i)}return!1},T=function(){var e,i,r,n,o,a,s,c;if(a=E(),!(i=S()))return a;for(o={value:i,prec:l(i)},s=E(),s||t("Expected expression after "+i,f),n=[a,o,s];(i=S())&&0!==(r=l(i));){for(o={value:i,prec:r};n.length>2&&r<=n[n.length-2].prec;)s=n.pop(),i=n.pop().value,a=n.pop(),e=u(i,a,s),n.push(e);e=E(),e||t("Expected expression after "+i,f),n.push(o,e)}for(c=n.length-1,e=n[c];c>1;)e=u(n[c-1].value,n[c-2],e),c-=2;return e},E=function(){var t,r,n;if(C(),t=v(f),c(t)||46===t)return A();if(39===t||34===t)return w();if(d(t)||40===t)return D();if(91===t)return M();for(r=e.substr(f,o),n=r.length;n>0;){if(i.hasOwnProperty(r))return f+=n,{type:"UnaryExpression",operator:r,argument:E(),prefix:!0};r=r.substr(0,--n)}return!1},A=function(){for(var e,i,r="";c(v(f));)r+=g(f++);if(46===v(f))for(r+=g(f++);c(v(f));)r+=g(f++);if("e"===(e=g(f))||"E"===e){for(r+=g(f++),e=g(f),"+"!==e&&"-"!==e||(r+=g(f++));c(v(f));)r+=g(f++);c(v(f-1))||t("Expected exponent ("+r+g(f)+")",f)}return i=v(f),d(i)?t("Variable names cannot start with a number ("+r+g(f)+")",f):46===i&&t("Unexpected period",f),{type:"Literal",value:parseFloat(r),raw:r}},w=function(){for(var e,i="",r=g(f++),n=!1;f<y;){if((e=g(f++))===r){n=!0;break}if("\\"===e)switch(e=g(f++)){case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:i+="\\"+e}else i+=e}return n||t('Unclosed quote after "'+i+'"',f),{type:"Literal",value:i,raw:r+i+r}},x=function(){var i,r=v(f),n=f;for(d(r)?f++:t("Unexpected "+g(f),f);f<y&&(r=v(f),h(r));)f++;return i=e.slice(n,f),s.hasOwnProperty(i)?{type:"Literal",value:s[i],raw:i}:"this"===i?{type:"ThisExpression"}:{type:"Identifier",name:i}},P=function(e){for(var i,r,n=[],o=!1;f<y;){if(C(),(i=v(f))===e){o=!0,f++;break}44===i?f++:(r=b(),r&&"Compound"!==r.type||t("Expected comma",f),n.push(r))}return o||t("Expected "+String.fromCharCode(e),f),n},D=function(){var e,i;for(e=v(f),i=40===e?I():x(),C(),e=v(f);46===e||91===e||40===e;)f++,46===e?(C(),i={type:"MemberExpression",computed:!1,object:i,property:x()}):91===e?(i={type:"MemberExpression",computed:!0,object:i,property:b()},C(),e=v(f),93!==e&&t("Unclosed [",f),f++):40===e&&(i={type:"CallExpression",arguments:P(41),callee:i}),C(),e=v(f);return i},I=function(){f++;var e=b();if(C(),41===v(f))return f++,e;t("Unclosed (",f)},M=function(){return f++,{type:"ArrayExpression",elements:P(93)}},R=[];f<y;)n=v(f),59===n||44===n?f++:(p=b())?R.push(p):f<y&&t('Unexpected "'+g(f)+'"',f);return 1===R.length?R[0]:{type:"Compound",body:R}};if(p.version="0.3.1",p.toString=function(){return"JavaScript Expression Parser (JSEP) v"+p.version},p.addUnaryOp=function(e){return o=Math.max(e.length,o),i[e]=!0,this},p.addBinaryOp=function(e,t){return a=Math.max(e.length,a),r[e]=t,this},p.addLiteral=function(e,t){return s[e]=t,this},p.removeUnaryOp=function(e){return delete i[e],e.length===o&&(o=n(i)),this},p.removeAllUnaryOps=function(){return i={},o=0,this},p.removeBinaryOp=function(e){return delete r[e],e.length===a&&(a=n(r)),this},p.removeAllBinaryOps=function(){return r={},a=0,this},p.removeLiteral=function(e){return delete s[e],this},p.removeAllLiterals=function(){return s={},this},"undefined"==typeof exports){var f=e.jsep;e.jsep=p,p.noConflict=function(){return e.jsep===p&&(e.jsep=f),p}}else"undefined"!=typeof module&&module.exports?exports=module.exports=p:exports.parse=p}(this),"undefined"!=typeof jsep)return jsep.noConflict()}),define("Scene/ExpressionNodeType",["../Core/freezeObject"],function(e){"use strict";return e({VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18})}),define("Scene/Expression",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Check","../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/isArray","../Core/Math","../Core/RuntimeError","../ThirdParty/jsep","./ExpressionNodeType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t){this._expression=e,e=w(e,t),e=D(x(e)),d.addBinaryOp("=~",0),d.addBinaryOp("!~",0);var i;try{i=d(e)}catch(e){throw new c(e)}this._runtimeAst=V(this,i)}function f(e){return e-Math.floor(e)}function m(e){return Math.pow(2,e)}function _(e){return u.log2(e)}function g(r){return function(n,o){if("number"==typeof o)return r(o);if(o instanceof e)return e.fromElements(r(o.x),r(o.y),ee.getCartesian2());if(o instanceof t)return t.fromElements(r(o.x),r(o.y),r(o.z),ee.getCartesian3());if(o instanceof i)return i.fromElements(r(o.x),r(o.y),r(o.z),r(o.w),ee.getCartesian4());throw new c('Function "'+n+'" requires a vector or number argument. Argument is '+o+".")}}function v(r,n){return function(o,a,s){if(n&&"number"==typeof s){if("number"==typeof a)return r(a,s);if(a instanceof e)return e.fromElements(r(a.x,s),r(a.y,s),ee.getCartesian2());if(a instanceof t)return t.fromElements(r(a.x,s),r(a.y,s),r(a.z,s),ee.getCartesian3());if(a instanceof i)return i.fromElements(r(a.x,s),r(a.y,s),r(a.z,s),r(a.w,s),ee.getCartesian4())}if("number"==typeof a&&"number"==typeof s)return r(a,s);if(a instanceof e&&s instanceof e)return e.fromElements(r(a.x,s.x),r(a.y,s.y),ee.getCartesian2());if(a instanceof t&&s instanceof t)return t.fromElements(r(a.x,s.x),r(a.y,s.y),r(a.z,s.z),ee.getCartesian3());if(a instanceof i&&s instanceof i)return i.fromElements(r(a.x,s.x),r(a.y,s.y),r(a.z,s.z),r(a.w,s.w),ee.getCartesian4());throw new c('Function "'+o+'" requires vector or number arguments of matching types. Arguments are '+a+" and "+s+".")}}function y(r,n){return function(o,a,s,l){if(n&&"number"==typeof l){if("number"==typeof a&&"number"==typeof s)return r(a,s,l);if(a instanceof e&&s instanceof e)return e.fromElements(r(a.x,s.x,l),r(a.y,s.y,l),ee.getCartesian2());if(a instanceof t&&s instanceof t)return t.fromElements(r(a.x,s.x,l),r(a.y,s.y,l),r(a.z,s.z,l),ee.getCartesian3());if(a instanceof i&&s instanceof i)return i.fromElements(r(a.x,s.x,l),r(a.y,s.y,l),r(a.z,s.z,l),r(a.w,s.w,l),ee.getCartesian4())}if("number"==typeof a&&"number"==typeof s&&"number"==typeof l)return r(a,s,l);if(a instanceof e&&s instanceof e&&l instanceof e)return e.fromElements(r(a.x,s.x,l.x),r(a.y,s.y,l.y),ee.getCartesian2());if(a instanceof t&&s instanceof t&&l instanceof t)return t.fromElements(r(a.x,s.x,l.x),r(a.y,s.y,l.y),r(a.z,s.z,l.z),ee.getCartesian3());if(a instanceof i&&s instanceof i&&l instanceof i)return i.fromElements(r(a.x,s.x,l.x),r(a.y,s.y,l.y),r(a.z,s.z,l.z),r(a.w,s.w,l.w),ee.getCartesian4());throw new c('Function "'+o+'" requires vector or number arguments of matching types. Arguments are '+a+", "+s+", and "+l+".")}}function C(r,n){if("number"==typeof n)return Math.abs(n);if(n instanceof e)return e.magnitude(n);if(n instanceof t)return t.magnitude(n);if(n instanceof i)return i.magnitude(n);throw new c('Function "'+r+'" requires a vector or number argument. Argument is '+n+".")}function b(r,n){if("number"==typeof n)return 1;if(n instanceof e)return e.normalize(n,ee.getCartesian2());if(n instanceof t)return t.normalize(n,ee.getCartesian3());if(n instanceof i)return i.normalize(n,ee.getCartesian4());throw new c('Function "'+r+'" requires a vector or number argument. Argument is '+n+".")}function S(r,n,o){if("number"==typeof n&&"number"==typeof o)return Math.abs(n-o);if(n instanceof e&&o instanceof e)return e.distance(n,o);if(n instanceof t&&o instanceof t)return t.distance(n,o);if(n instanceof i&&o instanceof i)return i.distance(n,o);throw new c('Function "'+r+'" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")}function T(r,n,o){if("number"==typeof n&&"number"==typeof o)return n*o;if(n instanceof e&&o instanceof e)return e.dot(n,o);if(n instanceof t&&o instanceof t)return t.dot(n,o);if(n instanceof i&&o instanceof i)return i.dot(n,o);throw new c('Function "'+r+'" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")}function E(e,i,r){if(i instanceof t&&r instanceof t)return t.cross(i,r,ee.getCartesian3());throw new c('Function "'+e+'" requires vec3 arguments. Arguments are '+i+" and "+r+".")}function A(e,t,i,r,n){this._type=e,this._value=t,this._left=i,this._right=r,this._test=n,this.evaluate=void 0,U(this)}function w(e,t){if(!o(t))return e;for(var i in t)if(t.hasOwnProperty(i)){var r=new RegExp("\\$\\{"+i+"\\}","g"),n="("+t[i]+")";o(n)&&(e=e.replace(r,n))}return e}function x(e){return e.replace(ne,oe)}function P(e){return e.replace(ae,"\\")}function D(e){for(var t=e,i="",r=t.indexOf("${");r>=0;){var n,o=t.indexOf("'"),a=t.indexOf('"');if(o>=0&&o<r)n=t.indexOf("'",o+1),i+=t.substr(0,n+1),t=t.substr(n+1),r=t.indexOf("${");else if(a>=0&&a<r)n=t.indexOf('"',a+1),i+=t.substr(0,n+1),t=t.substr(n+1),r=t.indexOf("${");else{i+=t.substr(0,r);var s=t.indexOf("}");if(s<0)throw new c("Unmatched {.");i+="czm_"+t.substr(r+2,s-(r+2)),t=t.substr(s+1),r=t.indexOf("${")}}return i+=t}function I(e){var t=typeof e.value;return null===e.value?new A(h.LITERAL_NULL,null):"boolean"===t?new A(h.LITERAL_BOOLEAN,e.value):"number"===t?new A(h.LITERAL_NUMBER,e.value):"string"===t?e.value.indexOf("${")>=0?new A(h.VARIABLE_IN_STRING,e.value):new A(h.LITERAL_STRING,P(e.value)):void 0}function M(e,t){var i,r,n,a,s=t.arguments,l=s.length;if("MemberExpression"===t.callee.type){i=t.callee.property.name;var u=t.callee.object;if("test"===i||"exec"===i){if("regExp"!==u.callee.name)throw new c(i+" is not a function.");return 0===l?"test"===i?new A(h.LITERAL_BOOLEAN,!1):new A(h.LITERAL_NULL,null):(n=V(e,u),a=V(e,s[0]),new A(h.FUNCTION_CALL,i,n,a))}if("toString"===i)return r=V(e,u),new A(h.FUNCTION_CALL,i,r);throw new c('Unexpected function call "'+i+'".')}if("color"===(i=t.callee.name)){if(0===l)return new A(h.LITERAL_COLOR,i);if(r=V(e,s[0]),o(s[1])){var d=V(e,s[1]);return new A(h.LITERAL_COLOR,i,[r,d])}return new A(h.LITERAL_COLOR,i,[r])}if("rgb"===i||"hsl"===i){if(l<3)throw new c(i+" requires three arguments.");return r=[V(e,s[0]),V(e,s[1]),V(e,s[2])],new A(h.LITERAL_COLOR,i,r)}if("rgba"===i||"hsla"===i){if(l<4)throw new c(i+" requires four arguments.");return r=[V(e,s[0]),V(e,s[1]),V(e,s[2]),V(e,s[3])],new A(h.LITERAL_COLOR,i,r)}if("vec2"===i||"vec3"===i||"vec4"===i){r=new Array(l);for(var p=0;p<l;++p)r[p]=V(e,s[p]);return new A(h.LITERAL_VECTOR,i,r)}if("isNaN"===i||"isFinite"===i)return 0===l?"isNaN"===i?new A(h.LITERAL_BOOLEAN,!0):new A(h.LITERAL_BOOLEAN,!1):(r=V(e,s[0]),new A(h.UNARY,i,r));if("isExactClass"===i||"isClass"===i){if(l<1||l>1)throw new c(i+" requires exactly one argument.");return r=V(e,s[0]),new A(h.UNARY,i,r)}if("getExactClassName"===i){if(l>0)throw new c(i+" does not take any argument.");return new A(h.UNARY,i)}if(o(le[i])){if(1!==l)throw new c(i+" requires exactly one argument.");return r=V(e,s[0]),new A(h.UNARY,i,r)}if(o(ue[i])){if(2!==l)throw new c(i+" requires exactly two arguments.");return n=V(e,s[0]),a=V(e,s[1]),new A(h.BINARY,i,n,a)}if(o(ce[i])){if(3!==l)throw new c(i+" requires exactly three arguments.");n=V(e,s[0]),a=V(e,s[1]);var f=V(e,s[2]);return new A(h.TERNARY,i,n,a,f)}if("Boolean"===i)return 0===l?new A(h.LITERAL_BOOLEAN,!1):(r=V(e,s[0]),new A(h.UNARY,i,r));if("Number"===i)return 0===l?new A(h.LITERAL_NUMBER,0):(r=V(e,s[0]),new A(h.UNARY,i,r));if("String"===i)return 0===l?new A(h.LITERAL_STRING,""):(r=V(e,s[0]),new A(h.UNARY,i,r));if("regExp"===i)return R(e,t);throw new c('Unexpected function call "'+i+'".')}function R(e,t){var i=t.arguments;if(0===i.length)return new A(h.LITERAL_REGEX,new RegExp);var r,n=V(e,i[0]);if(i.length>1){var o=V(e,i[1]);if(B(n)&&B(o)){try{r=new RegExp(P(String(n._value)),o._value)}catch(e){throw new c(e)}return new A(h.LITERAL_REGEX,r)}return new A(h.REGEX,n,o)}if(B(n)){try{r=new RegExp(P(String(n._value)))}catch(e){throw new c(e)}return new A(h.LITERAL_REGEX,r)}return new A(h.REGEX,n)}function O(e){if(k(e.name)){var t=z(e.name);return"tiles3d_"===t.substr(0,8)?new A(h.BUILTIN_VARIABLE,t):new A(h.VARIABLE,t)}if("NaN"===e.name)return new A(h.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new A(h.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new A(h.LITERAL_UNDEFINED,void 0);throw new c(e.name+" is not defined.")}function L(e){var t=e.property.name;return"PI"===t?new A(h.LITERAL_NUMBER,Math.PI):"E"===t?new A(h.LITERAL_NUMBER,Math.E):void 0}function N(e){if("POSITIVE_INFINITY"===e.property.name)return new A(h.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function F(e,t){if("Math"===t.object.name)return L(t);if("Number"===t.object.name)return N(t);var i,r=V(e,t.object);return t.computed?(i=V(e,t.property),new A(h.MEMBER,"brackets",r,i)):(i=new A(h.LITERAL_STRING,t.property.name),new A(h.MEMBER,"dot",r,i))}function B(e){return e._type>=h.LITERAL_NULL}function k(e){return"czm_"===e.substr(0,4)}function z(e){return e.substr(4)}function V(e,t){var i,r,n,o;if("Literal"===t.type)i=I(t);else if("CallExpression"===t.type)i=M(e,t);else if("Identifier"===t.type)i=O(t);else if("UnaryExpression"===t.type){r=t.operator;var a=V(e,t.argument);if(!(te.indexOf(r)>-1))throw new c('Unexpected operator "'+r+'".');i=new A(h.UNARY,r,a)}else if("BinaryExpression"===t.type){if(r=t.operator,n=V(e,t.left),o=V(e,t.right),!(ie.indexOf(r)>-1))throw new c('Unexpected operator "'+r+'".');i=new A(h.BINARY,r,n,o)}else if("LogicalExpression"===t.type)r=t.operator,n=V(e,t.left),o=V(e,t.right),ie.indexOf(r)>-1&&(i=new A(h.BINARY,r,n,o));else if("ConditionalExpression"===t.type){var s=V(e,t.test);n=V(e,t.consequent),o=V(e,t.alternate),i=new A(h.CONDITIONAL,"?",n,o,s)}else if("MemberExpression"===t.type)i=F(e,t);else{if("ArrayExpression"!==t.type)throw new c("Compound"===t.type?"Provide exactly one expression.":"Cannot parse expression.");for(var l=[],u=0;u<t.elements.length;u++)l[u]=V(e,t.elements[u]);i=new A(h.ARRAY,l)}return i}function U(e){e._type===h.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===h.FUNCTION_CALL?"test"===e._value?e.evaluate=e._evaluateRegExpTest:"exec"===e._value?e.evaluate=e._evaluateRegExpExec:"toString"===e._value&&(e.evaluate=e._evaluateToString):e._type===h.UNARY?"!"===e._value?e.evaluate=e._evaluateNot:"-"===e._value?e.evaluate=e._evaluateNegative:"+"===e._value?e.evaluate=e._evaluatePositive:"isNaN"===e._value?e.evaluate=e._evaluateNaN:"isFinite"===e._value?e.evaluate=e._evaluateIsFinite:"isExactClass"===e._value?e.evaluate=e._evaluateIsExactClass:"isClass"===e._value?e.evaluate=e._evaluateIsClass:"getExactClassName"===e._value?e.evaluate=e._evaluateGetExactClassName:"Boolean"===e._value?e.evaluate=e._evaluateBooleanConversion:"Number"===e._value?e.evaluate=e._evaluateNumberConversion:"String"===e._value?e.evaluate=e._evaluateStringConversion:o(le[e._value])&&(e.evaluate=H(e._value)):e._type===h.BINARY?"+"===e._value?e.evaluate=e._evaluatePlus:"-"===e._value?e.evaluate=e._evaluateMinus:"*"===e._value?e.evaluate=e._evaluateTimes:"/"===e._value?e.evaluate=e._evaluateDivide:"%"===e._value?e.evaluate=e._evaluateMod:"==="===e._value?e.evaluate=e._evaluateEqualsStrict:"!=="===e._value?e.evaluate=e._evaluateNotEqualsStrict:"<"===e._value?e.evaluate=e._evaluateLessThan:"<="===e._value?e.evaluate=e._evaluateLessThanOrEquals:">"===e._value?e.evaluate=e._evaluateGreaterThan:">="===e._value?e.evaluate=e._evaluateGreaterThanOrEquals:"&&"===e._value?e.evaluate=e._evaluateAnd:"||"===e._value?e.evaluate=e._evaluateOr:"=~"===e._value?e.evaluate=e._evaluateRegExpMatch:"!~"===e._value?e.evaluate=e._evaluateRegExpNotMatch:o(ue[e._value])&&(e.evaluate=W(e._value)):e._type===h.TERNARY?e.evaluate=q(e._value):e._type===h.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===h.ARRAY?e.evaluate=e._evaluateArray:e._type===h.VARIABLE?e.evaluate=e._evaluateVariable:e._type===h.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===h.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===h.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===h.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===h.REGEX?e.evaluate=e._evaluateRegExp:e._type===h.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=G):e.evaluate=e._evaluateLiteral}function G(e){return o(e)?e.content.tileset.timeSinceLoad:0}function H(e){var t=le[e];return function(i){var r=this._left.evaluate(i);return t(e,r)}}function W(e){var t=ue[e];return function(i){var r=this._left.evaluate(i),n=this._right.evaluate(i);return t(e,r,n)}}function q(e){var t=ce[e];return function(i){var r=this._left.evaluate(i),n=this._right.evaluate(i),o=this._test.evaluate(i);return t(e,r,n,o)}}function Y(e,t){if(o(e))return e.getProperty(t)}function j(e){return"feature"===e._value}function X(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==h.LITERAL_NUMBER)return;var o=t[0]._value,a=t[1]._value,s=t[2]._value,l=4===i?t[3]._value:1;return n.fromHsl(o,a,s,l,se)}function Q(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==h.LITERAL_NUMBER)return;var n=se;return n.red=t[0]._value/255,n.green=t[1]._value/255,n.blue=t[2]._value/255,n.alpha=4===i?t[3]._value:1,n}function K(e){return e%1==0?e.toFixed(1):e.toString()}function Z(e){return"vec3("+K(e.red)+", "+K(e.green)+", "+K(e.blue)+")"}function J(e){return"vec4("+K(e.red)+", "+K(e.green)+", "+K(e.blue)+", "+K(e.alpha)+")"}function $(e,t,i,r){for(var n=e.length,o=new Array(n),a=0;a<n;++a)o[a]=e[a].getShaderExpression(t,i,r);return o}a(p.prototype,{expression:{get:function(){return this._expression}}});var ee={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new e],cartesian3Array:[new t],cartesian4Array:[new i],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new e),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new t),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new i),this.cartesian4Array[this.cartesian4Index++]}};p.prototype.evaluate=function(r,o){ee.reset();var a=this._runtimeAst.evaluate(r);return o instanceof n&&a instanceof i?n.fromCartesian4(a,o):a instanceof e||a instanceof t||a instanceof i?a.clone(o):a},p.prototype.evaluateColor=function(e,t){ee.reset();var i=this._runtimeAst.evaluate(e);return n.fromCartesian4(i,t)},p.prototype.getShaderFunction=function(e,t,i,r){var n=this.getShaderExpression(t,i);return n=r+" "+e+"() \n{ \n return "+n+"; \n} \n"},p.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)}
- ;var te=["!","-","+"],ie=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],re=/\${(.*?)}/g,ne=/\\/g,oe="@#%",ae=/@#%/g,se=new n,le={abs:g(Math.abs),sqrt:g(Math.sqrt),cos:g(Math.cos),sin:g(Math.sin),tan:g(Math.tan),acos:g(Math.acos),asin:g(Math.asin),atan:g(Math.atan),radians:g(u.toRadians),degrees:g(u.toDegrees),sign:g(u.sign),floor:g(Math.floor),ceil:g(Math.ceil),round:g(Math.round),exp:g(Math.exp),exp2:g(m),log:g(Math.log),log2:g(_),fract:g(f),length:C,normalize:b},ue={atan2:v(Math.atan2,!1),pow:v(Math.pow,!1),min:v(Math.min,!0),max:v(Math.max,!0),distance:S,dot:T,cross:E},ce={clamp:y(u.clamp,!0),mix:y(u.lerp,!0)};return A.prototype._evaluateLiteral=function(){return this._value},A.prototype._evaluateLiteralColor=function(e){var t=se,r=this._left;if("color"===this._value)o(r)?r.length>1?(n.fromCssColorString(r[0].evaluate(e),t),t.alpha=r[1].evaluate(e)):n.fromCssColorString(r[0].evaluate(e),t):n.fromBytes(255,255,255,255,t);else if("rgb"===this._value)n.fromBytes(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),255,t);else if("rgba"===this._value){var a=255*r[3].evaluate(e);n.fromBytes(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),a,t)}else"hsl"===this._value?n.fromHsl(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),1,t):"hsla"===this._value&&n.fromHsl(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),r[3].evaluate(e),t);return i.fromColor(t,ee.getCartesian4())},A.prototype._evaluateLiteralVector=function(r){for(var n=ee.getArray(),o=this._value,a=this._left,s=a.length,l=0;l<s;++l){var u=a[l].evaluate(r);if("number"==typeof u)n.push(u);else if(u instanceof e)n.push(u.x,u.y);else if(u instanceof t)n.push(u.x,u.y,u.z);else{if(!(u instanceof i))throw new c(o+" argument must be a vector or number. Argument is "+u+".");n.push(u.x,u.y,u.z,u.w)}}var d=n.length,h=parseInt(o.charAt(3));if(0===d)throw new c("Invalid "+o+" constructor. No valid arguments.");if(d<h&&d>1)throw new c("Invalid "+o+" constructor. Not enough arguments.");if(d>h&&s>1)throw new c("Invalid "+o+" constructor. Too many arguments.");if(1===d){var p=n[0];n.push(p,p,p)}return"vec2"===o?e.fromArray(n,0,ee.getCartesian2()):"vec3"===o?t.fromArray(n,0,ee.getCartesian3()):"vec4"===o?i.fromArray(n,0,ee.getCartesian4()):void 0},A.prototype._evaluateLiteralString=function(){return this._value},A.prototype._evaluateVariableString=function(e){for(var t=this._value,i=re.exec(t);null!==i;){var r=i[0],n=i[1],a=Y(e,n);o(a)||(a=""),t=t.replace(r,a),i=re.exec(t)}return t},A.prototype._evaluateVariable=function(e){return Y(e,this._value)},A.prototype._evaluateMemberDot=function(r){if(j(this._left))return Y(r,this._right.evaluate(r));var n=this._left.evaluate(r);if(o(n)){var a=this._right.evaluate(r);if(n instanceof e||n instanceof t||n instanceof i){if("r"===a)return n.x;if("g"===a)return n.y;if("b"===a)return n.z;if("a"===a)return n.w}return n[a]}},A.prototype._evaluateMemberBrackets=function(r){if(j(this._left))return Y(r,this._right.evaluate(r));var n=this._left.evaluate(r);if(o(n)){var a=this._right.evaluate(r);if(n instanceof e||n instanceof t||n instanceof i){if(0===a||"r"===a)return n.x;if(1===a||"g"===a)return n.y;if(2===a||"b"===a)return n.z;if(3===a||"a"===a)return n.w}return n[a]}},A.prototype._evaluateArray=function(e){for(var t=[],i=0;i<this._value.length;i++)t[i]=this._value[i].evaluate(e);return t},A.prototype._evaluateNot=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new c('Operator "!" requires a boolean argument. Argument is '+t+".");return!t},A.prototype._evaluateNegative=function(r){var n=this._left.evaluate(r);if(n instanceof e)return e.negate(n,ee.getCartesian2());if(n instanceof t)return t.negate(n,ee.getCartesian3());if(n instanceof i)return i.negate(n,ee.getCartesian4());if("number"==typeof n)return-n;throw new c('Operator "-" requires a vector or number argument. Argument is '+n+".")},A.prototype._evaluatePositive=function(r){var n=this._left.evaluate(r);if(!(n instanceof e||n instanceof t||n instanceof i||"number"==typeof n))throw new c('Operator "+" requires a vector or number argument. Argument is '+n+".");return n},A.prototype._evaluateLessThan=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new c('Operator "<" requires number arguments. Arguments are '+t+" and "+i+".");return t<i},A.prototype._evaluateLessThanOrEquals=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new c('Operator "<=" requires number arguments. Arguments are '+t+" and "+i+".");return t<=i},A.prototype._evaluateGreaterThan=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new c('Operator ">" requires number arguments. Arguments are '+t+" and "+i+".");return t>i},A.prototype._evaluateGreaterThanOrEquals=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new c('Operator ">=" requires number arguments. Arguments are '+t+" and "+i+".");return t>=i},A.prototype._evaluateOr=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new c('Operator "||" requires boolean arguments. First argument is '+t+".");if(t)return!0;var i=this._right.evaluate(e);if("boolean"!=typeof i)throw new c('Operator "||" requires boolean arguments. Second argument is '+i+".");return t||i},A.prototype._evaluateAnd=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new c('Operator "&&" requires boolean arguments. First argument is '+t+".");if(!t)return!1;var i=this._right.evaluate(e);if("boolean"!=typeof i)throw new c('Operator "&&" requires boolean arguments. Second argument is '+i+".");return t&&i},A.prototype._evaluatePlus=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);if(o instanceof e&&n instanceof e)return e.add(n,o,ee.getCartesian2());if(o instanceof t&&n instanceof t)return t.add(n,o,ee.getCartesian3());if(o instanceof i&&n instanceof i)return i.add(n,o,ee.getCartesian4());if("string"==typeof n||"string"==typeof o)return n+o;if("number"==typeof n&&"number"==typeof o)return n+o;throw new c('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+n+" and "+o+".")},A.prototype._evaluateMinus=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);if(o instanceof e&&n instanceof e)return e.subtract(n,o,ee.getCartesian2());if(o instanceof t&&n instanceof t)return t.subtract(n,o,ee.getCartesian3());if(o instanceof i&&n instanceof i)return i.subtract(n,o,ee.getCartesian4());if("number"==typeof n&&"number"==typeof o)return n-o;throw new c('Operator "-" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")},A.prototype._evaluateTimes=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);if(o instanceof e&&n instanceof e)return e.multiplyComponents(n,o,ee.getCartesian2());if(o instanceof e&&"number"==typeof n)return e.multiplyByScalar(o,n,ee.getCartesian2());if(n instanceof e&&"number"==typeof o)return e.multiplyByScalar(n,o,ee.getCartesian2());if(o instanceof t&&n instanceof t)return t.multiplyComponents(n,o,ee.getCartesian3());if(o instanceof t&&"number"==typeof n)return t.multiplyByScalar(o,n,ee.getCartesian3());if(n instanceof t&&"number"==typeof o)return t.multiplyByScalar(n,o,ee.getCartesian3());if(o instanceof i&&n instanceof i)return i.multiplyComponents(n,o,ee.getCartesian4());if(o instanceof i&&"number"==typeof n)return i.multiplyByScalar(o,n,ee.getCartesian4());if(n instanceof i&&"number"==typeof o)return i.multiplyByScalar(n,o,ee.getCartesian4());if("number"==typeof n&&"number"==typeof o)return n*o;throw new c('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+n+" and "+o+".")},A.prototype._evaluateDivide=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);if(o instanceof e&&n instanceof e)return e.divideComponents(n,o,ee.getCartesian2());if(n instanceof e&&"number"==typeof o)return e.divideByScalar(n,o,ee.getCartesian2());if(o instanceof t&&n instanceof t)return t.divideComponents(n,o,ee.getCartesian3());if(n instanceof t&&"number"==typeof o)return t.divideByScalar(n,o,ee.getCartesian3());if(o instanceof i&&n instanceof i)return i.divideComponents(n,o,ee.getCartesian4());if(n instanceof i&&"number"==typeof o)return i.divideByScalar(n,o,ee.getCartesian4());if("number"==typeof n&&"number"==typeof o)return n/o;throw new c('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+n+" and "+o+".")},A.prototype._evaluateMod=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);if(o instanceof e&&n instanceof e)return e.fromElements(n.x%o.x,n.y%o.y,ee.getCartesian2());if(o instanceof t&&n instanceof t)return t.fromElements(n.x%o.x,n.y%o.y,n.z%o.z,ee.getCartesian3());if(o instanceof i&&n instanceof i)return i.fromElements(n.x%o.x,n.y%o.y,n.z%o.z,n.w%o.w,ee.getCartesian4());if("number"==typeof n&&"number"==typeof o)return n%o;throw new c('Operator "%" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")},A.prototype._evaluateEqualsStrict=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);return o instanceof e&&n instanceof e||o instanceof t&&n instanceof t||o instanceof i&&n instanceof i?n.equals(o):n===o},A.prototype._evaluateNotEqualsStrict=function(r){var n=this._left.evaluate(r),o=this._right.evaluate(r);return o instanceof e&&n instanceof e||o instanceof t&&n instanceof t||o instanceof i&&n instanceof i?!n.equals(o):n!==o},A.prototype._evaluateConditional=function(e){var t=this._test.evaluate(e);if("boolean"!=typeof t)throw new c("Conditional argument of conditional expression must be a boolean. Argument is "+t+".");return t?this._left.evaluate(e):this._right.evaluate(e)},A.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},A.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},A.prototype._evaluateIsExactClass=function(e){return!!o(e)&&e.isExactClass(this._left.evaluate(e))},A.prototype._evaluateIsClass=function(e){return!!o(e)&&e.isClass(this._left.evaluate(e))},A.prototype._evaluateGetExactClassName=function(e){if(o(e))return e.getExactClassName()},A.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},A.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},A.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},A.prototype._evaluateRegExp=function(e){var t=this._value.evaluate(e),i="";o(this._left)&&(i=this._left.evaluate(e));var r;try{r=new RegExp(t,i)}catch(e){throw new c(e)}return r},A.prototype._evaluateRegExpTest=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new c("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+i+".");return t.test(i)},A.prototype._evaluateRegExpMatch=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return t.test(i);if(i instanceof RegExp&&"string"==typeof t)return i.test(t);throw new c('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+i+".")},A.prototype._evaluateRegExpNotMatch=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return!t.test(i);if(i instanceof RegExp&&"string"==typeof t)return!i.test(t);throw new c('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+i+".")},A.prototype._evaluateRegExpExec=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new c("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+i+".");var r=t.exec(i);return o(r)?r[1]:null},A.prototype._evaluateToString=function(r){var n=this._left.evaluate(r);if(n instanceof RegExp||n instanceof e||n instanceof t||n instanceof i)return String(n);throw new c('Unexpected function call "'+this._value+'".')},A.prototype.getShaderExpression=function(e,t,i){var r,a,s,u,d=this._type,p=this._value;switch(o(this._left)&&(a=l(this._left)?$(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),o(this._right)&&(s=this._right.getShaderExpression(e,t,this)),o(this._test)&&(u=this._test.getShaderExpression(e,t,this)),l(this._value)&&(p=$(this._value,e,t,this)),d){case h.VARIABLE:return e+p;case h.UNARY:if("Boolean"===p)return"bool("+a+")";if("Number"===p)return"float("+a+")";if("round"===p)return"floor("+a+" + 0.5)";if(o(le[p]))return p+"("+a+")";if("isNaN"===p||"isFinite"===p||"String"===p||"isExactClass"===p||"isClass"===p||"getExactClassName"===p)throw new c('Error generating style shader: "'+p+'" is not supported.');return o(le[p])?p+"("+a+")":p+a;case h.BINARY:return"%"===p?"mod("+a+", "+s+")":"==="===p?"("+a+" == "+s+")":"!=="===p?"("+a+" != "+s+")":"atan2"===p?"atan("+a+", "+s+")":o(ue[p])?p+"("+a+", "+s+")":"("+a+" "+p+" "+s+")";case h.TERNARY:if(o(ce[p]))return p+"("+a+", "+s+", "+u+")";break;case h.CONDITIONAL:return"("+u+" ? "+a+" : "+s+")";case h.MEMBER:return"r"===s||"x"===s||"0.0"===s?a+"[0]":"g"===s||"y"===s||"1.0"===s?a+"[1]":"b"===s||"z"===s||"2.0"===s?a+"[2]":"a"===s||"w"===s||"3.0"===s?a+"[3]":a+"[int("+s+")]";case h.FUNCTION_CALL:throw new c('Error generating style shader: "'+p+'" is not supported.');case h.ARRAY:if(4===p.length)return"vec4("+p[0]+", "+p[1]+", "+p[2]+", "+p[3]+")";if(3===p.length)return"vec3("+p[0]+", "+p[1]+", "+p[2]+")";if(2===p.length)return"vec2("+p[0]+", "+p[1]+")";throw new c("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case h.REGEX:throw new c("Error generating style shader: Regular expressions are not supported.");case h.VARIABLE_IN_STRING:throw new c("Error generating style shader: Converting a variable to a string is not supported.");case h.LITERAL_NULL:throw new c("Error generating style shader: null is not supported.");case h.LITERAL_BOOLEAN:return p?"true":"false";case h.LITERAL_NUMBER:return K(p);case h.LITERAL_STRING:if(o(i)&&i._type===h.MEMBER&&("r"===p||"g"===p||"b"===p||"a"===p||"x"===p||"y"===p||"z"===p||"w"===p))return p;if(r=n.fromCssColorString(p,se),o(r))return Z(r);throw new c("Error generating style shader: String literals are not supported.");case h.LITERAL_COLOR:var f=a;if("color"===p){if(!o(f))return"vec4(1.0)";if(f.length>1){var m=f[0],_=f[1];return"1.0"!==_&&(t.translucent=!0),"vec4("+m+", "+_+")"}return"vec4("+f[0]+", 1.0)"}if("rgb"===p)return r=Q(this),o(r)?J(r):"vec4("+f[0]+" / 255.0, "+f[1]+" / 255.0, "+f[2]+" / 255.0, 1.0)";if("rgba"===p)return"1.0"!==f[3]&&(t.translucent=!0),r=Q(this),o(r)?J(r):"vec4("+f[0]+" / 255.0, "+f[1]+" / 255.0, "+f[2]+" / 255.0, "+f[3]+")";if("hsl"===p)return r=X(this),o(r)?J(r):"vec4(czm_HSLToRGB(vec3("+f[0]+", "+f[1]+", "+f[2]+")), 1.0)";if("hsla"===p)return r=X(this),o(r)?(1!==r.alpha&&(t.translucent=!0),J(r)):("1.0"!==f[3]&&(t.translucent=!0),"vec4(czm_HSLToRGB(vec3("+f[0]+", "+f[1]+", "+f[2]+")), "+f[3]+")");break;case h.LITERAL_VECTOR:for(var g=a.length,v=p+"(",y=0;y<g;++y)v+=a[y],y<g-1&&(v+=", ");return v+=")";case h.LITERAL_REGEX:throw new c("Error generating style shader: Regular expressions are not supported.");case h.LITERAL_UNDEFINED:throw new c("Error generating style shader: undefined is not supported.");case h.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===p)return"u_time"}},p}),define("Scene/Vector3DTilePrimitive",["../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Matrix4","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/ShadowVolumeFS","../Shaders/VectorTileVS","./BlendingState","./Cesium3DTileFeature","./ClassificationType","./DepthFunction","./Expression","./StencilConstants","./StencilFunction","./StencilOperation","./Vector3DTileBatch"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P){"use strict";function D(i){i=r(i,r.EMPTY_OBJECT),this._batchTable=i.batchTable,this._batchIds=i.batchIds,this._positions=i.positions,this._vertexBatchIds=i.vertexBatchIds,this._indices=i.indices,this._indexCounts=i.indexCounts,this._indexOffsets=i.indexOffsets,this._batchedIndices=i.batchedIndices,this._boundingVolume=i.boundingVolume,this._boundingVolumes=i.boundingVolumes,this._center=r(i.center,e.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilPreloadPass3DTiles=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=t.clone(t.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=r(i.classificationType,S.BOTH),this._vertexShaderSource=i._vertexShaderSource,this._fragmentShaderSource=i._fragmentShaderSource,this._attributeLocations=i._attributeLocations,this._uniformMap=i._uniformMap,this._pickId=i._pickId,this._modelMatrix=i._modelMatrix,this._boundingSphere=i._boundingSphere,this._batchIdLookUp={};for(var n=this._batchIds.length,o=0;o<n;++o){var a=this._batchIds[o];this._batchIdLookUp[a]=o}}function I(e,t){if(!n(e._va)){var r=c.createVertexBuffer({context:t,typedArray:e._positions,usage:d.STATIC_DRAW}),o=c.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:d.STATIC_DRAW}),a=c.createIndexBuffer({context:t,typedArray:e._indices,usage:d.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?s.UNSIGNED_SHORT:s.UNSIGNED_INT}),l=[{index:0,vertexBuffer:r,componentDatatype:i.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:o,componentDatatype:i.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new g({context:t,attributes:l,indexBuffer:a}),t.webgl2&&(e._vaSwap=new g({context:t,attributes:l,indexBuffer:c.createIndexBuffer({context:t,sizeInBytes:a.sizeInBytes,usage:d.DYNAMIC_DRAW,indexDatatype:a.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0}}function M(e,t){if(!n(e._sp)){var i=e._batchTable,o=r(e._attributeLocations,Q),a=e._pickId,s=e._vertexShaderSource,l=e._fragmentShaderSource;if(n(s))return e._sp=m.fromCache({context:t,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:o}),e._spStencil=e._sp,l=_.replaceMain(l,"czm_non_pick_main"),l=l+"void main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+a+"; \n} \n",void(e._spPick=m.fromCache({context:t,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:o}));var u=i.getVertexShaderCallback(!1,"a_batchId",void 0)(y),c=i.getFragmentShaderCallback()(v,!1,void 0);a=i.getPickId();var d=new _({sources:[u]}),h=new _({defines:["VECTOR_TILE"],sources:[c]});e._sp=m.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:o}),d=new _({sources:[y]}),h=new _({defines:["VECTOR_TILE"],sources:[v]}),e._spStencil=m.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:o}),c=_.replaceMain(c,"czm_non_pick_main"),c=c+"\nvoid main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+a+"; \n} \n";var p=new _({sources:[u]}),f=new _({defines:["VECTOR_TILE"],sources:[c]});e._spPick=m.fromCache({context:t,vertexShaderSource:p,fragmentShaderSource:f,attributeLocations:o})}}function R(e){var t=e?w.EQUAL:w.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:x.KEEP,zFail:x.DECREMENT_WRAP,zPass:x.DECREMENT_WRAP},backFunction:t,backOperation:{fail:x.KEEP,zFail:x.INCREMENT_WRAP,zPass:x.INCREMENT_WRAP},reference:A.CESIUM_3D_TILE_MASK,mask:A.CESIUM_3D_TILE_MASK},stencilMask:A.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1}}function O(e){var t=e?w.EQUAL:w.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:x.KEEP,zFail:x.KEEP,zPass:x.INCREMENT_WRAP},backFunction:t,backOperation:{fail:x.KEEP,zFail:x.KEEP,zPass:x.DECREMENT_WRAP},reference:A.CESIUM_3D_TILE_MASK,mask:A.CESIUM_3D_TILE_MASK},stencilMask:A.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:T.LESS_OR_EQUAL},depthMask:!1}}function L(e){n(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=f.fromCache(R(!1)),e._rsStencilPreloadPass3DTiles=f.fromCache(R(!0)),e._rsStencilDepthPass=f.fromCache(O(!1)),e._rsStencilDepthPass3DTiles=f.fromCache(O(!0)),e._rsColorPass=f.fromCache(K),e._rsPickPass=f.fromCache(Z))}function N(e,t){if(!n(e._uniformMap)){var i={u_modifiedModelViewProjection:function(){var i=t.uniformState.view,r=t.uniformState.projection;return l.clone(i,J),l.multiplyByPoint(J,e._center,$),l.setTranslation(J,$,J),l.multiply(r,J,J),J},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(i)}}function F(e,t,i,r,n,o,a){for(var s=e.constructor.BYTES_PER_ELEMENT,l=o.length,u=0;u<l;++u){var c=o[u],d=a[c],h=r[d],p=n[d],f=new e.constructor(e.buffer,s*h,p);t.set(f,i),r[d]=i,i+=p}return i}function B(e,i){var r=e._indices,n=e._indexOffsets,o=e._indexCounts,a=e._batchIdLookUp,s=new r.constructor(r.length),l=i.pop(),u=[l],c=F(r,s,0,n,o,l.batchIds,a);for(l.offset=0,l.count=c;i.length>0;){var d=i.pop();if(t.equals(d.color,l.color))c=F(r,s,c,n,o,d.batchIds,a),l.batchIds=l.batchIds.concat(d.batchIds),l.count=c-l.offset;else{var h=c;c=F(r,s,c,n,o,d.batchIds,a),d.offset=h,d.count=c-h,u.push(d),l=d}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=u}function k(e,t,i,r,n,o,a){for(var s=e.bytesPerIndex,l=o.length,u=0;u<l;++u){var c=o[u],d=a[c],h=r[d],p=n[d];t.copyFromBuffer(e,h*s,i*s,p*s),r[d]=i,i+=p}return i}function z(e,i){var r=e._indexOffsets,n=e._indexCounts,o=e._batchIdLookUp,a=i.pop(),s=[a],l=e._va.indexBuffer,u=e._vaSwap.indexBuffer,c=k(l,u,0,r,n,a.batchIds,o);for(a.offset=0,a.count=c;i.length>0;){var d=i.pop();if(t.equals(d.color,a.color))c=k(l,u,c,r,n,d.batchIds,o),a.batchIds=a.batchIds.concat(d.batchIds),a.count=c-a.offset;else{var h=c;c=k(l,u,c,r,n,d.batchIds,o),d.offset=h,d.count=c-h,s.push(d),a=d}}var p=e._va;e._va=e._vaSwap,e._vaSwap=p,e._batchedIndices=s}function V(e,t){return t.color.toRgba()-e.color.toRgba()}function U(e,t){if(!e._batchDirty)return!1;for(var i=e._batchedIndices,r=i.length,o=!1,a={},s=0;s<r;++s){var l=i[s].color,u=l.toRgba();if(n(a[u])){o=!0;break}a[u]=!0}return o?o&&!e.forceRebatch&&e._framesSinceLastRebatch<120?void++e._framesSinceLastRebatch:(i.sort(V),t.webgl2?z(e,i):B(e,i),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0):(e._batchDirty=!1,!1)}function G(e,t){var i=U(e,t),o=e._commands,a=e._batchedIndices,s=a.length,u=3*s;if(!n(o)||i||o.length!==u){o.length=u;for(var c=e._va,d=e._sp,f=r(e._modelMatrix,l.IDENTITY),m=e._uniformMap,_=e._boundingVolume,g=0;g<s;++g){var v=a[g].offset,y=a[g].count,C=o[3*g];n(C)||(C=o[3*g]=new h({owner:e})),C.vertexArray=c,C.modelMatrix=f,C.offset=v,C.count=y,C.renderState=e._rsStencilPreloadPass,C.shaderProgram=d,C.uniformMap=m,C.boundingVolume=_,C.cull=!1,C.pass=p.TERRAIN_CLASSIFICATION;var b=h.shallowClone(C,C.derivedCommands.tileset);b.renderState=e._rsStencilPreloadPass3DTiles,b.pass=p.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=b;var S=o[3*g+1];n(S)||(S=o[3*g+1]=new h({owner:e})),S.vertexArray=c,S.modelMatrix=f,S.offset=v,S.count=y,S.renderState=e._rsStencilDepthPass,S.shaderProgram=d,S.uniformMap=m,S.boundingVolume=_,S.cull=!1,S.pass=p.TERRAIN_CLASSIFICATION;var T=h.shallowClone(S,S.derivedCommands.tileset);T.renderState=e._rsStencilDepthPass3DTiles,T.pass=p.CESIUM_3D_TILE_CLASSIFICATION,S.derivedCommands.tileset=T;var E=o[3*g+2];n(E)||(E=o[3*g+2]=new h({owner:e})),E.vertexArray=c,E.modelMatrix=f,E.offset=v,E.count=y,E.renderState=e._rsColorPass,E.shaderProgram=d,E.uniformMap=m,E.boundingVolume=_,E.cull=!1,E.pass=p.TERRAIN_CLASSIFICATION;var A=h.shallowClone(E,E.derivedCommands.tileset);A.pass=p.CESIUM_3D_TILE_CLASSIFICATION,E.derivedCommands.tileset=A}e._commandsDirty=!0}}function H(e,t){if(e.classificationType!==S.TERRAIN&&t.invertClassification&&(!n(e._commandsIgnoreShow)||e._commandsDirty)){for(var i=e._commands,r=e._commandsIgnoreShow,o=e._spStencil,a=i.length,s=r.length=a/3*2,l=0,u=0;u<s;u+=2){var c=r[u]=h.shallowClone(i[l],r[u]);c.shaderProgram=o,c.pass=p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,c=r[u+1]=h.shallowClone(i[l+1],r[u+1]),c.shaderProgram=o,c.pass=p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,l+=3}e._commandsDirty=!1}}function W(e){if(e._pickCommandsDirty){var t=e._indexOffsets.length,i=e._pickCommands;i.length=3*t;for(var o=e._va,a=e._spStencil,s=e._spPick,u=r(e._modelMatrix,l.IDENTITY),c=e._uniformMap,d=0;d<t;++d){var f=e._indexOffsets[d],m=e._indexCounts[d],_=n(e._boundingVolumes)?e._boundingVolumes[d]:e.boundingVolume,g=i[3*d];n(g)||(g=i[3*d]=new h({owner:e,pickOnly:!0})),g.vertexArray=o,g.modelMatrix=u,g.offset=f,g.count=m,g.renderState=e._rsStencilPreloadPass,g.shaderProgram=a,g.uniformMap=c,g.boundingVolume=_,g.pass=p.TERRAIN_CLASSIFICATION;var v=h.shallowClone(g,g.derivedCommands.tileset);v.renderState=e._rsStencilPreloadPass3DTiles,v.pass=p.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=v;var y=i[3*d+1];n(y)||(y=i[3*d+1]=new h({owner:e,pickOnly:!0})),y.vertexArray=o,y.modelMatrix=u,y.offset=f,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=a,y.uniformMap=c,y.boundingVolume=_,y.pass=p.TERRAIN_CLASSIFICATION;var C=h.shallowClone(y,y.derivedCommands.tileset);C.renderState=e._rsStencilDepthPass3DTiles,C.pass=p.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=C;var b=i[3*d+2];n(b)||(b=i[3*d+2]=new h({owner:e,pickOnly:!0})),b.vertexArray=o,b.modelMatrix=u,b.offset=f,b.count=m,b.renderState=e._rsPickPass,b.shaderProgram=s,b.uniformMap=c,b.boundingVolume=_,b.pass=p.TERRAIN_CLASSIFICATION;var S=h.shallowClone(b,b.derivedCommands.tileset);S.pass=p.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=S}e._pickCommandsDirty=!1}}function q(e,i){e._updatingAllCommands=!0;var r,n=e._batchIds,o=n.length;for(r=0;r<o;++r){var a=n[r],s=i[a];s.show=!0,s.color=t.WHITE}var l=e._batchedIndices;for(o=l.length,r=0;r<o;++r)l[r].color=t.clone(t.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}function Y(e,t,i,r){var o,a,s=e.classificationType,l=s!==S.CESIUM_3D_TILE,u=s!==S.TERRAIN,c=t.commandList,d=i.length;for(a=0;a<d;++a)l&&(o=i[a],o.pass=p.TERRAIN_CLASSIFICATION,c.push(o)),u&&(o=i[a].derivedCommands.tileset,o.pass=p.CESIUM_3D_TILE_CLASSIFICATION,c.push(o));if(t.invertClassification&&n(r))for(d=r.length,a=0;a<d;++a)c.push(r[a])}function j(e,t){for(var i=e.commandList,r=t.length,n=0;n<r;n+=3){var o=t[n+2];o.pass=p.OPAQUE,i.push(o)}}function X(e){var t=e.debugWireframe===e._debugWireframe;if(!(t=t&&!(e.debugWireframe&&e._wireframeDirty))){n(e._rsWireframe)||(e._rsWireframe=f.fromCache({}));var i,r;e.debugWireframe?(i=e._rsWireframe,r=u.LINES):(i=e._rsColorPass,r=u.TRIANGLES);for(var o=e._commands,a=o.length,s=0;s<a;s+=3){var l=o[s+2];l.renderState=i,l.primitiveType=r}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}}o(D.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Q={position:0,a_batchId:1},K={stencilTest:{enabled:!0,frontFunction:w.NOT_EQUAL,frontOperation:{fail:x.KEEP,zFail:x.KEEP,zPass:x.DECREMENT_WRAP},backFunction:w.NOT_EQUAL,backOperation:{fail:x.KEEP,zFail:x.KEEP,zPass:x.DECREMENT_WRAP},reference:0,mask:A.CLASSIFICATION_MASK},stencilMask:A.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:C.ALPHA_BLEND},Z={stencilTest:{enabled:!0,frontFunction:w.NOT_EQUAL,frontOperation:{fail:x.KEEP,zFail:x.KEEP,zPass:x.DECREMENT_WRAP},backFunction:w.NOT_EQUAL,backOperation:{fail:x.KEEP,zFail:x.KEEP,zPass:x.DECREMENT_WRAP},reference:0,mask:A.CLASSIFICATION_MASK},stencilMask:A.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},J=new l,$=new e;D.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var o=i[n];t[o]=new b(e,o)}},D.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var ee=new t,te=t.WHITE,ie=/\$/;return D.prototype.applyStyle=function(e,i){if(!n(e))return void q(this,i);var r=e.color,o=r instanceof E&&!ie.test(r.expression);this._updatingAllCommands=o;var a,s=this._batchIds,l=s.length;for(a=0;a<l;++a){var u=s[a],c=i[u];c.color=n(e.color)?e.color.evaluateColor(c,ee):te,c.show=!n(e.show)||e.show.evaluate(c)}if(o){var d=this._batchedIndices;for(l=d.length,a=0;a<l;++a)d[a].color=t.clone(t.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}},D.prototype.updateCommands=function(e,i){if(!this._updatingAllCommands){var r=this._batchIdLookUp,o=r[e];if(n(o)){var a,s=this._indexOffsets,l=this._indexCounts,u=s[o],c=l[o],d=this._batchedIndices,h=d.length;for(a=0;a<h;++a){var p=d[a].offset,f=d[a].count;if(u>=p&&u<p+f)break}d.push(new P({color:t.clone(i),offset:u,count:c,batchIds:[e]}));for(var m=[],_=[],g=d[a].batchIds,v=g.length,y=0;y<v;++y){var C=g[y];if(C!==e){s[r[C]]<u?m.push(C):_.push(C)}}0!==_.length&&d.push(new P({color:t.clone(d[a].color),offset:u+c,count:d[a].offset+d[a].count-(u+c),batchIds:_})),0!==m.length?(d[a].count=u-d[a].offset,d[a].batchIds=m):d.splice(a,1),this._batchDirty=!0}}},D.prototype.update=function(e){var t=e.context;I(this,t),M(this,t),L(this),N(this,t);var i=e.passes;i.render&&(G(this,t),H(this,e),X(this),this._debugWireframe?j(e,this._commands):Y(this,e,this._commands,this._commandsIgnoreShow)),i.pick&&(W(this),Y(this,e,this._pickCommands))},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),a(this)},D}),define("Scene/ClassificationModel",["../Core/arraySlice","../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/IndexDatatype","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../ThirdParty/GltfPipeline/addDefaults","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType","../ThirdParty/GltfPipeline/parseGlb","../ThirdParty/GltfPipeline/updateVersion","../ThirdParty/when","./Axis","./ClassificationType","./ModelLoadResources","./ModelUtility","./processModelMaterialsCommon","./processPbrMaterials","./SceneMode","./Vector3DTileBatch","./Vector3DTilePrimitive"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L){"use strict";function N(e){e=s(e,s.EMPTY_OBJECT);var i=e.gltf;if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),
- !(i instanceof Uint8Array))throw new _("Only binary glTF is supported as a classifier.");i=T(i),E(i),y(i),I(i),M(i),C.buffer(i,function(e){if(!l(e.extras._pipeline.source))throw new _("Buffer data must be embedded in the binary gltf.")});var r=i.nodes,n=i.meshes,o=r[0],a=o.mesh;if(1!==r.length||!l(a))throw new _("Only one node is supported for classification and it must have a mesh.");if(1!==n.length)throw new _("Only one mesh is supported when using b3dm for classification.");var u=n[0].primitives;if(1!==u.length)throw new _("Only one primitive per mesh is supported when using b3dm for classification.");var c=u[0].attributes.POSITION;if(!l(c))throw new _("The mesh must have a position attribute.");var d=u[0].attributes._BATCHID;if(!l(d))throw new _("The mesh must have a batch id attribute.");this._gltf=i,this.show=s(e.show,!0),this.modelMatrix=f.clone(s(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(this.modelMatrix),this._ready=!1,this._readyPromise=A.defer(),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=s(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=s(e.ignoreCommands,!1),this._upAxis=s(e.upAxis,w.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new f,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new t,this._state=ee.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new f,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function F(e){var t=e.gltf,i=e._loadResources;C.buffer(t,function(e,t){i.buffers[t]=e.extras._pipeline.source})}function B(e){var t=e.gltf.bufferViews,i=e._loadResources.vertexBuffersToCreate;C.bufferView(e.gltf,function(e,t){e.target===v.ARRAY_BUFFER&&i.enqueue(t)});var r=e._loadResources.indexBuffersToCreate,n={};C.accessor(e.gltf,function(e){var i=e.bufferView;t[i].target!==v.ELEMENT_ARRAY_BUFFER||l(n[i])||(n[i]=!0,r.enqueue({id:i,componentType:e.componentType}))})}function k(e,t){var i=t._loadResources,r=t.gltf.bufferViews,n=r[e],o=i.getBuffer(n);t._buffers[e]=o,t._geometryByteLength+=o.byteLength}function z(e,t,i){var r=i._loadResources,n=i.gltf.bufferViews,o=n[e],a={typedArray:r.getBuffer(o),indexDatatype:t};i._buffers[e]=a,i._geometryByteLength+=a.typedArray.byteLength}function V(e){var t=e._loadResources;if(0===t.pendingBufferLoads){for(var i=t.vertexBuffersToCreate,r=t.indexBuffersToCreate;i.length>0;)k(i.dequeue(),e);for(;r.length>0;){var n=r.dequeue();z(n.id,n.componentType,e)}}}function U(e,t){var i=t.gltf.meshes[0].primitives[0],r=D.modifyShaderForQuantizedAttributes(t.gltf,i,e);return t._quantizedUniforms=r.uniforms,r.shader}function G(e,t){return l(t)&&(e=t(e)),e}function H(e){var t=e.gltf,i=D.getAttributeOrUniformBySemantic(t,"POSITION"),r=D.getAttributeOrUniformBySemantic(t,"_BATCHID"),n={};n[i]=0,n[r]=1;var o,a,s=D.getAttributeOrUniformBySemantic(t,"MODELVIEWPROJECTION");if(l(s))o="uniform mat4 "+s+";\n",a=s+" * vec4("+i+", 1.0)";else{var u=D.getAttributeOrUniformBySemantic(t,"PROJECTION"),c=D.getAttributeOrUniformBySemantic(t,"MODELVIEW");l(c)||(c=D.getAttributeOrUniformBySemantic(t,"CESIUM_RTC_MODELVIEW")),o="uniform mat4 "+c+";\nuniform mat4 "+u+";\n",a=u+" * "+c+" * vec4("+i+", 1.0)"}var d=" vec4 positionInClipCoords = "+a+";\n",h="attribute vec3 "+i+";\nattribute float "+r+";\n"+o+"void main() {\n"+d+" gl_Position = czm_depthClampFarPlane(positionInClipCoords);\n}\n";e.extensionsUsed.WEB3D_quantized_attributes&&(h=U(h,e));var p=G(h,e._vertexShaderLoaded),f=G("#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeDepthClampedToFarPlane();\n}\n",e._classificationShaderLoaded);p=D.modifyVertexShaderForLogDepth(p,a),f=D.modifyFragmentShaderForLogDepth(f),e._shaderProgram={vertexShaderSource:p,fragmentShaderSource:f,attributeLocations:n}}function W(){return{POSITION:0,_BATCHID:1}}function q(e){if(e._loadResources.finishedBuffersCreation()&&!l(e._vertexArray)){var t=e._buffers,i=e.gltf,r=i.accessors,n=i.meshes,o=n[0].primitives,a=o[0],s=W(),u={};C.meshPrimitiveAttribute(a,function(e,n){var o=s[n];if(l(o)){var a=r[e];u[n]={index:o,vertexBuffer:t[a.bufferView],componentsPerAttribute:S(a.type),componentDatatype:a.componentType,offsetInBytes:a.byteOffset,strideInBytes:b(i,a)}}});var c;if(l(a.indices)){var d=r[a.indices];c=t[d.bufferView]}e._vertexArray={attributes:u,indexBuffer:c}}}function Y(e,t){if(!l(e._uniformMap)){var i={};C.technique(e.gltf,function(r){C.techniqueUniform(r,function(r,n){l(r.semantic)&&l(te[r.semantic])&&(i[n]=te[r.semantic](t.uniformState,e))})}),e._uniformMap=i}}function j(e,t){return D.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function X(e,t){switch(e.mode){case m.TRIANGLES:return t/3;case m.TRIANGLE_STRIP:case m.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Q(r){var s,u,c=r._batchTable,d=r._uniformMap,h=r._vertexArray,m=r.gltf,_=m.accessors,g=m.meshes,v=g[0].primitives[0],y=_[v.indices],C=v.attributes.POSITION,b=D.getAccessorMinMax(m,C),S=t.fromCornerPoints(i.fromArray(b.min),i.fromArray(b.max));if(l(y))u=y.count,s=y.byteOffset/p.getSizeInBytes(y.componentType);else{u=_[v.attributes.POSITION].count,s=0}if(r._trianglesLength+=X(v,u),l(r._uniformMapLoaded)&&(d=r._uniformMapLoaded(d)),r.extensionsUsed.WEB3D_quantized_attributes){var T=j(r,v);d=o(d,T)}var E=h.attributes.POSITION,A=E.componentDatatype,w=E.vertexBuffer,x=w.byteOffset,P=w.byteLength/a.getSizeInBytes(A),I=a.createArrayBufferView(A,w.buffer,x,P);E=h.attributes._BATCHID,A=E.componentDatatype,w=E.vertexBuffer,x=w.byteOffset,P=w.byteLength/a.getSizeInBytes(A);var M,R=a.createArrayBufferView(A,w.buffer,x,P),N=h.indexBuffer.typedArray;M=h.indexBuffer.indexDatatype===p.UNSIGNED_SHORT?new Uint16Array(N.buffer,N.byteOffset,N.byteLength/Uint16Array.BYTES_PER_ELEMENT):new Uint32Array(N.buffer,N.byteOffset,N.byteLength/Uint32Array.BYTES_PER_ELEMENT),I=e(I),R=e(R),M=e(M,s,s+u);var F=[],B=[],k=[],z=[],V=R[M[0]];F.push(V),k.push(0);for(var U,G,H,W=M.length,q=1;q<W;++q)(U=R[M[q]])!==V&&(G=k[k.length-1],H=q-G,F.push(U),B.push(H),k.push(q),z.push(new O({offset:G,count:H,batchIds:[V],color:n.WHITE})),V=U);G=k[k.length-1],H=W-G,B.push(H),z.push(new O({offset:G,count:H,batchIds:[V],color:n.WHITE}));var Y=r._shaderProgram,Q=Y.vertexShaderSource,K=Y.fragmentShaderSource,Z=Y.attributeLocations,J=l(r._pickIdLoaded)?r._pickIdLoaded():void 0;r._primitive=new L({classificationType:r._classificationType,positions:I,indices:M,indexOffsets:k,indexCounts:B,batchIds:F,vertexBatchIds:R,batchedIndices:z,batchTable:c,boundingVolume:new t,_vertexShaderSource:Q,_fragmentShaderSource:K,_attributeLocations:Z,_uniformMap:d,_pickId:J,_modelMatrix:new f,_boundingSphere:S}),r._buffers=void 0,r._vertexArray=void 0,r._shaderProgram=void 0,r._uniformMap=void 0}function K(e){if(e._loadResources.finished()&&!l(e._primitive)){var t=e.gltf,i=t.nodes,r=i[0];e._nodeMatrix=D.getTransform(r,e._nodeMatrix),Q(e)}}function Z(e,t){var i=t.context;D.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,i),V(e),H(e),q(e),Y(e,i),K(e)}function J(e,n,o,a){var s=e._computedModelMatrix;if(e._mode!==R.SCENE3D&&!e._ignoreCommands){var u=f.getColumn(s,3,ie);if(r.equals(u,r.UNIT_W)){var c=e.boundingSphere.center,d=g.wgs84To2DModelMatrix(a,c,re);s=f.multiply(d,s,re),l(e._rtcCenter)&&(f.setTranslation(s,r.UNIT_W,s),e._rtcCenter=e._rtcCenter2D)}else s=g.basisTo2D(a,s,re),e._rtcCenter=e._rtcCenter3D}var h=e._primitive;(n||o)&&(f.multiplyTransformation(s,e._nodeMatrix,h._modelMatrix),t.transform(h._boundingSphere,h._modelMatrix,h._boundingVolume),l(e._rtcCenter)&&i.add(e._rtcCenter,h._boundingVolume.center,h._boundingVolume.center))}if(!h.supportsTypedArrays())return{};var $=new i,ee=D.ModelState;u(N.prototype,{gltf:{get:function(){return this._gltf}},boundingSphere:{get:function(){var e=this.modelMatrix,t=f.getScale(e,$),r=this._scaledBoundingSphere;return r.center=i.multiplyComponents(this._boundingSphere.center,t,r.center),r.radius=i.maximumComponent(t)*this._initialRadius,l(this._rtcCenter)&&i.add(this._rtcCenter,r.center,r.center),r}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return l(this._extensionsUsed)||(this._extensionsUsed=D.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return l(this._extensionsRequired)||(this._extensionsRequired=D.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});var te={PROJECTION:function(e,t){return D.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return D.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return D.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return D.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}},ie=new r,re=new f;return N.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},N.prototype.update=function(e){if(e.mode!==R.MORPHING){if(!h.supportsWebP.initialized)return void h.supportsWebP.initialize();var t=h.supportsWebP();if(this._state===ee.NEEDS_LOAD&&l(this.gltf)&&(this._state=ee.LOADING,this._state!==ee.FAILED)){var r=this.gltf.extensions;if(l(r)&&l(r.CESIUM_RTC)){var n=i.fromArray(r.CESIUM_RTC.center);if(!i.equals(n,i.ZERO)){this._rtcCenter3D=n;var o=e.mapProjection,a=o.ellipsoid,s=a.cartesianToCartographic(this._rtcCenter3D),u=o.project(s);i.fromElements(u.z,u.x,u.y,u),this._rtcCenter2D=u,this._rtcCenterEye=new i,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new P,D.parseBuffers(this)}var c=this._loadResources,d=!1;this._state===ee.LOADING&&(0===c.pendingBufferLoads&&(D.checkSupportedExtensions(this.extensionsRequired,t),F(this),B(this),this._boundingSphere=D.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,Z(this,e)),c.finished()&&(this._state=ee.LOADED,d=!0)),l(c)&&this._state===ee.LOADED&&(d||Z(this,e),c.finished()&&(this._loadResources=void 0));var p=this.show;if(p&&this._state===ee.LOADED||d){this._dirty=!1;var m=this.modelMatrix,_=e.mode!==this._mode;this._mode=e.mode;var g=!f.equals(this._modelMatrix,m)||_;if(g||d){f.clone(m,this._modelMatrix);var v=this._computedModelMatrix;f.clone(m,v),this._upAxis===w.Y?f.multiplyTransformation(v,w.Y_UP_TO_Z_UP,v):this._upAxis===w.X&&f.multiplyTransformation(v,w.X_UP_TO_Z_UP,v)}(g||d)&&(J(this,g,d,e.mapProjection),this._dirty=!0)}if(d){var y=this;return void e.afterRender.push(function(){y._ready=!0,y._readyPromise.resolve(y)})}p&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))}},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),c(this)},N}),define("Scene/Batched3DModel3DTileContent",["../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getStringFromTypedArray","../Core/Matrix4","../Core/RequestType","../Core/RuntimeError","../Core/Transforms","../Renderer/Pass","./Axis","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./ClassificationModel","./Model","./ModelUtility"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S){"use strict";function T(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._model=void 0,this._batchTable=void 0,this._features=void 0,this._batchIdAttributeName=void 0,this._diffuseAttributeOrUniformName={},this._rtcCenterTransform=void 0,this._contentModelMatrix=void 0,this.featurePropertiesDirty=!1,I(this,r,n)}function E(e){var t=S.getAttributeOrUniformBySemantic(e,"_BATCHID");return n(t)||(t=S.getAttributeOrUniformBySemantic(e,"BATCHID"),n(t)&&T._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`.")),t}function A(e){return function(t,i){var r=e._batchTable,o=!n(e._tileset.classificationType),a=e._model.gltf;n(a)&&(e._batchIdAttributeName=E(a),e._diffuseAttributeOrUniformName[i]=S.getDiffuseAttributeOrUniform(a,i));var s=r.getVertexShaderCallback(o,e._batchIdAttributeName,e._diffuseAttributeOrUniformName[i]);return n(s)?s(t):t}}function w(e){return function(t,i){var r=e._batchTable,o=!n(e._tileset.classificationType),a=e._model.gltf;n(a)&&(e._diffuseAttributeOrUniformName[i]=S.getDiffuseAttributeOrUniform(a,i));var s=r.getFragmentShaderCallback(o,e._diffuseAttributeOrUniformName[i]);return n(s)?s(t):t}}function x(e){return function(){return e._batchTable.getPickId()}}function P(e){return function(t){var i=e._batchTable,r=i.getClassificationFragmentShaderCallback();return n(r)?r(t):t}}function D(e){return function(t,i){e._model.updateCommands(t,i)}}function I(t,o,a){var s=t._tileset,l=t._tile,u=t._resource,f=r(a,0);a=f;var v=new Uint8Array(o),S=new DataView(o);a+=R;var E=S.getUint32(a,!0);if(1!==E)throw new p("Only Batched 3D Model version 1 is supported. Version "+E+" is not.");a+=R;var I=S.getUint32(a,!0);a+=R;var M=S.getUint32(a,!0);a+=R;var O=S.getUint32(a,!0);a+=R;var L=S.getUint32(a,!0);a+=R;var N=S.getUint32(a,!0);a+=R;var F;L>=570425344?(a-=2*R,F=M,L=O,N=0,M=0,O=0,T._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.")):N>=570425344&&(a-=R,F=L,L=M,N=O,M=0,O=0,T._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Batched3DModel."));var B;if(0===M)B={BATCH_LENGTH:r(F,0)};else{var k=c(v,a,M);B=JSON.parse(k),a+=M}var z=new Uint8Array(o,a,O);a+=O;var V=new y(B,z);F=V.getGlobalProperty("BATCH_LENGTH"),V.featuresLength=F;var U,G;if(L>0){var H=c(v,a,L);U=JSON.parse(H),a+=L,N>0&&(G=new Uint8Array(o,a,N),G=new Uint8Array(G),a+=N)}var W;n(s.classificationType)&&(W=D(t));var q=new g(t,F,U,G,W);t._batchTable=q;var Y=f+I-a;if(0===Y)throw new p("glTF byte length must be greater than 0.");var j;a%4==0?j=new Uint8Array(o,a,Y):(T._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),j=new Uint8Array(v.subarray(a,a+Y)));var X={content:t,primitive:s};t._rtcCenterTransform=d.IDENTITY;var Q=V.getGlobalProperty("RTC_CENTER",i.FLOAT,3);n(Q)&&(t._rtcCenterTransform=d.fromTranslation(e.fromArray(Q))),t._contentModelMatrix=d.multiply(l.computedTransform,t._rtcCenterTransform,new d),n(s.classificationType)?t._model=new C({gltf:j,cull:!1,basePath:u,requestType:h.TILES3D,modelMatrix:t._contentModelMatrix,upAxis:s._gltfUpAxis,forwardAxis:_.X,debugWireframe:s.debugWireframe,vertexShaderLoaded:A(t),classificationShaderLoaded:P(t),uniformMapLoaded:q.getUniformMapCallback(),pickIdLoaded:x(t),classificationType:s._classificationType,batchTable:q}):t._model=new b({gltf:j,cull:!1,releaseGltfJson:!0,opaquePass:m.CESIUM_3D_TILE,basePath:u,requestType:h.TILES3D,modelMatrix:t._contentModelMatrix,upAxis:s._gltfUpAxis,forwardAxis:_.X,shadows:s.shadows,debugWireframe:s.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:A(t),fragmentShaderLoaded:w(t),uniformMapLoaded:q.getUniformMapCallback(),pickIdLoaded:x(t),addBatchIdToGeneratedShaders:F>0,pickObject:X,imageBasedLightingFactor:s.imageBasedLightingFactor,lightColor:s.lightColor,luminanceAtZenith:s.luminanceAtZenith,sphericalHarmonicCoefficients:s.sphericalHarmonicCoefficients,specularEnvironmentMaps:s.specularEnvironmentMaps})}function M(e){var t=e.featuresLength;if(!n(e._features)&&t>0){for(var i=new Array(t),r=0;r<t;++r)i[r]=new v(e,r);e._features=i}}if(!u.supportsTypedArrays())return{};T._deprecationWarning=a,o(T.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var R=Uint32Array.BYTES_PER_ELEMENT;T.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},T.prototype.getFeature=function(e){return M(this),this._features[e]},T.prototype.applyDebugSettings=function(e,i){i=e?i:t.WHITE,0===this.featuresLength?this._model.color=i:this._batchTable.setAllColor(i)};var O=new t;return T.prototype.applyStyle=function(e){if(0===this.featuresLength){var i=n(e)&&n(e.color),r=n(e)&&n(e.show);this._model.color=i?e.color.evaluateColor(void 0,O):t.WHITE,this._model.show=!r||e.show.evaluate(void 0)}else this._batchTable.applyStyle(e)},T.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._contentModelMatrix=d.multiply(this._tile.computedTransform,this._rtcCenterTransform,this._contentModelMatrix),this._model.modelMatrix=this._contentModelMatrix,this._model.shadows=this._tileset.shadows,this._model.imageBasedLightingFactor=this._tileset.imageBasedLightingFactor,this._model.lightColor=this._tileset.lightColor,this._model.luminanceAtZenith=this._tileset.luminanceAtZenith,this._model.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._model.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._model.debugWireframe=this._tileset.debugWireframe;var r=this._tileset.clippingPlanes;this._model.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,n(r)&&this._tile.clippingPlanesDirty&&(this._model._clippingPlanes=r.enabled&&this._tile._isClipped?r:void 0),n(r)&&n(this._model._clippingPlanes)&&this._model._clippingPlanes!==r&&(this._model._clippingPlanes=r),this._model.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&!n(e.classificationType)&&this._batchTable.addDerivedCommands(t,i)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),s(this)},T}),define("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";return e({AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"})}),define("Scene/DiscardEmptyTileImagePolicy",["../Core/defined","../Core/defineProperties"],function(e,t){"use strict";function i(e){}i.prototype.isReady=function(){return!0},i.prototype.shouldDiscardImage=function(e){return i.EMPTY_IMAGE===e};var r;return t(i,{EMPTY_IMAGE:{get:function(){return e(r)||(r=new Image,r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),r}}}),i}),define("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/buildModuleUrl","../Core/Check","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardEmptyTileImagePolicy","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(t){function i(e){if(1!==e.resourceSets.length)return void a();var t=e.resourceSets[0].resources[0];S._tileWidth=t.imageWidth,S._tileHeight=t.imageHeight,S._maximumLevel=t.zoomMax-1,S._imageUrlSubdomains=t.imageUrlSubdomains,S._imageUrlTemplate=t.imageUrl;var i=S._attributionList=t.imageryProviders;i||(i=S._attributionList=[]);for(var n=0,o=i.length;n<o;++n){var s=i[n];if(s.credit instanceof r)break;s.credit=new r(s.attribution);for(var l=s.coverageAreas,d=0,h=s.coverageAreas.length;d<h;++d){var f=l[d],m=f.bbox;f.bbox=new c(u.toRadians(m[1]),u.toRadians(m[0]),u.toRadians(m[3]),u.toRadians(m[2]))}}S._ready=!0,S._readyPromise.resolve(!0),p.handleSuccess(C)}function a(e){var t="An error occurred while accessing "+b.url+".";C=p.handleError(C,S,S._errorEvent,t,void 0,void 0,void 0,s),S._readyPromise.reject(new h(t))}function s(){var e=b.fetchJsonp("jsonp");y._metadataCache[T]=e,e.then(i).otherwise(a)}t=n(t,{}),this._key=e.getKey(t.key),this._resource=d.createIfNeeded(t.url),this._resource.appendForwardSlash(),this._tileProtocol=t.tileProtocol,this._mapStyle=n(t.mapStyle,_.AERIAL),this._culture=n(t.culture,""),this._tileDiscardPolicy=t.tileDiscardPolicy,o(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new g),this._proxy=t.proxy,this._credit=new r('<a href="http://www.bing.com"><img src="'+y.logoUrl+'" title="Bing Imagery"/></a>'),this.defaultGamma=1,this._tilingScheme=new f({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new l,this._ready=!1,this._readyPromise=m.defer();var v=this._tileProtocol;if(o(v))v.length>0&&":"===v[v.length-1]&&(v=v.substr(0,v.length-1));else{v="http:"===document.location.protocol?"http":"https"}var C,b=this._resource.getDerivedResource({url:"REST/v1/Imagery/Metadata/"+this._mapStyle,queryParameters:{incl:"ImageryProviders",key:this._key,uriScheme:v}}),S=this,T=b.url,E=y._metadataCache[T];o(E)?E.then(i).otherwise(a):s()}function C(e,t,i,r,n){var o=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+i+r)%a.length;return e._resource.getDerivedResource({url:o,request:n,templateValues:{quadkey:y.tileXYToQuadKey(t,i,r),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}function b(e,t,i){++t;for(var r=[],n=0,a=e.length;n<a;++n){for(var s=e[n],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,T);o(f)&&(u=!0)}}u&&r.push(s.credit)}return r}a(y.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.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 S=new c;y.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,S);return b(this._attributionList,i,r)},y.prototype.requestImage=function(e,t,i,r){var n=v.loadImage(this,C(this,e,t,i,r));if(o(n))return n.otherwise(function(e){return o(e.blob)&&0===e.blob.size?g.EMPTY_IMAGE:m.reject(e)})},y.prototype.pickFeatures=function(e,t,i,r,n){},y.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},y.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}},y._logoUrl=void 0,a(y,{logoUrl:{get:function(){return o(y._logoUrl)||(y._logoUrl=t("Assets/Images/bing_maps_credit.png")),y._logoUrl},set:function(e){y._logoUrl=e}}});var T=new c;return y._metadataCache={},y}),define("Scene/BoxEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,i,r,n){"use strict";function o(t){t=i(t,a),this._dimensions=e.clone(t)}var a=new e(1,1,1);r(o.prototype,{dimensions:{get:function(){return this._dimensions},set:function(t){e.clone(t,this._dimensions)}}});var s=new e;return o.prototype.emit=function(t){var i=this._dimensions,r=e.multiplyByScalar(i,.5,s),o=n.randomBetween(-r.x,r.x),a=n.randomBetween(-r.y,r.y),l=n.randomBetween(-r.z,r.z);t.position=e.fromElements(o,a,l,t.position),t.velocity=e.normalize(t.position,t.velocity)},o}),define("Shaders/BrdfLutGeneratorFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(1.0 - v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n"}),define("Scene/BrdfLutGenerator",["../Core/BoundingRectangle","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/BrdfLutGeneratorFS"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function m(t,i){var r=t._framebuffer,n=i.createViewportQuadCommand(p,{framebuffer:r,renderState:s.fromCache({viewport:new e(0,0,256,256)})});t._drawCommand=n}function _(e,t){var i=new u({context:t,width:256,height:256,pixelFormat:n.RGBA,pixelDatatype:a.UNSIGNED_BYTE,sampler:new l({wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:d.NEAREST,magnificationFilter:c.NEAREST})});e._colorTexture=i;var r=new o({context:t,colorTextures:[i],destroyAttachments:!1});e._framebuffer=r}return i(f.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),f.prototype.update=function(e){if(!t(this._colorTexture)){var i=e.context;_(this,i),m(this,i),this._drawCommand.execute(i),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),r(this)},f}),define("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/PerspectiveFrustum","../Core/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,T),g=t.magnitude(t.multiplyByScalar(p,t.dot(_,p),E)),v=t.magnitude(t.multiplyByScalar(f,t.dot(_,f),E));l=Math.min(.2*d(m,g,v),1e9)}if(u<l){var y=-Math.pow(1e6*(l-r),1/8),C=Math.pow(1e6*(l-o),1/8);return function(e){var t=e*(C-y)+y;return-Math.pow(t,8)/1e6+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,A),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){
- var y=e.camera,C=e.mapProjection,b=C.ellipsoid,S=i.clone(y.positionCartographic,w),T=y.pitch,E=f(y.heading,a),A=f(y.roll,u),P=b.cartesianToCartographic(o,x);S.longitude=s.zeroToTwoPi(S.longitude),P.longitude=s.zeroToTwoPi(P.longitude);var D=!1;if(n(d)){var I=s.zeroToTwoPi(d),M=Math.min(S.longitude,P.longitude),R=Math.max(S.longitude,P.longitude),O=I>=M&&I<=R;if(n(m)){var L=Math.abs(S.longitude-P.longitude),N=s.TWO_PI-L;(O?L:N)<(O?N:L)*m&&!O&&(D=!0)}else O||(D=!0)}D?_(S,P):g(S,P);var F=p(y,o,S.height,P.height,c),B=h(T,l,F,v);return function(){var e=S.longitude,i=P.longitude,n=S.latitude,o=P.latitude;return function(l){var c=l.time/r,d=t.fromRadians(s.lerp(e,i,c),s.lerp(n,o,c),F(c));y.setView({destination:d,orientation:{heading:s.lerp(E,a,c),pitch:B(c),roll:s.lerp(A,u,c)}})}}()}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,A),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 b(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var S={},T=new t,E=new t,A=new t,w=new i,x=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,T=o.easingFunction;d&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,P),l=h.project(P,D));var E=i.camera,A=o.endTransform;n(A)&&E._setTransform(A);var w=o.duration;n(w)||(w=Math.ceil(t.distance(E.position,l)/1e6)+2,w=Math.min(w,3));var x=r(o.heading,0),I=r(o.pitch,-s.PI_OVER_TWO),M=r(o.roll,0),R=i.screenSpaceCameraController;R.enableInputs=!1;var O=b(R,o.complete),L=b(R,o.cancel),N=E.frustum,F=i.mode===c.SCENE2D;if(F=F&&e.equalsEpsilon(E.position,l,s.EPSILON6),F=F&&s.equalsEpsilon(Math.max(N.right-N.left,N.top-N.bottom),l.z,s.EPSILON6),F=F||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,E.position,s.EPSILON10),F=F&&s.equalsEpsilon(s.negativePiToPi(x),s.negativePiToPi(E.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(I),s.negativePiToPi(E.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(M),s.negativePiToPi(E.roll),s.EPSILON10))return C(O,L);var B=new Array(4);if(B[c.SCENE2D]=y,B[c.SCENE3D]=v,B[c.COLUMBUS_VIEW]=m,w<=0){return C(function(){B[u](i,1,l,x,I,M,f,_,g,S)({time:1}),"function"==typeof O&&O()},L)}var k=B[u](i,w,l,x,I,M,f,_,g,S);if(!n(T)){var z=E.positionCartographic.height;T=z>(u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z)&&z>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:w,easingFunction:T,startObject:{time:0},stopObject:{time:w},update:k,complete:O,cancel:L}},S}),define("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";return e({ROTATE:0,INFINITE_SCROLL:1})}),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/getTimestamp","../Core/HeadingPitchRange","../Core/HeadingPitchRoll","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I){"use strict";function M(e){this._scene=e,this._transform=C.clone(C.IDENTITY),this._invTransform=C.clone(C.IDENTITY),this._actualTransform=C.clone(C.IDENTITY),this._actualInvTransform=C.clone(C.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new T,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=v.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 C,this._invViewMatrix=new C,R(this),this._mode=I.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,v.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 R(e){C.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),C.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),C.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function O(e){if(a(e._oldPositionWC)){e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;var t=i.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=i.magnitude(t),e._oldPositionWC=i.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=p()):e.timeSinceMoved=Math.max(p()-e._lastMovedTimestamp,0)/1e3}else e._oldPositionWC=i.clone(e.positionWC,e._oldPositionWC)}function L(e){x.basisTo2D(e._projection,e._transform,e._actualTransform)}function N(e){var t=e._projection,n=t.ellipsoid,o=C.getColumn(e._transform,3,ge),a=n.cartesianToCartographic(o,fe),s=t.project(a,me),l=ve;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,be),c=r.add(C.getColumn(e._transform,0,_e),o,_e);n.cartesianToCartographic(c,a),t.project(a,s);var d=ye;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=Ce;if(i.magnitudeSquared(d)>v.EPSILON10)i.cross(u,d,h);else{var p=r.add(C.getColumn(e._transform,1,_e),o,_e);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)<v.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),C.setColumn(e._actualTransform,0,d,e._actualTransform),C.setColumn(e._actualTransform,1,h,e._actualTransform),C.setColumn(e._actualTransform,2,u,e._actualTransform),C.setColumn(e._actualTransform,3,l,e._actualTransform)}function F(e){var t=e._mode,r=!1,n=0;t===I.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&&(C.inverseTransformation(e._transform,e._invTransform),e._mode===I.COLUMBUS_VIEW||e._mode===I.SCENE2D?C.equals(C.IDENTITY,e._transform)?C.clone(M.TRANSFORM_2D,e._actualTransform):e._mode===I.COLUMBUS_VIEW?L(e):N(e):C.clone(e._transform,e._actualTransform),C.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var f=e._actualTransform;if(a||p)if(e._positionWC=C.multiplyByPoint(f,o,e._positionWC),t===I.SCENE3D||t===I.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var m=Se;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===I.SCENE2D&&(m.z=n),e._projection.unproject(m,e._positionCartographic)}if(l||c||h){var _=i.dot(s,i.cross(u,d,Se));if(Math.abs(1-_)>v.EPSILON2){var g=1/i.magnitudeSquared(u),y=i.dot(u,s)*g,b=i.multiplyByScalar(s,y,Se);u=i.normalize(i.subtract(u,b,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=C.multiplyByPointAsVector(f,s,e._directionWC),i.normalize(e._directionWC,e._directionWC)),(c||p)&&(e._upWC=C.multiplyByPointAsVector(f,u,e._upWC),i.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=C.multiplyByPointAsVector(f,d,e._rightWC),i.normalize(e._rightWC,e._rightWC)),(a||l||c||h||p)&&R(e)}function B(e,t){var i;return i=v.equalsEpsilon(Math.abs(e.z),1,v.EPSILON3)?Math.atan2(t.y,t.x)-v.PI_OVER_TWO:Math.atan2(e.y,e.x)-v.PI_OVER_TWO,v.TWO_PI-v.zeroToTwoPi(i)}function k(e){return v.PI_OVER_TWO-v.acosClamped(e.z)}function z(e,t,i){var r=0;return v.equalsEpsilon(Math.abs(e.z),1,v.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=v.zeroToTwoPi(r+v.TWO_PI)),r}function V(e,t,r){var n=C.clone(e.transform,Oe),o=x.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Le);e._setTransform(o),i.clone(i.ZERO,e.position),r.heading=r.heading-v.PI_OVER_TWO;var a=E.fromHeadingPitchRoll(r,Ne),s=y.fromQuaternion(a,Fe);y.getColumn(s,0,e.direction),y.getColumn(s,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function U(e,t,r,n){var o=C.clone(e.transform,Oe);if(e._setTransform(C.IDENTITY),!i.equals(t,e.positionWC)){if(n){var a=e._projection,s=a.ellipsoid.cartesianToCartographic(t,Be);t=a.project(s,Re)}i.clone(t,e.position)}r.heading=r.heading-v.PI_OVER_TWO;var l=E.fromHeadingPitchRoll(r,Ne),u=y.fromQuaternion(l,Fe);y.getColumn(u,0,e.direction),y.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function G(e,r,n,o){var a=C.clone(e.transform,Oe);if(e._setTransform(C.IDENTITY),!i.equals(r,e.positionWC)){if(o){var s=e._projection,l=s.ellipsoid.cartesianToCartographic(r,Be);r=s.project(l,Re)}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===D.ROTATE){n.heading=n.heading-v.PI_OVER_TWO,n.pitch=-v.PI_OVER_TWO,n.roll=0;var p=E.fromHeadingPitchRoll(n,Ne),f=y.fromQuaternion(p,Fe);y.getColumn(f,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(a)}function H(e,t,r,n){var o=i.clone(r.direction,ke),a=i.clone(r.up,ze);if(e._scene.mode===I.SCENE3D){var s=e._projection.ellipsoid,l=x.eastNorthUpToFixedFrame(t,s,Te),u=C.inverseTransformation(l,Ee);C.multiplyByPointAsVector(u,o,o),C.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,Ve);return n.heading=B(o,a),n.pitch=k(o),n.roll=z(o,a,c),n}function W(e,t){var i,r,n=e._scene.mapMode2D===D.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 q(e,t){var r=e.position;if(a(e.constrainedAxis)&&!i.equalsEpsilon(e.position,i.ZERO,v.EPSILON2)){var n=i.normalize(r,Qe),o=i.equalsEpsilon(n,e.constrainedAxis,v.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,Je),v.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,Ke),u=i.dot(n,l),c=v.acosClamped(u);t>0&&t>c&&(t=c-v.EPSILON4),u=i.dot(n,i.negate(l,Je)),c=v.acosClamped(u),t<0&&-t>c&&(t=-c+v.EPSILON4);var d=i.cross(l,n,Ze);e.rotate(d,t)}}else e.rotate(e.right,t)}function Y(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function j(e,t){var i,r=e.frustum;if(t*=.5,Math.abs(r.top)+Math.abs(r.bottom)>Math.abs(r.left)+Math.abs(r.right)){var n=r.top-t,o=r.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===D.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,n=-a),n<=o&&(n=1,o=-1),i=r.right/r.top,r.top=n,r.bottom=o,r.right=r.top*i,r.left=-r.right}else{var s=r.right-t,l=r.left+t,u=e._maxCoord.x;e._scene.mapMode2D===D.ROTATE&&(u*=e.maximumZoomFactor),s>u&&(s=u,l=-u),s<=l&&(s=1,l=-1),i=r.top/r.right,r.right=s,r.left=l,r.top=r.right*i,r.bottom=-r.top}}function X(e,t){e.move(e.direction,t)}function Q(e,t,r){t=v.clamp(t,-v.PI_OVER_TWO,v.PI_OVER_TWO),e=v.zeroToTwoPi(e)-v.PI_OVER_TWO;var n=E.fromAxisAngle(i.UNIT_Y,-t,tt),o=E.fromAxisAngle(i.UNIT_Z,-e,it),a=E.multiply(o,n,o),s=y.fromQuaternion(a,rt),l=i.clone(i.UNIT_X,et);return y.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function K(e,t,r,n){return Math.abs(i.dot(t,r))/n-i.dot(e,r)}function Z(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:mt,l=t.north,u=t.south,c=t.east,h=t.west;h>c&&(c+=v.TWO_PI);var p,f=.5*(h+c);if(u<-v.PI_OVER_TWO+v.RADIANS_PER_DEGREE&&l>v.PI_OVER_TWO-v.RADIANS_PER_DEGREE)p=0;else{var m=ot;m.longitude=f,m.latitude=l,m.height=0;var _=at;_.longitude=f,_.latitude=u,_.height=0;var g=nt;a(g)&&g.ellipsoid===o||(nt=g=new d(void 0,void 0,o)),g.setEndPoints(m,_),p=g.interpolateUsingFraction(.5,ot).latitude}var y=ot;y.longitude=f,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,pt),S=ot;S.longitude=c,S.latitude=l;var T=o.cartographicToCartesian(S,st);S.longitude=h;var E=o.cartographicToCartesian(S,ut);S.longitude=f;var A=o.cartographicToCartesian(S,dt);S.latitude=u;var w=o.cartographicToCartesian(S,ht);S.longitude=c;var x=o.cartographicToCartesian(S,ct);S.longitude=h;var P=o.cartographicToCartesian(S,lt);i.subtract(E,C,E),i.subtract(x,C,x),i.subtract(T,C,T),i.subtract(P,C,P),i.subtract(A,C,A),i.subtract(w,C,w);var D=o.geodeticSurfaceNormal(C,s.direction);i.negate(D,D);var I=i.cross(D,i.UNIT_Z,s.right);i.normalize(I,I);var M,R=i.cross(I,D,s.up);if(e.frustum instanceof b){var O,L,N=Math.max(i.distance(T,E),i.distance(x,P)),F=Math.max(i.distance(T,x),i.distance(E,P)),B=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,k=F*B;N>k?(O=N,L=O/B):(L=F,O=k),M=Math.max(O,L)}else{var z=Math.tan(.5*e.frustum.fovy),V=e.frustum.aspectRatio*z;if(M=Math.max(K(D,R,E,z),K(D,R,x,z),K(D,R,T,z),K(D,R,P,z),K(D,R,A,z),K(D,R,w,z),K(D,I,E,V),K(D,I,x,V),K(D,I,T,V),K(D,I,P,V),K(D,I,A,V),K(D,I,w,V)),u<0&&l>0){var U=ot;U.longitude=h,U.latitude=0,U.height=0;var G=o.cartographicToCartesian(U,ft);i.subtract(G,C,G),M=Math.max(M,K(D,R,G,z),K(D,I,G,V)),U.longitude=c,G=o.cartographicToCartesian(U,ft),i.subtract(G,C,G),M=Math.max(M,K(D,R,G,z),K(D,I,G,V))}}return i.add(C,i.multiplyByScalar(D,-M,ft),r)}function J(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,s=_t;s.longitude=t.east,s.latitude=t.north;var l=r.project(s,gt);C.multiplyByPoint(n,l,l),C.multiplyByPoint(o,l,l),s.longitude=t.west,s.latitude=t.south;var u=r.project(s,vt);if(C.multiplyByPoint(n,u,u),C.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 $(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=yt;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,Ct);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,bt),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 ee(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,St),a=g.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return A.getPoint(n,s,r)}}function te(e,t,r,n){var o=e.getPickRay(t,Tt),a=o.origin;a=i.fromElements(a.y,a.z,0,a);var s=r.unproject(a);if(!(s.latitude<-v.PI_OVER_TWO||s.latitude>v.PI_OVER_TWO))return r.ellipsoid.cartographicToCartesian(s,n)}function ie(e,t,r,n){var o=e.getPickRay(t,Et),a=-o.origin.x/o.direction.x;A.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-v.PI_OVER_TWO||s.latitude>v.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function re(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,At);i.add(h,p,p);var f=i.multiplyByScalar(e.rightWC,c*u*l,wt),m=i.multiplyByScalar(e.upWC,d*u*s,xt),_=i.add(p,f,r.direction);return i.add(_,m,_),i.subtract(_,h,_),i.normalize(_,_),r}function ne(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,Pt),i.add(Pt,d,d),i.multiplyByScalar(e.up,c,Pt),i.add(Pt,d,d),i.clone(e.directionWC,r.direction),e._mode!==I.COLUMBUS_VIEW&&e._mode!==I.SCENE2D||i.fromElements(r.origin.z,r.origin.x,r.origin.y,r.origin),r}function oe(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 ae(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,Rt),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,Ot),Ot);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,Lt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,Nt)),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 oe(e,r,s,m,_,t)}}function se(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function le(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 ue(e,t,i){a(i)||(i=f.clone(M.DEFAULT_OFFSET));var r=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,o=i.range;if(!a(o)||0===o){var s=t.radius;0===s?i.range=kt:e.frustum instanceof b||e._mode===I.SCENE2D?i.range=le(e,s):i.range=se(e,s),i.range=v.clamp(i.range,r,n)}return i}function ce(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,jt),l=i.magnitude(s),u=i.normalize(s,Xt);i.equalsEpsilon(u,i.UNIT_Z,v.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,Qt),Qt),n=i.normalize(i.cross(u,r,Kt),Kt));var c=Math.sqrt(i.magnitudeSquared(s)-1),d=i.multiplyByScalar(u,1/l,jt),h=c/l,p=i.multiplyByScalar(r,h,Xt),f=i.multiplyByScalar(n,h,Qt),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 g=i.subtract(d,f,Zt[2]);i.add(g,p,g),i.multiplyComponents(o,g,g);var y=i.add(d,f,Zt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Zt}function de(e,t,i,r,n,o){Jt.x=e,Jt.y=t;var s=r.pickEllipsoid(Jt,n,$t);return a(s)?(ei[i]=n.cartesianToCartographic(s,ei[i]),1):(ei[i]=n.cartesianToCartographic(o[i],ei[i]),0)}M.TRANSFORM_2D=new C(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),M.TRANSFORM_2D_INVERSE=C.inverseTransformation(M.TRANSFORM_2D,new C),M.DEFAULT_VIEW_RECTANGLE=w.fromDegrees(-95,-20,-70,90),M.DEFAULT_VIEW_FACTOR=.5,M.DEFAULT_OFFSET=new f(0,-v.PI_OVER_FOUR,0),M.prototype.hasCurrentFlight=function(){return a(this._currentFlight)&&a(this._scene.preloadFlightCamera)},M.prototype._updateCameraChanged=function(){var e=this;if(O(e),0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===I.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,g=Math.max(u,d),y=Math.min(c,h),C=Math.max(p,m),b=Math.min(f,_);if(g>=y||C>=f)r=1;else{var S=l;u<d&&c>h&&p<m&&f>_&&(S=s),r=1-(y-g)*(b-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 T,E=v.acosClamped(i.dot(e.directionWC,e._changedDirection));T=a(e.frustum.fovy)?E/(.5*e.frustum.fovy):E;var A=i.distance(e.positionWC,e._changedPosition),w=A/e.positionCartographic.height;(T>t||w>t)&&(e._changed.raiseEvent(Math.max(T,w)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var he=new C,pe=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!==I.SCENE2D&&s!==I.MORPHING){var u,c,d=l.ellipsoid,h=e.mapProjection;C.equals(this.transform,C.IDENTITY)||(u=C.clone(this.transform,he),c=i.magnitude(this.position),this._setTransform(C.IDENTITY));var p=pe;s===I.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===I.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 fe=new n,me=new i,_e=new i,ge=new r,ve=new r,ye=new r,Ce=new r,be=new r,Se=new i,Te=new C,Ee=new C;s(M.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return F(this),this._invTransform}},viewMatrix:{get:function(){return F(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return F(this),this._invViewMatrix}},positionCartographic:{get:function(){return F(this),this._positionCartographic}},positionWC:{get:function(){return F(this),this._positionWC}},directionWC:{get:function(){return F(this),this._directionWC}},upWC:{get:function(){return F(this),this._upWC}},rightWC:{get:function(){return F(this),this._rightWC}},heading:{get:function(){if(this._mode!==I.MORPHING){var e=this._projection.ellipsoid,t=C.clone(this._transform,Te),i=x.eastNorthUpToFixedFrame(this.positionWC,e,Ee);this._setTransform(i);var r=B(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==I.MORPHING){var e=this._projection.ellipsoid,t=C.clone(this._transform,Te),i=x.eastNorthUpToFixedFrame(this.positionWC,e,Ee);this._setTransform(i);var r=k(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==I.MORPHING){var e=this._projection.ellipsoid,t=C.clone(this._transform,Te),i=x.eastNorthUpToFixedFrame(this.positionWC,e,Ee);this._setTransform(i);var r=z(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!==I.MORPHING,t=this._mode===I.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=i.top/i.right;i.right=2*this._maxCoord.x,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top}this._mode===I.SCENE2D&&W(this,this.position);var n=this._scene.globe,o=!a(n)||n._surface.tileProvider.ready&&0===n._surface._tileLoadQueueHigh.length&&0===n._surface._tileLoadQueueMedium.length&&0===n._surface._tileLoadQueueLow.length&&0===n._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!o),o&&this._adjustHeightForTerrain()};var Ae=new i,we=new i,xe=new i;M.prototype._setTransform=function(e){var t=i.clone(this.positionWC,Ae),r=i.clone(this.upWC,we),n=i.clone(this.directionWC,xe);C.clone(e,this._transform),this._transformChanged=!0,F(this);var o=this._actualInvTransform;C.multiplyByPoint(o,t,this.position),C.multiplyByPointAsVector(o,n,this.direction),C.multiplyByPointAsVector(o,r,this.up),i.cross(this.direction,this.up,this.right),F(this)};var Pe=new t,De=new A,Ie=new i,Me=new i;M.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof b&&(e||!(this._positionCartographic.height<15e4))){if(!C.equals(C.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=Pe;s.x=n.drawingBufferWidth/2,s.y=n.drawingBufferHeight/2;var l=this.getPickRay(s,De);if(t=o.pickWorldCoordinates(l,n,Ie),n.pickPositionSupported&&(r=n.pickPositionWorldCoordinates(s,Me)),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 Re=new i,Oe=new C,Le=new C,Ne=new E,Fe=new y,Be=new n,ke=new i,ze=new i,Ve=new i,Ue={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},Ge=new m;M.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),r=this._mode;if(r!==I.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,i.clone(this.positionWC,Re));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,Re),n=!1),a(t.direction)&&(t=H(this,s,t,Ue.orientation)),Ge.heading=o(t.heading,0),Ge.pitch=o(t.pitch,-v.PI_OVER_TWO),Ge.roll=o(t.roll,0),this._suspendTerrainAdjustment=!0,r===I.SCENE3D?V(this,s,Ge):r===I.SCENE2D?G(this,s,Ge,n):U(this,s,Ge,n)}};var He=new i;M.prototype.flyHome=function(e){var t=this._mode;if(t===I.MORPHING&&this._scene.completeMorph(),t===I.SCENE2D)this.flyTo({destination:M.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:C.IDENTITY});else if(t===I.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:C.IDENTITY})}else if(t===I.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,He).z),roll:0},endTransform:C.IDENTITY,convert:!1})}},M.prototype.worldToCameraCoordinates=function(e,t){return a(t)||(t=new r),F(this),C.multiplyByVector(this._actualInvTransform,e,t)},M.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new i),F(this),C.multiplyByPoint(this._actualInvTransform,e,t)},M.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new i),F(this),C.multiplyByPointAsVector(this._actualInvTransform,e,t)},M.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new r),F(this),C.multiplyByVector(this._actualTransform,e,t)},M.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new i),F(this),C.multiplyByPoint(this._actualTransform,e,t)},M.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new i),F(this),C.multiplyByPointAsVector(this._actualTransform,e,t)};var We=new i;M.prototype.move=function(e,t){var r=this.position;i.multiplyByScalar(e,t,We),i.add(r,We,r),this._mode===I.SCENE2D&&W(this,r),this._adjustOrthographicFrustum(!0)},M.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this._mode===I.SCENE2D?j(this,e):this.move(this.direction,e)},M.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this._mode===I.SCENE2D?j(this,-e):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._mode!==I.SCENE2D&&this.look(this.up,-e)},M.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.up,e)},M.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.right,-e)},M.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.right,e)};var qe=new E,Ye=new y;M.prototype.look=function(e,t){var i=o(t,this.defaultLookAmount),r=E.fromAxisAngle(e,-i,qe),n=y.fromQuaternion(r,Ye),a=this.direction,s=this.up,l=this.right;y.multiplyByVector(n,a,a),y.multiplyByVector(n,s,s),y.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 je=new E,Xe=new y;M.prototype.rotate=function(e,t){var r=o(t,this.defaultRotateAmount),n=E.fromAxisAngle(e,-r,je),a=y.fromQuaternion(n,Xe);y.multiplyByVector(a,this.position,this.position),y.multiplyByVector(a,this.direction,this.direction),y.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),q(this,e)},M.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),q(this,-e)};var Qe=new i,Ke=new i,Ze=new i,Je=new i;M.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),Y(this,-e)},M.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),Y(this,e)},M.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===I.SCENE2D?j(this,e):X(this,e)},M.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===I.SCENE2D?j(this,-e):X(this,-e)},M.prototype.getMagnitude=function(){return this._mode===I.SCENE3D?i.magnitude(this.position):this._mode===I.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===I.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var $e=new C;M.prototype.lookAt=function(e,t){var i=x.eastNorthUpToFixedFrame(e,c.WGS84,$e);this.lookAtTransform(i,t)};var et=new i,tt=new E,it=new E,rt=new y;M.prototype.lookAtTransform=function(e,r){if(this._setTransform(e),a(r)){var n;if(n=a(r.heading)?Q(r.heading,r.pitch,r.range):r,this._mode===I.SCENE2D){t.clone(t.ZERO,this.position),i.negate(n,this.up),this.up.z=0,i.magnitudeSquared(this.up)<v.EPSILON10&&i.clone(i.UNIT_Y,this.up),i.normalize(this.up,this.up),this._setTransform(C.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)<v.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 nt,ot=new n,at=new n,st=new i,lt=new i,ut=new i,ct=new i,dt=new i,ht=new i,pt=new i,ft=new i,mt={direction:new i,right:new i,up:new i},_t=new n,gt=new i,vt=new i,yt=new n,Ct=new i,bt=new i;M.prototype.getRectangleCameraCoordinates=function(e,t){var r=this._mode;return a(t)||(t=new i),r===I.SCENE3D?Z(this,e,t):r===I.COLUMBUS_VIEW?J(this,e,t):r===I.SCENE2D?$(this,e,t):void 0};var St=new A,Tt=new A,Et=new A;M.prototype.pickEllipsoid=function(e,t,r){var n=this._scene.canvas;if(0!==n.clientWidth&&0!==n.clientHeight){if(a(r)||(r=new i),t=o(t,c.WGS84),this._mode===I.SCENE3D)r=ee(this,e,t,r);else if(this._mode===I.SCENE2D)r=te(this,e,this._projection,r);else{if(this._mode!==I.COLUMBUS_VIEW)return;r=ie(this,e,this._projection,r)}return r}};var At=new i,wt=new i,xt=new i,Pt=new i;M.prototype.getPickRay=function(e,t){a(t)||(t=new A);var i=this.frustum;return a(i.aspectRatio)&&a(i.fov)&&a(i.near)?re(this,e,t):ne(this,e,t)};var Dt=new i,It=new i;M.prototype.distanceToBoundingSphere=function(e){var t=i.subtract(this.positionWC,e.center,Dt),r=i.multiplyByScalar(this.directionWC,i.dot(t,this.directionWC),It);return Math.max(0,i.magnitude(r)-e.radius)};var Mt=new t;M.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,Mt);return Math.max(n.x,n.y)};var Rt=new i,Ot=new i,Lt=new i,Nt=new i;M.prototype.createCorrectPositionTween=function(e){if(this._mode===I.COLUMBUS_VIEW)return ae(this,e)};var Ft=new i,Bt={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;if(this._mode!==I.MORPHING){this.cancelFlight();var i=o(e.orientation,o.EMPTY_OBJECT);if(a(i.direction)&&(i=H(this,t,i,Ue.orientation)),a(e.duration)&&e.duration<=0){var r=Ue;return r.destination=e.destination,r.orientation.heading=i.heading,r.orientation.pitch=i.pitch,r.orientation.roll=i.roll,r.convert=e.convert,r.endTransform=e.endTransform,this.setView(r),void("function"==typeof e.complete&&e.complete())}var n=a(t.west);n&&(t=this.getRectangleCameraCoordinates(t,Ft));var s,l=this;Bt.destination=t,Bt.heading=i.heading,Bt.pitch=i.pitch,Bt.roll=i.roll,Bt.duration=e.duration,Bt.complete=function(){s===l._currentFlight&&(l._currentFlight=void 0),a(e.complete)&&e.complete()},Bt.cancel=e.cancel,Bt.endTransform=e.endTransform,Bt.convert=!n&&e.convert,Bt.maximumHeight=e.maximumHeight,Bt.pitchAdjustHeight=e.pitchAdjustHeight,Bt.flyOverLongitude=e.flyOverLongitude,Bt.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Bt.easingFunction=e.easingFunction;var u=this._scene;s=u.tweens.add(P.createTween(u,Bt)),this._currentFlight=s;var c=this._scene.preloadFlightCamera;this._mode!==I.SCENE2D?(a(c)||(c=M.clone(this)),c.setView({destination:t,orientation:i}),this._scene.preloadFlightCullingVolume=c.frustum.computeCullingVolume(c.positionWC,c.directionWC,c.upWC)):c=void 0}};var kt=100;M.prototype.viewBoundingSphere=function(e,t){t=ue(this,e,t),this.lookAt(e.center,t)};var zt=new C,Vt=new i,Ut=new i,Gt=new i,Ht=new i,Wt=new r,qt=new E,Yt=new y;M.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var r=this._mode===I.SCENE2D||this._mode===I.COLUMBUS_VIEW;this._setTransform(C.IDENTITY);var n,a=ue(this,e,t.offset);n=r?i.multiplyByScalar(i.UNIT_Z,a.range,Vt):Q(a.heading,a.pitch,a.range);var s=x.eastNorthUpToFixedFrame(e.center,c.WGS84,zt);C.multiplyByPoint(s,n,n);var l,u;if(!r){if(l=i.subtract(e.center,n,Ut),i.normalize(l,l),u=C.multiplyByPointAsVector(s,i.UNIT_Z,Gt),1-Math.abs(i.dot(l,u))<v.EPSILON6){var d=E.fromAxisAngle(l,a.heading,qt),h=y.fromQuaternion(d,Yt);i.fromCartesian4(C.getColumn(s,1,Wt),u),y.multiplyByVector(h,u,u)}var p=i.cross(l,u,Ht);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 jt=new i,Xt=new i,Qt=new i,Kt=new i,Zt=[new i,new i,new i,new i],Jt=new t,$t=new i,ei=[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);if(n.computeVisibility(a)!==_.OUTSIDE){var s=this._scene.canvas,l=s.clientWidth,u=s.clientHeight,d=0,h=ce(this,t);if(d+=de(0,0,0,this,t,h),d+=de(0,u,1,this,t,h),d+=de(l,u,2,this,t,h),(d+=de(l,0,3,this,t,h))<2)return w.MAX_VALUE;r=w.fromCartographicArray(ei,r);for(var p=0,f=ei[3].longitude,m=0;m<4;++m){var g=ei[m].longitude,y=Math.abs(g-f);y>v.PI?p+=v.TWO_PI-y:p+=y,f=g}return v.equalsEpsilon(Math.abs(p),v.TWO_PI,v.EPSILON9)&&(r.west=-v.PI,r.east=v.PI,ei[0].latitude>=0?r.north=v.PI_OVER_TWO:r.south=-v.PI_OVER_TWO),r}},M.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===I.SCENE2D||this.frustum instanceof T)){var e=this._scene;this.frustum=new T,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=v.toRadians(60)}},M.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===I.SCENE2D||this.frustum instanceof b)){var e=this._scene;this.frustum=new b,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),C.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t},M}),define("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";return e({LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4})}),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);return this._movement[i]},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/Composite3DTileContent",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/getMagic","../Core/RuntimeError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i,r,n,o){this._tileset=e,this._tile=t,this._resource=i,this._contents=[],this._readyPromise=s.defer(),u(this,r,n,o)}function u(i,r,n,l){n=e(n,0);var u=new Uint8Array(r),d=new DataView(r);n+=c;var h=d.getUint32(n,!0);if(1!==h)throw new a("Only Composite Tile version 1 is supported. Version "+h+" is not.");n+=c,n+=c;var p=d.getUint32(n,!0);n+=c;for(var f=[],m=0;m<p;++m){var _=o(u,n),g=d.getUint32(n+2*c,!0),v=l[_];if(!t(v))throw new a("Unknown tile content type, "+_+", inside Composite tile");var y=v(i._tileset,i._tile,i._resource,r,n);i._contents.push(y),f.push(y.readyPromise),n+=g}s.all(f).then(function(){i._readyPromise.resolve(i)}).otherwise(function(e){i._readyPromise.reject(e)})}if(!n.supportsTypedArrays())return{};i(l.prototype,{featurePropertiesDirty:{get:function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)if(e[i].featurePropertiesDirty)return!0;return!1},set:function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}});var c=Uint32Array.BYTES_PER_ELEMENT;return l.prototype.hasProperty=function(e,t){return!1},l.prototype.getFeature=function(e){},l.prototype.applyDebugSettings=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].applyDebugSettings(e,t)},l.prototype.applyStyle=function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].applyStyle(e)},l.prototype.update=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].update(e,t)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)e[i].destroy();return r(this)},l}),define("Scene/Vector3DTileGeometry",["../Core/arraySlice","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Matrix4","../Core/TaskProcessor","../ThirdParty/when","./ClassificationType","./Vector3DTileBatch","./Vector3DTilePrimitive"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,o(this._center)||(o(this._boundingVolume)?this._center=i.clone(this._boundingVolume.center):this._center=i.clone(i.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=c.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=d.BOTH}function m(e){var t=new Float64Array(l.packedLength+i.packedLength),r=0;return i.pack(e._center,t,r),r+=i.packedLength,l.pack(e._modelMatrix,t,r),t}function _(e,i){for(var n=0,o=i[n++],a=i[n++],s=e._boundingVolumes=new Array(a),l=0;l<a;++l)s[l]=t.unpack(i,n),n+=t.packedLength;for(var u=i[n++],c=e._batchedIndices=new Array(u),d=0;d<u;++d){var p=r.unpack(i,n);n+=r.packedLength;for(var f=i[n++],m=i[n++],_=i[n++],g=new Array(_),v=0;v<_;++v)g[v]=i[n++];c[d]=new h({color:p,offset:f,count:m,batchIds:g})}return o}function g(t){if(!o(t._primitive)){if(!o(t._verticesPromise)){var i=t._boxes,r=t._boxBatchIds,a=t._cylinders,s=t._cylinderBatchIds,l=t._ellipsoids,u=t._ellipsoidBatchIds,c=t._spheres,d=t._sphereBatchIds,h=t._batchTableColors,f=t._packedBuffer;if(!o(h)){var g=0;o(t._boxes)&&(i=t._boxes=e(i),r=t._boxBatchIds=e(r),g+=r.length),o(t._cylinders)&&(a=t._cylinders=e(a),s=t._cylinderBatchIds=e(s),g+=s.length),o(t._ellipsoids)&&(l=t._ellipsoids=e(l),u=t._ellipsoidBatchIds=e(u),g+=u.length),o(t._spheres)&&(c=t._sphere=e(c),d=t._sphereBatchIds=e(d),g+=d.length),h=t._batchTableColors=new Uint32Array(g);for(var C=t._batchTable,b=0;b<g;++b){var S=C.getColor(b,y);h[b]=S.toRgba()}f=t._packedBuffer=m(t)}var T=[];o(i)&&T.push(i.buffer,r.buffer),o(a)&&T.push(a.buffer,s.buffer),o(l)&&T.push(l.buffer,u.buffer),o(c)&&T.push(c.buffer,d.buffer),T.push(h.buffer,f.buffer);var E={boxes:o(i)?i.buffer:void 0,boxBatchIds:o(i)?r.buffer:void 0,cylinders:o(a)?a.buffer:void 0,cylinderBatchIds:o(a)?s.buffer:void 0,ellipsoids:o(l)?l.buffer:void 0,ellipsoidBatchIds:o(l)?u.buffer:void 0,spheres:o(c)?c.buffer:void 0,sphereBatchIds:o(c)?d.buffer:void 0,batchTableColors:h.buffer,packedBuffer:f.buffer},A=t._verticesPromise=v.scheduleTask(E,T);if(!o(A))return;A.then(function(e){var i=new Float64Array(e.packedBuffer),r=_(t,i);t._indices=2===r?new Uint16Array(e.indices):new Uint32Array(e.indices),t._indexOffsets=new Uint32Array(e.indexOffsets),t._indexCounts=new Uint32Array(e.indexCounts),t._positions=new Float32Array(e.positions),t._vertexBatchIds=new Uint16Array(e.vertexBatchIds),t._batchIds=new Uint16Array(e.batchIds),t._ready=!0})}t._ready&&!o(t._primitive)&&(t._primitive=new p({batchTable:t._batchTable,positions:t._positions,batchIds:t._batchIds,vertexBatchIds:t._vertexBatchIds,indices:t._indices,indexOffsets:t._indexOffsets,indexCounts:t._indexCounts,batchedIndices:t._batchedIndices,boundingVolume:t._boundingVolume,boundingVolumes:t._boundingVolumes,center:t._center,pickObject:n(t._pickObject,t)}),t._boxes=void 0,t._boxBatchIds=void 0,t._cylinders=void 0,t._cylinderBatchIds=void 0,t._ellipsoids=void 0,t._ellipsoidBatchIds=void 0,t._spheres=void 0,t._sphereBatchIds=void 0,t._center=void 0,t._modelMatrix=void 0,t._batchTable=void 0,t._boundingVolume=void 0,t._boundingVolumes=void 0,t._batchedIndices=void 0,t._indices=void 0,t._indexOffsets=void 0,t._indexCounts=void 0,t._positions=void 0,t._vertexBatchIds=void 0,t._batchIds=void 0,t._batchTableColors=void 0,t._packedBuffer=void 0,t._verticesPromise=void 0,t._readyPromise.resolve())}}a(f.prototype,{trianglesLength:{get:function(){return o(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return o(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}}),f.packedBoxLength=l.packedLength+i.packedLength,f.packedCylinderLength=l.packedLength+2,f.packedEllipsoidLength=l.packedLength+i.packedLength,f.packedSphereLength=i.packedLength+1;var v=new u("createVectorTileGeometries"),y=new r;return f.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},f.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},f.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},f.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},f.prototype.update=function(e){g(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),s(this)},f}),define("Scene/Geometry3DTileContent",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getMagic","../Core/getStringFromTypedArray","../Core/Math","../Core/Matrix4","../Core/Rectangle","../Core/RuntimeError","../ThirdParty/when","./Cesium3DTileBatchTable","./Vector3DTileGeometry"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._geometries=void 0,this._contentReadyPromise=void 0,this._readyPromise=f.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,C(this,r,n)}function v(e){return function(t,r){i(e._geometries)&&e._geometries.updateCommands(t,r)}}function y(e,r){var n,o,a,s,l,u=t(e.BOXES_LENGTH,0),c=t(e.CYLINDERS_LENGTH,0),d=t(e.ELLIPSOIDS_LENGTH,0),h=t(e.SPHERES_LENGTH,0);if(u>0&&i(e.BOX_BATCH_IDS)){var f=r.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(r.buffer,f,u)}if(c>0&&i(e.CYLINDER_BATCH_IDS)){var m=r.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;o=new Uint16Array(r.buffer,m,c)}if(d>0&&i(e.ELLIPSOID_BATCH_IDS)){var _=r.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;a=new Uint16Array(r.buffer,_,d)}if(h>0&&i(e.SPHERE_BATCH_IDS)){var g=r.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;s=new Uint16Array(r.buffer,g,h)}var v=i(n)||i(o)||i(a)||i(s),y=u>0&&!i(n)||c>0&&!i(o)||d>0&&!i(a)||h>0&&!i(s);if(v&&y)throw new p("If one group of batch ids is defined, then all batch ids must be defined.");if(!(i(n)||i(o)||i(a)||i(s))){var C=0;if(!i(n)&&u>0)for(n=new Uint16Array(u),l=0;l<u;++l)n[l]=C++;if(!i(o)&&c>0)for(o=new Uint16Array(c),l=0;l<c;++l)o[l]=C++;if(!i(a)&&d>0)for(a=new Uint16Array(d),l=0;l<d;++l)a[l]=C++;if(!i(s)&&h>0)for(s=new Uint16Array(h),l=0;l<h;++l)s[l]=C++}return{boxes:n,cylinders:o,ellipsoids:a,spheres:s}}function C(r,n,o){o=t(o,0);var a=new Uint8Array(n),s=new DataView(n);o+=S;var l=s.getUint32(o,!0);if(1!==l)throw new p("Only Geometry tile version 1 is supported. Version "+l+" is not.");o+=S;var c=s.getUint32(o,!0);if(o+=S,0===c)return void r._readyPromise.resolve(r);var h=s.getUint32(o,!0);if(o+=S,0===h)throw new p("Feature table must have a byte length greater than zero");var f=s.getUint32(o,!0);o+=S;var g=s.getUint32(o,!0);o+=S;var C=s.getUint32(o,!0);o+=S;var b=u(a,o,h),T=JSON.parse(b);o+=h;var E=new Uint8Array(n,o,f);o+=f;var A,w;if(g>0){var x=u(a,o,g);A=JSON.parse(x),o+=g,C>0&&(w=new Uint8Array(n,o,C),w=new Uint8Array(w))}var P=t(T.BOXES_LENGTH,0),D=t(T.CYLINDERS_LENGTH,0),I=t(T.ELLIPSOIDS_LENGTH,0),M=t(T.SPHERES_LENGTH,0),R=P+D+I+M,O=new m(r,R,A,w,v(r));if(r._batchTable=O,0!==R){var L,N=r.tile.computedTransform;i(T.RTC_CENTER)&&(L=e.unpack(T.RTC_CENTER),d.multiplyByPoint(N,L,L));var F=y(T,E);if(P>0||D>0||I>0||M>0){var B,k,z,V;if(P>0){var U=E.byteOffset+T.BOXES.byteOffset;B=new Float32Array(E.buffer,U,_.packedBoxLength*P)}if(D>0){var G=E.byteOffset+T.CYLINDERS.byteOffset;k=new Float32Array(E.buffer,G,_.packedCylinderLength*D)}if(I>0){var H=E.byteOffset+T.ELLIPSOIDS.byteOffset;z=new Float32Array(E.buffer,H,_.packedEllipsoidLength*I)}if(M>0){var W=E.byteOffset+T.SPHERES.byteOffset;V=new Float32Array(E.buffer,W,_.packedSphereLength*M)}r._geometries=new _({boxes:B,boxBatchIds:F.boxes,cylinders:k,cylinderBatchIds:F.cylinders,ellipsoids:z,ellipsoidBatchIds:F.ellipsoids,spheres:V,sphereBatchIds:F.spheres,center:L,modelMatrix:N,batchTable:O,boundingVolume:r.tile.boundingVolume.boundingVolume})}}}function b(e){var t=e.featuresLength;if(!i(e._features)&&t>0){var r=new Array(t);i(e._geometries)&&e._geometries.createFeatures(e,r),e._features=r}}if(!s.supportsTypedArrays())return{};r(g.prototype,{featuresLength:{get:function(){return i(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return i(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return i(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return i(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var S=Uint32Array.BYTES_PER_ELEMENT;return g.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},g.prototype.getFeature=function(e){return b(this),this._features[e]},g.prototype.applyDebugSettings=function(e,t){i(this._geometries)&&this._geometries.applyDebugSettings(e,t)},g.prototype.applyStyle=function(e){b(this),i(this._geometries)&&this._geometries.applyStyle(e,this._features)},g.prototype.update=function(e,t){if(i(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),i(this._batchTable)&&this._geometries._ready&&this._batchTable.update(e,t),!i(this._contentReadyPromise)){var r=this;this._contentReadyPromise=this._geometries.readyPromise.then(function(){r._readyPromise.resolve(r)})}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),n(this)},g}),define("Scene/ModelInstance",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function i(e,i,r){this.primitive=e,this._modelMatrix=t.clone(i),this._instanceId=r}return e(i.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return t.clone(this._modelMatrix)},set:function(e){t.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}}),i}),define("Scene/ModelInstanceCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/PrimitiveType","../Core/Resource","../Core/RuntimeError","../Core/Transforms","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/ShaderSource","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/when","./Model","./ModelInstance","./ModelUtility","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P){"use strict";function D(e){e=s(e,s.EMPTY_OBJECT),this.show=s(e.show,!0),this._instancingSupported=!1,this._dynamic=s(e.dynamic,!1),this._allowPicking=s(e.allowPicking,!0),this._ready=!1,this._readyPromise=T.defer(),this._state=ne.NEEDS_LOAD,this._dirty=!1,this._cull=s(e.cull,!0),this._opaquePass=s(e.opaquePass,C.OPAQUE),this._instances=I(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._boundingSphere=M(this),this._center=i.clone(this._boundingSphere.center),this._rtcTransform=new h,this._rtcModelView=new h,this._mode=void 0,this.modelMatrix=h.clone(h.IDENTITY),this._modelMatrix=h.clone(this.modelMatrix),this._url=f.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=f.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=s(e.shadows,P.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=s(e.debugWireframe,!1),this._debugWireframe=!1,this._imageBasedLightingFactor=new t(1,1),t.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=e.luminanceAtZenith,this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps}function I(e,t){t=s(t,[]);for(var i=t.length,r=new Array(i),n=0;n<i;++n){var o=t[n],a=o.modelMatrix,l=s(o.batchId,n);r[n]=new A(e,a,l)}return r}function M(t){for(var r=t.length,n=new Array(r),o=0;o<r;++o)n[o]=h.getTranslation(t._instances[o]._modelMatrix,new i);return e.fromPoints(n)}function R(e,t,i,r){return function(n,o){var a=n.semantic;if(l(a)&&e.indexOf(a)>-1){if(!(t.indexOf(a)>-1))throw new m('Shader program cannot be optimized for instancing. Uniform "'+o+'" in program "'+i+'" uses unsupported semantic "'+a+'"');r[o]=a}}}function O(e,t){if(l(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];var i={};e._instancedUniformsByProgram=i;var r=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],n=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],o=e._model._sourceTechniques;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],u=s.program;if(!l(i[u])){var c={};i[u]=c,S.techniqueUniform(s,R(r,n,t,c))}}return i[t]}function L(e){return function(t,i){var r=O(e,i),n=l(e._batchTable),o=b.replaceMain(t,"czm_instancing_main"),a="",s="";for(var u in r)if(r.hasOwnProperty(u)){var c,d=r[u];"MODELVIEW"===d||"CESIUM_RTC_MODELVIEW"===d?c="czm_instanced_modelView":"MODELVIEWPROJECTION"===d?(c="czm_instanced_modelViewProjection",a+="mat4 czm_instanced_modelViewProjection;\n",s+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===d&&(c="czm_instanced_modelViewInverseTranspose",a+="mat3 czm_instanced_modelViewInverseTranspose;\n",s+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n");var h=new RegExp("uniform.*"+u+".*");o=o.replace(h,""),h=new RegExp(u+"\\b","g"),o=o.replace(h,c)}var p,f,m;n?(p="attribute float a_batchId;\n",f="",m=""):(p="",f="attribute vec4 pickColor;\nvarying vec4 v_pickColor;\n",m=" v_pickColor = pickColor;\n");var _="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+a+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\nattribute vec4 czm_modelMatrixRow2;\n"+p+f+o+"void main()\n{\n mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n"+s+" czm_instancing_main();\n"+m+"}\n";if(n){var g=e._model.gltf,v=w.getDiffuseAttributeOrUniform(g,i);_=e._batchTable.getVertexShaderCallback(!0,"a_batchId",v)(_)}return _}}function N(e){return function(t,i){var r=e._batchTable;if(l(r)){var n=e._model.gltf,o=w.getDiffuseAttributeOrUniform(n,i);t=r.getFragmentShaderCallback(!0,o)(t)}else t="varying vec4 v_pickColor;\n"+t;return t}}function F(e,t){return function(){return h.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function B(e){return function(){return e.computedMatrix}}function k(e,t){return function(i,r,o){i=n(i),i.czm_instanced_modifiedModelView=F(e,t),i.czm_instanced_nodeTransform=B(o);var a=O(e,r);for(var s in a)a.hasOwnProperty(s)&&delete i[s];return l(e._batchTable)&&(i=e._batchTable.getUniformMapCallback()(i)),i}}function z(e){return function(t,i){if(l(e._batchTable)){var r=e._model.gltf,n=w.getDiffuseAttributeOrUniform(r,i);t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",n)(t),t="uniform float a_batchId\n;"+t}return t}}function V(e){return function(t,i){var r=e._batchTable;if(l(r)){var n=e._model.gltf,o=w.getDiffuseAttributeOrUniform(n,i);t=r.getFragmentShaderCallback(!0,o)(t)}else t="uniform vec4 czm_pickColor;\n"+t;return t}}function U(e){return function(t){return l(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function G(e){var t=e._instances,i=e.length,r=e._center,n=e._vertexBufferTypedArray
- ;l(n)||(n=new Float32Array(12*i)),e._dynamic&&(e._vertexBufferTypedArray=n);for(var o=0;o<i;++o){var a=t[o]._modelMatrix,s=h.clone(a,ae);s[12]-=r.x,s[13]-=r.y,s[14]-=r.z;var u=12*o;n[u+0]=s[0],n[u+1]=s[4],n[u+2]=s[8],n[u+3]=s[12],n[u+4]=s[1],n[u+5]=s[5],n[u+6]=s[9],n[u+7]=s[13],n[u+8]=s[2],n[u+9]=s[6],n[u+10]=s[10],n[u+11]=s[14]}return n}function H(e,t){var i,r=e._instances,n=e.length,a=e._dynamic,s=l(e._batchTable);if(s){var u=new Uint16Array(n);for(i=0;i<n;++i)u[i]=r[i]._instanceId;e._batchIdBuffer=g.createVertexBuffer({context:t,typedArray:u,usage:v.STATIC_DRAW})}if(!s){var c=new Uint8Array(4*n);for(i=0;i<n;++i){var d=e._pickIds[i],h=d.color,p=4*i;c[p]=o.floatToByte(h.red),c[p+1]=o.floatToByte(h.green),c[p+2]=o.floatToByte(h.blue),c[p+3]=o.floatToByte(h.alpha)}e._pickIdBuffer=g.createVertexBuffer({context:t,typedArray:c,usage:v.STATIC_DRAW})}var f=G(e);e._vertexBuffer=g.createVertexBuffer({context:t,typedArray:f,usage:a?v.STREAM_DRAW:v.STATIC_DRAW})}function W(e){var t=G(e);e._vertexBuffer.copyFromArrayView(t)}function q(e,t){for(var i=e._instances,r=i.length,n=new Array(r),o=0;o<r;++o)n[o]=t.createPickId(i[o]);return n}function Y(e,t){var i=e._instancingSupported,r=l(e._batchTable),n=e._allowPicking,o={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:n,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLightingFactor:e.imageBasedLightingFactor,lightColor:e.lightColor,luminanceAtZenith:e.luminanceAtZenith,sphericalHarmonicCoefficients:e.sphericalHarmonicCoefficients,specularEnvironmentMaps:e.specularEnvironmentMaps};if(r||(e._pickIds=q(e,t)),i){H(e,t);var s=a.getSizeInBytes(a.FLOAT),u={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:a.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:12*s,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:a.FLOAT,normalize:!1,offsetInBytes:4*s,strideInBytes:12*s,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:a.FLOAT,normalize:!1,offsetInBytes:8*s,strideInBytes:12*s,instanceDivisor:1}};r&&(u.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:a.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r||(u.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:a.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),o.precreatedAttributes=u,o.vertexShaderLoaded=L(e),o.fragmentShaderLoaded=N(e),o.uniformMapLoaded=k(e,t),l(e._url)&&(o.cacheKey=e._url.getUrlComponent()+"#instanced")}else o.vertexShaderLoaded=z(e),o.fragmentShaderLoaded=V(e),o.uniformMapLoaded=U(e,t);l(e._url)?e._model=E.fromGltf(o):e._model=new E(o)}function j(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?p.LINES:p.TRIANGLES,i=e._drawCommands,r=i.length,n=0;n<r;++n)i[n].primitiveType=t}}function X(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e._drawCommands,i=t.length,r=0;r<i;++r)t[r].debugShowBoundingVolume=e.debugShowBoundingVolume}}function Q(e,t){for(var i=t.length,r=e.length,n=e._boundingSphere,o=e._cull,a=0;a<i;++a){var s=y.shallowClone(t[a]);s.instanceCount=r,s.boundingVolume=n,s.cull=o,l(e._batchTable)?s.pickId=e._batchTable.getPickId():s.pickId="v_pickColor",e._drawCommands.push(s)}}function K(e){return function(){return e}}function Z(e){return function(){return e}}function J(t,i){for(var r=t._instances,o=i.length,a=t.length,s=t._batchTable,u=l(s),c=t._cull,d=0;d<o;++d)for(var p=0;p<a;++p){var f=y.shallowClone(i[d]);if(f.modelMatrix=new h,f.boundingVolume=new e,f.cull=c,f.uniformMap=n(f.uniformMap),u)f.uniformMap.a_batchId=K(r[p]._instanceId);else{var m=t._pickIds[p];f.uniformMap.czm_pickColor=Z(m.color)}t._drawCommands.push(f)}}function $(t){for(var i=t._modelCommands,r=i.length,n=t.length,o=t._rtcTransform,a=t._center,s=0;s<r;++s)for(var l=i[s],u=0;u<n;++u){var c=s*n+u,d=t._drawCommands[c],p=h.clone(t._instances[u]._modelMatrix,ae);p[12]-=a.x,p[13]-=a.y,p[14]-=a.z,p=h.multiply(o,p,ae);var f=l.modelMatrix,m=d.modelMatrix;h.multiply(p,f,m);var _=l.boundingVolume,g=d.boundingVolume;e.transform(_,p,g)}}function ee(e){for(var t=e._nodeCommands,i=t.length,r=[],n=0;n<i;++n){var o=t[n];o.show&&r.push(o.command)}return r}function te(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;r++){if(t[r].command.dirty)return!0}return!1}function ie(e,t){e._drawCommands=[];var i=ee(e._model);t?Q(e,i):(J(e,i),$(e))}function re(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=P.castShadows(e.shadows),i=P.receiveShadows(e.shadows),r=e._drawCommands,n=r.length,o=0;o<n;++o){var a=r[o];a.castShadows=t,a.receiveShadows=i}}}var ne={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};u(D.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){t.clone(e,this._imageBasedLightingFactor)}}});var oe=new i,ae=new h;return D.prototype.expandBoundingSphere=function(t){var i=h.getTranslation(t,oe);e.expand(this._boundingSphere,i,this._boundingSphere)},D.prototype.update=function(e){if(e.mode!==x.MORPHING&&this.show&&0!==this.length){var t=e.context;if(this._state===ne.NEEDS_LOAD){this._state=ne.LOADING,this._instancingSupported=t.instancedArrays,Y(this,t);var r=this;this._model.readyPromise.otherwise(function(e){r._state=ne.FAILED,r._readyPromise.reject(e)})}var n=this._instancingSupported,o=this._model;if(o.imageBasedLightingFactor=this.imageBasedLightingFactor,o.lightColor=this.lightColor,o.luminanceAtZenith=this.luminanceAtZenith,o.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,o.specularEnvironmentMaps=this.specularEnvironmentMaps,o.update(e),o.ready&&this._state===ne.LOADING){this._state=ne.LOADED,this._ready=!0;var a=o.boundingSphere.radius+i.magnitude(o.boundingSphere.center);return this._boundingSphere.radius+=a,this._modelCommands=ee(o),ie(this,n),void this._readyPromise.resolve(this)}if(this._state===ne.LOADED){var s=e.mode!==this._mode,l=this.modelMatrix,u=!h.equals(this._modelMatrix,l);if(s||u){this._mode=e.mode,h.clone(l,this._modelMatrix);var c=h.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==x.SCENE3D&&(c=_.basisTo2D(e.mapProjection,c,c)),h.getTranslation(c,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,W(this)),te(o)&&ie(this,n),!n&&(o.dirty||this._dirty||s||u)&&$(this),re(this),j(this),X(this);var d=e.passes;if(d.render||d.pick)for(var p=e.commandList,f=this._drawCommands,m=f.length,g=0;g<m;++g)p.push(f[g])}}},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._model=this._model&&this._model.destroy();var e=this._pickIds;if(l(e))for(var t=e.length,i=0;i<t;++i)e[i].destroy();return c(this)},D}),define("Scene/Instanced3DModel3DTileContent",["../Core/AttributeCompression","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getBaseUri","../Core/getStringFromTypedArray","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/RequestType","../Core/RuntimeError","../Core/Transforms","../Core/TranslationRotationScale","../Renderer/Pass","./Axis","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./ModelInstanceCollection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w){"use strict";function x(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._modelInstanceCollection=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,D(this,r,n)}function P(e){return function(){return e._batchTable.getPickId()}}function D(i,a,s){var l=n(s,0);s=l;var u=new Uint8Array(a),d=new DataView(a);s+=M;var h=d.getUint32(s,!0);if(1!==h)throw new v("Only Instanced 3D Model version 1 is supported. Version "+h+" is not.");s+=M;var E=d.getUint32(s,!0);s+=M;var D=d.getUint32(s,!0);if(0===D)throw new v("featureTableJsonByteLength is zero, the feature table must be defined.");s+=M;var I=d.getUint32(s,!0);s+=M;var L=d.getUint32(s,!0);s+=M;var N=d.getUint32(s,!0);s+=M;var F=d.getUint32(s,!0);if(1!==F&&0!==F)throw new v("Only glTF format 0 (uri) or 1 (embedded) are supported. Format "+F+" is not.");s+=M;var B=p(u,s,D),k=JSON.parse(B);s+=D;var z=new Uint8Array(a,s,I);s+=I;var V=new A(k,z),U=V.getGlobalProperty("INSTANCES_LENGTH");if(V.featuresLength=U,!o(U))throw new v("Feature table global property: INSTANCES_LENGTH must be defined");var G,H;if(L>0){var W=p(u,s,L);G=JSON.parse(W),s+=L,N>0&&(H=new Uint8Array(a,s,N),H=new Uint8Array(H),s+=N)}i._batchTable=new T(i,U,G,H);var q=l+E-s;if(0===q)throw new v("glTF byte length is zero, i3dm must have a glTF to instance.");var Y;s%4==0?Y=new Uint8Array(a,s,q):(x._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),Y=new Uint8Array(u.subarray(s,s+q)));var j=i._tileset,X={instances:new Array(U),batchTable:i._batchTable,cull:!1,url:void 0,requestType:g.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:j._gltfUpAxis,forwardAxis:S.X,opaquePass:b.CESIUM_3D_TILE,pickIdLoaded:P(i),imageBasedLightingFactor:j.imageBasedLightingFactor,lightColor:j.lightColor,luminanceAtZenith:j.luminanceAtZenith,sphericalHarmonicCoefficients:j.sphericalHarmonicCoefficients,specularEnvironmentMaps:j.specularEnvironmentMaps};if(0===F){var Q=p(Y);Q=Q.replace(/[\s\0]+$/,""),X.url=i._resource.getDerivedResource({url:Q})}else X.gltf=Y,X.basePath=i._resource.clone();var K,Z=V.getGlobalProperty("EAST_NORTH_UP"),J=V.getGlobalProperty("RTC_CENTER",r.FLOAT,3);o(J)&&(K=t.unpack(J));for(var $=X.instances,ee=new t,te=new Array(3),ie=new t,re=new t,ne=new t,oe=new f,ae=new _,se=new t,le=new C,ue=new m,ce=0;ce<U;ce++){var de=V.getProperty("POSITION",r.FLOAT,3,ce,R);if(!o(de)){de=te;var he=V.getProperty("POSITION_QUANTIZED",r.UNSIGNED_SHORT,3,ce,R);if(!o(he))throw new v("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");var pe=V.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",r.FLOAT,3);if(!o(pe))throw new v("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var fe=V.getGlobalProperty("QUANTIZED_VOLUME_SCALE",r.FLOAT,3);if(!o(fe))throw new v("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var me=0;me<3;me++)de[me]=he[me]/65535*fe[me]+pe[me]}t.unpack(de,0,ee),o(K)&&t.add(ee,K,ee),le.translation=ee;var _e=V.getProperty("NORMAL_UP",r.FLOAT,3,ce,R),ge=V.getProperty("NORMAL_RIGHT",r.FLOAT,3,ce,O),ve=!1;if(o(_e)){if(!o(ge))throw new v("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");t.unpack(_e,0,re),t.unpack(ge,0,ie),ve=!0}else{var ye=V.getProperty("NORMAL_UP_OCT32P",r.UNSIGNED_SHORT,2,ce,R),Ce=V.getProperty("NORMAL_RIGHT_OCT32P",r.UNSIGNED_SHORT,2,ce,O);if(o(ye)){if(!o(Ce))throw new v("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");e.octDecodeInRange(ye[0],ye[1],65535,re),e.octDecodeInRange(Ce[0],Ce[1],65535,ie),ve=!0}else Z?(y.eastNorthUpToFixedFrame(ee,c.WGS84,ue),m.getRotation(ue,oe)):f.clone(f.IDENTITY,oe)}ve&&(t.cross(ie,re,ne),t.normalize(ne,ne),f.setColumn(oe,0,ie,oe),f.setColumn(oe,1,re,oe),f.setColumn(oe,2,ne,oe)),_.fromRotationMatrix(oe,ae),le.rotation=ae,se=t.fromElements(1,1,1,se);var be=V.getProperty("SCALE",r.FLOAT,1,ce);o(be)&&t.multiplyByScalar(se,be,se);var Se=V.getProperty("SCALE_NON_UNIFORM",r.FLOAT,3,ce,R);o(Se)&&(se.x*=Se[0],se.y*=Se[1],se.z*=Se[2]),le.scale=se;var Te=V.getProperty("BATCH_ID",r.UNSIGNED_SHORT,1,ce);o(Te)||(Te=ce),m.fromTranslationRotationScale(le,ue);var Ee=ue.clone();$[ce]={modelMatrix:Ee,batchId:Te}}i._modelInstanceCollection=new w(X)}function I(e){var t=e.featuresLength;if(!o(e._features)&&t>0){for(var i=new Array(t),r=0;r<t;++r)i[r]=new E(e,r);e._features=i}}if(!d.supportsTypedArrays())return{};x._deprecationWarning=s,a(x.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){var e=this._modelInstanceCollection._model;return o(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){var e=this._modelInstanceCollection._model;return o(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){var e=this._modelInstanceCollection._model;return o(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var M=Uint32Array.BYTES_PER_ELEMENT,R=new Array(4),O=new Array(4);return x.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},x.prototype.getFeature=function(e){this.featuresLength;return I(this),this._features[e]},x.prototype.applyDebugSettings=function(e,t){t=e?t:i.WHITE,this._batchTable.setAllColor(t)},x.prototype.applyStyle=function(e){this._batchTable.applyStyle(e)},x.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.lightColor=this._tileset.lightColor,this._modelInstanceCollection.luminanceAtZenith=this._tileset.luminanceAtZenith,this._modelInstanceCollection.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._modelInstanceCollection.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe;var r=this._modelInstanceCollection._model;if(o(r)){var n=this._tileset.clippingPlanes;r.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,o(n)&&this._tile.clippingPlanesDirty&&(r._clippingPlanes=n.enabled&&this._tile._isClipped?n:void 0),o(n)&&o(r._clippingPlanes)&&r._clippingPlanes!==n&&(r._clippingPlanes=n)}this._modelInstanceCollection.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&this._batchTable.addDerivedCommands(t,i,!1)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),l(this)},x}),define("Scene/Cesium3DTileRefine",["../Core/freezeObject"],function(e){"use strict";return e({ADD:0,REPLACE:1})}),define("Scene/PointCloud",["../Core/arraySlice","../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Math","../Core/Check","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/getStringFromTypedArray","../Core/Matrix4","../Core/oneTimeWarning","../Core/OrthographicFrustum","../Core/Plane","../Core/PrimitiveType","../Core/RuntimeError","../Core/Transforms","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BlendingState","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./DracoLoader","./getClipAndStyleCode","./getClippingFunction","./SceneMode","./ShadowMode","./StencilConstants"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V){"use strict";function U(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=a.clone(a.DARKGRAY),this._highlightColor=a.clone(a.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=$.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._readyPromise=I.defer(),this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=u(e.opaquePass,A.OPAQUE),this._cull=u(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=m.clone(m.IDENTITY),this._modelMatrix=m.clone(m.IDENTITY),this.time=0,this.shadows=z.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,G(this,e)}function G(t,r){var n=r.arrayBuffer,o=u(r.byteOffset,0),d=new Uint8Array(n),h=new DataView(n);o+=te;var p=h.getUint32(o,!0);if(1!==p)throw new C("Only Point Cloud tile version 1 is supported. Version "+p+" is not.");o+=te,o+=te;var m=h.getUint32(o,!0);if(0===m)throw new C("Feature table must have a byte length greater than zero");o+=te;var _=h.getUint32(o,!0);o+=te;var g=h.getUint32(o,!0);o+=te;var v=h.getUint32(o,!0);o+=te;var y=f(d,o,m),b=JSON.parse(y);o+=m;var S=new Uint8Array(n,o,_);o+=_;var T,E;if(g>0){var A=f(d,o,g);T=JSON.parse(A),o+=g,v>0&&(E=new Uint8Array(n,o,v),o+=v)}var w=new L(b,S),x=w.getGlobalProperty("POINTS_LENGTH");if(w.featuresLength=x,!c(x))throw new C("Feature table global property: POINTS_LENGTH must be defined");var P=w.getGlobalProperty("RTC_CENTER",l.FLOAT,3);c(P)&&(t._rtcCenter=i.unpack(P));var D,I,M,O,N,F,B,k=!1,z=!1,V=!1,U=!1,G=!1,H=!1,W=!1,q=!1,Y=c(b.extensions)?b.extensions["3DTILES_draco_point_compression"]:void 0,j=c(T)&&c(T.extensions)?T.extensions["3DTILES_draco_point_compression"]:void 0;if(c(j)&&(B=j.properties),c(Y)){F=Y.properties;var X=Y.byteOffset,Q=Y.byteLength;if(!c(F)||!c(X)||!c(Q))throw new C("Draco properties, byteOffset, and byteLength must be defined");N=e(S,X,X+Q),k=c(F.POSITION),z=c(F.RGB)||c(F.RGBA),V=c(F.NORMAL),U=c(F.BATCH_ID),H=c(F.RGBA),t._decodingState=$.NEEDS_DECODE}var K;if(c(N)&&(K={buffer:N,featureTableProperties:F,batchTableProperties:B,properties:s(F,B),dequantizeInShader:t._dequantizeInShader}),!k)if(c(b.POSITION))D=w.getPropertyArray("POSITION",l.FLOAT,3),k=!0;else if(c(b.POSITION_QUANTIZED)){D=w.getPropertyArray("POSITION_QUANTIZED",l.UNSIGNED_SHORT,3),G=!0,k=!0;var Z=w.getGlobalProperty("QUANTIZED_VOLUME_SCALE",l.FLOAT,3);if(!c(Z))throw new C("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");t._quantizedVolumeScale=i.unpack(Z),t._quantizedRange=65535;var J=w.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",l.FLOAT,3);if(!c(J))throw new C("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t._quantizedVolumeOffset=i.unpack(J)}if(z||(c(b.RGBA)?(I=w.getPropertyArray("RGBA",l.UNSIGNED_BYTE,4),H=!0,z=!0):c(b.RGB)?(I=w.getPropertyArray("RGB",l.UNSIGNED_BYTE,3),z=!0):c(b.RGB565)&&(I=w.getPropertyArray("RGB565",l.UNSIGNED_SHORT,1),W=!0,z=!0)),V||(c(b.NORMAL)?(M=w.getPropertyArray("NORMAL",l.FLOAT,3),V=!0):c(b.NORMAL_OCT16P)&&(M=w.getPropertyArray("NORMAL_OCT16P",l.UNSIGNED_BYTE,2),q=!0,V=!0)),U||c(b.BATCH_ID)&&(O=w.getPropertyArray("BATCH_ID",l.UNSIGNED_SHORT,1),U=!0),!k)throw new C("Either POSITION or POSITION_QUANTIZED must be defined.");if(c(b.CONSTANT_RGBA)){var ee=w.getGlobalProperty("CONSTANT_RGBA",l.UNSIGNED_BYTE,4);t._constantColor=a.fromBytes(ee[0],ee[1],ee[2],ee[3],t._constantColor)}if(U){var ie=w.getGlobalProperty("BATCH_LENGTH");if(!c(ie))throw new C("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");c(E)&&(E=new Uint8Array(E)),c(t._batchTableLoaded)&&t._batchTableLoaded(ie,T,E)}var re;!U&&c(E)&&(re=R.getBinaryProperties(x,T,E)),t._parsedContent={positions:D,colors:I,normals:M,batchIds:O,styleableProperties:re,draco:K},t._pointsLength=x,t._isQuantized=G,t._isOctEncoded16P=q,t._isRGB565=W,t._isTranslucent=H,t._hasColors=z,t._hasNormals=V,t._hasBatchIds=U}function H(e){if(!c(ee)){n.setRandomNumberSeed(0),ee=new Array(e);for(var t=0;t<e;++t)ee[t]=n.nextRandomNumber()}return ee}function W(e){for(var r=e.length/3,o=Math.min(r,20),a=H(20),s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=i.fromElements(s,s,s,ie),c=i.fromElements(l,l,l,re),d=0;d<o;++d){var h=Math.floor(a[d]*r),p=i.unpack(e,3*h,ne);i.minimumByComponent(u,p,u),i.maximumByComponent(c,p,c)}var f=t.fromCornerPoints(u,c);return f.radius+=n.EPSILON2,f}function q(e,t){var i=l.fromTypedArray(e);return i===l.INT||i===l.UNSIGNED_INT||i===l.DOUBLE?(_("Cast pnts property to floats",'Point cloud property "'+t+'" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.'),new Float32Array(e)):e}function Y(e,r){var n,o,a=r.context,s=e._parsedContent,u=e._pointsLength,d=s.positions,h=s.colors,p=s.normals,f=s.batchIds,_=s.styleableProperties,g=c(_),v=e._isQuantized,C=e._isQuantizedDraco,b=e._isOctEncoded16P,x=e._isOctEncodedDraco,P=e._quantizedRange,I=e._octEncodedRange,R=e._isRGB565,O=e._isTranslucent,L=e._hasColors,N=e._hasNormals,F=e._hasBatchIds,B=[],k={};if(e._styleableShaderAttributes=k,g){var z=he;for(var U in _)if(_.hasOwnProperty(U)){var G=_[U],H=q(G.typedArray,U);n=G.componentCount,o=l.fromTypedArray(H);var Y=S.createVertexBuffer({context:a,typedArray:H,usage:T.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;var j={index:z,vertexBuffer:Y,componentsPerAttribute:n,componentDatatype:o,normalize:!1,offsetInBytes:0,strideInBytes:0};B.push(j),k[U]={location:z,componentCount:n},++z}}var X=S.createVertexBuffer({context:a,typedArray:d,usage:T.STATIC_DRAW});e._geometryByteLength+=X.sizeInBytes;var Q;L&&(Q=S.createVertexBuffer({context:a,typedArray:h,usage:T.STATIC_DRAW}),e._geometryByteLength+=Q.sizeInBytes);var K;N&&(K=S.createVertexBuffer({context:a,typedArray:p,usage:T.STATIC_DRAW}),e._geometryByteLength+=K.sizeInBytes);var Z;F&&(f=q(f,"batchIds"),Z=S.createVertexBuffer({context:a,typedArray:f,usage:T.STATIC_DRAW}),e._geometryByteLength+=Z.sizeInBytes);var J=[];if(o=v?l.UNSIGNED_SHORT:C?P<=255?l.UNSIGNED_BYTE:l.UNSIGNED_SHORT:l.FLOAT,J.push({index:le,vertexBuffer:X,componentsPerAttribute:3,componentDatatype:o,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(e._boundingSphere=v||C?t.fromCornerPoints(i.ZERO,e._quantizedVolumeScale):W(d)),L)if(R)J.push({index:ue,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:l.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{var $=O?4:3;J.push({index:ue,vertexBuffer:Q,componentsPerAttribute:$,componentDatatype:l.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}N&&(b?(n=2,o=l.UNSIGNED_BYTE):x?(n=2,o=I<=255?l.UNSIGNED_BYTE:l.UNSIGNED_SHORT):(n=3,o=l.FLOAT),J.push({index:ce,vertexBuffer:K,componentsPerAttribute:n,componentDatatype:o,normalize:!1,offsetInBytes:0,strideInBytes:0})),F&&J.push({index:de,vertexBuffer:Z,componentsPerAttribute:1,componentDatatype:l.fromTypedArray(f),normalize:!1,offsetInBytes:0,strideInBytes:0}),g&&(J=J.concat(B));var ee=new D({context:a,attributes:J}),te={depthTest:{enabled:!0}};e._opaquePass===A.CESIUM_3D_TILE&&(te.stencilTest=V.setCesium3DTileBit(),te.stencilMask=V.CESIUM_3D_TILE_MASK),e._opaqueRenderState=w.fromCache(te),e._translucentRenderState=w.fromCache({depthTest:{enabled:!0},depthMask:!1,blending:M.ALPHA_BLEND}),e._drawCommand=new E({boundingVolume:new t,cull:e._cull,modelMatrix:new m,primitiveType:y.POINTS,vertexArray:ee,count:u,shaderProgram:void 0,uniformMap:void 0,renderState:O?e._translucentRenderState:e._opaqueRenderState,pass:O?A.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function j(e,t){var r=t.context,n=e._isQuantized,o=e._isQuantizedDraco,l=e._isOctEncodedDraco,d={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){var i=oe;if(i.x=e._attenuation?e.maximumAttenuation:e._pointSize,i.y=e.time,e._attenuation){var n,o=t.camera.frustum;n=t.mode===k.SCENE2D||o instanceof g?Number.POSITIVE_INFINITY:r.drawingBufferHeight/t.camera.frustum.sseDenominator,i.z=e.geometricError*e.geometricErrorScale,i.w=n}return i},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){var t=e.clippingPlanes;return e.isClipped?t.texture:r.defaultTexture},u_clippingPlanesEdgeStyle:function(){var t=e.clippingPlanes;if(!c(t))return a.TRANSPARENT;var i=a.clone(t.edgeColor,se);return i.alpha=t.edgeWidth,i},u_clippingPlanesMatrix:function(){var t=e.clippingPlanes;if(!c(t))return m.IDENTITY;var i=u(e.clippingPlanesOriginMatrix,e._modelMatrix);return m.multiply(r.uniformState.view3D,i,pe),m.multiply(pe,t.modelMatrix,pe)}};(n||o||l)&&(d=s(d,{u_quantizedVolumeScaleAndOctEncodedRange:function(){var t=ae;if(c(e._quantizedVolumeScale)){var r=i.clone(e._quantizedVolumeScale,t);i.divideByScalar(r,e._quantizedRange,t)}return t.w=e._octEncodedRange,t}})),c(e._uniformMapLoaded)&&(d=e._uniformMapLoaded(d)),e._drawCommand.uniformMap=d}function X(e,t){for(var i=/czm_tiles3d_style_(\w+)/g,r=i.exec(e);null!==r;){var n=r[1];-1===t.indexOf(n)&&t.push(n),r=i.exec(e)}}function Q(e,t){for(var i=e.numberOfAttributes,r=0;r<i;++r){var n=e.getAttribute(r);if(n.index===t)return n}}function K(e){for(var t=fe.length,i=0;i<t;++i){var r=fe[i],n="czm_tiles3d_style_"+r,o=r.toLowerCase();e=e.replace(new RegExp(n+"(\\W)","g"),o+"$1")}return e.replace("()","(vec3 position, vec3 position_absolute, vec4 color, vec3 normal)")}function Z(e,t,i){var r,n,o,a,s,l,u=t.context,d=c(i),h=e._isQuantized,p=e._isQuantizedDraco,f=e._isOctEncoded16P,m=e._isOctEncodedDraco,_=e._isRGB565,g=e._isTranslucent,v=e._hasColors,y=e._hasNormals,b=e._hasBatchIds,S=e._backFaceCulling,T=e._normalShading,E=e._drawCommand.vertexArray,A=e.clippingPlanes,w=e._attenuation,P=g;if(d){var D={translucent:!1};a=i.getColorShaderFunction("getColorFromStyle","czm_tiles3d_style_",D),s=i.getShowShaderFunction("getShowFromStyle","czm_tiles3d_style_",D),l=i.getPointSizeShaderFunction("getPointSizeFromStyle","czm_tiles3d_style_",D),c(a)&&D.translucent&&(P=!0)}e._styleTranslucent=P;var I=c(a),M=c(s),R=c(l),O=e.isClipped,L=[];I&&(X(a,L),a=K(a)),M&&(X(s,L),s=K(s)),R&&(X(l,L),l=K(l));var N=L.indexOf("COLOR")>=0,k=L.indexOf("NORMAL")>=0,z=L.filter(function(e){return-1===fe.indexOf(e)});if(k&&!y)throw new C("Style references the NORMAL semantic but the point cloud does not have normals");var V=e._styleableShaderAttributes;for(n in V)if(V.hasOwnProperty(n)){o=V[n];var U=z.indexOf(n)>=0,G=Q(E,o.location);G.enabled=U}var H=v&&(!I||N);if(v){Q(E,ue).enabled=H}var W=y&&(T||S||k);if(y){Q(E,ce).enabled=W}var q={a_position:le};H&&(q.a_color=ue),W&&(q.a_normal=ce),b&&(q.a_batchId=de);var Y="",Z=z.length;for(r=0;r<Z;++r){if(n=z[r],o=V[n],!c(o))throw new C('Style references a property "'+n+'" that does not exist or is not styleable.');var J,$=o.componentCount,ee="czm_tiles3d_style_"+n;J=1===$?"float":"vec"+$,Y+="attribute "+J+" "+ee+"; \n",q[ee]=o.location}j(e,t);var te="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";te+="float u_pointSize; \nfloat u_time; \n",w&&(te+="float u_geometricError; \nfloat u_depthMultiplier; \n"),te+=Y,H&&(te+=g?"attribute vec4 a_color; \n":_?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),W&&(te+=f||m?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),b&&(te+="attribute float a_batchId; \n"),(h||p||m)&&(te+="uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \n"),I&&(te+=a),M&&(te+=s),R&&(te+=l),te+="void main() \n{ \n u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \n u_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \n",w&&(te+=" u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \n u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \n"),te+=H?g?" vec4 color = a_color; \n":_?" float compressed = a_color; \n float r = floor(compressed * SHIFT_RIGHT_11); \n compressed -= r * SHIFT_LEFT_11; \n float g = floor(compressed * SHIFT_RIGHT_5); \n compressed -= g * SHIFT_LEFT_5; \n float b = compressed; \n vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n vec4 color = vec4(rgb, 1.0); \n":" vec4 color = vec4(a_color, 1.0); \n":" vec4 color = u_constantColor; \n",te+=h||p?" vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \n":" vec3 position = a_position; \n",te+=" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",W?(te+=f?" vec3 normal = czm_octDecode(a_normal); \n":m?" vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \n":" vec3 normal = a_normal; \n",te+=" vec3 normalEC = czm_normal * normal; \n"):te+=" vec3 normal = vec3(1.0); \n",I&&(te+=" color = getColorFromStyle(position, position_absolute, color, normal); \n"),M&&(te+=" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),te+=R?" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal); \n":w?" vec4 positionEC = czm_modelView * vec4(position, 1.0); \n float depth = -positionEC.z; \n gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":" gl_PointSize = u_pointSize; \n",te+=" color = color * u_highlightColor; \n",W&&T&&(te+=" float diffuseStrength = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC); \n diffuseStrength = max(diffuseStrength, 0.4); \n color.xyz *= diffuseStrength; \n"),te+=" v_color = color; \n gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",W&&S&&(te+=" float visible = step(-normalEC.z, 0.0); \n gl_Position *= visible; \n gl_PointSize *= visible; \n"),M&&(te+=" gl_Position *= show; \n gl_PointSize *= show; \n"),te+="} \n";var ie="varying vec4 v_color; \n";O&&(ie+="uniform sampler2D u_clippingPlanes; \nuniform mat4 u_clippingPlanesMatrix; \nuniform vec4 u_clippingPlanesEdgeStyle; \n",ie+="\n",ie+=B(A,u),ie+="\n"),
- ie+="void main() \n{ \n gl_FragColor = czm_gammaCorrect(v_color); \n",O&&(ie+=F("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ie+="} \n",c(e._vertexShaderLoaded)&&(te=e._vertexShaderLoaded(te)),c(e._fragmentShaderLoaded)&&(ie=e._fragmentShaderLoaded(ie));var re=e._drawCommand;c(re.shaderProgram)&&re.shaderProgram.destroy(),re.shaderProgram=x.fromCache({context:u,vertexShaderSource:te,fragmentShaderSource:ie,attributeLocations:q});try{re.shaderProgram._bind()}catch(e){throw new C("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function J(e,t){if(e._decodingState===$.READY)return!1;if(e._decodingState===$.NEEDS_DECODE){var r=e._parsedContent,n=r.draco,o=N.decodePointCloud(n,t);c(o)&&(e._decodingState=$.DECODING,o.then(function(t){e._decodingState=$.READY;var o=c(t.POSITION)?t.POSITION.array:void 0,a=c(t.RGB)?t.RGB.array:void 0,s=c(t.RGBA)?t.RGBA.array:void 0,l=c(t.NORMAL)?t.NORMAL.array:void 0,d=c(t.BATCH_ID)?t.BATCH_ID.array:void 0,h=c(o)&&c(t.POSITION.data.quantization),p=c(l)&&c(t.NORMAL.data.quantization);if(h){var f=t.POSITION.data.quantization,m=f.range;e._quantizedVolumeScale=i.fromElements(m,m,m),e._quantizedVolumeOffset=i.unpack(f.minValues),e._quantizedRange=(1<<f.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<t.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);var _=r.styleableProperties,g=n.batchTableProperties;for(var v in g)if(g.hasOwnProperty(v)){var y=t[v];c(_)||(_={}),_[v]={typedArray:y.array,componentCount:y.data.componentsPerAttribute}}r.positions=u(o,r.positions),r.colors=u(u(s,a),r.colors),r.normals=u(l,r.normals),r.batchIds=u(d,r.batchIds),r.styleableProperties=_}).otherwise(function(t){e._decodingState=$.FAILED,e._readyPromise.reject(t)}))}return!0}if(!p.supportsTypedArrays())return{};var $={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};d(U.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},color:{get:function(){return a.clone(this._highlightColor)},set:function(e){this._highlightColor=a.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=t.clone(e)}}});var ee,te=Uint32Array.BYTES_PER_ELEMENT,ie=new i,re=new i,ne=new i,oe=new r,ae=new r,se=new a,le=0,ue=1,ce=2,de=3,he=4,pe=new m,fe=["POSITION","COLOR","NORMAL","POSITION_ABSOLUTE"],me=new r,_e=new i;return U.prototype.update=function(e){if(!J(this,e.context)){var n=!1,o=!m.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(Y(this,e),o=!0,n=!0,this._ready=!0,this._readyPromise.resolve(this),this._parsedContent=void 0),o){m.clone(this.modelMatrix,this._modelMatrix);var a=this._drawCommand.modelMatrix;if(m.clone(this._modelMatrix,a),c(this._rtcCenter)&&m.multiplyByTranslation(a,this._rtcCenter,a),c(this._quantizedVolumeOffset)&&m.multiplyByTranslation(a,this._quantizedVolumeOffset,a),e.mode!==k.SCENE3D){var s=e.mapProjection,l=m.getColumn(a,3,me);r.equals(l,r.UNIT_W)||b.basisTo2D(s,a,a)}var u=this._drawCommand.boundingVolume;if(t.clone(this._boundingSphere,u),this._cull){var d=u.center;m.multiplyByPoint(a,d,d);var h=m.getScale(a,_e);u.radius*=i.maximumComponent(h)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,n=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,n=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,n=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,n=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,n=!0),n&&Z(this,e,this._style),this._drawCommand.castShadows=z.castShadows(this.shadows),this._drawCommand.receiveShadows=z.receiveShadows(this.shadows);var p=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=p?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=p?A.TRANSLUCENT:this._opaquePass;var f=e.commandList,_=e.passes;(_.render||_.pick)&&f.push(this._drawCommand)}},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){var e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),h(this)},U}),define("Shaders/PostProcessStages/PointCloudEyeDomeLighting",[],function(){"use strict";return"#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec3 u_distancesAndEdlStrength;\nvarying vec2 v_textureCoordinates;\nvec2 neighborContribution(float log2Depth, vec2 padding)\n{\nfloat depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates + padding));\nif (depthOrLogDepth == 0.0) {\nreturn vec2(0.0);\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(v_textureCoordinates + padding, depthOrLogDepth);\nreturn vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\nvoid main()\n{\nfloat depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat log2Depth = log2(-eyeCoordinate.z);\nif (depthOrLogDepth == 0.0)\n{\ndiscard;\n}\nvec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\nfloat distX = u_distancesAndEdlStrength.x;\nfloat distY = u_distancesAndEdlStrength.y;\nvec2 responseAndCount = vec2(0.0);\nresponseAndCount += neighborContribution(log2Depth, vec2(0, distY));\nresponseAndCount += neighborContribution(log2Depth, vec2(distX, 0));\nresponseAndCount += neighborContribution(log2Depth, vec2(0, -distY));\nresponseAndCount += neighborContribution(log2Depth, vec2(-distX, 0));\nfloat response = responseAndCount.x / responseAndCount.y;\nfloat shade = exp(-response * 300.0 * u_distancesAndEdlStrength.z);\ncolor.rgb *= shade;\ngl_FragColor = vec4(color);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + (czm_projection * vec4(eyeCoordinate.xyz, 1.0)).w);\n#else\ngl_FragDepthEXT = czm_eyeToWindowCoordinates(vec4(eyeCoordinate.xyz, 1.0)).z;\n#endif\n}\n"}),define("Scene/PointCloudEyeDomeLighting",["../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/FeatureDetection","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Scene/BlendingState","../Scene/StencilConstants","../Shaders/PostProcessStages/PointCloudEyeDomeLighting"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b){"use strict";function S(){this._framebuffer=void 0,this._colorGBuffer=void 0,this._depthGBuffer=void 0,this._depthTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}function T(){return new p({wrapS:v.CLAMP_TO_EDGE,wrapT:v.CLAMP_TO_EDGE,minificationFilter:g.NEAREST,magnificationFilter:_.NEAREST})}function E(e){var t=e._framebuffer;i(t)&&(e._colorGBuffer.destroy(),e._depthGBuffer.destroy(),e._depthTexture.destroy(),t.destroy(),e._framebuffer=void 0,e._colorGBuffer=void 0,e._depthGBuffer=void 0,e._depthTexture=void 0,e._drawCommand=void 0,e._clearCommand=void 0)}function A(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=new m({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:d.UNSIGNED_BYTE,sampler:T()}),a=new m({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:d.UNSIGNED_BYTE,sampler:T()}),s=new m({context:t,width:i,height:r,pixelFormat:o.DEPTH_COMPONENT,pixelDatatype:d.UNSIGNED_INT,sampler:T()});e._framebuffer=new u({context:t,colorTextures:[n,a],depthTexture:s,destroyAttachments:!1}),e._colorGBuffer=n,e._depthGBuffer=a,e._depthTexture=s}function w(e,i){var r=b,n={u_pointCloud_colorGBuffer:function(){return e._colorGBuffer},u_pointCloud_depthGBuffer:function(){return e._depthGBuffer},u_distancesAndEdlStrength:function(){return I.x=e._radius/i.drawingBufferWidth,I.y=e._radius/i.drawingBufferHeight,I.z=e._strength,I}},o=h.fromCache({blending:y.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:C.setCesium3DTileBit(),stencilMask:C.CESIUM_3D_TILE_MASK});e._drawCommand=i.createViewportQuadCommand(r,{uniformMap:n,renderState:o,pass:c.CESIUM_3D_TILE,owner:e}),e._clearCommand=new s({framebuffer:e._framebuffer,color:new t(0,0,0,0),depth:1,renderState:h.fromCache(),pass:c.CESIUM_3D_TILE,owner:e})}function x(e,t){var r=t.drawingBufferWidth,n=t.drawingBufferHeight,o=e._colorGBuffer,a=!1,s=i(o)&&(o.width!==r||o.height!==n);return i(o)&&!s||(E(e),A(e,t),w(e,t),a=!0),a}function P(e){return e.drawBuffers&&e.fragmentDepth}function D(e,t){var r=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!i(r)){var n=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=f.replaceMain(e,"czm_point_cloud_post_process_main"),e=e.replace(/gl_FragColor/g,"gl_FragData[0]")}),o.sources.unshift("#extension GL_EXT_draw_buffers : enable \n"),o.sources.push("void main() \n{ \n czm_point_cloud_post_process_main(); \n gl_FragData[1] = czm_packDepth(gl_FragCoord.z); \n}"),r=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:n})}return r}var I=new e;return S.isSupported=P,S.prototype.update=function(e,t,r){if(P(e.context)){this._strength=r.eyeDomeLightingStrength,this._radius=r.eyeDomeLightingRadius;var n,o=x(this,e.context),s=e.commandList,u=s.length;for(n=t;n<u;++n){var d=s[n];if(d.primitiveType===a.POINTS&&d.pass!==c.TRANSLUCENT){var h=d.derivedCommands.pointCloudProcessor;(!i(h)||d.dirty||o||h.framebuffer!==this._framebuffer)&&(h=l.shallowClone(d),d.derivedCommands.pointCloudProcessor=h,h.framebuffer=this._framebuffer,h.shaderProgram=D(e.context,d.shaderProgram),h.castShadows=!1,h.receiveShadows=!1),s[n]=h}}var p=this._clearCommand,f=this._drawCommand;s.push(f),s.push(p)}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return E(this),r(this)},S}),define("Scene/PointCloudShading",["../Core/defaultValue","./PointCloudEyeDomeLighting"],function(e,t){"use strict";function i(t){var i=e(t,{});this.attenuation=e(i.attenuation,!1),this.geometricErrorScale=e(i.geometricErrorScale,1),this.maximumAttenuation=i.maximumAttenuation,this.baseResolution=i.baseResolution,this.eyeDomeLighting=e(i.eyeDomeLighting,!0),this.eyeDomeLightingStrength=e(i.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=e(i.eyeDomeLightingRadius,1),this.backFaceCulling=e(i.backFaceCulling,!1),this.normalShading=e(i.normalShading,!0)}return i.isSupported=function(e){return t.isSupported(e.context)},i}),define("Scene/PointCloud3DTileContent",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Renderer/Pass","../Renderer/ShaderSource","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileRefine","./PointCloud","./PointCloudShading","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._pickId=void 0,this._batchTable=void 0,this._styleDirty=!1,this._features=void 0,this.featurePropertiesDirty=!1,this._pointCloud=new f({arrayBuffer:r,byteOffset:n,cull:!1,opaquePass:u.CESIUM_3D_TILE,vertexShaderLoaded:v(this),fragmentShaderLoaded:y(this),uniformMapLoaded:C(this),batchTableLoaded:b(this),pickIdLoaded:S(this)})}function v(e){return function(t){return r(e._batchTable)?e._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(t):t}}function y(e){return function(t){return r(e._batchTable)?e._batchTable.getFragmentShaderCallback(!1,void 0)(t):"uniform vec4 czm_pickColor;\n"+t}}function C(e){return function(i){return r(e._batchTable)?e._batchTable.getUniformMapCallback()(i):t(i,{czm_pickColor:function(){return e._pickId.color}})}}function b(e){return function(t,i,r){e._batchTable=new d(e,t,i,r)}}function S(e){return function(){return r(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}function T(e){var t=e._tileset.pointCloudShading,i=e._tile.contentBoundingVolume.boundingSphere.volume(),n=l.cbrt(i/e.pointsLength),o=e._tile.geometricError;return 0===o&&(o=r(t)&&r(t.baseResolution)?t.baseResolution:n),o}function E(e){var t=e.featuresLength;if(!r(e._features)&&t>0){for(var i=new Array(t),n=0;n<t;++n)i[n]=new h(e,n);e._features=i}}n(g.prototype,{featuresLength:{get:function(){return r(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return r(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}}),g.prototype.hasProperty=function(e,t){return!!r(this._batchTable)&&this._batchTable.hasProperty(e,t)},g.prototype.getFeature=function(e){if(r(this._batchTable)){this.featuresLength;return E(this),this._features[e]}},g.prototype.applyDebugSettings=function(t,i){this._pointCloud.color=t?i:e.WHITE},g.prototype.applyStyle=function(e){r(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};var A=new m;return g.prototype.update=function(e,t){var n=this._pointCloud,o=i(e.pointCloudShading,A),a=this._tile,s=this._batchTable,l=t.mode,u=e.clippingPlanes;r(this._pickId)||r(s)||(this._pickId=t.context.createPickId({primitive:e,content:this})),r(s)&&s.update(e,t);var c;c=r(a._contentBoundingVolume)?l===_.SCENE3D?a._contentBoundingVolume.boundingSphere:a._contentBoundingVolume2D.boundingSphere:l===_.SCENE3D?a._boundingVolume.boundingSphere:a._boundingVolume2D.boundingSphere;var d=this._styleDirty;this._styleDirty=!1,n.clippingPlanesOriginMatrix=e.clippingPlanesOriginMatrix,n.style=r(s)?void 0:e.style,n.styleDirty=d,n.modelMatrix=a.computedTransform,n.time=e.timeSinceLoad,n.shadows=e.shadows,n.boundingSphere=c,n.clippingPlanes=u,n.isClipped=r(u)&&u.enabled&&a._isClipped,n.clippingPlanesDirty=a.clippingPlanesDirty,n.attenuation=o.attenuation,n.backFaceCulling=o.backFaceCulling,n.normalShading=o.normalShading,n.geometricError=T(this),n.geometricErrorScale=o.geometricErrorScale,r(o)&&r(o.maximumAttenuation)?n.maximumAttenuation=o.maximumAttenuation:a.refine===p.ADD?n.maximumAttenuation=5:n.maximumAttenuation=e.maximumScreenSpaceError,n.update(t)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._pickId=this._pickId&&this._pickId.destroy(),this._pointCloud=this._pointCloud&&this._pointCloud.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),o(this)},g}),define("Scene/Tileset3DTileContent",["../Core/defaultValue","../Core/defineProperties","../Core/destroyObject","../Core/getStringFromTypedArray","../Core/RuntimeError","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._readyPromise=o.defer(),this.featurePropertiesDirty=!1,s(this,r,n)}function s(t,i,o){o=e(o,0);var a,s=new Uint8Array(i),l=r(s,o);try{a=JSON.parse(l)}catch(e){return void t._readyPromise.reject(new n("Invalid tile content."))}t._tileset.loadTileset(t._resource,a,t._tile),t._readyPromise.resolve(t)}return t(a.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}}),a.prototype.hasProperty=function(e,t){return!1},a.prototype.getFeature=function(e){},a.prototype.applyDebugSettings=function(e,t){},a.prototype.applyStyle=function(e){},a.prototype.update=function(e,t){},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return i(this)},a}),define("Scene/Cesium3DTilePointFeature",["../Core/Cartographic","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","./createBillboardPointCallback"],function(e,t,i,r,n,o){"use strict";function a(e,t,i,r,n){this._content=e,this._billboard=i,this._label=r,this._polyline=n,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),s(this)}function s(e){var n=e._billboard;if(r(e._billboardImage)&&e._billboardImage!==n.image)return void(n.image=e._billboardImage);if(!r(e._billboardImage)){var s=i(e._color,a.defaultColor),l=i(e._pointOutlineColor,a.defaultPointOutlineColor),u=i(e._pointOutlineWidth,a.defaultPointOutlineWidth),c=i(e._pointSize,a.defaultPointSize),d=e._billboardColor,h=e._billboardOutlineColor,p=e._billboardOutlineWidth,f=e._billboardSize;if(!t.equals(s,d)||!t.equals(l,h)||u!==p||c!==f){e._billboardColor=t.clone(s,e._billboardColor),e._billboardOutlineColor=t.clone(l,e._billboardOutlineColor),e._billboardOutlineWidth=u,e._billboardSize=c;var m=s.alpha,_=s.toCssColorString(),g=l.toCssColorString(),v=JSON.stringify([_,c,g,u]);n.setImage(v,o(m,_,g,u,c))}}}var l=new e;return n(a.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=t.clone(e,this._color),s(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,s(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=t.clone(e,this._pointOutlineColor),s(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,s(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){r(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){var t=i(this._heightOffset,0),r=this._content.tileset.ellipsoid,n=r.cartesianToCartographic(this._billboard.position,l);n.height=n.height-t+e;var o=r.cartographicToCartesian(n);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=t.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){var t=this._billboardImage!==e;this._billboardImage=e,t&&s(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){var e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}}),a.defaultColor=t.WHITE,a.defaultPointOutlineColor=t.BLACK,a.defaultPointOutlineWidth=0,a.defaultPointSize=8,a.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},a.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},a.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},a.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},a.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},a.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},a.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},a}),define("Scene/Vector3DTilePoints",["../Core/arraySlice","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DistanceDisplayCondition","../Core/Ellipsoid","../Core/NearFarScalar","../Core/Rectangle","../Core/TaskProcessor","../ThirdParty/when","./BillboardCollection","./Cesium3DTilePointFeature","./HorizontalOrigin","./LabelCollection","./LabelStyle","./PolylineCollection","./VerticalOrigin"],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._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=void 0,this._labelCollection=void 0,this._polylineCollection=void 0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=h.defer(),this._resolvedPromise=!1}function b(e,t){var i=e._rectangle,r=e._minHeight,n=e._maxHeight,o=2+c.packedLength+l.packedLength,a=new Float64Array(o),s=0;return a[s++]=r,a[s++]=n,c.pack(i,a,s),s+=c.packedLength,l.pack(t,a,s),a}function S(t,r){if(!n(t._billboardCollection)){var o;if(!n(t._verticesPromise)){o=t._positions;var a=t._packedBuffer;n(a)||(o=t._positions=e(o),t._batchIds=e(t._batchIds),a=t._packedBuffer=b(t,r));var s=[o.buffer,a.buffer],l={positions:o.buffer,packedBuffer:a.buffer},u=t._verticesPromise=E.scheduleTask(l,s);if(!n(u))return;u.then(function(e){t._positions=new Float64Array(e.positions),t._ready=!0})}if(t._ready&&!n(t._billboardCollection)){o=t._positions;var c=t._batchTable,d=t._batchIds,h=t._billboardCollection=new p({batchTable:c}),f=t._labelCollection=new _({batchTable:c}),m=t._polylineCollection=new v;m._useHighlightColor=!0;for(var g=o.length/3,y=0;y<g;++y){var C=d[y],S=i.unpack(o,3*y,A),T=h.add();T.position=S,T._batchIndex=C;var w=f.add();w.text=" ",w.position=S,w._batchIndex=C;m.add().positions=[i.clone(S),i.clone(S)]}t._positions=void 0,t._packedBuffer=void 0}}}function T(e,i){for(var n=e._batchIds,o=n.length,a=0;a<o;++a){var s=n[a],l=i[s];l.show=!0,l.pointSize=f.defaultPointSize,l.color=f.defaultColor,l.pointOutlineColor=f.defaultPointOutlineColor,l.pointOutlineWidth=f.defaultPointOutlineWidth,l.labelColor=r.WHITE,l.labelOutlineColor=r.WHITE,l.labelOutlineWidth=1,l.font="30px sans-serif",l.labelStyle=g.FILL,l.labelText=void 0,l.backgroundColor=new r(.165,.165,.165,.8),l.backgroundPadding=new t(7,5),l.backgroundEnabled=!1,l.scaleByDistance=void 0,l.translucencyByDistance=void 0,l.distanceDisplayCondition=void 0,l.heightOffset=0,l.anchorLineEnabled=!1,l.anchorLineColor=r.WHITE,l.image=void 0,l.disableDepthTestDistance=0,l.horizontalOrigin=m.CENTER,l.verticalOrigin=y.CENTER,l.labelHorizontalOrigin=m.RIGHT,l.labelVerticalOrigin=y.BASELINE}}o(C.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}},readyPromise:{get:function(){return this._readyPromise.promise}}});var E=new d("createVectorTilePoints"),A=new i;C.prototype.createFeatures=function(e,t){for(var i=this._billboardCollection,r=this._labelCollection,n=this._polylineCollection,o=this._batchIds,a=o.length,s=0;s<a;++s){var l=o[s],u=i.get(s),c=r.get(s),d=n.get(s);t[l]=new f(e,l,u,c,d)}},C.prototype.applyDebugSettings=function(e,t){e?(r.clone(t,this._billboardCollection._highlightColor),r.clone(t,this._labelCollection._highlightColor),r.clone(t,this._polylineCollection._highlightColor)):(r.clone(r.WHITE,this._billboardCollection._highlightColor),r.clone(r.WHITE,this._labelCollection._highlightColor),r.clone(r.WHITE,this._polylineCollection._highlightColor))};var w=new r,x=new r,P=new r,D=new r,I=new r,M=new r,R=new u,O=new u,L=new s;return C.prototype.applyStyle=function(e,t){if(!n(e))return void T(this,t);for(var i=this._batchIds,r=i.length,o=0;o<r;++o){var a=i[o],s=t[a];if(n(e.show)&&(s.show=e.show.evaluate(s)),n(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),n(e.color)&&(s.color=e.color.evaluateColor(s,w)),n(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,x)),n(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),n(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,P)),n(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,D)),n(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),n(e.font)&&(s.font=e.font.evaluate(s)),n(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),n(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,n(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,I)),n(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),n(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),n(e.scaleByDistance)){var l=e.scaleByDistance.evaluate(s);R.near=l.x,R.nearValue=l.y,R.far=l.z,R.farValue=l.w,s.scaleByDistance=R}else s.scaleByDistance=void 0;if(n(e.translucencyByDistance)){var u=e.translucencyByDistance.evaluate(s);O.near=u.x,O.nearValue=u.y,O.far=u.z,O.farValue=u.w,s.translucencyByDistance=O}else s.translucencyByDistance=void 0;if(n(e.distanceDisplayCondition)){var c=e.distanceDisplayCondition.evaluate(s);L.near=c.x,L.far=c.y,s.distanceDisplayCondition=L}else s.distanceDisplayCondition=void 0;n(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),n(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),n(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,M)),n(e.image)?s.image=e.image.evaluate(s):s.image=void 0,n(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),n(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),n(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),n(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),n(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}},C.prototype.update=function(e){S(this,e.mapProjection.ellipsoid),this._ready&&(this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e),this._resolvedPromise||(this._readyPromise.resolve(),this._resolvedPromise=!0))},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),a(this)},C}),define("Scene/Vector3DTilePolygons",["../Core/arraySlice","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/Rectangle","../Core/TaskProcessor","../ThirdParty/when","./ClassificationType","./Vector3DTileBatch","./Vector3DTilePrimitive"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=r(e.ellipsoid,s.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=r(e.center,t.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._readyPromise=h.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=p.BOTH}function g(e){var i=new Float64Array(3+t.packedLength+s.packedLength+c.packedLength),r=0;return i[r++]=e._indices.BYTES_PER_ELEMENT,i[r++]=e._minimumHeight,i[r++]=e._maximumHeight,t.pack(e._center,i,r),r+=t.packedLength,s.pack(e._ellipsoid,i,r),r+=s.packedLength,c.pack(e._rectangle,i,r),i}function v(e,t){for(var r=1,n=t[r++],o=e._boundingVolumes=new Array(n),a=0;a<n;++a)o[a]=u.unpack(t,r),r+=u.packedLength;for(var s=t[r++],l=e._batchedIndices=new Array(s),c=0;c<s;++c){var d=i.unpack(t,r);r+=i.packedLength
- ;for(var h=t[r++],p=t[r++],m=t[r++],_=new Array(m),g=0;g<m;++g)_[g]=t[r++];l[c]=new f({color:d,offset:h,count:p,batchIds:_})}}function y(t){if(!n(t._primitive)){if(!n(t._verticesPromise)){var i=t._positions,r=t._counts,o=t._indexCounts,a=t._indices,s=t._transferrableBatchIds,u=t._batchTableColors,d=t._packedBuffer;if(!n(u)){i=t._positions=e(t._positions),r=t._counts=e(t._counts),o=t._indexCounts=e(t._indexCounts),a=t._indices=e(t._indices),t._center=t._ellipsoid.cartographicToCartesian(c.center(t._rectangle)),s=t._transferrableBatchIds=new Uint32Array(t._batchIds),u=t._batchTableColors=new Uint32Array(s.length);for(var p=t._batchTable,f=u.length,_=0;_<f;++_){var y=p.getColor(_,b);u[_]=y.toRgba()}d=t._packedBuffer=g(t)}var S=[i.buffer,r.buffer,o.buffer,a.buffer,s.buffer,u.buffer,d.buffer],T={packedBuffer:d.buffer,positions:i.buffer,counts:r.buffer,indexCounts:o.buffer,indices:a.buffer,batchIds:s.buffer,batchTableColors:u.buffer},E=t._polygonMinimumHeights,A=t._polygonMaximumHeights;n(E)&&n(A)&&(E=e(E),A=e(A),S.push(E.buffer,A.buffer),T.minimumHeights=E,T.maximumHeights=A);var w=t._verticesPromise=C.scheduleTask(T,S);if(!n(w))return;h(w,function(e){t._positions=void 0,t._counts=void 0,t._polygonMinimumHeights=void 0,t._polygonMaximumHeights=void 0;var i=new Float64Array(e.packedBuffer),r=i[0];v(t,i),t._indices=2===l.getSizeInBytes(r)?new Uint16Array(e.indices):new Uint32Array(e.indices),t._indexOffsets=new Uint32Array(e.indexOffsets),t._indexCounts=new Uint32Array(e.indexCounts),t._batchedPositions=new Float32Array(e.positions),t._vertexBatchIds=new Uint16Array(e.batchIds),t._ready=!0})}t._ready&&!n(t._primitive)&&(t._primitive=new m({batchTable:t._batchTable,positions:t._batchedPositions,batchIds:t._batchIds,vertexBatchIds:t._vertexBatchIds,indices:t._indices,indexOffsets:t._indexOffsets,indexCounts:t._indexCounts,batchedIndices:t._batchedIndices,boundingVolume:t._boundingVolume,boundingVolumes:t._boundingVolumes,center:t._center}),t._batchTable=void 0,t._batchIds=void 0,t._positions=void 0,t._counts=void 0,t._indices=void 0,t._indexCounts=void 0,t._indexOffsets=void 0,t._batchTableColors=void 0,t._packedBuffer=void 0,t._batchedPositions=void 0,t._transferrableBatchIds=void 0,t._vertexBatchIds=void 0,t._ellipsoid=void 0,t._minimumHeight=void 0,t._maximumHeight=void 0,t._polygonMinimumHeights=void 0,t._polygonMaximumHeights=void 0,t._center=void 0,t._rectangle=void 0,t._boundingVolume=void 0,t._boundingVolumes=void 0,t._batchedIndices=void 0,t._verticesPromise=void 0,t._readyPromise.resolve())}}o(_.prototype,{trianglesLength:{get:function(){return n(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return n(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}});var C=new d("createVectorTilePolygons"),b=new i;return _.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},_.prototype.update=function(e){y(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),a(this)},_}),define("Shaders/Vector3DTilePolylinesVS",[],function(){"use strict";return"attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelView;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = u_modifiedModelView * currentPosition;\nvec4 prev = u_modifiedModelView * previousPosition;\nvec4 next = u_modifiedModelView * nextPosition;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(czm_projection * p);\n#endif\n}\n"}),define("Scene/Vector3DTilePolylines",["../Core/arraySlice","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/FeatureDetection","../Core/IndexDatatype","../Core/Matrix4","../Core/Rectangle","../Core/TaskProcessor","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/Vector3DTilePolylinesVS","../ThirdParty/when","./BlendingState","./Cesium3DTileFeature"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w){"use strict";function x(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=n(e.ellipsoid,l.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=i.clone(i.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._readyPromise=E.defer(),this._verticesPromise=void 0}function P(e){var i=e._rectangle,r=e._minimumHeight,n=e._maximumHeight,o=e._ellipsoid,a=e._center,s=2+h.packedLength+l.packedLength+t.packedLength,u=new Float64Array(s),c=0;return u[c++]=r,u[c++]=n,h.pack(i,u,c),c+=h.packedLength,l.pack(o,u,c),c+=l.packedLength,t.pack(a,u,c),u}function D(t,i){if(!o(t._va)){if(!o(t._verticesPromise)){var n=t._positions,a=t._widths,s=t._counts,l=t._transferrableBatchIds,u=t._packedBuffer;o(u)||(n=t._positions=e(n),a=t._widths=e(a),s=t._counts=e(s),l=t._transferrableBatchIds=e(t._batchIds),u=t._packedBuffer=P(t));var d=[n.buffer,a.buffer,s.buffer,l.buffer,u.buffer],h={positions:n.buffer,widths:a.buffer,counts:s.buffer,batchIds:l.buffer,packedBuffer:u.buffer},p=t._verticesPromise=N.scheduleTask(h,d);if(!o(p))return;E(p,function(e){t._currentPositions=new Float32Array(e.currentPositions),t._previousPositions=new Float32Array(e.previousPositions),t._nextPositions=new Float32Array(e.nextPositions),t._expandAndWidth=new Float32Array(e.expandAndWidth),t._vertexBatchIds=new Uint16Array(e.batchIds);var i=e.indexDatatype;t._indices=i===c.UNSIGNED_SHORT?new Uint16Array(e.indices):new Uint32Array(e.indices),t._ready=!0})}if(t._ready&&!o(t._va)){var _=t._currentPositions,g=t._previousPositions,v=t._nextPositions,y=t._expandAndWidth,C=t._vertexBatchIds,S=t._indices,T=g.byteLength+_.byteLength+v.byteLength;T+=y.byteLength+C.byteLength+S.byteLength,t._trianglesLength=S.length/3,t._geometryByteLength=T;var A=f.createVertexBuffer({context:i,typedArray:g,usage:m.STATIC_DRAW}),w=f.createVertexBuffer({context:i,typedArray:_,usage:m.STATIC_DRAW}),x=f.createVertexBuffer({context:i,typedArray:v,usage:m.STATIC_DRAW}),D=f.createVertexBuffer({context:i,typedArray:y,usage:m.STATIC_DRAW}),I=f.createVertexBuffer({context:i,typedArray:C,usage:m.STATIC_DRAW}),M=f.createIndexBuffer({context:i,typedArray:S,usage:m.STATIC_DRAW,indexDatatype:2===S.BYTES_PER_ELEMENT?c.UNSIGNED_SHORT:c.UNSIGNED_INT}),R=[{index:F.previousPosition,vertexBuffer:A,componentDatatype:r.FLOAT,componentsPerAttribute:3},{index:F.currentPosition,vertexBuffer:w,componentDatatype:r.FLOAT,componentsPerAttribute:3},{index:F.nextPosition,vertexBuffer:x,componentDatatype:r.FLOAT,componentsPerAttribute:3},{index:F.expandAndWidth,vertexBuffer:D,componentDatatype:r.FLOAT,componentsPerAttribute:2},{index:F.a_batchId,vertexBuffer:I,componentDatatype:r.UNSIGNED_SHORT,componentsPerAttribute:1}];t._va=new b({context:i,attributes:R,indexBuffer:M}),t._positions=void 0,t._widths=void 0,t._counts=void 0,t._ellipsoid=void 0,t._minimumHeight=void 0,t._maximumHeight=void 0,t._rectangle=void 0,t._transferrableBatchIds=void 0,t._packedBuffer=void 0,t._currentPositions=void 0,t._previousPositions=void 0,t._nextPositions=void 0,t._expandAndWidth=void 0,t._vertexBatchIds=void 0,t._indices=void 0,t._readyPromise.resolve()}}}function I(e,t){o(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){var i=t.uniformState.view;return d.clone(i,B),d.multiplyByPoint(B,e._center,k),d.setTranslation(B,k,B),B},u_highlightColor:function(){return e._highlightColor}})}function M(e){if(!o(e._rs)){var t={enabled:!0,factor:-5,units:-5};e._rs=v.fromCache({blending:A.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}}function R(e,t){if(!o(e._sp)){var i=e._batchTable,r=i.getVertexShaderCallback(!1,"a_batchId",void 0)(T),n=i.getFragmentShaderCallback()(z,!1,void 0),a=new C({defines:["VECTOR_TILE",u.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[S,r]}),s=new C({defines:["VECTOR_TILE"],sources:[n]});e._sp=y.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:F})}}function O(e,t){if(!o(e._command)){var i=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new _({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:i,boundingVolume:e._boundingVolume,pass:g.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}function L(e,t){for(var r=e._batchIds,n=r.length,o=0;o<n;++o){var a=r[o],s=t[a];s.show=!0,s.color=i.WHITE}}a(x.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise.promise}}});var N=new p("createVectorTilePolylines"),F={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4},B=new d,k=new t,z="uniform vec4 u_highlightColor; \nvoid main()\n{\n gl_FragColor = u_highlightColor;\n}\n";x.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var o=i[n];t[o]=new w(e,o)}},x.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var V=new i,U=i.WHITE;return x.prototype.applyStyle=function(e,t){if(!o(e))return void L(this,t);for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=i[n],s=t[a];s.color=o(e.color)?e.color.evaluateColor(s,V):U,s.show=!o(e.show)||e.show.evaluate(s)}},x.prototype.update=function(e){var t=e.context;if(D(this,t),I(this,t),R(this,t),M(this),this._ready){var i=e.passes;(i.render||i.pick)&&O(this,e)}},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),s(this)},x}),define("Scene/Vector3DTileContent",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getMagic","../Core/getStringFromTypedArray","../Core/Math","../Core/Matrix4","../Core/Rectangle","../Core/RuntimeError","../ThirdParty/when","./Cesium3DTileBatchTable","./Vector3DTilePoints","./Vector3DTilePolygons","./Vector3DTilePolylines"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._contentReadyPromise=void 0,this._readyPromise=f.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,S(this,r,n)}function C(e){return function(t,r){i(e._polygons)&&e._polygons.updateCommands(t,r)}}function b(e,r){var n,o,a,s,l=t(e.POLYGONS_LENGTH,0),u=t(e.POLYLINES_LENGTH,0),c=t(e.POINTS_LENGTH,0);if(l>0&&i(e.POLYGON_BATCH_IDS)){var d=r.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(r.buffer,d,l)}if(u>0&&i(e.POLYLINE_BATCH_IDS)){var h=r.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;o=new Uint16Array(r.buffer,h,u)}if(c>0&&i(e.POINT_BATCH_IDS)){var f=r.byteOffset+e.POINT_BATCH_IDS.byteOffset;a=new Uint16Array(r.buffer,f,c)}var m=i(n)||i(o)||i(a),_=l>0&&!i(n)||u>0&&!i(o)||c>0&&!i(a);if(m&&_)throw new p("If one group of batch ids is defined, then all batch ids must be defined.");if(!i(n)&&!i(o)&&!i(a)){var g=0;if(!i(n)&&l>0)for(n=new Uint16Array(l),s=0;s<l;++s)n[s]=g++;if(!i(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=g++;if(!i(a)&&c>0)for(a=new Uint16Array(c),s=0;s<c;++s)a[s]=g++}return{polygons:n,polylines:o,points:a}}function S(r,n,o){o=t(o,0);var s=new Uint8Array(n),l=new DataView(n);o+=A;var f=l.getUint32(o,!0);if(1!==f)throw new p("Only Vector tile version 1 is supported. Version "+f+" is not.");o+=A;var y=l.getUint32(o,!0);if(o+=A,0===y)return void r._readyPromise.resolve(r);var S=l.getUint32(o,!0);if(o+=A,0===S)throw new p("Feature table must have a byte length greater than zero");var T=l.getUint32(o,!0);o+=A;var w=l.getUint32(o,!0);o+=A;var x=l.getUint32(o,!0);o+=A;var P=l.getUint32(o,!0);o+=A;var D=l.getUint32(o,!0);o+=A;var I=l.getUint32(o,!0);o+=A;var M=l.getUint32(o,!0);o+=A;var R=u(s,o,S),O=JSON.parse(R);o+=S;var L=new Uint8Array(n,o,T);o+=T;var N,F;if(w>0){var B=u(s,o,w);N=JSON.parse(B),o+=w,x>0&&(F=new Uint8Array(n,o,x),F=new Uint8Array(F),o+=x)}var k=t(O.POLYGONS_LENGTH,0),z=t(O.POLYLINES_LENGTH,0),V=t(O.POINTS_LENGTH,0),U=k+z+V,G=new m(r,U,N,F,C(r));if(r._batchTable=G,0!==U){var H,W,q;if(!i(O.REGION))throw new p("REGION is required in the feature table.");var Y=O.REGION;H=h.unpack(Y),W=Y[4],q=Y[5];var j,X=r._tile.computedTransform;i(O.RTC_CENTER)?(j=e.unpack(O.RTC_CENTER),d.multiplyByPoint(X,j,j)):(j=h.center(H),j.height=c.lerp(W,q,.5),j=a.WGS84.cartographicToCartesian(j));var Q=b(O,L);if(o+=o%4,k>0){var K=new Uint32Array(n,o,P/A);o+=P;var Z=new Uint16Array(n,o,D/E);o+=D;var J,$,ee=L.byteOffset+O.POLYGON_COUNT.byteOffset,te=new Uint32Array(L.buffer,ee,k),ie=L.byteOffset+O.POLYGON_INDEX_COUNT.byteOffset,re=new Uint32Array(L.buffer,ie,k);if(i(O.POLYGON_MINIMUM_HEIGHTS)&&i(O.POLYGON_MAXIMUM_HEIGHTS)){var ne=L.byteOffset+O.POLYGON_MINIMUM_HEIGHTS.byteOffset;J=new Float32Array(L.buffer,ne,k);var oe=L.byteOffset+O.POLYGON_MAXIMUM_HEIGHTS.byteOffset;$=new Float32Array(L.buffer,oe,k)}r._polygons=new g({positions:Z,counts:te,indexCounts:re,indices:K,minimumHeight:W,maximumHeight:q,polygonMinimumHeights:J,polygonMaximumHeights:$,center:j,rectangle:H,boundingVolume:r.tile.boundingVolume.boundingVolume,batchTable:G,batchIds:Q.polygons,modelMatrix:X})}if(z>0){var ae=new Uint16Array(n,o,I/E);o+=I;var se,le=L.byteOffset+O.POLYLINE_COUNT.byteOffset,ue=new Uint32Array(L.buffer,le,z);if(i(O.POLYLINE_WIDTHS)){var ce=L.byteOffset+O.POLYLINE_WIDTHS.byteOffset;se=new Uint16Array(L.buffer,ce,z)}else{se=new Uint16Array(z);for(var de=0;de<z;++de)se[de]=2}r._polylines=new v({positions:ae,widths:se,counts:ue,batchIds:Q.polylines,minimumHeight:W,maximumHeight:q,center:j,rectangle:H,boundingVolume:r.tile.boundingVolume.boundingVolume,batchTable:G})}if(V>0){var he=new Uint16Array(n,o,M/E);r._points=new _({positions:he,batchIds:Q.points,minimumHeight:W,maximumHeight:q,rectangle:H,batchTable:G})}}}function T(e){var t=e.featuresLength;if(!i(e._features)&&t>0){var r=new Array(t);i(e._polygons)&&e._polygons.createFeatures(e,r),i(e._polylines)&&e._polylines.createFeatures(e,r),i(e._points)&&e._points.createFeatures(e,r),e._features=r}}if(!s.supportsTypedArrays())return{};r(y.prototype,{featuresLength:{get:function(){return i(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return i(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){var e=0;return i(this._polygons)&&(e+=this._polygons.trianglesLength),i(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){var e=0;return i(this._polygons)&&(e+=this._polygons.geometryByteLength),i(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return i(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return i(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var E=Uint16Array.BYTES_PER_ELEMENT,A=Uint32Array.BYTES_PER_ELEMENT;return y.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},y.prototype.getFeature=function(e){return T(this),this._features[e]},y.prototype.applyDebugSettings=function(e,t){i(this._polygons)&&this._polygons.applyDebugSettings(e,t),i(this._polylines)&&this._polylines.applyDebugSettings(e,t),i(this._points)&&this._points.applyDebugSettings(e,t)},y.prototype.applyStyle=function(e){T(this),i(this._polygons)&&this._polygons.applyStyle(e,this._features),i(this._polylines)&&this._polylines.applyStyle(e,this._features),i(this._points)&&this._points.applyStyle(e,this._features)},y.prototype.update=function(e,t){var r=!0;if(i(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),r=r&&this._polygons._ready),i(this._polylines)&&(this._polylines.update(t),r=r&&this._polylines._ready),i(this._points)&&(this._points.update(t),r=r&&this._points._ready),i(this._batchTable)&&r&&this._batchTable.update(e,t),!i(this._contentReadyPromise)){var n=i(this._points)?this._points.readyPromise:void 0,o=i(this._polygons)?this._polygons.readyPromise:void 0,a=i(this._polylines)?this._polylines.readyPromise:void 0,s=this;this._contentReadyPromise=f.all([n,o,a]).then(function(){s._readyPromise.resolve(s)})}},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),n(this)},y}),define("Scene/Cesium3DTileContentFactory",["./Batched3DModel3DTileContent","./Composite3DTileContent","./Geometry3DTileContent","./Instanced3DModel3DTileContent","./PointCloud3DTileContent","./Tileset3DTileContent","./Vector3DTileContent"],function(e,t,i,r,n,o,a){"use strict";var s={b3dm:function(t,i,r,n,o){return new e(t,i,r,n,o)},pnts:function(e,t,i,r,o){return new n(e,t,i,r,o)},i3dm:function(e,t,i,n,o){return new r(e,t,i,n,o)},cmpt:function(e,i,r,n,o){return new t(e,i,r,n,o,s)},json:function(e,t,i,r,n){return new o(e,t,i,r,n)},geom:function(e,t,r,n,o){return new i(e,t,r,n,o)},vctr:function(e,t,i,r,n){return new a(e,t,i,r,n)}};return s}),define("Scene/Cesium3DTileContentState",["../Core/freezeObject"],function(e){"use strict";return e({UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5})}),define("Scene/Cesium3DTileOptimizationHint",["../Core/freezeObject"],function(e){"use strict";return e({NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0})}),define("Scene/Cesium3DTilesetMostDetailedTraversal",["../Core/Intersect","../Core/ManagedArray","./Cesium3DTileRefine"],function(e,t,i){"use strict";function r(){}function n(e){return e._visible&&e._inRequestVolume}function o(e){return e.hasEmptyContent||e.hasTilesetContent}function a(e){return!o(e)&&e.contentUnloaded}function s(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:(t.hasEmptyContent,!0))}function l(e,t,i,r){for(var o=t.children,a=o.length,s=0;s<a;++s){var l=o[s];l.updateVisibility(r),n(l)&&i.push(l)}}function u(e,t){(a(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function c(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function d(e){++e.statistics.visited}function h(t,i,r){i.contentAvailable&&i.contentVisibility(r)!==e.OUTSIDE&&t._selectedTiles.push(i)}var p={stack:new t,stackMaximumLength:0};return r.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e._hasMixedContent=!1;var r=!0,a=e.root;if(a.updateVisibility(t),!n(a))return r;var f=p.stack;for(f.push(e.root);f.length>0;){p.stackMaximumLength=Math.max(p.stackMaximumLength,f.length);var m=f.pop(),_=m.refine===i.ADD,g=m.refine===i.REPLACE,v=s(e,m);v&&l(e,m,f,t),(_||g&&!v)&&(u(e,m),c(e,m,t),h(e,m,t),o(m)||m.contentAvailable||(r=!1)),d(e)}return p.stack.trim(p.stackMaximumLength),r},r}),define("Scene/Cesium3DTilesetTraversal",["../Core/Cartesian3","../Core/defined","../Core/Intersect","../Core/ManagedArray","../Core/Math","./Cesium3DTileOptimizationHint","./Cesium3DTileRefine"],function(e,t,i,r,n,o,a){"use strict";function s(){}function l(e){return e._visible&&e._inRequestVolume}function u(e,t,i){N(e,t,e._maximumScreenSpaceError,e._maximumScreenSpaceError,i)}function c(e,t,i){N(e,t,Number.MAX_VALUE,e._maximumScreenSpaceError,i),B(e,t,i)}function d(e,t,i){N(e,t,Math.max(e.baseScreenSpaceError,e.maximumScreenSpaceError),e.maximumScreenSpaceError,i),B(e,t,i)}function h(e){return e._skipLevelOfDetail}function p(e,t){e._emptyTiles.push(t)}function f(e,t,r){if(t.contentVisibility(r)!==i.OUTSIDE){var n=t.content;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,t.lastStyleTime=0,e._selectedTilesToStyle.push(t)):t._selectedFrame<r.frameNumber-1&&e._selectedTilesToStyle.push(t),t._selectedFrame=r.frameNumber,e._selectedTiles.push(t)}}function m(e,t,i){var r=V.stack;for(r.push(t);r.length>0;){V.stackMaximumLength=Math.max(V.stackMaximumLength,r.length);for(var n=r.pop(),o=n.children,a=o.length,s=0;s<a;++s){var u=o[s];l(u)&&(u.contentAvailable?(w(e,u,i),v(e,u,i),f(e,u,i)):u._depth-t._depth<G&&r.push(u))}}}function _(e,i,r){if(!h(e))return void(i.contentAvailable&&f(e,i,r));var n=i.contentAvailable?i:i._ancestorWithContentAvailable;t(n)?n._shouldSelect=!0:m(e,i,r)}function g(e,t,i){++e._statistics.visited,t._visitedFrame=i.frameNumber}function v(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function y(e,t){e._maximumPriority.distance=Math.max(t._priorityHolder._distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._priorityHolder._distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(t._depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(t._depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(t._priorityHolder._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._priorityHolder._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.reverseScreenSpaceError=Math.max(t._priorityReverseScreenSpaceError,e._maximumPriority.reverseScreenSpaceError),e._minimumPriority.reverseScreenSpaceError=Math.min(t._priorityReverseScreenSpaceError,e._minimumPriority.reverseScreenSpaceError)}function C(e,t,i){if(!e.cullRequestsWhileMoving)return!0;var r=t.boundingSphere,n=Math.max(2*r.radius,1),o=i.camera,a=0!==o.positionWCDeltaMagnitude?o.positionWCDeltaMagnitude:o.positionWCDeltaMagnitudeLastFrame;return e.cullRequestsWhileMovingMultiplier*a/n<1}function b(e,t,i){if(t._requestedFrame!==i.frameNumber&&(D(t)||t.contentExpired)&&C(e,t,i)){var r=i.camera.timeSinceMoved<e.foveatedTimeDelay;t.priorityDeferred&&r||(t._requestedFrame=i.frameNumber,e._requestedTiles.push(t))}}function S(e,t,i){t._updatedVisibilityFrame!==e._updatedVisibilityFrame&&(t.updateVisibility(i),t._updatedVisibilityFrame=e._updatedVisibilityFrame)}function T(e,t,i){for(var r=!1,n=t.children,o=n.length,a=0;a<o;++a){var s=n[a];S(e,s,i),r=r||l(s)}return r}function E(e,i,r){var n=i.parent;return!(!t(n)||n.hasTilesetContent||n.refine!==a.ADD)&&i.getScreenSpaceError(r,!0)<=e._maximumScreenSpaceError}function A(e,t,i){if(S(e,t,i),l(t)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var n=t.children[0];return A(e,n,i),void(t._visible=n._visible)}if(E(e,t,i))return void(t._visible=!1);var s=t.refine===a.REPLACE,u=t._optimChildrenWithinParent===o.USE_OPTIMIZATION;return s&&u&&r&&!T(e,t,i)?(++e._statistics.numberOfTilesCulledWithChildrenUnion,void(t._visible=!1)):void 0}}function w(e,t,i){A(e,t,i),t.updateExpiration(),t._wasMinPriorityChild=!1,t._priorityHolder=t,y(e,t),t._shouldSelect=!1,t._finalResolution=!0}function x(e,i){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;var r=e.parent;if(t(r)){var n=!D(r)||r._requestedFrame===i.frameNumber;e._ancestorWithContent=n?r:r._ancestorWithContent,e._ancestorWithContentAvailable=r.contentAvailable?r:r._ancestorWithContentAvailable}}function P(e){return e.hasEmptyContent||e.hasTilesetContent}function D(e){return!P(e)&&e.contentUnloaded}function I(e,i){var r=i._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(i._priorityProgressiveResolutionScreenSpaceErrorLeaf||t(r)&&i._screenSpaceError<r._screenSpaceError/e.skipScreenSpaceErrorFactor&&i._depth>r._depth+e.skipLevels)}function M(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function R(e,t,i,r){var n,o=t.refine===a.REPLACE,s=t.children,u=s.length;for(n=0;n<u;++n)w(e,s[n],r);s.sort(M);var c,d=!h(e)&&o&&!P(t),p=!0,f=!1,m=-1,_=Number.MAX_VALUE;for(n=0;n<u;++n)if(c=s[n],l(c)?(i.push(c),c._foveatedFactor<_&&(m=n,_=c._foveatedFactor),f=!0):(d||e.loadSiblings)&&(c._foveatedFactor<_&&(m=n,_=c._foveatedFactor),b(e,c,r),v(e,c,r)),d){var g;g=!!c._inRequestVolume&&(P(c)?F(e,c,r):c.contentAvailable),p=p&&g}if(f||(p=!1),-1!==m&&!h(e)&&o){var y=s[m];y._wasMinPriorityChild=!0;var C=(t._wasMinPriorityChild||t===e.root)&&_<=t._priorityHolder._foveatedFactor?t._priorityHolder:t;for(C._foveatedFactor=Math.min(y._foveatedFactor,C._foveatedFactor),C._distanceToCamera=Math.min(y._distanceToCamera,C._distanceToCamera),n=0;n<u;++n)c=s[n],c._priorityHolder=C}return p}function O(e,i,r){return!h(e)||!e.immediatelyLoadDesiredLevelOfDetail&&(!t(i._ancestorWithContent)||(0===i._screenSpaceError?i.parent._screenSpaceError>r:i._screenSpaceError>r))}function L(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function N(e,i,r,n,o){var s=k.stack;for(s.push(i);s.length>0;){k.stackMaximumLength=Math.max(k.stackMaximumLength,s.length);var l=s.pop();x(l,o);var u=O(e,l,r),c=l.refine===a.ADD,d=l.refine===a.REPLACE,h=l.parent,f=!t(h)||h._refines,m=!1;L(e,l)&&(m=R(e,l,s,o)&&f);var y=!m&&f;P(l)?(p(e,l,o),b(e,l,o),y&&_(e,l,o)):c?(_(e,l,o),b(e,l,o)):d&&(u?(b(e,l,o),y&&_(e,l,o)):y?(_(e,l,o),b(e,l,o)):I(e,l)&&b(e,l,o)),g(e,l,o),v(e,l,o),l._refines=m}}function F(e,t,i){var r=!0,n=z.stack;for(n.push(t);n.length>0;){z.stackMaximumLength=Math.max(z.stackMaximumLength,n.length);var o=n.pop(),a=o.children,s=a.length,u=P(o)&&L(e,o);if(u||o.contentAvailable||(r=!1),w(e,o,i),l(o)||(b(e,o,i),v(e,o,i)),u)for(var c=0;c<s;++c){var d=a[c];n.push(d)}}return r}function B(e,i,r){var n,o=U.stack,s=U.ancestorStack;for(o.push(i);o.length>0||s.length>0;){if(U.stackMaximumLength=Math.max(U.stackMaximumLength,o.length),U.ancestorStackMaximumLength=Math.max(U.ancestorStackMaximumLength,s.length),s.length>0){var u=s.peek();if(u._stackLength===o.length){s.pop(),u!==n&&(u._finalResolution=!1),f(e,u,r);continue}}var c=o.pop();if(t(c)){var d=c.refine===a.ADD,h=c._shouldSelect,p=c.children,m=p.length,_=L(e,c);if(h)if(d)f(e,c,r);else{if(c._selectionDepth=s.length,c._selectionDepth>0&&(e._hasMixedContent=!0),n=c,!_){f(e,c,r);continue}s.push(c),c._stackLength=o.length}if(_)for(var g=0;g<m;++g){var v=p[g];l(v)&&o.push(v)}}}}var k={stack:new r,stackMaximumLength:0},z={stack:new r,stackMaximumLength:0},V={stack:new r,stackMaximumLength:0},U={stack:new r,stackMaximumLength:0,ancestorStack:new r,ancestorStackMaximumLength:0},G=2;return s.selectTiles=function(e,t){if(e._requestedTiles.length=0,!e.debugFreezeFrame){e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e._hasMixedContent=!1;var i=e.root;if(w(e,i,t),l(i)&&!(i.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)){h(e)?e.immediatelyLoadDesiredLevelOfDetail?c(e,i,t):d(e,i,t):u(e,i,t),k.stack.trim(k.stackMaximumLength),z.stack.trim(z.stackMaximumLength),V.stack.trim(V.stackMaximumLength),U.stack.trim(U.stackMaximumLength),U.ancestorStack.trim(U.ancestorStackMaximumLength);for(var r=e._requestedTiles,n=r.length,o=0;o<n;++o)r[o].updatePriority()}}},s}),define("Scene/Cesium3DTilePass",["../Core/Check","../Core/freezeObject","./Cesium3DTilesetMostDetailedTraversal","./Cesium3DTilesetTraversal"],function(e,t,i,r){"use strict";var n={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},o=new Array(n.NUMBER_OF_PASSES);return o[n.RENDER]=t({traversal:r,isRender:!0,requestTiles:!0,ignoreCommands:!1}),o[n.PICK]=t({traversal:r,isRender:!1,requestTiles:!1,ignoreCommands:!1}),o[n.SHADOW]=t({traversal:r,isRender:!1,requestTiles:!0,ignoreCommands:!1}),o[n.PRELOAD]=t({traversal:r,isRender:!1,requestTiles:!0,ignoreCommands:!0}),o[n.PRELOAD_FLIGHT]=t({traversal:r,isRender:!1,requestTiles:!0,ignoreCommands:!0}),o[n.REQUEST_RENDER_MODE_DEFER_CHECK]=t({traversal:r,isRender:!1,requestTiles:!0,ignoreCommands:!0}),o[n.MOST_DETAILED_PRELOAD]=t({traversal:i,isRender:!1,requestTiles:!0,ignoreCommands:!0}),o[n.MOST_DETAILED_PICK]=t({traversal:i,isRender:!1,requestTiles:!1,ignoreCommands:!1}),n.getPassOptions=function(e){return o[e]},t(n)}),define("Scene/Empty3DTileContent",["../Core/defineProperties","../Core/destroyObject"],function(e,t){"use strict";function i(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}return e(i.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},batchTable:{get:function(){}}}),i.prototype.hasProperty=function(e,t){return!1},i.prototype.getFeature=function(e){},i.prototype.applyDebugSettings=function(e,t){},i.prototype.applyStyle=function(e){},i.prototype.update=function(e,t){},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return t(this)},i}),define("Scene/TileBoundingRegion",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defineProperties","../Core/Ellipsoid","../Core/GeometryInstance","../Core/IntersectionTests","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Plane","../Core/Ray","../Core/Rectangle","../Core/RectangleOutlineGeometry","./PerInstanceColorAppearance","./Primitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(i){this.rectangle=f.clone(i.rectangle),this.minimumHeight=o(i.minimumHeight,0),this.maximumHeight=o(i.maximumHeight,0),this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t;var r=o(i.ellipsoid,s.WGS84);C(this,i.rectangle,r),
- o(i.computeBoundingVolumes,!0)&&(this._orientedBoundingBox=d.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,r),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox))}function C(e,i,r){r.cartographicToCartesian(f.southwest(i),e.southwestCornerCartesian),r.cartographicToCartesian(f.northeast(i),e.northeastCornerCartesian),x.longitude=i.west,x.latitude=.5*(i.south+i.north),x.height=0;var n=r.cartographicToCartesian(x,A),o=t.cross(n,t.UNIT_Z,b);t.normalize(o,e.westNormal),x.longitude=i.east;var a=r.cartographicToCartesian(x,w),s=t.cross(t.UNIT_Z,a,b);t.normalize(s,e.eastNormal);var l,c=t.subtract(n,a,b),d=t.normalize(c,E),p=i.south;if(p>0){x.longitude=.5*(i.west+i.east),x.latitude=p;var m=r.cartographicToCartesian(x,D.origin);t.clone(d,D.direction);var _=h.fromPointNormal(e.southwestCornerCartesian,e.westNormal,P);u.rayPlane(D,_,e.southwestCornerCartesian),l=r.geodeticSurfaceNormal(m,S)}else l=r.geodeticSurfaceNormalCartographic(f.southeast(i),S);var g=t.cross(l,c,T);t.normalize(g,e.southNormal);var v,y=i.north;if(y<0){x.longitude=.5*(i.west+i.east),x.latitude=y;var C=r.cartographicToCartesian(x,D.origin);t.negate(d,D.direction);var I=h.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,P);u.rayPlane(D,I,e.northeastCornerCartesian),v=r.geodeticSurfaceNormal(C,S)}else v=r.geodeticSurfaceNormalCartographic(f.northwest(i),S);var M=t.cross(c,v,T);t.normalize(M,e.northNormal)}a(y.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});var b=new t,S=new t,T=new t,E=new t,A=new t,w=new t,x=new i,P=new h(t.UNIT_X,0),D=new p,I=new t,M=new t,R=new t(0,-1,0),O=new t(0,0,-1),L=new t;return y.prototype.distanceToCamera=function(e){var i=e.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!f.contains(this.rectangle,n)){var a=this.southwestCornerCartesian,s=this.northeastCornerCartesian,l=this.westNormal,u=this.southNormal,c=this.eastNormal,d=this.northNormal;e.mode!==v.SCENE3D&&(a=e.mapProjection.project(f.southwest(this.rectangle),I),a.z=a.y,a.y=a.x,a.x=0,s=e.mapProjection.project(f.northeast(this.rectangle),M),s.z=s.y,s.y=s.x,s.x=0,l=R,c=t.UNIT_Y,u=O,d=t.UNIT_Z);var h=t.subtract(r,a,L),p=t.dot(h,l),m=t.dot(h,u),_=t.subtract(r,s,L),g=t.dot(_,c),y=t.dot(_,d);p>0?o+=p*p:g>0&&(o+=g*g),m>0?o+=m*m:y>0&&(o+=y*y)}var C,b,S;if(e.mode===v.SCENE3D?(C=n.height,b=this.minimumHeight,S=this.maximumHeight):(C=r.x,b=0,S=0),C>S){var T=C-S;o+=T*T}else if(C<b){var E=b-C;o+=E*E}return Math.sqrt(o)},y.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},y.prototype.createDebugVolume=function(e){var t=new c.clone(c.IDENTITY),i=new m({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),r=new l({geometry:i,id:"outline",modelMatrix:t,attributes:{color:n.fromColor(e)}});return new g({geometryInstances:r,appearance:new _({translucent:!1,flat:!0}),asynchronous:!1})},y}),define("Scene/TileBoundingSphere",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix4","../Core/SphereOutlineGeometry","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i){this._boundingSphere=new e(t,i)}return n(c.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),c.prototype.distanceToCamera=function(e){var i=this._boundingSphere;return Math.max(0,t.distance(i.center,e.camera.positionWC)-i.radius)},c.prototype.intersectPlane=function(t){return e.intersectPlane(this._boundingSphere,t)},c.prototype.update=function(e,i){t.clone(e,this._boundingSphere.center),this._boundingSphere.radius=i},c.prototype.createDebugVolume=function(e){var t=new s({radius:this.radius}),i=a.fromTranslation(this.center,new a.clone(a.IDENTITY)),n=new o({geometry:t,id:"outline",modelMatrix:i,attributes:{color:r.fromColor(e)}});return new u({geometryInstances:n,appearance:new l({translucent:!1,flat:!0}),asynchronous:!1})},c}),define("Scene/TileOrientedBoundingBox",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t,i){this._orientedBoundingBox=new u(t,i),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}return o(h.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),h.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},h.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},h.prototype.update=function(t,r){i.clone(t,this._orientedBoundingBox.center),s.clone(r,this._orientedBoundingBox.halfAxes),e.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},h.prototype.createDebugVolume=function(e){var r=new t({minimum:new i(-1,-1,-1),maximum:new i(1,1,1)}),o=l.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),s=new a({geometry:r,id:"outline",modelMatrix:o,attributes:{color:n.fromColor(e)}});return new d({geometryInstances:s,appearance:new c({translucent:!1,flat:!0}),asynchronous:!1})},h}),define("Scene/Cesium3DTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CullingVolume","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/Ellipsoid","../Core/getMagic","../Core/Intersect","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/OrthographicFrustum","../Core/Rectangle","../Core/Request","../Core/RequestScheduler","../Core/RequestState","../Core/RequestType","../Core/Resource","../Core/RuntimeError","../Core/Transforms","../ThirdParty/when","./Cesium3DTileContentFactory","./Cesium3DTileContentState","./Cesium3DTileOptimizationHint","./Cesium3DTilePass","./Cesium3DTileRefine","./Empty3DTileContent","./SceneMode","./TileBoundingRegion","./TileBoundingSphere","./TileOrientedBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B){"use strict";function k(e,t,r,n){this._tileset=e,this._header=r;var o=r.content;this.transform=a(r.transform)?_.unpack(r.transform):_.clone(_.IDENTITY);var s=a(n)?n.computedTransform:e.modelMatrix,l=_.multiply(s,this.transform,new _),u=a(n)?n._initialTransform:_.IDENTITY;this._initialTransform=_.multiply(u,this.transform,new _),this.computedTransform=l,this._boundingVolume=this.createBoundingVolume(r.boundingVolume,l),this._boundingVolume2D=void 0;var c;a(o)&&a(o.boundingVolume)&&(c=this.createBoundingVolume(o.boundingVolume,l)),this._contentBoundingVolume=c,this._contentBoundingVolume2D=void 0;var d;a(r.viewerRequestVolume)&&(d=this.createBoundingVolume(r.viewerRequestVolume,l)),this._viewerRequestVolume=d,this.geometricError=r.geometricError,a(this.geometricError)||(this.geometricError=a(n)?n.geometricError:e._geometricError,k._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead."));var h;a(r.refine)?("replace"!==r.refine&&"add"!==r.refine||k._deprecationWarning("lowercase-refine",'This tile uses a lowercase refine "'+r.refine+'". Instead use "'+r.refine.toUpperCase()+'".'),h="REPLACE"===r.refine.toUpperCase()?R.REPLACE:R.ADD):h=a(n)?n.refine:R.REPLACE,this.refine=h,this.children=[],this.parent=n;var f,m,g,v,y;if(t=E.createIfNeeded(t),a(o)){var C=o.uri;a(o.url)&&(k._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),C=o.url),m=!1,g=D.UNLOADED,v=t.getDerivedResource({url:C}),y=b.getServerKey(v.getUrlComponent())}else f=new O(e,this),m=!0,g=D.READY;this._content=f,this._contentResource=v,this._contentState=g,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=y,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.cacheNode=void 0;var S,T,A=r.expire;a(A)&&(S=A.duration,a(A.date)&&(T=p.fromIso8601(A.date))),this.expireDuration=S,this.expireDate=T,this.lastStyleTime=0,this._optimChildrenWithinParent=I.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=i.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new p,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}function z(e,i){var r=e._tileset,n=i.camera,o=e.boundingSphere,s=o.radius,l=t.multiplyByScalar(n.directionWC,e._centerZDepth,ie),u=t.add(n.positionWC,l,ie),c=t.subtract(u,o.center,ie);if(t.magnitude(c)>s){var d=t.normalize(c,ie),h=t.multiplyByScalar(d,s,ie),p=t.add(o.center,h,ie),m=t.subtract(p,n.positionWC,ie),_=t.normalize(m,ie);e._foveatedFactor=1-Math.abs(t.dot(n.directionWC,_))}else e._foveatedFactor=0;var g=e.refine===R.REPLACE,v=r._skipLevelOfDetail;if(g&&!v||!r.foveatedScreenSpaceError||1===r.foveatedConeSize||e._priorityProgressiveResolution&&g&&v||r._pass===M.PRELOAD_FLIGHT||r._pass===M.PRELOAD)return!1;var y=1-Math.cos(.5*n.frustum.fov),C=r.foveatedConeSize*y;if(e._foveatedFactor<=C)return!1;var b=y-C,S=f.clamp((e._foveatedFactor-C)/b,0,1),T=r.foveatedInterpolationCallback(r.foveatedMinimumScreenSpaceErrorRelaxation,r.maximumScreenSpaceError,S),E=0===e._screenSpaceError&&a(e.parent)?.5*e.parent._screenSpaceError:e._screenSpaceError;return r.maximumScreenSpaceError-T<=E}function V(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;var i=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;var r=t.parent,n=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=n,s=a(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function U(e,t){var i=t.parent,r=a(i)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent),n=r?i._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-n}function G(e){if(a(e.expireDuration)){var t=p.now(re);p.addSeconds(t,e.expireDuration,t),a(e.expireDate)?p.lessThan(e.expireDate,t)&&p.clone(t,e.expireDate):e.expireDate=p.clone(t)}}function H(e){return function(t){e._contentState=D.FAILED,e._contentReadyPromise.reject(t),e._contentReadyToProcessPromise.reject(t)}}function W(e){return function(){return e._priority}}function q(t,i){if(i.mode!==L.SCENE3D&&!a(t._boundingVolume2D)){var r=t._boundingVolume.boundingSphere,n=e.projectTo2D(r,i.mapProjection,ne);t._boundingVolume2D=new F(n.center,n.radius)}return i.mode!==L.SCENE3D?t._boundingVolume2D:t._boundingVolume}function Y(t,i){if(i.mode!==L.SCENE3D&&!a(t._contentBoundingVolume2D)){var r=t._contentBoundingVolume.boundingSphere,n=e.projectTo2D(r,i.mapProjection,ne);t._contentBoundingVolume2D=new F(n.center,n.radius)}return i.mode!==L.SCENE3D?t._contentBoundingVolume2D:t._contentBoundingVolume}function j(e,i,r){var n=t.fromElements(e[0],e[1],e[2],ue),o=m.fromArray(e,3,le);n=_.multiplyByPoint(i,n,n);var s=_.getRotation(i,ae);return o=m.multiply(s,o,o),a(r)?(r.update(n,o),r):new B(n,o)}function X(e,t,i,r){var n=y.unpack(e,0,ce),o=e[4],s=e[5],l=g.fromRectangle(n,o,s,c.WGS84,de),u=l.center,d=l.halfAxes;t=_.multiplyTransformation(t,_.inverseTransformation(i,he),he),u=_.multiplyByPoint(t,u,u);var h=_.getRotation(t,ae);return d=m.multiply(h,d,d),a(r)&&r instanceof B?(r.update(u,d),r):new B(u,d)}function Q(e,t,i,r){if(!_.equalsEpsilon(t,i,f.EPSILON8))return X(e,t,i,r);if(a(r))return r;var n=y.unpack(e,0,ce);return new N({rectangle:n,minimumHeight:e[4],maximumHeight:e[5]})}function K(e,i,r){var n=t.fromElements(e[0],e[1],e[2],ue),o=e[3];n=_.multiplyByPoint(i,n,n);var s=_.getScale(i,se);return o*=t.maximumComponent(s),a(r)?(r.update(n,o),r):new F(n,o)}function Z(e,t,n){if(n.passes.render){var o=a(e._header.content)&&a(e._header.content.boundingVolume),s=e.hasEmptyContent||e.hasTilesetContent,l=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(l){var u;u=e._finalResolution?s?i.DARKGRAY:i.WHITE:i.YELLOW,a(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(u)),e._debugBoundingVolume.update(n);var c=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");c.color=r.toValue(u,c.color)}else!l&&a(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(a(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(i.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&a(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&a(e._viewerRequestVolume)?(a(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(i.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&a(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());var d=t.debugColorizeTiles&&!e._debugColorizeTiles||a(t._heatmap.tilePropertyName),h=!t.debugColorizeTiles&&e._debugColorizeTiles;d?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):h&&(e._debugColorizeTiles=!1,e.color=i.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),h&&t.makeStyleDirty()}}function J(e,t,i){var r=e._content,n=e._expiredContent;if(a(n)){if(!e.contentReady)return void n.update(t,i);e._expiredContent.destroy(),e._expiredContent=void 0}r.update(t,i)}function $(e,t){var i=t.clippingPlanes,r=0;a(i)&&e._isClipped&&i.enabled&&(r=i.clippingPlanesState),r!==e._clippingPlanesState&&(e._clippingPlanesState=r,e.clippingPlanesDirty=!0)}function ee(e,t,i){var r=e*Math.pow(10,t);return parseInt(r)*Math.pow(10,i)}function te(e,t,i){return Math.max(f.normalize(e,t,i)-f.EPSILON7,0)}k._deprecationWarning=l,s(k.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return o(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},extras:{get:function(){return this._header.extras}},color:{get:function(){return a(this._color)||(this._color=new i),i.clone(this._color)},set:function(e){this._color=i.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&!this.hasEmptyContent&&!this.hasTilesetContent||a(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===D.READY}},contentUnloaded:{get:function(){return this._contentState===D.UNLOADED}},contentExpired:{get:function(){return this._contentState===D.EXPIRED}},contentFailed:{get:function(){return this._contentState===D.FAILED}},contentReadyToProcessPromise:{get:function(){if(a(this._contentReadyToProcessPromise))return this._contentReadyToProcessPromise.promise}},contentReadyPromise:{get:function(){if(a(this._contentReadyPromise))return this._contentReadyPromise.promise}},commandsLength:{get:function(){return this._commandsLength}}});var ie=new t,re=new p;k.prototype.getScreenSpaceError=function(e,t,i){var r=this._tileset,n=o(i,1),s=a(this.parent)?this.parent.geometricError:r._geometricError,l=t?s:this.geometricError;if(0===l)return 0;var u,c=e.camera,d=c.frustum,h=e.context,p=h.drawingBufferWidth,m=h.drawingBufferHeight*n;if(e.mode===L.SCENE2D||d instanceof v){a(d._offCenterFrustum)&&(d=d._offCenterFrustum);u=l/(Math.max(d.top-d.bottom,d.right-d.left)/Math.max(p,m))}else{var _=Math.max(this._distanceToCamera,f.EPSILON7);if(u=l*m/(_*c.frustum.sseDenominator),r.dynamicScreenSpaceError){var g=r._dynamicScreenSpaceErrorComputedDensity,y=r.dynamicScreenSpaceErrorFactor;u-=f.fog(_,g)*y}}return u},k.prototype.updateVisibility=function(e){var t=this.parent,i=this._tileset,r=a(t)?t.computedTransform:i.modelMatrix,o=a(t)?t._visibilityPlaneMask:n.MASK_INDETERMINATE;this.updateTransform(r),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,i.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==n.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=U(i,this),this._priorityProgressiveResolution=V(i,this),this.priorityDeferred=z(this,e)},k.prototype.updateExpiration=function(){if(a(this.expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=p.now(re);p.lessThan(this.expireDate,e)&&(this._contentState=D.EXPIRED,this._expiredContent=this._content)}},k.prototype.requestContent=function(){var e=this,t=this._tileset;if(this.hasEmptyContent)return!1;var i=this._contentResource.clone(),r=this.contentExpired;r&&i.setQueryParameters({expired:this.expireDate.toString()});var n=new C({throttle:!0,throttleByServer:!0,type:T.TILES3D,priorityFunction:W(this),serverKey:this._serverKey});this._request=n,i.request=n;var o=i.fetchArrayBuffer();if(!a(o))return!1;var s=this._contentState;this._contentState=D.LOADING,this._contentReadyToProcessPromise=x.defer(),this._contentReadyPromise=x.defer(),r&&(this.expireDate=void 0);var l=H(this);return o.then(function(i){if(e.isDestroyed())return void l();var r,n=new Uint8Array(i),o=d(n),s=P[o];return t._disableSkipLevelOfDetail=t._disableSkipLevelOfDetail||"vctr"===o||"geom"===o,a(s)?r=s(t,e,e._contentResource,i,0):(r=P.json(t,e,e._contentResource,i,0),e.hasTilesetContent=!0),e._content=r,e._contentState=D.PROCESSING,e._contentReadyToProcessPromise.resolve(r),r.readyPromise.then(function(t){if(e.isDestroyed())return void l();G(e),e._selectedFrame=0,e.lastStyleTime=0,p.now(e._loadTimestamp),e._contentState=D.READY,e._contentReadyPromise.resolve(t)})}).otherwise(function(i){if(n.state===S.CANCELLED)return e._contentState=s,--t.statistics.numberOfPendingRequests,void++t.statistics.numberOfAttemptedRequests;l(i)}),!0},k.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||(this._content=this._content&&this._content.destroy(),this._contentState=D.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var ne=new e;k.prototype.visibility=function(e,t){var i=e.cullingVolume,r=q(this,e),o=this._tileset,s=o.clippingPlanes;if(a(s)&&s.enabled){var l=s.computeIntersectionWithBoundingVolume(r,o.clippingPlanesOriginMatrix);if(this._isClipped=l!==h.INSIDE,l===h.OUTSIDE)return n.MASK_OUTSIDE}return i.computeVisibilityWithPlaneMask(r,t)},k.prototype.contentVisibility=function(e){if(!a(this._contentBoundingVolume))return h.INSIDE;if(this._visibilityPlaneMask===n.MASK_INSIDE)return h.INSIDE;var t=e.cullingVolume,i=Y(this,e),r=this._tileset,o=r.clippingPlanes;if(a(o)&&o.enabled){var s=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=s!==h.INSIDE,s===h.OUTSIDE)return h.OUTSIDE}return t.computeVisibility(i)},k.prototype.distanceToTile=function(e){return q(this,e).distanceToCamera(e)};var oe=new t;k.prototype.distanceToTileCenter=function(e){var i=q(this,e),r=i.boundingVolume,n=t.subtract(r.center,e.camera.positionWC,oe);return t.dot(e.camera.directionWC,n)},k.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!a(t)||0===t.distanceToCamera(e)};var ae=new m,se=new t,le=new m,ue=new t,ce=new y,de=new g,he=new _;k.prototype.createBoundingVolume=function(e,t,i){if(!a(e))throw new A("boundingVolume must be defined");if(a(e.box))return j(e.box,t,i);if(a(e.region))return Q(e.region,t,this._initialTransform,i);if(a(e.sphere))return K(e.sphere,t,i);throw new A("boundingVolume must contain a sphere, region, or box")},k.prototype.updateTransform=function(e){e=o(e,_.IDENTITY);var t=_.multiply(e,this.transform,he);if(!_.equals(t,this.computedTransform)){_.clone(t,this.computedTransform);var i=this._header,r=this._header.content;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),a(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),a(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}},k.prototype.update=function(e,t){var i=t.commandList.length;$(this,e),Z(this,e,t),J(this,e,t),this._commandsLength=t.commandList.length-i,this.clippingPlanesDirty=!1};var pe=[];return k.prototype.process=function(e,t){var i=t.commandList;t.commandList=pe,this._content.update(e,t),pe.length=0,t.commandList=i},k.prototype.updatePriority=function(){var e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,r=e._maximumPriority,n=Math.pow(10,8),o=Math.pow(10,9),a=Math.pow(10,10),s=te(this._depth,i.depth,r.depth);s=t?1-s:s;var l=!e._skipLevelOfDetail&&this.refine===R.REPLACE,u=l?te(this._priorityHolder._distanceToCamera,i.distance,r.distance):te(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,r.reverseScreenSpaceError),c=ee(u,4,0),d=this._priorityProgressiveResolution?0:n,h=te(this._priorityHolder._foveatedFactor,i.foveatedFactor,r.foveatedFactor),p=ee(h,4,4),f=this.priorityDeferred?o:0,m=e._pass===M.PRELOAD_FLIGHT?0:a;this._priority=s+c+d+p+f+m},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),u(this)},k}),define("Scene/Cesium3DTileContent",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n){this.featurePropertiesDirty=!1}return e(i.prototype,{featuresLength:{get:function(){t.throwInstantiationError()}},pointsLength:{get:function(){t.throwInstantiationError()}},trianglesLength:{get:function(){t.throwInstantiationError()}},geometryByteLength:{get:function(){t.throwInstantiationError()}},texturesByteLength:{get:function(){t.throwInstantiationError()}},batchTableByteLength:{get:function(){t.throwInstantiationError()}},innerContents:{get:function(){t.throwInstantiationError()}},readyPromise:{get:function(){t.throwInstantiationError()}},tileset:{get:function(){t.throwInstantiationError()}},tile:{get:function(){t.throwInstantiationError()}},url:{get:function(){t.throwInstantiationError()}},batchTable:{get:function(){t.throwInstantiationError()}}}),i.prototype.hasProperty=function(e,i){t.throwInstantiationError()},i.prototype.getFeature=function(e){t.throwInstantiationError()},i.prototype.applyDebugSettings=function(e,i){t.throwInstantiationError()},i.prototype.applyStyle=function(e){t.throwInstantiationError()},i.prototype.update=function(e,i){t.throwInstantiationError()},i.prototype.isDestroyed=function(){t.throwInstantiationError()},i.prototype.destroy=function(){t.throwInstantiationError()},i}),define("Scene/Cesium3DTileOptimizations",["../Core/Cartesian3","../Core/Check","./Cesium3DTileOptimizationHint","./TileBoundingRegion","./TileOrientedBoundingBox"],function(e,t,i,r,n){"use strict";var o={},a=new e;return o.checkChildrenWithinParent=function(t){var o=t.children,s=o.length,l=t.boundingVolume;if(l instanceof n||l instanceof r){var u=l._orientedBoundingBox;t._optimChildrenWithinParent=i.USE_OPTIMIZATION;for(var c=0;c<s;++c){var d=o[c],h=d.boundingVolume;if(!(h instanceof n||h instanceof r)){t._optimChildrenWithinParent=i.SKIP_OPTIMIZATION;break}var p=h._orientedBoundingBox,f=e.subtract(p.center,u.center,a),m=e.magnitude(f);e.divideByScalar(f,m,f);if(Math.abs(u.halfAxes[0]*f.x)+Math.abs(u.halfAxes[1]*f.y)+Math.abs(u.halfAxes[2]*f.z)+Math.abs(u.halfAxes[3]*f.x)+Math.abs(u.halfAxes[4]*f.y)+Math.abs(u.halfAxes[5]*f.z)+Math.abs(u.halfAxes[6]*f.x)+Math.abs(u.halfAxes[7]*f.y)+Math.abs(u.halfAxes[8]*f.z)<=Math.abs(p.halfAxes[0]*f.x)+Math.abs(p.halfAxes[1]*f.y)+Math.abs(p.halfAxes[2]*f.z)+Math.abs(p.halfAxes[3]*f.x)+Math.abs(p.halfAxes[4]*f.y)+Math.abs(p.halfAxes[5]*f.z)+Math.abs(p.halfAxes[6]*f.x)+Math.abs(p.halfAxes[7]*f.y)+Math.abs(p.halfAxes[8]*f.z)+m){t._optimChildrenWithinParent=i.SKIP_OPTIMIZATION;break}}}return t._optimChildrenWithinParent===i.USE_OPTIMIZATION},o}),define("Scene/Cesium3DTilePassState",["../Core/Check"],function(e){"use strict";function t(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}return t}),define("Scene/ConditionsExpression",["../Core/clone","../Core/defined","../Core/defineProperties","./Expression"],function(e,t,i,r){"use strict";function n(t,i){this._conditionsExpression=e(t,!0),this._conditions=t.conditions,this._runtimeConditions=void 0,a(this,i)}function o(e,t){this.condition=e,this.expression=t}function a(e,i){var n=[],a=e._conditions;if(t(a)){for(var s=a.length,l=0;l<s;++l){var u=a[l],c=String(u[0]),d=String(u[1]);n.push(new o(new r(c,i),new r(d,i)))}e._runtimeConditions=n}}return i(n.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),n.prototype.evaluate=function(e,i){var r=this._runtimeConditions;if(t(r))for(var n=r.length,o=0;o<n;++o){var a=r[o];if(a.condition.evaluate(e))return a.expression.evaluate(e,i)}},n.prototype.evaluateColor=function(e,i){var r=this._runtimeConditions;if(t(r))for(var n=r.length,o=0;o<n;++o){var a=r[o];if(a.condition.evaluate(e))return a.expression.evaluateColor(e,i)}},n.prototype.getShaderFunction=function(e,i,r,n){var o=this._runtimeConditions;if(t(o)&&0!==o.length){for(var a="",s=o.length,l=0;l<s;++l){var u=o[l],c=u.condition.getShaderExpression(i,r),d=u.expression.getShaderExpression(i,r);a+=" "+(0===l?"if":"else if")+" ("+c+") \n { \n return "+d+"; \n } \n"}return a=n+" "+e+"() \n{ \n"+a+" return "+n+"(1.0); \n} \n"}},n}),define("Scene/Cesium3DTileStyle",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Resource","../ThirdParty/when","./ConditionsExpression","./Expression"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1;var t;if("string"==typeof e||e instanceof o){t=o.createIfNeeded(e).fetchJson(e)}else t=a.resolve(e);var i=this;this._readyPromise=t.then(function(e){return c(i,e),i})}function c(r,n){n=t(e(n,!0),r._style),r._style=n,r.show=n.show,r.color=n.color,r.pointSize=n.pointSize,r.pointOutlineColor=n.pointOutlineColor,r.pointOutlineWidth=n.pointOutlineWidth,r.labelColor=n.labelColor,r.labelOutlineColor=n.labelOutlineColor,r.labelOutlineWidth=n.labelOutlineWidth,r.labelStyle=n.labelStyle,r.font=n.font,r.labelText=n.labelText,r.backgroundColor=n.backgroundColor,r.backgroundPadding=n.backgroundPadding,r.backgroundEnabled=n.backgroundEnabled,r.scaleByDistance=n.scaleByDistance,r.translucencyByDistance=n.translucencyByDistance,r.distanceDisplayCondition=n.distanceDisplayCondition,r.heightOffset=n.heightOffset,r.anchorLineEnabled=n.anchorLineEnabled,r.anchorLineColor=n.anchorLineColor,r.image=n.image,r.disableDepthTestDistance=n.disableDepthTestDistance,r.horizontalOrigin=n.horizontalOrigin,r.verticalOrigin=n.verticalOrigin,r.labelHorizontalOrigin=n.labelHorizontalOrigin,r.labelVerticalOrigin=n.labelVerticalOrigin;var o={};if(i(n.meta)){var a=n.defines,s=t(n.meta,t.EMPTY_OBJECT);for(var u in s)s.hasOwnProperty(u)&&(o[u]=new l(s[u],a))}r._meta=o,r._ready=!0}function d(e,r){var n=t(e._style,t.EMPTY_OBJECT).defines;if(i(r))return"boolean"==typeof r||"number"==typeof r?new l(String(r)):"string"==typeof r?new l(r,n):i(r.conditions)?new s(r,n):r}function h(t){if(i(t))return i(t.expression)?t.expression:i(t.conditionsExpression)?e(t.conditionsExpression,!0):t}return r(u.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){this._show=d(this,e),this._style.show=h(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=d(this,e),this._style.color=h(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){
- this._pointSize=d(this,e),this._style.pointSize=h(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=d(this,e),this._style.pointOutlineColor=h(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=d(this,e),this._style.pointOutlineWidth=h(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=d(this,e),this._style.labelColor=h(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=d(this,e),this._style.labelOutlineColor=h(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=d(this,e),this._style.labelOutlineWidth=h(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=d(this,e),this._style.font=h(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=d(this,e),this._style.labelStyle=h(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=d(this,e),this._style.labelText=h(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=d(this,e),this._style.backgroundColor=h(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=d(this,e),this._style.backgroundPadding=h(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=d(this,e),this._style.backgroundEnabled=h(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=d(this,e),this._style.scaleByDistance=h(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=d(this,e),this._style.translucencyByDistance=h(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=d(this,e),this._style.distanceDisplayCondition=h(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=d(this,e),this._style.heightOffset=h(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=d(this,e),this._style.anchorLineEnabled=h(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=d(this,e),this._style.anchorLineColor=h(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=d(this,e),this._style.image=h(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=d(this,e),this._style.disableDepthTestDistance=h(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=d(this,e),this._style.horizontalOrigin=h(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=d(this,e),this._style.verticalOrigin=h(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=d(this,e),this._style.labelHorizontalOrigin=h(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=d(this,e),this._style.labelVerticalOrigin=h(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}}),u.prototype.getColorShaderFunction=function(e,t,r){return this._colorShaderFunctionReady?(r.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,this._colorShaderFunction=i(this.color)?this.color.getShaderFunction(e,t,r,"vec4"):void 0,this._colorShaderTranslucent=r.translucent,this._colorShaderFunction)},u.prototype.getShowShaderFunction=function(e,t,r){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,this._showShaderFunction=i(this.show)?this.show.getShaderFunction(e,t,r,"bool"):void 0,this._showShaderFunction)},u.prototype.getPointSizeShaderFunction=function(e,t,r){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,this._pointSizeShaderFunction=i(this.pointSize)?this.pointSize.getShaderFunction(e,t,r,"float"):void 0,this._pointSizeShaderFunction)},u}),define("Scene/Cesium3DTileStyleEngine",["../Core/defined","../Core/defineProperties"],function(e,t){"use strict";function i(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}return t(i.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}}}),i.prototype.makeDirty=function(){this._styleDirty=!0},i.prototype.applyStyle=function(t,i){if(t.ready&&(!e(this._style)||this._style.ready)){var r=this._styleDirty;i.passes.render&&(this._styleDirty=!1),r&&++this._lastStyleTime;for(var n=this._lastStyleTime,o=t._statistics,a=r?t._selectedTiles:t._selectedTilesToStyle,s=a.length,l=0;l<s;++l){var u=a[l];if(u.lastStyleTime!==n){var c=u.content;u.lastStyleTime=n,c.applyStyle(this._style),o.numberOfFeaturesStyled+=c.featuresLength,++o.numberOfTilesStyled}}}},i}),define("Scene/Cesium3DTilesetCache",["../Core/defined","../Core/DoublyLinkedList"],function(e,t){"use strict";function i(){this._list=new t,this._sentinel=this._list.add(),this._trimTiles=!1}return i.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},i.prototype.touch=function(t){var i=t.cacheNode;e(i)&&this._list.splice(this._sentinel,i)},i.prototype.add=function(t){e(t.cacheNode)||(t.cacheNode=this._list.add(t))},i.prototype.unloadTile=function(t,i,r){var n=i.cacheNode;e(n)&&(this._list.remove(n),i.cacheNode=void 0,r(t,i))},i.prototype.unloadTiles=function(e,t){var i=this._trimTiles;this._trimTiles=!1;for(var r=this._list,n=1024*e.maximumMemoryUsage*1024,o=this._sentinel,a=r.head;a!==o&&(e.totalMemoryUsageInBytes>n||i);){var s=a.item;a=a.next,this.unloadTile(e,s,t)}},i.prototype.trim=function(){this._trimTiles=!0},i}),define("Scene/Cesium3DTilesetHeatmap",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/JulianDate","../Core/Math"],function(e,t,i,r,n,o){"use strict";function a(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function s(e,t){return"_loadTimestamp"===t?n.toDate(e).getTime():e}function l(e,t){var r=e.tilePropertyName;if(i(r)){var n=s(t[r],r);return i(n)?(e._maximum=Math.max(n,e._maximum),e._minimum=Math.min(n,e._minimum),n):(e.tilePropertyName=void 0,n)}}a.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=s(e,i),this._referenceMaximum[i]=s(t,i)};var u=[new e(.1,.1,.1,1),new e(.153,.278,.878,1),new e(.827,.231,.49,1),new e(.827,.188,.22,1),new e(1,.592,.259,1),new e(1,.843,0,1)];return a.prototype.colorize=function(t,r){var n=this.tilePropertyName;if(i(n)&&t.contentAvailable&&t._selectedFrame===r.frameNumber){var a=l(this,t),s=this._previousMinimum,c=this._previousMaximum;if(s!==Number.MAX_VALUE&&c!==-Number.MAX_VALUE){var d=c-s+o.EPSILON7,h=o.clamp(a-s,0,d),p=h/d,f=u.length-1,m=p*f,_=Math.floor(m),g=Math.ceil(m),v=m-_,y=u[_],C=u[g],b=e.clone(e.WHITE);b.red=o.lerp(y.red,C.red,v),b.green=o.lerp(y.green,C.green,v),b.blue=o.lerp(y.blue,C.blue,v),t._debugColor=b}}},a.prototype.resetMinimumMaximum=function(){var e=this.tilePropertyName;if(i(e)){var t=this._referenceMinimum[e],r=this._referenceMaximum[e],n=i(t)&&i(r);this._previousMinimum=n?t:this._minimum,this._previousMaximum=n?r:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}},a}),define("Scene/Cesium3DTilesetStatistics",["../Core/defined"],function(e){"use strict";function t(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function i(t,r,n,o){var a=r.innerContents,s=r.pointsLength,l=r.trianglesLength,u=r.featuresLength,c=r.geometryByteLength,d=r.texturesByteLength,h=r.batchTableByteLength;if(o?(t.numberOfFeaturesLoaded+=n?-u:u,t.numberOfPointsLoaded+=n?-s:s,t.geometryByteLength+=n?-c:c,t.texturesByteLength+=n?-d:d,t.batchTableByteLength+=n?-h:h):(t.numberOfFeaturesSelected+=n?-u:u,t.numberOfPointsSelected+=n?-s:s,t.numberOfTrianglesSelected+=n?-l:l),e(a))for(var p=a.length,f=0;f<p;++f)i(t,a[f],n,o)}return t.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},t.prototype.incrementSelectionCounts=function(e){i(this,e,!1,!1)},t.prototype.incrementLoadCounts=function(e){i(this,e,!1,!0)},t.prototype.decrementLoadCounts=function(e){i(this,e,!0,!0)},t.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength},t}),define("Scene/Cesium3DTileset",["../Core/ApproximateTerrainHeights","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/DoublyLinkedList","../Core/Ellipsoid","../Core/Event","../Core/JulianDate","../Core/ManagedArray","../Core/Math","../Core/Matrix4","../Core/Resource","../Core/RuntimeError","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Pass","../Renderer/RenderState","../ThirdParty/when","./Axis","./Cesium3DTile","./Cesium3DTileColorBlendMode","./Cesium3DTileContentState","./Cesium3DTileOptimizations","./Cesium3DTilePass","./Cesium3DTilePassState","./Cesium3DTileRefine","./Cesium3DTilesetCache","./Cesium3DTilesetHeatmap","./Cesium3DTilesetMostDetailedTraversal","./Cesium3DTilesetStatistics","./Cesium3DTilesetTraversal","./Cesium3DTileStyleEngine","./ClippingPlaneCollection","./LabelCollection","./PointCloudEyeDomeLighting","./PointCloudShading","./SceneMode","./ShadowMode","./StencilConstants","./TileBoundingRegion","./TileBoundingSphere","./TileOrientedBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q){"use strict";function K(i){i=a(i,a.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._extensionsUsed=void 0,this._gltfUpAxis=void 0,this._cache=new L,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._extras=void 0,this._credits=void 0,this._cullWithChildrenBounds=a(i.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new _,this._maximumScreenSpaceError=a(i.maximumScreenSpaceError,16),this._maximumMemoryUsage=a(i.maximumMemoryUsage,512),this._styleEngine=new z,this._modelMatrix=s(i.modelMatrix)?v.clone(i.modelMatrix):v.clone(v.IDENTITY),this._statistics=new B,this._statisticsLast=new B,this._statisticsPerPass=new Array(M.NUMBER_OF_PASSES);for(var r=0;r<M.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new B;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new N(i.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=a(i.cullRequestsWhileMoving,!0),this.cullRequestsWhileMovingMultiplier=a(i.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=g.clamp(a(i.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=a(i.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._readyPromise=A.defer(),this._classificationType=i.classificationType,this._ellipsoid=a(i.ellipsoid,p.WGS84),this._initialClippingPlanesOriginMatrix=v.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this.preloadWhenHidden=a(i.preloadWhenHidden,!1),this.preloadFlightDestinations=a(i.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=a(i.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=a(i.foveatedScreenSpaceError,!0),this._foveatedConeSize=a(i.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=a(i.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=a(i.foveatedInterpolationCallback,g.lerp),this.foveatedTimeDelay=a(i.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=a(i.shadows,q.ENABLED),this.show=a(i.show,!0),this.colorBlendMode=P.HIGHLIGHT,this.colorBlendAmount=.5,this.pointCloudShading=new H(i.pointCloudShading),this._pointCloudEyeDomeLighting=new G,this.loadProgress=new f,this.allTilesLoaded=new f,this.initialTilesLoaded=new f,this.tileLoad=new f,this.tileUnload=new f,this.tileFailed=new f,this.tileVisible=new f,this.skipLevelOfDetail=a(i.skipLevelOfDetail,!0),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=a(i.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=a(i.skipScreenSpaceErrorFactor,16),this.skipLevels=a(i.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=a(i.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=a(i.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=i.clippingPlanes,this._imageBasedLightingFactor=new t(1,1),t.clone(i.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=i.lightColor,this.luminanceAtZenith=a(i.luminanceAtZenith,.5),this.sphericalHarmonicCoefficients=i.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=i.specularEnvironmentMaps,this.debugFreezeFrame=a(i.debugFreezeFrame,!1),this.debugColorizeTiles=a(i.debugColorizeTiles,!1),this.debugWireframe=a(i.debugWireframe,!1),this.debugShowBoundingVolume=a(i.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=a(i.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=a(i.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=a(i.debugShowGeometricError,!1),this.debugShowRenderingStatistics=a(i.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=a(i.debugShowMemoryUsage,!1),this.debugShowUrl=a(i.debugShowUrl,!1);var n,l=this;A(i.url).then(function(e){var t;return n=y.createIfNeeded(e),l._credits=n.credits,"json"===n.extension?t=n.getBaseUri(!0):n.isDataUri&&(t=""),l._url=n.url,l._basePath=t,K.loadJson(n)}).then(function(t){l._root=l.loadTileset(n,t);var i=s(t.asset.gltfUpAxis)?w.fromName(t.asset.gltfUpAxis):w.Y,r=t.asset;l._asset=r,l._properties=t.properties,l._geometricError=t.geometricError,l._extensionsUsed=t.extensionsUsed,l._gltfUpAxis=i,l._extras=t.extras;var a=r.extras;if(s(a)&&s(a.cesium)&&s(a.cesium.credits)){var u=a.cesium.credits,c=l._credits;s(c)||(c=[],l._credits=c);for(var d=0;d<u.length;++d){var h=u[d];c.push(new o(h.html,h.showOnScreen))}}var p=l._root.createBoundingVolume(t.root.boundingVolume,v.IDENTITY),f=p.boundingSphere.center,m=l._ellipsoid.cartesianToCartographic(f);s(m)&&m.height>e._defaultMinTerrainHeight&&(l._initialClippingPlanesOriginMatrix=b.eastNorthUpToFixedFrame(f)),l._clippingPlanesOriginMatrix=v.clone(l._initialClippingPlanesOriginMatrix),l._readyPromise.resolve(l)}).otherwise(function(e){l._readyPromise.reject(e)})}function Z(e,t){var n,o,a,s,l,u=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof j)n=i.normalize(u.positionWC,ve),o=u.directionWC,a=u.positionCartographic.height,s=d.minimumHeight,l=d.maximumHeight;else{var h=v.inverseTransformation(c.computedTransform,Ce),p=t.mapProjection.ellipsoid,f=d.boundingVolume,m=v.multiplyByPoint(h,f.center,be);if(i.magnitude(m)>p.minimumRadius){var _=r.fromCartesian(m,p,ye);n=i.normalize(u.positionWC,ve),o=u.directionWC,a=u.positionCartographic.height,s=0,l=2*_.height}else{var y=v.multiplyByPoint(h,u.positionWC,Se);if(n=i.UNIT_Z,o=v.multiplyByPointAsVector(h,u.directionWC,Te),o=i.normalize(o,o),a=y.z,d instanceof Q){var C=c._header.boundingVolume.box[11];s=m.z-C,l=m.z+C}else if(d instanceof X){var b=f.radius;s=m.z-b,l=m.z+b}}}var S=e.dynamicScreenSpaceErrorHeightFalloff,T=s+(l-s)*S,E=l,A=g.clamp((a-T)/(E-T),0,1),w=Math.abs(i.dot(o,n)),x=1-w;x*=1-A;var P=e.dynamicScreenSpaceErrorDensity;P*=x,e._dynamicScreenSpaceErrorComputedDensity=P}function J(e,t){if(!t.hasEmptyContent){var i=e._statistics,r=t.contentExpired;if(!t.requestContent())return void++i.numberOfAttemptedRequests;r&&(t.hasTilesetContent?he(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),++i.numberOfPendingRequests,e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(ie(e,t)),t.contentReadyPromise.then(ne(e,t)).otherwise(re(e,t))}}function $(e,t){return e._priority-t._priority}function ee(e,t){for(var i=e._requestedTilesInFlight,r=0,n=i.length,o=0;o<n;++o){var a=i[o],s=t.frameNumber-a._touchedFrame>=1;a._contentState===D.LOADING?s?(a._request.cancel(),++r):r>0&&(i[o-r]=a):++r}i.length-=r}function te(e,t){var i=e._requestedTiles,r=i.length;i.sort($);for(var n=0;n<r;++n)J(e,i[n])}function ie(e,t){return function(){e._processingQueue.push(t),--e._statistics.numberOfPendingRequests,++e._statistics.numberOfTilesProcessing}}function re(e,t){return function(i){e._processingQueue.indexOf(t)>=0?--e._statistics.numberOfTilesProcessing:--e._statistics.numberOfPendingRequests;var r=t._contentResource.url,n=s(i.message)?i.message:i.toString();e.tileFailed.numberOfListeners>0?e.tileFailed.raiseEvent({url:r,message:n}):(console.log("A 3D tile failed to load: "+r),console.log("Error: "+n))}}function ne(e,t){return function(){--e._statistics.numberOfTilesProcessing,t.hasTilesetContent||(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(t)),e.tileLoad.raiseEvent(t)}}function oe(e){for(var t=e._processingQueue,i=t.length,r=0,n=0;n<i;++n){var o=t[n];o._contentState===D.PROCESSING?r>0&&(t[n-r]=o):++r}t.length-=r}function ae(e,t){oe(e);for(var i=e._processingQueue,r=i.length,n=0;n<r;++n)i[n].process(e,t)}function se(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,Ae):Math.round(t).toLocaleString()}function le(e){var t=e.boundingVolume.boundingVolume,r=t.halfAxes,n=t.radius,o=i.clone(t.center,Ee);if(s(r))o.x+=.75*(r[0]+r[3]+r[6]),o.y+=.75*(r[1]+r[4]+r[7]),o.z+=.75*(r[2]+r[5]+r[8]);else if(s(n)){var a=i.normalize(t.center,Ee);a=i.multiplyByScalar(a,.75*n,Ee),o=i.add(a,t.center,Ee)}return o}function ue(e,t,i){var r="",n=0;if(t.debugShowGeometricError&&(r+="\nGeometric error: "+e.geometricError,n++),t.debugShowRenderingStatistics){r+="\nCommands: "+e.commandsLength,n++;e.content.pointsLength>0&&(r+="\nPoints: "+e.content.pointsLength,n++);e.content.trianglesLength>0&&(r+="\nTriangles: "+e.content.trianglesLength,n++),r+="\nFeatures: "+e.content.featuresLength,n++}t.debugShowMemoryUsage&&(r+="\nTexture Memory: "+se(e.content.texturesByteLength),r+="\nGeometry Memory: "+se(e.content.geometryByteLength),n+=2),t.debugShowUrl&&(r+="\nUrl: "+e._header.content.uri,n++);var o={text:r.substring(1),position:i,font:19-n+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function ce(e,i){var r,n,o=e._selectedTiles,a=o.length,l=e._emptyTiles,u=l.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(s(e.debugPickedTile)){var c=s(e.debugPickPosition)?e.debugPickPosition:le(e.debugPickedTile),d=ue(e.debugPickedTile,e,c);d.pixelOffset=new t(15,-15)}}else{for(r=0;r<a;++r)n=o[r],ue(n,e,le(n));for(r=0;r<u;++r)n=l[r],n.hasTilesetContent&&ue(n,e,le(n))}e._tileDebugLabels.update(i)}function de(e,t,i){e._styleEngine.applyStyle(e,t);var r,n,o=e._statistics,a=t.commandList,l=a.length,u=e._selectedTiles,c=u.length,d=e._emptyTiles,h=d.length,p=e.tileVisible,f=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&c>0;e._backfaceCommands.length=0,f&&(s(e._stencilClearCommand)||(e._stencilClearCommand=new S({stencil:0,pass:T.CESIUM_3D_TILE,renderState:E.fromCache({stencilMask:Y.SKIP_LOD_MASK})})),a.push(e._stencilClearCommand));var m=a.length;for(r=0;r<c;++r)n=u[r],i&&p.raiseEvent(n),n.update(e,t),o.incrementSelectionCounts(n.content),++o.selected;for(r=0;r<h;++r)n=d[r],n.update(e,t);var _=a.length-m;if(e._backfaceCommands.trim(),f){var g=e._backfaceCommands.values,v=g.length;for(a.length+=v,r=_-1;r>=0;--r)a[m+v+r]=a[m+r];for(r=0;r<v;++r)a[m+r]=g[r]}_=a.length-l,o.numberOfCommands=_,i&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&_>0&&e._pointCloudEyeDomeLighting.update(t,l,e.pointCloudShading),i&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(s(e._tileDebugLabels)||(e._tileDebugLabels=new U),ce(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}function he(e,t){var i=t,r=we;for(r.push(t);r.length>0;){t=r.pop();for(var n=t.children,o=n.length,a=0;a<o;++a)r.push(n[a]);t!==i&&(fe(e,t),--e._statistics.numberOfTilesTotal)}i.children=[]}function pe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function fe(e,t){e._cache.unloadTile(e,t,pe),t.destroy()}function me(e,t){var i=e._statistics,r=e._statisticsLast,n=i.numberOfPendingRequests,o=i.numberOfTilesProcessing,a=r.numberOfPendingRequests,s=r.numberOfTilesProcessing;B.clone(i,r);var l=n!==a||o!==s;l&&t.afterRender.push(function(){e.loadProgress.raiseEvent(n,o)}),e._tilesLoaded=0===i.numberOfPendingRequests&&0===i.numberOfTilesProcessing&&0===i.numberOfAttemptedRequests,l&&e._tilesLoaded&&(t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){e.initialTilesLoaded.raiseEvent()})))}function _e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function ge(e,t,i,r){if(t.mode===W.MORPHING)return!1;if(!e.ready)return!1;var n=e._statistics;n.clear();var o=r.isRender;++e._updatedVisibilityFrame,_e(e);var a=r.traversal.selectTiles(e,t);if(r.requestTiles&&te(e),de(e,t,o),B.clone(n,i),o){var l=e._credits;if(s(l)&&0!==n.selected)for(var u=l.length,c=0;c<u;++c)t.creditDisplay.addCredit(l[c])}return a}l(K.prototype,{asset:{get:function(){return this._asset}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){V.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return s(this._root)}},readyPromise:{get:function(){return this._readyPromise.promise}},tilesLoaded:{get:function(){return this._tilesLoaded}},url:{get:function(){return this._url}},basePath:{get:function(){return u("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=v.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){var e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return s(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(v.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):v.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){t.clone(e,this._imageBasedLightingFactor)}}}),K.loadJson=function(e){return y.createIfNeeded(e).fetchJson()},K.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},K.prototype.loadTileset=function(e,t,i){var r=t.asset;if(!s(r))throw new C("Tileset must have an asset property.");if("0.0"!==r.version&&"1.0"!==r.version)throw new C("The tileset must be 3D Tiles version 0.0 or 1.0.");var n=this._statistics,o=r.tilesetVersion;s(o)?(this._basePath+="?v="+o,e.setQueryParameters({v:o})):delete e.queryParameters.v;var a=new x(this,e,t.root,i);s(i)&&(i.children.push(a),a._depth=i._depth+1);var l=[];for(l.push(a);l.length>0;){var u=l.pop();++n.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&u.refine===O.ADD;var c=u._header.children;if(s(c))for(var d=c.length,h=0;h<d;++h){var p=c[h],f=new x(this,e,p,u);u.children.push(f),f._depth=u._depth+1,l.push(f)}this._cullWithChildrenBounds&&I.checkChildrenWithinParent(u)}return a};var ve=new i,ye=new r,Ce=new v,be=new i,Se=new i,Te=new i;K.prototype.postPassesUpdate=function(e){this.ready&&(ee(this,e),me(this,e),this._cache.unloadTiles(this,pe))},K.prototype.prePassesUpdate=function(e){if(this.ready){ae(this,e);var t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,s(t)&&t.enabled&&t.update(e),s(this._loadTimestamp)||(this._loadTimestamp=m.clone(e.time)),this._timeSinceLoad=Math.max(1e3*m.secondsDifference(e.time,this._loadTimestamp),0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!s(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive,this.dynamicScreenSpaceError&&Z(this,e),e.newFrame&&this._cache.reset()}};var Ee=new i,Ae={maximumFractionDigits:3},we=[];return K.prototype.trimLoadedTiles=function(){this._cache.trim()},K.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)},K.prototype.updateForPass=function(e,t){var i=t.pass;if(!(i===M.PRELOAD&&(!this.preloadWhenHidden||this.show)||i===M.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||i===M.REQUEST_RENDER_MODE_DEFER_CHECK&&!this.cullRequestsWhileMoving&&this.foveatedTimeDelay<=0)){var r=e.commandList,n=e.camera,o=e.cullingVolume;t.ready=!1;var s=M.getPassOptions(i),l=s.ignoreCommands,u=a(t.commandList,r),c=u.length;e.commandList=u,e.camera=a(t.camera,n),e.cullingVolume=a(t.cullingVolume,o);var d=this._statisticsPerPass[i];(this.show||l)&&(this._pass=i,t.ready=ge(this,e,d,s)),l&&(u.length=c),e.commandList=r,e.camera=n,e.cullingVolume=o}},K.prototype.hasExtension=function(e){return!!s(this._extensionsUsed)&&this._extensionsUsed.indexOf(e)>-1},K.prototype.isDestroyed=function(){return!1},K.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),s(this._root)){var e=we;for(e.push(this._root);e.length>0;){var t=e.pop();t.destroy();for(var i=t.children,r=i.length,n=0;n<r;++n)e.push(i[n])}}return this._root=void 0,c(this)},K}),define("Scene/CircleEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,i,r,n){"use strict";function o(e){e=i(e,1),this._radius=i(e,1)}return r(o.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),o.prototype.emit=function(t){var i=n.randomBetween(0,n.TWO_PI),r=n.randomBetween(0,this._radius),o=r*Math.cos(i),a=r*Math.sin(i);t.position=e.fromElements(o,a,0,t.position),t.velocity=e.clone(e.UNIT_Z,t.velocity)},o}),define("Scene/ConeEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,i,r,n){"use strict";function o(e){this._angle=i(e,a)}var a=n.toRadians(30);return r(o.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}}),o.prototype.emit=function(t){var i=Math.tan(this._angle),r=n.randomBetween(0,n.TWO_PI),o=n.randomBetween(0,i),a=o*Math.cos(r),s=o*Math.sin(r);t.velocity=e.fromElements(a,s,1,t.velocity),e.normalize(t.velocity,t.velocity),t.position=e.clone(e.ZERO,t.position)},o}),
- define("Scene/CreditDisplay",["../Core/AssociativeArray","../Core/buildModuleUrl","../Core/Check","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){for(var i=e.length,n=0;n<i;n++){var o=e[n];if(r.equals(o,t))return!0}return!1}function u(e){var t=e._previousCesiumCredit,i=e._currentCesiumCredit;r.equals(i,t)||(o(t)&&e._cesiumCreditContainer.removeChild(t.element),o(i)&&e._cesiumCreditContainer.appendChild(i.element),e._previousCesiumCredit=i)}function c(e){var t=document.createElement("span");return t.textContent=e,t.className=S,t}function d(e,t){if(o(t)){var i=document.createElement(t);i._creditId=e._creditId,i.appendChild(e),e=i}return e}function h(e,t,i,r){for(var n=e.childNodes,a=-1,s=0;s<t.length;++s){var l=t[s];if(o(l)){if(a=s,o(i)&&(a*=2,s>0)){var u=a-1;if(n.length<=u)e.appendChild(c(i));else{var h=n[u];h.className!==S&&e.replaceChild(c(i),h)}}var p=l.element;if(n.length<=a)e.appendChild(d(p,r));else{var f=n[a];f._creditId!==l._id&&e.replaceChild(d(p,r),f)}}}for(++a;a<n.length;)e.removeChild(n[a])}function p(e){var t=e._lightboxCredits,i=e.viewport.clientWidth,r=e.viewport.clientHeight;i!==e._lastViewportWidth&&(i<v?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px"),e._lastViewportWidth=i),i>=v&&r!==e._lastViewportHeight&&(t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px",e._lastViewportHeight=r)}function f(e,t){var i=e+" {";for(var r in t)t.hasOwnProperty(r)&&(i+=r+": "+t[r]+"; ");return i+=" }\n"}function m(){var e="";e+=f(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),e+=f(".cesium-credit-lightbox",{"background-color":"#303336",color:C,position:"relative","min-height":y+"px",margin:"auto"}),e+=f(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:C}),e+=f(".cesium-credit-lightbox > ul > li a:hover",{color:b}),e+=f(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=f(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=f(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=f(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:C}),e+=f(".cesium-credit-lightbox-close:hover",{color:b}),e+=f(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=f(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=f(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=f(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:C}),e+=f(".cesium-credit-expand-link:hover",{color:b}),e+=f(".cesium-credit-text",{color:C}),e+=f(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});var t=document.head,i=document.createElement("style");i.innerHTML=e,t.insertBefore(i,t.firstChild)}function _(t,i,o){function a(e){u.contains(e.target)||s.hideLightbox()}var s=this;o=n(o,document.body);var l=document.createElement("div");l.className="cesium-credit-lightbox-overlay",o.appendChild(l);var u=document.createElement("div");u.className="cesium-credit-lightbox",l.appendChild(u),l.addEventListener("click",a,!1);var c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",u.appendChild(c);var d=document.createElement("a");d.onclick=this.hideLightbox.bind(this),d.innerHTML="×",d.className="cesium-credit-lightbox-close",u.appendChild(d);var h=document.createElement("ul");u.appendChild(h);var p=document.createElement("div");p.className="cesium-credit-logoContainer",p.style.display="inline",t.appendChild(p);var f=document.createElement("div");f.className="cesium-credit-textContainer",f.style.display="inline",t.appendChild(f);var g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.textContent="Data attribution",t.appendChild(g),m();var v=r.clone(_.cesiumCredit);this._delimiter=n(i," • "),this._screenContainer=f,this._cesiumCreditContainer=p,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=u,this._creditList=h,this._lightbox=l,this._hideLightbox=a,this._expandLink=g,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=v,this._previousCesiumCredit=void 0,this._currentCesiumCredit=v,this._currentFrameCredits={screenCredits:new e,lightboxCredits:new e},this._defaultCredit=void 0,this.viewport=o,this.container=t}function g(){if(!o(T)){var e=t("Assets/Images/ion-credit.png");T=new r('<a href="https://cesium.com/" target="_blank"><img src="'+e+'" title="Cesium ion"/></a>',!0)}return _._cesiumCreditInitialized||(_._cesiumCredit=T,_._cesiumCreditInitialized=!0),T}var v=576,y=100,C="#ffffff",b="#48b",S="cesium-credit-delimiter";_.prototype.addCredit=function(e){if(e._isIon)return o(this._defaultCredit)||(this._defaultCredit=r.clone(g())),void(this._currentCesiumCredit=this._defaultCredit);e.showOnScreen?this._currentFrameCredits.screenCredits.set(e.id,e):this._currentFrameCredits.lightboxCredits.set(e.id,e)},_.prototype.addDefaultCredit=function(e){var t=this._defaultCredits;l(t,e)||t.push(e)},_.prototype.removeDefaultCredit=function(e){var t=this._defaultCredits,i=t.indexOf(e);-1!==i&&t.splice(i,1)},_.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},_.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},_.prototype.update=function(){this._expanded&&p(this)},_.prototype.beginFrame=function(){var e=this._currentFrameCredits,t=e.screenCredits;t.removeAll();for(var i=this._defaultCredits,n=0;n<i.length;++n){var o=i[n];t.set(o.id,o)}e.lightboxCredits.removeAll(),r.equals(_.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=r.clone(_.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},_.prototype.endFrame=function(){var e=this._currentFrameCredits.screenCredits.values;h(this._screenContainer,e,this._delimiter,void 0);var t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",h(this._creditList,t,void 0,"li"),u(this)},_.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),s(this)},_.prototype.isDestroyed=function(){return!1},_._cesiumCredit=void 0,_._cesiumCreditInitialized=!1;var T;return a(_,{cesiumCredit:{get:function(){return g(),_._cesiumCredit},set:function(e){_._cesiumCredit=e,_._cesiumCreditInitialized=!0}}}),_}),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/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/FrustumGeometry","../Core/FrustumOutlineGeometry","../Core/GeometryInstance","../Core/Matrix3","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","../Core/Quaternion","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(e){e=r(e,r.EMPTY_OBJECT),this._camera=e.camera,this._color=r(e.color,t.CYAN),this._updateOnChange=r(e.updateOnChange,!0),this.show=r(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var y=new e,C=new c,b=new m,S=new p,T=new f,E=new d,A=new h,w=new t,x=[1,1e5];return v.prototype.update=function(r){if(this.show){var n,o,a=this._planesPrimitives,h=this._outlinePrimitives;if(this._updateOnChange){for(o=a.length,n=0;n<o;++n)h[n]=h[n]&&h[n].destroy(),a[n]=a[n]&&a[n].destroy();a.length=0,h.length=0}if(0===a.length){var v,P=this._camera,D=P.frustum;v=D instanceof p?S:D instanceof f?T:D instanceof d?E:A,v=D.clone(v);var I=r.frustumSplits,M=I.length-1;M<=0&&(I=x,I[0]=this._camera.frustum.near,I[1]=this._camera.frustum.far,M=1);var R=P.positionWC,O=P.directionWC,L=P.upWC,N=P.rightWC;N=e.negate(N,y);var F=C;c.setColumn(F,0,N,F),c.setColumn(F,1,L,F),c.setColumn(F,2,O,F);var B=m.fromRotationMatrix(F,b);for(a.length=h.length=M,n=0;n<M;++n)v.near=I[n],v.far=I[n+1],a[n]=new g({geometryInstances:new u({geometry:new s({origin:R,orientation:B,frustum:v,_drawNearPlane:0===n}),attributes:{color:i.fromColor(t.fromAlpha(this._color,.1,w))},id:this.id,pickPrimitive:this}),appearance:new _({translucent:!0,flat:!0}),asynchronous:!1}),h[n]=new g({geometryInstances:new u({geometry:new l({origin:R,orientation:B,frustum:v,_drawNearPlane:0===n}),attributes:{color:i.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new _({translucent:!1,flat:!0}),asynchronous:!1})}for(o=a.length,n=0;n<o;++n)h[n].update(r),a[n].update(r)}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return o(this)},v}),define("Scene/DebugModelMatrixPrimitive",["../Core/ArcType","../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,c){"use strict";function d(e){e=r(e,r.EMPTY_OBJECT),this.length=r(e.length,1e7),this._length=void 0,this.width=r(e.width,2),this._width=void 0,this.show=r(e.show,!0),this.modelMatrix=s.clone(r(e.modelMatrix,s.IDENTITY)),this._modelMatrix=new s,this.id=e.id,this._id=void 0,this._primitive=void 0}return d.prototype.update=function(r){if(this.show){if(!n(this._primitive)||!s.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=s.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,n(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var o=new a({geometry:new l({positions:[t.ZERO,t.UNIT_X],width:this.width,vertexFormat:u.VERTEX_FORMAT,colors:[i.RED,i.RED],arcType:e.NONE}),modelMatrix:s.multiplyByUniformScale(this.modelMatrix,this.length,new s),id:this.id,pickPrimitive:this}),d=new a({geometry:new l({positions:[t.ZERO,t.UNIT_Y],width:this.width,vertexFormat:u.VERTEX_FORMAT,colors:[i.GREEN,i.GREEN],arcType:e.NONE}),modelMatrix:s.multiplyByUniformScale(this.modelMatrix,this.length,new s),id:this.id,pickPrimitive:this}),h=new a({geometry:new l({positions:[t.ZERO,t.UNIT_Z],width:this.width,vertexFormat:u.VERTEX_FORMAT,colors:[i.BLUE,i.BLUE],arcType:e.NONE}),modelMatrix:s.multiplyByUniformScale(this.modelMatrix,this.length,new s),id:this.id,pickPrimitive:this});this._primitive=new c({geometryInstances:[o,d,h],appearance:new u,asynchronous:!1})}this._primitive.update(r)}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),o(this)},d}),define("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\nczm_writeLogDepth();\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;\nczm_vertexLogDepth();\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/ShaderSource","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./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,this._useLogDepth=!1}function y(e,i){var r=e.radii,n=i.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,b),a=t.magnitude(o),s=t.normalize(o,S),l=t.normalize(t.cross(t.UNIT_Z,o,T),T),u=t.normalize(t.cross(s,l,E),E),c=Math.sqrt(t.magnitudeSquared(o)-1),d=t.multiplyByScalar(s,1/a,b),h=c/a,p=t.multiplyByScalar(l,h,S),f=t.multiplyByScalar(u,h,T),m=t.add(d,f,E);t.subtract(m,p,m),t.multiplyComponents(r,m,m),t.pack(m,C,0);var _=t.subtract(d,f,E);t.subtract(_,p,_),t.multiplyComponents(r,_,_),t.pack(_,C,3);var g=t.add(d,f,E);t.add(g,p,g),t.multiplyComponents(r,g,g),t.pack(g,C,6);var v=t.subtract(d,f,E);return t.add(v,p,v),t.multiplyComponents(r,v,v),t.pack(v,C,9),C}var C=n.supportsTypedArrays()?new Float32Array(12):[],b=new t,S=new t,T=new t,E=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,b=n.useLogDepth;if(r(this._command)||(this._rs=d.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new u({renderState:this._rs,boundingVolume:new e(t.ZERO,C.maximumRadius),pass:c.OPAQUE,owner:this})),!r(this._sp)||this._useLogDepth!==b){this._useLogDepth=b;var S=new p({sources:[_]}),T=new p({sources:[m]});if(b){T.sources.push("#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),T.defines.push("LOG_DEPTH"),S.defines.push("LOG_DEPTH"),S.defines.push("DISABLE_GL_POSITION_LOG_DEPTH")}this._sp=h.replaceCache({shaderProgram:this._sp,context:v,vertexShaderSource:S,fragmentShaderSource:T,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}var E=y(C,n);if(r(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(E);else{var A=new o({attributes:{position:new a({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:E})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=f.fromGeometry({context:v,geometry:A,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/DerivedCommand",["../Core/defaultValue","../Core/defined","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderSource"],function(e,t,i,r,n){"use strict";function o(){}function a(e,i){var r=e.shaderCache.getDerivedShaderProgram(i,"depthOnly");if(!t(r)){var o,a=i._attributeLocations,s=i.fragmentShaderSource,l=!1,u=s.sources,c=u.length;for(o=0;o<c;++o)if(h.test(u[o])||p.test(u[o])){l=!0;break}var d=!1,f=s.defines;for(c=f.length,o=0;o<c;++o)if("LOG_DEPTH"===f[o]){d=!0;break}var m;l||d?!l&&d&&(m="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeLogDepth(); \n} \n",s=new n({defines:["LOG_DEPTH"],sources:[m]})):(m="void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n",s=new n({sources:[m]})),r=e.shaderCache.createDerivedShaderProgram(i,"depthOnly",{vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return r}function s(e,i){var n=e._depthOnlyRenderStateCache,o=n[i.id];if(!t(o)){var a=r.getState(i);a.depthMask=!0,a.colorMask={red:!1,green:!1,blue:!1,alpha:!1},o=r.fromCache(a),n[i.id]=o}return o}function l(e,i){var r=e.shaderCache.getDerivedShaderProgram(i,"logDepth");if(!t(r)){var o=i._attributeLocations,a=i.vertexShaderSource.clone(),s=i.fragmentShaderSource.clone();a.defines=t(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH"),s.defines=t(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");var l,u,c=!1,d=a.sources,h=d.length;for(l=0;l<h;++l)if(m.test(d[l])){c=!0;break}if(!c){for(l=0;l<h;++l)d[l]=n.replaceMain(d[l],"czm_log_depth_main");u="\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n",d.push(u)}var p=!0;for(c=!1,d=s.sources,h=d.length,l=0;l<h;++l)f.test(d[l])&&(c=!0),_.test(d[l])&&(p=!1);var g="";if(p&&(g+="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),!c){for(l=0;l<h;l++)d[l]=n.replaceMain(d[l],"czm_log_depth_main");g+="\nvoid main() \n{ \n czm_log_depth_main(); \n czm_writeLogDepth(); \n} \n"}d.push(g),r=e.shaderCache.createDerivedShaderProgram(i,"logDepth",{vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:o})}return r}function u(e,i,r){var o=e.shaderCache.getDerivedShaderProgram(i,"pick");if(!t(o)){for(var a=i._attributeLocations,s=i.fragmentShaderSource,l=s.sources,u=l.length,c="void main() \n{ \n czm_non_pick_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = "+r+"; \n} \n",d=new Array(u+1),h=0;h<u;++h)d[h]=n.replaceMain(l[h],"czm_non_pick_main");d[u]=c,s=new n({sources:d,defines:s.defines}),o=e.shaderCache.createDerivedShaderProgram(i,"pick",{vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return o}function c(e,i){var n=e._pickRenderStateCache,o=n[i.id];if(!t(o)){var a=r.getState(i);a.blending.enabled=!1,a.depthMask=!0,o=r.fromCache(a),n[i.id]=o}return o}function d(e,i){var r=e.shaderCache.getDerivedShaderProgram(i,"HDR");if(!t(r)){var n=i._attributeLocations,o=i.vertexShaderSource.clone(),a=i.fragmentShaderSource.clone();o.defines=t(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),a.defines=t(a.defines)?a.defines.slice(0):[],a.defines.push("HDR"),r=e.shaderCache.createDerivedShaderProgram(i,"HDR",{vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n})}return r}var h=/\bgl_FragDepthEXT\b/,p=/\bdiscard\b/;o.createDepthOnlyDerivedCommand=function(e,r,n,o){t(o)||(o={});var l,u;return t(o.depthOnlyCommand)&&(l=o.depthOnlyCommand.shaderProgram,u=o.depthOnlyCommand.renderState),o.depthOnlyCommand=i.shallowClone(r,o.depthOnlyCommand),t(l)&&o.shaderProgramId===r.shaderProgram.id?(o.depthOnlyCommand.shaderProgram=l,o.depthOnlyCommand.renderState=u):(o.depthOnlyCommand.shaderProgram=a(n,r.shaderProgram),o.depthOnlyCommand.renderState=s(e,r.renderState),o.shaderProgramId=r.shaderProgram.id),o};var f=/\s+czm_writeLogDepth\(/,m=/\s+czm_vertexLogDepth\(/,_=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;return o.createLogDepthCommand=function(e,r,n){t(n)||(n={});var o;return t(n.command)&&(o=n.command.shaderProgram),n.command=i.shallowClone(e,n.command),t(o)&&n.shaderProgramId===e.shaderProgram.id?n.command.shaderProgram=o:(n.command.shaderProgram=l(r,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id),n},o.createPickDerivedCommand=function(e,r,n,o){t(o)||(o={});var a,s;return t(o.pickCommand)&&(a=o.pickCommand.shaderProgram,s=o.pickCommand.renderState),o.pickCommand=i.shallowClone(r,o.pickCommand),t(a)&&o.shaderProgramId===r.shaderProgram.id?(o.pickCommand.shaderProgram=a,o.pickCommand.renderState=s):(o.pickCommand.shaderProgram=u(n,r.shaderProgram,r.pickId),o.pickCommand.renderState=c(e,r.renderState),o.shaderProgramId=r.shaderProgram.id),o},o.createHdrCommand=function(e,r,n){t(n)||(n={});var o;return t(n.command)&&(o=n.command.shaderProgram),n.command=i.shallowClone(e,n.command),t(o)&&n.shaderProgramId===e.shaderProgram.id?n.command.shaderProgram=o:(n.command.shaderProgram=d(r,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id),n},o}),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;if(!e(i))return n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0);n._alpha=r.toRadians(i),n._beta=r.toRadians(t.beta),n._gamma=r.toRadians(t.gamma)}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_ray ray = czm_ray(t * direction, direction);\nvec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\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);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + positionCC.w);\n#else\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#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);\nczm_vertexLogDepth();\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,b,S){"use strict";function T(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,b.fromType(b.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._useLogDepth=!1,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),pickOnly:!0});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 E(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:A,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var A={position:0},w="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n";return T.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=E(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 b=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var T=t.useLogDepth,x=this._useLogDepth!==T;this._useLogDepth=T;var P,D,I=this._colorCommand;(_||b||s||x)&&(P=new m({sources:[v]}),D=new m({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&D.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&D.defines.push("WRITE_DEPTH"),this._useLogDepth&&(P.defines.push("LOG_DEPTH","DISABLE_GL_POSITION_LOG_DEPTH"),D.defines.push("LOG_DEPTH"),D.sources.push(w)),this._sp=f.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:P,fragmentShaderSource:D,attributeLocations:A}),I.vertexArray=this._va,I.renderState=this._rs,I.shaderProgram=this._sp,I.uniformMap=r(this._uniforms,this.material._uniforms),I.executeInClosestFrustum=a);var M=t.commandList,R=t.passes;if(R.render&&(I.boundingVolume=this._boundingSphere,I.debugShowBoundingVolume=this.debugShowBoundingVolume,I.modelMatrix=this._computedModelMatrix,I.pass=a?h.TRANSLUCENT:h.OPAQUE,M.push(I)),R.pick){var O=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})),(_||b||!o(this._pickSP)||x)&&(P=new m({sources:[v]}),D=new m({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),
- this.onlySunLighting&&D.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&D.defines.push("WRITE_DEPTH"),this._useLogDepth&&(P.defines.push("LOG_DEPTH"),D.defines.push("LOG_DEPTH"),D.sources.push(w)),this._pickSP=f.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:P,fragmentShaderSource:D,attributeLocations:A}),O.vertexArray=this._va,O.renderState=this._rs,O.shaderProgram=this._pickSP,O.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),O.executeInClosestFrustum=a),O.boundingVolume=this._boundingSphere,O.modelMatrix=this._computedModelMatrix,O.pass=a?h.TRANSLUCENT:h.OPAQUE,M.push(O)}}},T.prototype.isDestroyed=function(){return!1},T.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)},T}),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,this.minimumBrightness=.03}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}else if(h-1>=0&&e>=t[h-1])return--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){if(n.fog.enabled=this.enabled){var l=n.camera,d=l.positionCartographic;if(!t(d)||d.height>8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var h=d.height,f=o(h),m=i.clamp((h-a[f])/(a[f+1]-a[f]),0,1),_=i.lerp(s[f],s[f+1],m),g=1e6*this.density;_=_*(g-g/u*c)*1e-6;var v=e.normalize(l.positionWC,p);_*=1-Math.abs(e.dot(l.directionWC,v)),n.fog.density=_,n.fog.sse=this.screenSpaceErrorFactor,n.fog.minimumBrightness=this.minimumBrightness}},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._preUpdateRemoveListener=this._scene.preUpdate.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(){1===++this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preUpdateRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),define("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i,r){this.context=t,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=r,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,postProcess:!1,offscreen:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.shadowState={shadowsEnabled:!0,lightShadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.sunColor=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=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("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 i,n=[],o=e.documentElement.childNodes,a=0;a<o.length;a++)if(o[a].nodeType===Node.ELEMENT_NODE){i=o[a];break}if(!t(i))throw new r("Unable to find first child of the feature info xml document");for(var s=i.childNodes,l=0;l<s.length;++l){var u=s[l];if(u.nodeType===Node.ELEMENT_NODE){var c={};h(u,c),n.push(p(u,c))}}return n}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)&&!b.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,b=/<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\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[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#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nuniform sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n#if defined(FOG) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) || defined(GROUND_ATMOSPHERE)\nuniform float u_minimumBrightness;\n#endif\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\nvarying float v_aspect;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying float v_distance;\nvarying vec3 v_fogRayleighColor;\nvarying vec3 v_fogMieColor;\n#endif\n#ifdef GROUND_ATMOSPHERE\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split,\nvec4 colorToAlpha)\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(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_COLOR_TO_ALPHA\nvec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\ncolorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\nalpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n#if !defined(APPLY_GAMMA)\nvec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\ncolor = tempColor.rgb;\nalpha = tempColor.a;\n#else\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\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\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\noutAlpha += sign(outAlpha) - 1.0;\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, max(outAlpha, 0.0));\n}\nvec3 colorCorrect(vec3 rgb) {\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(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 = czm_HSBToRGB(hsb);\n#endif\nreturn rgb;\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\nif (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\nv_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n{\ndiscard;\n}\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nfloat clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\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) || defined(HDR)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nfloat cameraDist;\nif (czm_sceneMode == czm_sceneMode2D)\n{\ncameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n}\nelse if (czm_sceneMode == czm_sceneModeColumbusView)\n{\ncameraDist = -czm_view[3].z;\n}\nelse\n{\ncameraDist = length(czm_view[3]);\n}\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nif (czm_sceneMode != czm_sceneMode3D) {\nvec3 radii = czm_ellipsoidRadii;\nfloat maxRadii = max(radii.x, max(radii.y, radii.z));\nfadeOutDist -= maxRadii;\nfadeInDist -= maxRadii;\n}\nfloat fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\nfloat fade = 0.0;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nwaterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\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, fade);\n}\n#endif\n#ifdef APPLY_MATERIAL\nczm_materialInput materialInput;\nmaterialInput.st = v_textureCoordinates.st;\nmaterialInput.normalEC = normalize(v_normalEC);\nmaterialInput.slope = v_slope;\nmaterialInput.height = v_height;\nmaterialInput.aspect = v_aspect;\nczm_material material = czm_getMaterial(materialInput);\ncolor.xyz = mix(color.xyz, material.diffuse, material.alpha);\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);\ndiffuseIntensity = mix(1.0, diffuseIntensity, fade);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nvec4 clippingPlanesEdgeColor = vec4(1.0);\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\nif (clipDistance < clippingPlanesEdgeWidth)\n{\nfinalColor = clippingPlanesEdgeColor;\n}\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nfinalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvec3 fogColor = colorCorrect(v_fogMieColor) + finalColor.rgb * colorCorrect(v_fogRayleighColor);\n#ifndef HDR\nconst float fExposure = 2.0;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\n#endif\n#endif\n#ifdef FOG\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), normalize(czm_sunPositionWC)), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\n#ifdef HDR\nconst float modifier = 0.15;\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor, modifier), finalColor.a);\n#else\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#endif\n#endif\n#ifdef GROUND_ATMOSPHERE\nif (czm_sceneMode != czm_sceneMode3D)\n{\ngl_FragColor = finalColor;\nreturn;\n}\n#if defined(PER_FRAGMENT_GROUND_ATMOSPHERE) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\nfloat mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0));\nvec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\nxy *= czm_viewport.zw * mpp * 0.5;\nvec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nvec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\nellipsoidPosition = (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(ellipsoidPosition, true);\nvec3 groundAtmosphereColor = colorCorrect(atmosColor.mie) + finalColor.rgb * colorCorrect(atmosColor.rayleigh);\n#ifndef HDR\ngroundAtmosphereColor = vec3(1.0) - exp(-fExposure * groundAtmosphereColor);\n#endif\nfadeInDist = u_nightFadeDistance.x;\nfadeOutDist = u_nightFadeDistance.y;\nfloat sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#ifdef HDR\nsunlitAtmosphereIntensity = max(sunlitAtmosphereIntensity * sunlitAtmosphereIntensity, 0.03);\n#endif\ngroundAtmosphereColor = mix(groundAtmosphereColor, fogColor, sunlitAtmosphereIntensity);\n#else\nvec3 groundAtmosphereColor = fogColor;\n#endif\n#ifdef HDR\ngroundAtmosphereColor = czm_saturation(groundAtmosphereColor, 1.6);\n#endif\nfinalColor = vec4(mix(finalColor.rgb, groundAtmosphereColor, fade), finalColor.a);\n#endif\ngl_FragColor = finalColor;\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, float fade)\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 * (1.0 - fade);\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;\n#ifdef HDR\nspecular *= 1.4;\nfloat e = 0.2;\nfloat d = 3.3;\nfloat c = 1.7;\nvec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\nvec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\nreturn vec4(color, 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 APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_aspect;\nvarying float v_height;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying float v_distance;\nvarying vec3 v_fogMieColor;\nvarying vec3 v_fogRayleighColor;\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(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\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) || defined(APPLY_MATERIAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nvec3 normalMC = czm_octDecode(encodedNormal);\nv_normalMC = normalMC;\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION) || defined(HDR)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nAtmosphereColor atmosFogColor = computeGroundAtmosphereFromSpace(position3DWC, false);\nv_fogMieColor = atmosFogColor.mie;\nv_fogRayleighColor = atmosFogColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n#ifdef APPLY_MATERIAL\nfloat northPoleZ = czm_ellipsoidRadii.z;\nvec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\nvec3 ellipsoidNormal = normalize(v_positionMC);\nvec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\nfloat dotProd = abs(dot(ellipsoidNormal, v_normalMC));\nv_slope = acos(dotProd);\nvec3 normalRejected = ellipsoidNormal * dotProd;\nvec3 normalProjected = v_normalMC - normalRejected;\nvec3 aspectVector = normalize(normalProjected);\nv_aspect = acos(dot(aspectVector, vectorEastMC));\nfloat determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\nv_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\nv_height = height;\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, bool useSunLighting)\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 = czm_branchFreeTernary(useSunLighting, dot(czm_sunDirectionWC, v3Pos) / length(v3Pos), 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","./getClippingFunction","./SceneMode"],function(e,t,i,r,n,o){"use strict";function a(e,t,i,r,n){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=r,this.clippingShaderState=n}function s(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function l(e){var t;switch(e){case o.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case o.SCENE2D:case o.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case o.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function u(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}return s.prototype.getShaderProgram=function(t){var o=t.frameState,s=t.surfaceTile,c=t.numberOfDayTextures,d=t.applyBrightness,h=t.applyContrast,p=t.applyHue,f=t.applySaturation,m=t.applyGamma,_=t.applyAlpha,g=t.applySplit,v=t.showReflectiveOcean,y=t.showOceanWaves,C=t.enableLighting,b=t.showGroundAtmosphere,S=t.perFragmentGroundAtmosphere,T=t.hasVertexNormals,E=t.useWebMercatorProjection,A=t.enableFog,w=t.enableClippingPlanes,x=t.clippingPlanes,P=t.clippedByBoundaries,D=t.hasImageryLayerCutout,I=t.colorCorrect,M=t.highlightFillTile,R=t.colorToAlpha,O=0,L="",N=s.renderedMesh,F=N.encoding;F.quantization===i.BITS12&&(O=1,L="QUANTIZATION_BITS12");var B=0,k="";e(s.vertexArray)&&e(s.terrainData)&&!s.terrainData._createdByUpsampling||(B=1,k="DISABLE_GL_POSITION_LOG_DEPTH");var z=0,V="";P&&(z=1,V="TILE_LIMIT_RECTANGLE");var U=0,G="";D&&(U=1,G="APPLY_IMAGERY_CUTOUT");var H=o.mode,W=H|d<<2|h<<3|p<<4|f<<5|m<<6|_<<7|v<<8|y<<9|C<<10|b<<11|S<<12|T<<13|E<<14|A<<15|O<<16|g<<17|w<<18|B<<19|z<<20|U<<21|I<<22|M<<23|R<<24,q=0;e(x)&&x.length>0&&(q=w?x.clippingPlanesState:0);var Y=s.surfaceShader;if(e(Y)&&Y.numberOfDayTextures===c&&Y.flags===W&&Y.material===this.material&&Y.clippingShaderState===q)return Y.shaderProgram;var j=this._shadersByTexturesFlags[c];if(e(j)||(j=this._shadersByTexturesFlags[c]=[]),Y=j[W],!e(Y)||Y.material!==this.material||Y.clippingShaderState!==q){var X=this.baseVertexShaderSource.clone(),Q=this.baseFragmentShaderSource.clone();0!==q&&Q.sources.unshift(n(x,o.context)),X.defines.push(L,k),Q.defines.push("TEXTURE_UNITS "+c,V,G),d&&Q.defines.push("APPLY_BRIGHTNESS"),h&&Q.defines.push("APPLY_CONTRAST"),p&&Q.defines.push("APPLY_HUE"),f&&Q.defines.push("APPLY_SATURATION"),m&&Q.defines.push("APPLY_GAMMA"),_&&Q.defines.push("APPLY_ALPHA"),v&&(Q.defines.push("SHOW_REFLECTIVE_OCEAN"),X.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&Q.defines.push("SHOW_OCEAN_WAVES"),R&&Q.defines.push("APPLY_COLOR_TO_ALPHA"),C&&(T?(X.defines.push("ENABLE_VERTEX_LIGHTING"),Q.defines.push("ENABLE_VERTEX_LIGHTING")):(X.defines.push("ENABLE_DAYNIGHT_SHADING"),Q.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(X.defines.push("GROUND_ATMOSPHERE"),Q.defines.push("GROUND_ATMOSPHERE"),S&&Q.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE")),X.defines.push("INCLUDE_WEB_MERCATOR_Y"),Q.defines.push("INCLUDE_WEB_MERCATOR_Y"),A&&(X.defines.push("FOG"),Q.defines.push("FOG")),g&&Q.defines.push("APPLY_SPLIT"),w&&Q.defines.push("ENABLE_CLIPPING_PLANES"),I&&Q.defines.push("COLOR_CORRECT"),M&&Q.defines.push("HIGHLIGHT_FILL_TILE");var K=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n";D&&(K+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var Z=0;Z<c;++Z)K+=D?" cutoutAndColorResult = u_dayTextureCutoutRectangles["+Z+"];\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n cutoutAndColorResult = sampleAndBlend(\n":" color = sampleAndBlend(\n",K+=" color,\n u_dayTextures["+Z+"],\n u_dayTextureUseWebMercatorT["+Z+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+Z+"],\n u_dayTextureTranslationAndScale["+Z+"],\n "+(_?"u_dayTextureAlpha["+Z+"]":"1.0")+",\n "+(d?"u_dayTextureBrightness["+Z+"]":"0.0")+",\n "+(h?"u_dayTextureContrast["+Z+"]":"0.0")+",\n "+(p?"u_dayTextureHue["+Z+"]":"0.0")+",\n "+(f?"u_dayTextureSaturation["+Z+"]":"0.0")+",\n "+(m?"u_dayTextureOneOverGamma["+Z+"]":"0.0")+",\n "+(g?"u_dayTextureSplit["+Z+"]":"0.0")+",\n "+(R?"u_colorsToAlpha["+Z+"]":"vec4(0.0)")+"\n );\n",D&&(K+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");K+=" return color;\n }",Q.sources.push(K),X.sources.push(l(H)),X.sources.push(u(E));var J=r.fromCache({context:o.context,vertexShaderSource:X,fragmentShaderSource:Q,attributeLocations:F.getAttributeLocations()});Y=j[W]=new a(c,W,this.material,J,q)}return s.surfaceShader=Y,Y.shaderProgram},s.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())}return t(this)},s}),define("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";return e({UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7})}),define("Scene/TileSelectionResult",[],function(){"use strict";var e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(t){return t>=e.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};return e}),define("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";return e({START:0,LOADING:1,DONE:2,FAILED:3})}),define("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";return e({FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6})}),define("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/IndexDatatype","../Core/IntersectionTests","../Core/OrientedBoundingBox","../Core/PixelFormat","../Core/Request","../Core/RequestState","../Core/RequestType","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileBoundingRegion","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x){"use strict";function P(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.orientedBoundingBox=void 0,this.boundingVolumeSourceTile=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new t,this.terrainState=A.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new e,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}function D(e,i,n,o,a,s){if(e.decodePosition(o,a,s),r(i)&&i!==E.SCENE3D){var l=n.ellipsoid,u=l.cartesianToCartographic(s);n.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function I(e,t,i){var n=t.getTileDataAvailable(e.x,e.y,e.level);if(!r(n)&&r(e.parent)){var o=e.parent,a=o.data;r(a)&&r(a.terrainData)&&(n=a.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}!1===n&&(e.data.terrainState=A.FAILED);for(var s=0,l=i.length;s<l;++s){var u=i.get(s);u.show&&u._createTileImagerySkeletons(e,t)}}function M(e,t,i,n,o){var a=e.data,s=e.parent;if(a.terrainState===A.FAILED&&void 0!==s){void 0!==s.data&&void 0!==s.data.terrainData&&!1!==s.data.terrainData.canUpsample||P.processStateMachine(s,t,i,n,!0)}if(a.terrainState===A.FAILED&&R(a,e,t,i,e.x,e.y,e.level),a.terrainState===A.UNLOADED&&O(a,i,e.x,e.y,e.level),a.terrainState===A.RECEIVED&&L(a,t,i,e.x,e.y,e.level),a.terrainState===A.TRANSFORMED&&N(a,t.context,i,e.x,e.y,e.level,o),a.terrainState>=A.RECEIVED&&void 0===a.waterMaskTexture&&i.hasWaterMask){if(void 0!==a.terrainData.waterMask)B(t.context,a);else{var l=a._findAncestorTileWithTerrainData(e);r(l)&&r(l.data.waterMaskTexture)&&(a.waterMaskTexture=l.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,l,a.waterMaskTranslationAndScale))}}}function R(e,t,i,n,o,a,s){var l=t.parent;if(!l)return void(t.state=T.FAILED);var u=l.data.terrainData,c=l.x,d=l.y,h=l.level;if(r(u)){var p=u.upsample(n.tilingScheme,c,d,h,o,a,s);r(p)&&(e.terrainState=A.RECEIVING,x(p,function(t){e.terrainData=t,e.terrainState=A.RECEIVED},function(){e.terrainState=A.FAILED}))}}function O(e,t,i,n,o){function a(t){e.terrainData=t,e.terrainState=A.RECEIVED,e.request=void 0}function s(){if(e.request.state===c.CANCELLED)return e.terrainData=void 0,e.terrainState=A.UNLOADED,void(e.request=void 0);e.terrainState=A.FAILED,e.request=void 0;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=h.handleError(t._requestError,t,t.errorEvent,r,i,n,o,l)}function l(){var l=new u({throttle:!1,throttleByServer:!0,type:d.TERRAIN});e.request=l;var c=t.requestTileGeometry(i,n,o,l);r(c)?(e.terrainState=A.RECEIVING,x(c,a,s)):(e.terrainState=A.UNLOADED,e.request=void 0)}l()}function L(e,i,n,o,a,l){var u=n.tilingScheme,c=e.terrainData,d=c.createMesh(u,o,a,l,i.terrainExaggeration);r(d)&&(e.terrainState=A.TRANSFORMING,x(d,function(i){e.mesh=i,e.orientedBoundingBox=s.clone(i.orientedBoundingBox,e.orientedBoundingBox),e.occludeePointInScaledSpace=t.clone(i.occludeePointInScaledSpace,e.occludeePointInScaledSpace),e.terrainState=A.TRANSFORMED},function(){e.terrainState=A.FAILED}))}function N(e,t,i,r,n,o,a){e.vertexArray=P._createVertexArrayForMesh(t,e.mesh),e.terrainState=A.READY,e.fill=e.fill&&e.fill.destroy(a)}function F(e){var t=e.cache.tile_waterMaskData;if(!r(t)){var i=g.create({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:m.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;t={allWaterTexture:i,sampler:new _({wrapS:C.CLAMP_TO_EDGE,wrapT:C.CLAMP_TO_EDGE,minificationFilter:y.LINEAR,magnificationFilter:v.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function B(e,t){var r,n=t.terrainData.waterMask,o=F(e),a=n.length;if(1===a){if(0===n[0])return;r=o.allWaterTexture}else{var s=Math.sqrt(a);r=g.create({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:m.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:o.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}n(P.prototype,{eligibleForUnloading:{get:function(){for(var e=this.terrainState,t=e===A.RECEIVING||e===A.TRANSFORMING,i=!t,n=this.imagery,o=0,a=n.length;i&&o<a;++o){var s=n[o];i=!r(s.loadingImagery)||s.loadingImagery.state!==S.TRANSITIONING}return i}},renderedMesh:{get:function(){return r(this.vertexArray)?this.mesh:r(this.fill)?this.fill.mesh:void 0}}});var k=new t,z=new t,V=new t,U=new t;return P.prototype.pick=function(e,i,n,o,s){var l=this.renderedMesh;if(r(l))for(var u=l.vertices,c=l.indices,d=l.encoding,h=c.length,p=0;p<h;p+=3){var f=c[p],m=c[p+1],_=c[p+2],g=D(d,i,n,u,f,k),v=D(d,i,n,u,m,z),y=D(d,i,n,u,_,V),C=a.rayTriangle(e,g,v,y,o,U);if(r(C))return t.clone(C,s)}},P.prototype.freeResources=function(){r(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=A.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();for(var e=this.imagery,t=0,i=e.length;t<i;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},P.prototype.freeVertexArray=function(){P._freeVertexArray(this.vertexArray),this.vertexArray=void 0,P._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},P.initialize=function(e,t,i){var n=e.data;r(n)||(n=e.data=new P),e.state===T.START&&(I(e,t,i),e.state=T.LOADING)},P.processStateMachine=function(e,t,i,n,o,a){P.initialize(e,i,n);var s=e.data;if(e.state===T.LOADING&&M(e,t,i,n,o),!a){var l=e.renderable;e.renderable=r(s.vertexArray);var u=s.terrainState===A.READY;e.upsampledFromParent=r(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();var c=s.processImagery(e,i,t);if(u&&c){var d=e._loadedCallbacks,h={};for(var p in d)d.hasOwnProperty(p)&&(d[p](e)||(h[p]=d[p]));e._loadedCallbacks=h,e.state=T.DONE}l&&(e.renderable=!0)}},P.prototype.processImagery=function(e,t,i,n){var o,a,s=e.data,l=e.upsampledFromParent,u=e.renderable,c=!0,d=s.imagery;for(o=0,a=d.length;o<a;++o){var h=d[o];if(r(h.loadingImagery)){if(h.loadingImagery.state===S.PLACEHOLDER){var p=h.loadingImagery.imageryLayer;if(p.imageryProvider.ready){h.freeResources(),d.splice(o,1),p._createTileImagerySkeletons(e,t,o),--o,a=d.length;continue}l=!1}var f=h.processStateMachine(e,i,n);c=c&&f,u=u&&(f||r(h.readyImagery)),l=l&&r(h.loadingImagery)&&(h.loadingImagery.state===S.FAILED||h.loadingImagery.state===S.INVALID)}else l=!1}return e.upsampledFromParent=l,e.renderable=u,c},P._createVertexArrayForMesh=function(e,t){var i=t.vertices,n=p.createVertexBuffer({context:e,typedArray:i,usage:f.STATIC_DRAW}),a=t.encoding.getAttributes(n),s=t.indices.indexBuffers||{},l=s[e.id];if(!r(l)||l.isDestroyed()){var u=t.indices;l=p.createIndexBuffer({context:e,typedArray:u,usage:f.STATIC_DRAW,indexDatatype:o.fromSizeInBytes(u.BYTES_PER_ELEMENT)}),l.vertexArrayDestroyable=!1,l.referenceCount=1,s[e.id]=l,t.indices.indexBuffers=s}else++l.referenceCount;return new b({context:e,attributes:a,indexBuffer:l})},P._freeVertexArray=function(e){if(r(e)){var t=e.indexBuffer;e.destroy(),r(t)&&!t.isDestroyed()&&r(t.referenceCount)&&0===--t.referenceCount&&t.destroy()}},P.prototype._findAncestorTileWithTerrainData=function(e){for(var t=e.parent;r(t)&&(!r(t.data)||!r(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},P.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/r.width,l=a/r.height;return i.x=s*(n.west-r.west)/o,i.y=l*(n.south-r.south)/a,i.z=s,i.w=l,i},P}),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,this.request=void 0,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){a=t.imageryProvider.tilingScheme.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,r){this.state!==i.UNLOADED||r||(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var n=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||n)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),define("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";return e({LEFT:-1,NONE:0,RIGHT:1})}),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,n){var o=this.loadingImagery,a=o.imageryLayer;if(o.processStateMachine(r,!this.useWebMercatorT,n),o.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=a._calculateTextureTranslationAndScale(i,this),!0;for(var s,l=o.parent;e(l)&&(l.state!==t.READY||!this.useWebMercatorT&&!e(l.texture));)l.state!==t.FAILED&&l.state!==t.INVALID&&(s=s||l),l=l.parent;return this.readyImagery!==l&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=l,e(l)&&(l.addReference(),this.textureTranslationAndScale=a._calculateTextureTranslationAndScale(i,this))),(o.state===t.FAILED||o.state===t.INVALID)&&(!e(s)||(s.processStateMachine(r,!this.useWebMercatorT,n),!1))},i}),define("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/Request","../Core/RequestState","../Core/RequestType","../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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V){"use strict";function U(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,U.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,U.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,U.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,U.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,U.DEFAULT_GAMMA)),this.splitDirection=i(t.splitDirection,i(e.defaultSplit,U.DEFAULT_SPLIT)),this.minificationFilter=i(t.minificationFilter,i(e.defaultMinificationFilter,U.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=i(t.magnificationFilter,i(e.defaultMagnificationFilter,U.DEFAULT_MAGNIFICATION_FILTER)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,p.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new V(B.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=i(t.colorToAlphaThreshold,U.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}function G(e,t,i){return e+":"+t+":"+i}function H(e,t,i){return JSON.stringify([e,t,i])}function W(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,l=0;l<64;++l){var u=l/63;a[s++]=0,a[s++]=u,a[s++]=1,a[s++]=u}var h={position:0,webMercatorT:1},p=g.getRegularGridIndices(2,64),f=b.createIndexBuffer({context:t,typedArray:p,usage:S.STATIC_DRAW,indexDatatype:c.UNSIGNED_SHORT});o.vertexArray=new O({context:t,attributes:[{index:h.position,vertexBuffer:b.createVertexBuffer({context:t,typedArray:a,usage:S.STATIC_DRAW}),componentsPerAttribute:2},{index:h.webMercatorT,vertexBuffer:b.createVertexBuffer({context:t,sizeInBytes:512,usage:S.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var m=new P({sources:[N]});o.shaderProgram=x.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:L,attributeLocations:h}),o.sampler=new w({wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,minificationFilter:M.LINEAR,magnificationFilter:I.LINEAR})}i.sampler=o.sampler;var _=i.width,v=i.height;K.textureDimensions.x=_,K.textureDimensions.y=v,K.texture=i;var y=Math.sin(n.south),C=.5*Math.log((1+y)/(1-y));y=Math.sin(n.north);var T=.5*Math.log((1+y)/(1-y)),E=1/(T-C),F=new D({context:t,width:_,height:v,pixelFormat:i.pixelFormat,
- pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});d.isPowerOfTwo(_)&&d.isPowerOfTwo(v)&&F.generateMipmap(A.NICEST);for(var B=n.south,k=n.north,z=Z,V=0,U=0;U<64;++U){var G=U/63,H=d.lerp(B,k,G);y=Math.sin(H);var W=.5*Math.log((1+y)/(1-y)),q=(W-C)*E;z[V++]=q,z[V++]=q}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(z),e.shaderProgram=o.shaderProgram,e.outputTexture=F,e.uniformMap=K,e.vertexArray=o.vertexArray}function q(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof l?1:Math.cos(i),s=n.rectangle,u=o.maximumRadius*s.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,d=Math.log(c)/Math.log(2);return 0|Math.round(d)}n(U.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),U.DEFAULT_BRIGHTNESS=1,U.DEFAULT_CONTRAST=1,U.DEFAULT_HUE=0,U.DEFAULT_SATURATION=1,U.DEFAULT_GAMMA=1,U.DEFAULT_SPLIT=k.NONE,U.DEFAULT_MINIFICATION_FILTER=M.LINEAR,U.DEFAULT_MAGNIFICATION_FILTER=I.LINEAR,U.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,U.prototype.isBaseLayer=function(){return this._isBaseLayer},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return o(this)};var Y=new p,j=new p,X=new p,Q=new p;U.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return p.intersection(e.rectangle,t)})},U.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.projection instanceof y&&e.rectangle.north<y.MaximumLatitude&&e.rectangle.south>-y.MaximumLatitude,l=p.intersection(a.rectangle,this._rectangle,Y),u=p.intersection(e.rectangle,l,j);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,d=e.rectangle;u=j,d.south>=c.north?u.north=u.south=c.north:d.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(d.south,c.south),u.north=Math.min(d.north,c.north)),d.west>=c.east?u.west=u.east=c.east:d.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(d.west,c.west),u.east=Math.min(d.east,c.east))}var h=0;u.south>0?h=u.south:u.north<0&&(h=u.north);var f=1*i.getLevelMaximumGeometricError(e.level),m=q(this,f,h);m=Math.max(0,m);var _=a.maximumLevel;if(m>_&&(m=_),r(a.minimumLevel)){var g=a.minimumLevel;m<g&&(m=g)}var v=a.tilingScheme,C=v.positionToTileXY(p.northwest(u),m),b=v.positionToTileXY(p.southeast(u),m),S=e.rectangle.width/512,T=e.rectangle.height/512,E=v.tileXYToRectangle(C.x,C.y,m);Math.abs(E.south-e.rectangle.north)<T&&C.y<b.y&&++C.y,Math.abs(E.east-e.rectangle.west)<S&&C.x<b.x&&++C.x;var A=v.tileXYToRectangle(b.x,b.y,m);Math.abs(A.north-e.rectangle.south)<T&&b.y>C.y&&--b.y,Math.abs(A.west-e.rectangle.east)<S&&b.x>C.x&&--b.x;var w,x=p.clone(e.rectangle,Q),P=v.tileXYToRectangle(C.x,C.y,m),D=p.intersection(P,l,X);s?(v.rectangleToNativeRectangle(x,x),v.rectangleToNativeRectangle(P,P),v.rectangleToNativeRectangle(D,D),v.rectangleToNativeRectangle(l,l),w=v.tileXYToNativeRectangle.bind(v),S=x.width/512,T=x.height/512):w=v.tileXYToRectangle.bind(v);var I,M,R=0,O=1;!this.isBaseLayer()&&Math.abs(D.west-x.west)>=S&&(R=Math.min(1,(D.west-x.west)/x.width)),!this.isBaseLayer()&&Math.abs(D.north-x.north)>=T&&(O=Math.max(0,(D.north-x.south)/x.height));for(var L=O,N=C.x;N<=b.x;N++)if(I=R,P=w(N,C.y,m),D=p.simpleIntersection(P,l,X),r(D)){R=Math.min(1,(D.east-x.west)/x.width),N===b.x&&(this.isBaseLayer()||Math.abs(D.east-x.east)<S)&&(R=1),O=L;for(var F=C.y;F<=b.y;F++)if(M=O,P=w(N,F,m),D=p.simpleIntersection(P,l,X),r(D)){O=Math.max(0,(D.south-x.south)/x.height),F===b.y&&(this.isBaseLayer()||Math.abs(D.south-x.south)<T)&&(O=0);var B=new t(I,O,R,M),k=this.getImageryFromCache(N,F,m);o.imagery.splice(n,0,new V(k,B,s)),++n}}return!0},U.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,Y),n=o.rectangleToNativeRectangle(n,Q)}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)},U.prototype._requestImagery=function(e){function t(t){if(!r(t))return i();e.image=t,e.state=z.RECEIVED,e.request=void 0,v.handleSuccess(a._requestImageError)}function i(t){if(e.request.state===m.CANCELLED)return e.state=z.UNLOADED,void(e.request=void 0);e.state=z.FAILED,e.request=void 0;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=v.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){var n=new f({throttle:!1,throttleByServer:!0,type:_.IMAGERY});e.request=n,e.state=z.TRANSITIONING;var a=o.requestImage(e.x,e.y,e.level,n);if(!r(a))return e.state=z.UNLOADED,void(e.request=void 0);r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),F(a,t,i)}var o=this._imageryProvider,a=this;n()},U.prototype._createTextureWebGL=function(e,t){var i=new w({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),n=t.image;return new D(r(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView},sampler:i}:{context:e,source:n,pixelFormat:this._imageryProvider.hasAlphaChannel?h.RGBA:h.RGB,sampler:i})},U.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=z.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=z.INVALID)}}var a=this._createTextureWebGL(e,t);i.tilingScheme.projection instanceof y?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=z.TEXTURE_LOADED},U.prototype._finalizeReprojectTexture=function(e,t){var n=this.minificationFilter,o=this.magnificationFilter;if(n===M.LINEAR&&o===I.LINEAR&&!h.isCompressedFormat(t.pixelFormat)&&d.isPowerOfTwo(t.width)&&d.isPowerOfTwo(t.height)){n=M.LINEAR_MIPMAP_LINEAR;var a=E.maximumTextureFilterAnisotropy,s=Math.min(a,i(this._maximumAnisotropy,a)),l=G(n,o,s),u=e.cache.imageryLayerMipmapSamplers;r(u)||(u={},e.cache.imageryLayerMipmapSamplers=u);var c=u[l];r(c)||(c=u[l]=new w({wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:o,maximumAnisotropy:s})),t.generateMipmap(A.NICEST),t.sampler=c}else{var p=G(n,o,0),f=e.cache.imageryLayerNonMipmapSamplers;r(f)||(f={},e.cache.imageryLayerNonMipmapSamplers=f);var m=f[p];r(m)||(m=f[p]=new w({wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:o})),t.sampler=m}},U.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if((r=i(r,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof l)&&o.width/n.width>1e-5){var s=this;t.addReference();var u=new T({persists:!0,owner:this,preExecute:function(e){W(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,s._finalizeReprojectTexture(a,e),t.state=z.READY,t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),this._finalizeReprojectTexture(a,n),t.state=z.READY},U.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},U.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},U.prototype.getImageryFromCache=function(e,t,i,n){var o=H(e,t,i),a=this._imageryCache[o];return r(a)||(a=new B(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},U.prototype.removeImageryFromCache=function(e){var t=H(e.x,e.y,e.level);delete this._imageryCache[t]};var K={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},Z=s.supportsTypedArrays()?new Float32Array(128):void 0;return U}),define("Scene/TerrainFillMesh",["../Core/AttributeCompression","../Core/binarySearch","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/HeightmapTerrainData","../Core/Math","../Core/DeveloperError","../Core/OrientedBoundingBox","../Core/Queue","../Core/Rectangle","../Core/TileEdge","../Core/TerrainEncoding","../Core/TerrainMesh","../Core/WebMercatorProjection","./GlobeSurfaceTile","./TileSelectionResult"],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.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new o}function b(e,t,i,r,n,o,a,l,u){if(void 0!==r){for(var d=r;d&&(d._lastSelectionResultFrame!==n||y.wasKicked(d._lastSelectionResult)||y.originalResult(d._lastSelectionResult)===y.CULLED);){if(a)return;var h=d.parent;if(o>=f.NORTHWEST&&void 0!==h)switch(o){case f.NORTHWEST:d=d===h.northwestChild?h:void 0;break;case f.NORTHEAST:d=d===h.northeastChild?h:void 0;break;case f.SOUTHWEST:d=d===h.southwestChild?h:void 0;break;case f.SOUTHEAST:d=d===h.southeastChild?h:void 0}else d=h}if(void 0!==d){if(d._lastSelectionResult===y.RENDERED){if(s(d.data.vertexArray))return;return void S(e,t,i,d,o,n,l,u)}if(y.originalResult(r._lastSelectionResult)!==y.CULLED)switch(o){case f.WEST:b(e,t,i,r.northwestChild,n,o,!0,l,u),b(e,t,i,r.southwestChild,n,o,!0,l,u);break;case f.EAST:b(e,t,i,r.southeastChild,n,o,!0,l,u),b(e,t,i,r.northeastChild,n,o,!0,l,u);break;case f.SOUTH:b(e,t,i,r.southwestChild,n,o,!0,l,u),b(e,t,i,r.southeastChild,n,o,!0,l,u);break;case f.NORTH:b(e,t,i,r.northeastChild,n,o,!0,l,u),b(e,t,i,r.northwestChild,n,o,!0,l,u);break;case f.NORTHWEST:b(e,t,i,r.northwestChild,n,o,!0,l,u);break;case f.NORTHEAST:b(e,t,i,r.northeastChild,n,o,!0,l,u);break;case f.SOUTHWEST:b(e,t,i,r.southwestChild,n,o,!0,l,u);break;case f.SOUTHEAST:b(e,t,i,r.southeastChild,n,o,!0,l,u);break;default:throw new c("Invalid edge")}}}}function S(e,t,i,r,n,o,a,s){var l=r.data;if(void 0===l.fill)l.fill=new C(r);else if(l.fill.visitedFrame===o)return;l.fill.enqueuedFrame!==o&&(l.fill.enqueuedFrame=o,l.fill.changedThisFrame=!1,a.enqueue(r)),T(e,t,i,r,n,s)}function T(e,t,i,r,n,o){var a,l=r.data.fill,c=i.data.fill;s(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(w(e,t,i,o),c.changedThisFrame=!1),a=i.data.fill.mesh):a=i.data.mesh;var d,h;switch(n){case f.WEST:d=l.westMeshes,h=l.westTiles;break;case f.SOUTH:d=l.southMeshes,h=l.southTiles;break;case f.EAST:d=l.eastMeshes,h=l.eastTiles;break;case f.NORTH:d=l.northMeshes,h=l.northTiles;break;case f.NORTHWEST:return l.changedThisFrame=l.changedThisFrame||l.northwestMesh!==a,l.northwestMesh=a,void(l.northwestTile=i);case f.NORTHEAST:return l.changedThisFrame=l.changedThisFrame||l.northeastMesh!==a,l.northeastMesh=a,void(l.northeastTile=i);case f.SOUTHWEST:return l.changedThisFrame=l.changedThisFrame||l.southwestMesh!==a,l.southwestMesh=a,void(l.southwestTile=i);case f.SOUTHEAST:return l.changedThisFrame=l.changedThisFrame||l.southeastMesh!==a,l.southeastMesh=a,void(l.southeastTile=i)}if(i.level<=r.level)return l.changedThisFrame=l.changedThisFrame||d[0]!==a||1!==d.length,d[0]=a,h[0]=i,d.length=1,void(h.length=1);var p,m,_,g,v,y=i.rectangle,C=r.rectangle;switch(n){case f.WEST:for(v=(C.north-C.south)*u.EPSILON5,p=0;p<h.length&&(_=h[p],g=_.rectangle,!u.greaterThan(y.north,g.south,v));++p);for(m=p;m<h.length&&(_=h[m],g=_.rectangle,!u.greaterThanOrEquals(y.south,g.north,v));++m);break;case f.SOUTH:for(v=(C.east-C.west)*u.EPSILON5,p=0;p<h.length&&(_=h[p],g=_.rectangle,!u.lessThan(y.west,g.east,v));++p);for(m=p;m<h.length&&(_=h[m],g=_.rectangle,!u.lessThanOrEquals(y.east,g.west,v));++m);break;case f.EAST:for(v=(C.north-C.south)*u.EPSILON5,p=0;p<h.length&&(_=h[p],g=_.rectangle,!u.lessThan(y.south,g.north,v));++p);for(m=p;m<h.length&&(_=h[m],g=_.rectangle,!u.lessThanOrEquals(y.north,g.south,v));++m);break;case f.NORTH:for(v=(C.east-C.west)*u.EPSILON5,p=0;p<h.length&&(_=h[p],g=_.rectangle,!u.greaterThan(y.east,g.west,v));++p);for(m=p;m<h.length&&(_=h[m],g=_.rectangle,!u.greaterThanOrEquals(y.west,g.east,v));++m);}m-p==1?(l.changedThisFrame=l.changedThisFrame||d[p]!==a,d[p]=a,h[p]=i):(l.changedThisFrame=!0,d.splice(p,m-p,a),h.splice(p,m-p,i))}function E(){this.height=0,this.encodedNormal=new r}function A(e,t,i,r,n,o,a,l,u){if(s(n))return n;var c;if(s(o)&&s(a))c=.5*(o.height+a.height);else if(s(o))c=o.height;else if(s(a))c=a.height;else if(s(l))c=l.height;else{var d=e.tile.data,h=d.tileBoundingRegion,p=0,f=0;s(h)&&(p=h.minimumHeight,f=h.maximumHeight),c=.5*(p+f)}return M(e,t,i,r,c,u),u}function w(t,n,o,a){v.initialize(o,t.terrainProvider,t._imageryLayers);var u=o.data,c=u.fill,h=o.rectangle,p=o.tilingScheme.ellipsoid,y=R(c,p,0,1,c.northwestTile,c.northwestMesh,c.northTiles,c.northMeshes,c.westTiles,c.westMeshes,Z),C=R(c,p,0,0,c.southwestTile,c.southwestMesh,c.westTiles,c.westMeshes,c.southTiles,c.southMeshes,Q),b=R(c,p,1,0,c.southeastTile,c.southeastMesh,c.southTiles,c.southMeshes,c.eastTiles,c.eastMeshes,K),S=R(c,p,1,1,c.northeastTile,c.northeastMesh,c.eastTiles,c.eastMeshes,c.northTiles,c.northMeshes,J);y=A(c,p,0,1,y,C,S,b,Z),C=A(c,p,0,0,C,y,b,S,Q),b=A(c,p,1,1,b,C,S,y,K),S=A(c,p,1,1,S,b,y,C,J);var T,E,w=C.height,P=b.height,D=y.height,I=S.height,M=Math.min(w,P,D,I),O=Math.max(w,P,D,I),N=.5*(M+O),F=t.getLevelMaximumGeometricError(o.level),B=p.maximumRadius-F,k=4*Math.acos(B/p.maximumRadius);if(k*=1.5,h.width>k&&O-M<=F){var V=new l({width:9,height:9,buffer:$,structure:{heightOffset:O}});c.mesh=V._createMeshSync(o.tilingScheme,o.x,o.y,o.level,1)}else{var H=new m(void 0,void 0,void 0,void 0,!0,!0),Y=G;Y.longitude=.5*(h.east+h.west),Y.latitude=.5*(h.north+h.south),Y.height=N,H.center=p.cartographicToCartesian(Y,H.center);var ee,te=5;for(ee=c.westMeshes,T=0,E=ee.length;T<E;++T)te+=ee[T].eastIndicesNorthToSouth.length;for(ee=c.southMeshes,T=0,E=ee.length;T<E;++T)te+=ee[T].northIndicesWestToEast.length;for(ee=c.eastMeshes,T=0,E=ee.length;T<E;++T)te+=ee[T].westIndicesSouthToNorth.length;for(ee=c.northMeshes,T=0,E=ee.length;T<E;++T)te+=ee[T].southIndicesEastToWest.length;var ie=X;ie.minimumHeight=M,ie.maximumHeight=O;var re=H.getStride(),ne=new Float32Array(te*re),oe=0,ae=oe;oe=x(p,h,H,ne,oe,0,1,y.height,y.encodedNormal,1,ie),oe=L(c,p,H,ne,oe,c.westTiles,c.westMeshes,f.EAST,ie);var se=oe;oe=x(p,h,H,ne,oe,0,0,C.height,C.encodedNormal,0,ie),oe=L(c,p,H,ne,oe,c.southTiles,c.southMeshes,f.NORTH,ie);var le=oe;oe=x(p,h,H,ne,oe,1,0,b.height,b.encodedNormal,0,ie),oe=L(c,p,H,ne,oe,c.eastTiles,c.eastMeshes,f.WEST,ie);var ue=oe;oe=x(p,h,H,ne,oe,1,1,S.height,S.encodedNormal,1,ie),oe=L(c,p,H,ne,oe,c.northTiles,c.northMeshes,f.SOUTH,ie),M=ie.minimumHeight,O=ie.maximumHeight;var ce=d.fromRectangle(h,M,O,o.tilingScheme.ellipsoid),de=g.geodeticLatitudeToMercatorAngle(h.south),he=1/(g.geodeticLatitudeToMercatorAngle(h.north)-de),pe=(g.geodeticLatitudeToMercatorAngle(Y.latitude)-de)*he;p.geodeticSurfaceNormalCartographic(U,W);var fe=e.octEncode(W,q),me=oe;H.encode(ne,oe*re,ce.center,r.fromElements(.5,.5,j),N,fe,pe),++oe;var _e,ge=oe,ve=ge<256?1:2,ye=3*(ge-1),Ce=ye*ve,be=(ne.length-ge*re)*Float32Array.BYTES_PER_ELEMENT;if(be>=Ce){var Se=ge*re*Float32Array.BYTES_PER_ELEMENT;_e=ge<256?new Uint8Array(ne.buffer,Se,ye):new Uint16Array(ne.buffer,Se,ye)}else _e=ge<256?new Uint8Array(ye):new Uint16Array(ye);ne=new Float32Array(ne.buffer,0,ge*re);var Te=0;for(T=0;T<ge-2;++T)_e[Te++]=me,_e[Te++]=T,_e[Te++]=T+1;_e[Te++]=me,_e[Te++]=T,_e[Te++]=0;var Ee=[];for(T=se;T>=ae;--T)Ee.push(T);var Ae=[];for(T=le;T>=se;--T)Ae.push(T);var we=[];for(T=ue;T>=le;--T)we.push(T);var xe=[];for(xe.push(0),T=me-1;T>=ue;--T)xe.push(T);c.mesh=new _(H.center,ne,_e,M,O,i.fromOrientedBoundingBox(ce),z(t,ce.center,h,O),H.getStride(),ce,H,n.terrainExaggeration,Ee,Ae,we,xe)}var Pe=n.context;s(c.vertexArray)&&(s(a)?a.push(c.vertexArray):v._freeVertexArray(c.vertexArray)),c.vertexArray=v._createVertexArrayForMesh(Pe,c.mesh),u.processImagery(o,t.terrainProvider,n,!0);var De=c.waterMaskTexture;if(c.waterMaskTexture=void 0,t.terrainProvider.hasWaterMask){var Ie=u._findAncestorTileWithTerrainData(o);s(Ie)&&s(Ie.data.waterMaskTexture)&&(c.waterMaskTexture=Ie.data.waterMaskTexture,++c.waterMaskTexture.referenceCount,u._computeWaterMaskTranslationAndScale(o,Ie,c.waterMaskTranslationAndScale))}s(De)&&0===--De.referenceCount&&De.destroy()}function x(e,t,i,r,n,o,a,s,l,c,d){var h=U;h.longitude=u.lerp(t.west,t.east,o),h.latitude=u.lerp(t.south,t.north,a),h.height=s;var p=e.cartographicToCartesian(h,H),f=Y;return f.x=o,f.y=a,i.encode(r,n*i.getStride(),p,f,s,l,c),d.minimumHeight=Math.min(d.minimumHeight,s),d.maximumHeight=Math.max(d.maximumHeight,s),n+1}function P(e,t,i,r){var n=e.rectangle,o=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(n=p.clone(e.rectangle,ee),n.west-=u.TWO_PI,n.east-=u.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(n=p.clone(e.rectangle,ee),n.west+=u.TWO_PI,n.east+=u.TWO_PI);var a=n.east-n.west,s=(o.west-n.west)/a,l=(o.east-n.west)/a,c=n.north-n.south,d=(o.south-n.south)/c,h=(o.north-n.south)/c,f=(i.x-s)/(l-s),m=(i.y-d)/(h-d);return Math.abs(f)<Math.EPSILON5?f=0:Math.abs(f-1)<Math.EPSILON5&&(f=1),Math.abs(m)<Math.EPSILON5?m=0:Math.abs(m-1)<Math.EPSILON5&&(m=1),r.x=f,r.y=m,r}function D(e,t,i,r,n){var o=e.encoding,a=e.vertices;if(n.height=o.decodeHeight(a,t),o.hasVertexNormals)o.getOctEncodedNormal(a,t,n.encodedNormal);else{var s=n.encodedNormal;s.x=0,s.y=0}}function I(t,i,r,o,a,s,l,c,d,h){var p,f=o.encoding,m=o.vertices,_=P(i,r,f.decodeTextureCoordinates(m,a,j),j),g=P(i,r,f.decodeTextureCoordinates(m,s,Y),Y);p=d?(l-_.x)/(g.x-_.x):(c-_.y)/(g.y-_.y);var v=f.decodeHeight(m,a),y=f.decodeHeight(m,s),C=r.rectangle;U.longitude=u.lerp(C.west,C.east,l),U.latitude=u.lerp(C.south,C.north,c),h.height=U.height=u.lerp(v,y,p);var b;if(f.hasVertexNormals){var S=f.getOctEncodedNormal(m,a,te),T=f.getOctEncodedNormal(m,s,ie),E=e.octDecode(S.x,S.y,H),A=e.octDecode(T.x,T.y,re);b=n.lerp(E,A,p,H),n.normalize(b,b),e.octEncode(b,h.encodedNormal)}else b=t.geodeticSurfaceNormalCartographic(U,H),e.octEncode(b,h.encodedNormal)}function M(t,i,r,n,o,a){a.height=o;var s=i.geodeticSurfaceNormalCartographic(U,H);e.octEncode(s,a.encodedNormal)}function R(e,t,i,r,n,o,a,l,u,c,d){if(k(e,t,l,a,!1,i,r,d)||k(e,t,c,u,!0,i,r,d))return d;var h;if(B(n,o))return h=0===i?0===r?o.eastIndicesNorthToSouth[0]:o.southIndicesEastToWest[0]:0===r?o.northIndicesWestToEast[0]:o.westIndicesSouthToNorth[0],D(o,h,i,r,d),d;var p;return p=0===i?0===r?O(e.westMeshes,e.westTiles,f.EAST,e.southMeshes,e.southTiles,f.NORTH,i,r):O(e.northMeshes,e.northTiles,f.SOUTH,e.westMeshes,e.westTiles,f.EAST,i,r):0===r?O(e.southMeshes,e.southTiles,f.NORTH,e.eastMeshes,e.eastTiles,f.WEST,i,r):O(e.eastMeshes,e.eastTiles,f.WEST,e.northMeshes,e.northTiles,f.SOUTH,i,r),s(p)?(M(e,t,i,r,p,d),d):void 0}function O(e,t,i,r,n,o,a,l){var u=F(e,t,!1,i,a,l),c=F(r,n,!0,o,a,l);return s(u)&&s(c)?.5*(u+c):s(u)?u:c}function L(e,t,i,r,n,o,a,s,l){for(var u=0;u<o.length;++u)n=N(e,t,i,r,n,o[u],a[u],s,l);return n}function N(e,t,i,r,n,o,a,s,l){var c=o.rectangle;s===f.EAST&&0===e.tile.x?(c=p.clone(o.rectangle,ee),c.west-=u.TWO_PI,c.east-=u.TWO_PI):s===f.WEST&&0===o.x&&(c=p.clone(o.rectangle,ee),c.west+=u.TWO_PI,c.east+=u.TWO_PI);var d,h,m=e.tile.rectangle;n>0&&(i.decodeTextureCoordinates(r,n-1,j),d=j.x,h=j.y);var _,v;switch(s){case f.WEST:_=a.westIndicesSouthToNorth,v=!1;break;case f.NORTH:_=a.northIndicesWestToEast,v=!0;break;case f.EAST:_=a.eastIndicesNorthToSouth,v=!1;break;case f.SOUTH:_=a.southIndicesEastToWest,v=!0}var y,C,b=o,S=e.tile,T=a.encoding,E=a.vertices,A=i.getStride();T.hasWebMercatorT&&(y=g.geodeticLatitudeToMercatorAngle(m.south),C=1/(g.geodeticLatitudeToMercatorAngle(m.north)-y));for(var w=0;w<_.length;++w){var x=_[w],D=T.decodeTextureCoordinates(E,x,j);P(b,S,D,D);var I=D.x,M=D.y,R=v?I:M;if(!(R<0||R>1)&&!(Math.abs(I-d)<u.EPSILON5&&Math.abs(M-h)<u.EPSILON5)){var O=Math.abs(I)<u.EPSILON5||Math.abs(I-1)<u.EPSILON5,L=Math.abs(M)<u.EPSILON5||Math.abs(M-1)<u.EPSILON5;if(!O||!L){var N,F=T.decodePosition(E,x,H),B=T.decodeHeight(E,x);T.hasVertexNormals?N=T.getOctEncodedNormal(E,x,q):(N=q,N.x=0,N.y=0);var k=M;if(T.hasWebMercatorT){var z=u.lerp(m.south,m.north,M);k=(g.geodeticLatitudeToMercatorAngle(z)-y)*C}i.encode(r,n*A,F,D,B,N,k),l.minimumHeight=Math.min(l.minimumHeight,B),l.maximumHeight=Math.max(l.maximumHeight,B),++n}}}return n}function F(e,t,i,r,n,o){var a,l,u;i?(a=0,l=e.length,u=1):(a=e.length-1,l=-1,u=-1);for(var c=a;c!==l;c+=u){var d=e[c];if(B(t[c],d)){var h;switch(r){case f.WEST:h=d.westIndicesSouthToNorth;break;case f.SOUTH:h=d.southIndicesEastToWest;break;case f.EAST:h=d.eastIndicesNorthToSouth;break;case f.NORTH:h=d.northIndicesWestToEast}var p=h[i?0:h.length-1];if(s(p))return d.encoding.decodeHeight(d.vertices,p)}}}function B(e,t){return s(t)&&(!s(e.data.fill)||!e.data.fill.changedThisFrame)}function k(e,i,r,n,o,a,s,l){var u,c,d,h,p,f=n[o?0:r.length-1],m=r[o?0:r.length-1];if(B(f,m)&&(0===a?0===s?(u=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,c=o,d=o):(u=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,c=!o,d=!1):0===s?(u=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,c=!o,d=!0):(u=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,c=o,d=!o),u.length>0)){h=o?0:u.length-1,p=u[h],m.encoding.decodeTextureCoordinates(m.vertices,p,j);var _=P(f,e.tile,j,j);if(_.x===a&&_.y===s)return D(m,p,a,s,l),!0;if(!((h=t(u,c?a:s,function(t,i){m.encoding.decodeTextureCoordinates(m.vertices,t,j);var r=P(f,e.tile,j,j);return d?c?r.x-a:r.y-s:c?a-r.x:s-r.y}))<0))return D(m,u[h],a,s,l),!0;if((h=~h)>0&&h<u.length)return I(i,f,e.tile,m,u[h-1],u[h],a,s,c,l),!0}return!1}function z(e,t,i,r,o){var a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,l=ne;return n.fromRadians(i.west,i.south,r,s,l[0]),n.fromRadians(i.east,i.south,r,s,l[1]),n.fromRadians(i.west,i.north,r,s,l[2]),n.fromRadians(i.east,i.north,r,s,l[3]),a.computeHorizonCullingPoint(t,l,o)}C.prototype.update=function(e,t,i){this.changedThisFrame&&(w(e,t,this.tile,i),this.changedThisFrame=!1)},C.prototype.destroy=function(e){s(this.vertexArray)&&(s(e)?e.push(this.vertexArray):v._freeVertexArray(this.vertexArray,e),this.vertexArray=void 0),s(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};var V=new h;C.updateFillTiles=function(e,t,i,r){var n=e._quadtree,o=n._levelZeroTiles,a=n._lastSelectionFrameNumber,l=V;l.clear();for(var u=0;u<t.length;++u){var c=t[u];s(c.data.vertexArray)&&l.enqueue(t[u])}for(var d=l.dequeue();void 0!==d;){var h=d.findTileToWest(o),p=d.findTileToSouth(o),m=d.findTileToEast(o),_=d.findTileToNorth(o);b(e,i,d,h,a,f.EAST,!1,l,r),b(e,i,d,p,a,f.NORTH,!1,l,r),b(e,i,d,m,a,f.WEST,!1,l,r),b(e,i,d,_,a,f.SOUTH,!1,l,r);var g=h.findTileToNorth(o),v=h.findTileToSouth(o),y=m.findTileToNorth(o),C=m.findTileToSouth(o);b(e,i,d,g,a,f.SOUTHEAST,!1,l,r),b(e,i,d,y,a,f.SOUTHWEST,!1,l,r),b(e,i,d,v,a,f.NORTHEAST,!1,l,r),b(e,i,d,C,a,f.NORTHWEST,!1,l,r),d=l.dequeue()}};var U=new a,G=new a,H=new n,W=new n,q=new r,Y=new r,j=new r,X={minimumHeight:0,maximumHeight:0},Q=new E,K=new E,Z=new E,J=new E,$="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0,ee=new p,te=new r,ie=new r,re=new n,ne=[new n,new n,new n,new n];return C}),define("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../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/OrthographicFrustum","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainMesh","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","./BlendingState","./ImageryState","./TileBoundingRegion","./TileSelectionResult","./ClippingPlaneCollection","./DepthFunction","./GlobeSurfaceTile","./ImageryLayer","./PerInstanceColorAppearance","./Primitive","./QuadtreeTileLoadState","./SceneMode","./ShadowMode","./TerrainFillMesh","./TerrainState"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z){"use strict";function J(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.showGroundAtmosphere=!1,this.shadows=Q.RECEIVE_ONLY,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._errorEvent=new f,this._imageryLayers.layerAdded.addEventListener(J.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(J.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(J.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(J.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new f,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new a(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=E.clone(E.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}function $(e,t){var i=e.loadingImagery;c(i)||(i=e.readyImagery);var r=t.loadingImagery;return c(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function ee(e,t){var i=t.creditDisplay;e._terrainProvider.ready&&c(e._terrainProvider.credit)&&i.addCredit(e._terrainProvider.credit);for(var r=e._imageryLayers,n=0,o=r.length;n<o;++n){var a=r.get(n).imageryProvider;a.ready&&c(a.credit)&&i.addCredit(a.credit)}}function te(e,t){if(t.west<t.east)return t;var i=E.clone(t,de);return E.center(e,he).longitude>0?i.east=y.PI:i.west=-y.PI,i}function ie(e,t,i,n,o){var a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,l=Ee;return r.fromRadians(i.west,i.south,n,s,l[0]),r.fromRadians(i.east,i.south,n,s,l[1]),r.fromRadians(i.west,i.north,n,s,l[2]),r.fromRadians(i.east,i.north,n,s,l[3]),a.computeHorizonCullingPoint(t,l,o)}function re(e,t,i){var r=e.data;void 0===r&&(r=e.data=new H),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new z({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var n=r.terrainData,o=r.mesh,a=r.tileBoundingRegion;if(void 0!==o&&void 0!==o.minimumHeight&&void 0!==o.maximumHeight)return a.minimumHeight=o.minimumHeight,a.maximumHeight=o.maximumHeight,e;if(void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight)return a.minimumHeight=n._minimumHeight*i.terrainExaggeration,a.maximumHeight=n._maximumHeight*i.terrainExaggeration,e;a.minimumHeight=Number.NaN,a.maximumHeight=Number.NaN;for(var s=e.parent;void 0!==s;){var l=s.data;if(void 0!==l){var u=l.mesh;if(void 0!==u&&void 0!==u.minimumHeight&&void 0!==u.maximumHeight)return a.minimumHeight=u.minimumHeight,a.maximumHeight=u.maximumHeight,s;var c=l.terrainData;if(void 0!==c&&void 0!==c._minimumHeight&&void 0!==c._maximumHeight)return a.minimumHeight=c._minimumHeight*i.terrainExaggeration,a.maximumHeight=c._maximumHeight*i.terrainExaggeration,s}s=s.parent}}function ne(e,t,i){return function(r){var n,o,a,s=-1,l=r.data.imagery,d=l.length;for(a=0;a<d;++a)if(n=l[a],o=u(n.readyImagery,n.loadingImagery),o.imageryLayer===t){s=a;break}if(-1!==s){var h=s+e;if(n=l[h],o=c(n)?u(n.readyImagery,n.loadingImagery):void 0,!c(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(r,i,h);for(a=s;a<h;++a)l[a].freeResources();l.splice(s,e)}return!0}}function oe(e,t){return{u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=C.multiplyByPoint(t,this.properties.rtc,be);return C.setTranslation(t,i,_e),_e},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=C.multiplyByPoint(t,this.properties.rtc,be);return C.setTranslation(t,r,ge),C.multiply(i,ge,ge),ge},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},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){var i=t._clippingPlanes;return c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){var i=t._clippingPlanes;return c(i)?C.multiply(e.context.uniformState.view,i.modelMatrix,Pe):C.IDENTITY},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor
- ;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},properties:{initialColor:new n(0,0,.5,1),fillHighlightColor:new a(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),nightFadeDistance:new i(1e7,4e7),hsbShift:new r,center3D:void 0,rtc:new r,modifiedModelView:new C,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new C,clippingPlanesEdgeColor:a.clone(a.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new n}}}function ae(e,t,i){var r,n,o=i.data;if(c(o.vertexArray)?(r=o.mesh,n=o.vertexArray):c(o.fill)&&c(o.fill.vertexArray)&&(r=o.fill.mesh,n=o.fill.vertexArray),c(r)&&c(n)){if(c(o.wireframeVertexArray)){if(o.wireframeVertexArray.mesh===r)return;o.wireframeVertexArray.destroy(),o.wireframeVertexArray=void 0}o.wireframeVertexArray=se(e,n,r),o.wireframeVertexArray.mesh=r}}function se(e,t,i){var r=i.indices,n={indices:r,primitiveType:T.TRIANGLES};_.toWireframe(n);var o=n.indices,a=I.createIndexBuffer({context:e,typedArray:o,usage:M.STATIC_DRAW,indexDatatype:g.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new F({context:e,attributes:t._attributes,indexBuffer:a})}function le(t,i,o){var s=i.data;c(s.vertexArray)||(void 0===s.fill&&(s.fill=new K(i)),s.fill.update(t,o));var u=o.creditDisplay,d=s.terrainData;if(c(d)&&c(d.credits))for(var h=d.credits,p=0,f=h.length;p<f;++p)u.addCredit(h[p]);var m=R.maximumTextureImageUnits,_=s.waterMaskTexture,g=s.waterMaskTranslationAndScale;!c(_)&&c(s.fill)&&(_=s.fill.waterMaskTexture,g=s.fill.waterMaskTranslationAndScale);var v=t.hasWaterMask&&c(_),S=t.oceanNormalMap,A=v&&c(S),w=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,P=o.fog.enabled,I=t.showGroundAtmosphere,M=Q.castShadows(t.shadows),N=Q.receiveShadows(t.shadows),F=t.hueShift,B=t.saturationShift,k=t.brightnessShift,z=!(y.equalsEpsilon(F,0,y.EPSILON7)&&y.equalsEpsilon(B,0,y.EPSILON7)&&y.equalsEpsilon(k,0,y.EPSILON7)),V=!1;if(I){var U,G=o.mode,H=o.camera;U=G===X.SCENE2D||G===X.COLUMBUS_VIEW?H.positionCartographic.height:r.magnitude(H.positionWC);var q=t.nightFadeOutDistance;G!==X.SCENE3D&&(q-=o.mapProjection.ellipsoid.maximumRadius),V=U>q}v&&--m,A&&--m,c(o.shadowState)&&o.shadowState.shadowsEnabled&&--m,c(t.clippingPlanes)&&t.clippingPlanes.enabled&&--m;var Y=s.renderedMesh,j=Y.center,Z=Y.encoding,J=ve,$=0,ee=0,ie=0,re=0,ne=!1;if(o.mode!==X.SCENE3D){var se=o.mapProjection,le=se.project(E.southwest(i.rectangle),Se),ue=se.project(E.northeast(i.rectangle),Te);if(J.x=le.x,J.y=le.y,J.z=ue.x,J.w=ue.y,o.mode!==X.MORPHING&&(j=Ce,j.x=0,j.y=.5*(J.z+J.x),j.z=.5*(J.w+J.y),J.x-=j.y,J.y-=j.z,J.z-=j.y,J.w-=j.z),o.mode===X.SCENE2D&&Z.quantization===x.BITS12){var de=1/(Math.pow(2,12)-1)*.5,he=(J.z-J.x)*de,pe=(J.w-J.y)*de;J.x-=he,J.y-=pe,J.z+=he,J.w+=pe}se instanceof D&&($=i.rectangle.south,ee=i.rectangle.north,ie=D.geodeticLatitudeToMercatorAngle($),re=1/(D.geodeticLatitudeToMercatorAngle(ee)-ie),ne=!0)}var fe=Ie;fe.frameState=o,fe.surfaceTile=s,fe.showReflectiveOcean=v,fe.showOceanWaves=A,fe.enableLighting=t.enableLighting,fe.showGroundAtmosphere=I,fe.perFragmentGroundAtmosphere=V,fe.hasVertexNormals=w,fe.useWebMercatorProjection=ne,fe.clippedByBoundaries=s.clippedByBoundaries;var me=s.imagery,_e=0,ge=me.length,be=t._renderState,Ee=t._blendRenderState,Pe=be,Me=t._firstPassInitialColor,Re=o.context;c(t._debug.boundingSphereTile)||xe();do{var Oe,Le,Ne=0;if(t._drawCommands.length<=t._usedDrawCommands?(Oe=new O,Oe.owner=i,Oe.cull=!1,Oe.boundingVolume=new e,Oe.orientedBoundingBox=void 0,Le=oe(o,t),t._drawCommands.push(Oe),t._uniformMaps.push(Le)):(Oe=t._drawCommands[t._usedDrawCommands],Le=t._uniformMaps[t._usedDrawCommands]),Oe.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile){var Fe=s.orientedBoundingBox;c(Fe)?Ae(Fe,a.RED).update(o):c(Y)&&c(Y.boundingSphere3D)&&we(Y.boundingSphere3D,a.RED).update(o)}var Be=Le.properties;n.clone(Me,Be.initialColor),Be.oceanNormalMap=S,Be.lightingFadeDistance.x=t.lightingFadeOutDistance,Be.lightingFadeDistance.y=t.lightingFadeInDistance,Be.nightFadeDistance.x=t.nightFadeOutDistance,Be.nightFadeDistance.y=t.nightFadeInDistance,Be.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity;var ke=!c(s.vertexArray)&&c(t.fillHighlightColor)&&t.fillHighlightColor.alpha>0;ke&&a.clone(t.fillHighlightColor,Be.fillHighlightColor),Be.center3D=Y.center,r.clone(j,Be.rtc),n.clone(J,Be.tileRectangle),Be.southAndNorthLatitude.x=$,Be.southAndNorthLatitude.y=ee,Be.southMercatorYAndOneOverHeight.x=ie,Be.southMercatorYAndOneOverHeight.y=re;var ze=ye,Ve=te(i.rectangle,t.cartographicLimitRectangle);r.fromElements(F,B,k,Be.hsbShift);var Ue=i.rectangle,Ge=1/Ue.width,He=1/Ue.height;ze.x=(Ve.west-Ue.west)*Ge,ze.y=(Ve.south-Ue.south)*He,ze.z=(Ve.east-Ue.west)*Ge,ze.w=(Ve.north-Ue.south)*He,n.clone(ze,Be.localizedCartographicLimitRectangle);var We=P&&y.fog(i._distance,o.fog.density)>y.EPSILON3;z=z&&(We||I);for(var qe=!1,Ye=!1,je=!1,Xe=!1,Qe=!1,Ke=!1,Ze=!1,Je=!1,$e=!1;Ne<m&&_e<ge;){var et=me[_e],tt=et.readyImagery;if(++_e,c(tt)&&0!==tt.imageryLayer.alpha){var it=et.useWebMercatorT?tt.textureWebMercator:tt.texture,rt=tt.imageryLayer;c(et.textureTranslationAndScale)||(et.textureTranslationAndScale=rt._calculateTextureTranslationAndScale(i,et)),Be.dayTextures[Ne]=it,Be.dayTextureTranslationAndScale[Ne]=et.textureTranslationAndScale,Be.dayTextureTexCoordsRectangle[Ne]=et.textureCoordinateRectangle,Be.dayTextureUseWebMercatorT[Ne]=et.useWebMercatorT,Be.dayTextureAlpha[Ne]=rt.alpha,Ke=Ke||1!==Be.dayTextureAlpha[Ne],Be.dayTextureBrightness[Ne]=rt.brightness,qe=qe||Be.dayTextureBrightness[Ne]!==W.DEFAULT_BRIGHTNESS,Be.dayTextureContrast[Ne]=rt.contrast,Ye=Ye||Be.dayTextureContrast[Ne]!==W.DEFAULT_CONTRAST,Be.dayTextureHue[Ne]=rt.hue,je=je||Be.dayTextureHue[Ne]!==W.DEFAULT_HUE,Be.dayTextureSaturation[Ne]=rt.saturation,Xe=Xe||Be.dayTextureSaturation[Ne]!==W.DEFAULT_SATURATION,Be.dayTextureOneOverGamma[Ne]=1/rt.gamma,Qe=Qe||Be.dayTextureOneOverGamma[Ne]!==1/W.DEFAULT_GAMMA,Be.dayTextureSplit[Ne]=rt.splitDirection,Ze=Ze||0!==Be.dayTextureSplit[Ne];var nt=Be.dayTextureCutoutRectangles[Ne];if(c(nt)||(nt=Be.dayTextureCutoutRectangles[Ne]=new n),n.clone(n.ZERO,nt),c(rt.cutoutRectangle)){var ot=te(Ue,rt.cutoutRectangle),at=E.simpleIntersection(ot,Ue,ce);Je=c(at)||Je,nt.x=(ot.west-Ue.west)*Ge,nt.y=(ot.south-Ue.south)*He,nt.z=(ot.east-Ue.west)*Ge,nt.w=(ot.north-Ue.south)*He}var st=Be.colorsToAlpha[Ne];c(st)||(st=Be.colorsToAlpha[Ne]=new n);var lt=c(rt.colorToAlpha)&&rt.colorToAlphaThreshold>0;if($e=$e||lt,lt){var ut=rt.colorToAlpha;st.x=ut.red,st.y=ut.green,st.z=ut.blue,st.w=rt.colorToAlphaThreshold}else st.w=-1;if(c(tt.credits))for(var ct=tt.credits,dt=0,ht=ct.length;dt<ht;++dt)u.addCredit(ct[dt]);++Ne}}Be.dayTextures.length=Ne,Be.waterMask=_,n.clone(g,Be.waterMaskTranslationAndScale),Be.minMaxHeight.x=Z.minimumHeight,Be.minMaxHeight.y=Z.maximumHeight,C.clone(Z.matrix,Be.scaleAndBias);var pt=t._clippingPlanes,ft=c(pt)&&pt.enabled&&i.isClipped;ft&&(Be.clippingPlanesEdgeColor=a.clone(pt.edgeColor,Be.clippingPlanesEdgeColor),Be.clippingPlanesEdgeWidth=pt.edgeWidth),c(t.uniformMap)&&(Le=l(Le,t.uniformMap)),fe.numberOfDayTextures=Ne,fe.applyBrightness=qe,fe.applyContrast=Ye,fe.applyHue=je,fe.applySaturation=Xe,fe.applyGamma=Qe,fe.applyAlpha=Ke,fe.applySplit=Ze,fe.enableFog=We,fe.enableClippingPlanes=ft,fe.clippingPlanes=pt,fe.hasImageryLayerCutout=Je,fe.colorCorrect=z,fe.highlightFillTile=ke,fe.colorToAlpha=$e,Oe.shaderProgram=t._surfaceShaderSet.getShaderProgram(fe),Oe.castShadows=M,Oe.receiveShadows=N,Oe.renderState=Pe,Oe.primitiveType=T.TRIANGLES,Oe.vertexArray=s.vertexArray||s.fill.vertexArray,Oe.uniformMap=Le,Oe.pass=L.GLOBE,t._debug.wireframe&&(ae(Re,t,i),c(s.wireframeVertexArray)&&(Oe.vertexArray=s.wireframeVertexArray,Oe.primitiveType=T.LINES));var mt=Oe.boundingVolume,_t=Oe.orientedBoundingBox;if(o.mode!==X.SCENE3D){var gt=s.tileBoundingRegion;e.fromRectangleWithHeights2D(i.rectangle,o.mapProjection,gt.minimumHeight,gt.maximumHeight,mt),r.fromElements(mt.center.z,mt.center.x,mt.center.y,mt.center),o.mode===X.MORPHING&&(mt=e.union(Y.boundingSphere3D,mt,mt))}else Oe.boundingVolume=e.clone(Y.boundingSphere3D,mt),Oe.orientedBoundingBox=b.clone(s.orientedBoundingBox,_t);Oe.dirty=!0,o.commandList.push(Oe),Pe=Ee,Me=De}while(_e<ge)}d(J.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}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){U.setOwner(e,this,"_clippingPlanes")}}}),J.prototype.update=function(e){this._imageryLayers._update()},J.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort($)})),ee(this,e);for(var t=this._vertexArraysToDestroy,i=t.length,r=0;r<i;++r)H._freeVertexArray(t[r]);t.length=0},J.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];c(n)&&(n.length=0)}var o=this._clippingPlanes;c(o)&&o.enabled&&o.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},J.prototype.endUpdate=function(e){c(this._renderState)||(this._renderState=N.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:G.LESS}}),this._blendRenderState=N.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:G.LESS_OR_EQUAL},blending:B.ALPHA_BLEND})),this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&K.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(c(n))for(var o=0,a=n.length;o<a;++o)le(this,n[o],e)}},J.prototype.updateForPick=function(e){for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)e.commandList.push(t[i])},J.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},J.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},J.prototype.loadTile=function(e,t){var i,r=t.data,n=!0;c(r)&&(n=r.boundingVolumeSourceTile!==t||t._lastSelectionResult===V.CULLED_BUT_NEEDED,i=r.terrainState),H.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n),r=t.data,n&&i!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)&&r.boundingVolumeSourceTile===t&&(n=!1,H.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n))};var ue=new e,ce=new E,de=new E,he=new o;J.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&y.fog(o,i.fog.density)>=1)return P.NONE;var a=t.data,s=a.tileBoundingRegion;if(void 0===a.boundingVolumeSourceTile)return P.PARTIAL;var l=i.cullingVolume,u=a.orientedBoundingBox;!c(u)&&c(a.renderedMesh)&&(u=a.renderedMesh.boundingSphere3D),a.clippedByBoundaries=!1;var d=te(t.rectangle,this.cartographicLimitRectangle),h=E.simpleIntersection(d,t.rectangle,ce);if(!c(h))return P.NONE;if(E.equals(h,t.rectangle)||(a.clippedByBoundaries=!0),i.mode!==X.SCENE3D&&(u=ue,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,s.minimumHeight,s.maximumHeight,u),r.fromElements(u.center.z,u.center.x,u.center.y,u.center),i.mode===X.MORPHING&&c(a.renderedMesh)&&(u=e.union(a.renderedMesh.boundingSphere3D,u,u))),!c(u))return v.INTERSECTING;var p=this._clippingPlanes;if(c(p)&&p.enabled){var f=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=f!==v.INSIDE,f===v.OUTSIDE)return P.NONE}var m=l.computeVisibility(u);if(m===v.OUTSIDE)return P.NONE;var _=i.mode===X.SCENE3D&&i.camera.frustum instanceof S;if(i.mode===X.SCENE3D&&!_&&c(n)){var g=a.occludeePointInScaledSpace;return c(g)?n.ellipsoid.isScaledSpacePointVisible(g)?m:P.NONE:m}return m},J.prototype.canRefine=function(e){return!!c(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};var pe=[],fe=[];J.prototype.canRenderWithoutLosingDetail=function(e,t){var i=e.data,r=pe;r.length=this._imageryLayers.length;var n,o=!1,a=!1;c(i)&&(o=i.terrainState===Z.READY,a=!0,n=i.imagery);var s,l;for(s=0,l=r.length;s<l;++s)r[s]=a;if(c(n))for(s=0,l=n.length;s<l;++s){var u=n[s],d=u.loadingImagery,h=!c(d)||d.state===k.FAILED||d.state===k.INVALID,p=(u.loadingImagery||u.readyImagery).imageryLayer._layerIndex;r[p]=h&&r[p]}var f=this.quadtree._lastSelectionFrameNumber,m=fe;for(m.length=0,m.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);m.length>0;){var _=m.pop(),g=_._lastSelectionResultFrame===f?_._lastSelectionResult:V.NONE;if(g===V.RENDERED){var v=_.data;if(!c(v))continue;if(!o&&_.data.terrainState===Z.READY)return!1;var y=_.data.imagery;for(s=0,l=y.length;s<l;++s){var C=y[s],b=C.loadingImagery,S=!c(b)||b.state===k.FAILED||b.state===k.INVALID,T=(C.loadingImagery||C.readyImagery).imageryLayer._layerIndex;if(S&&!r[T])return!1}}else g===V.REFINED&&m.push(_.southwestChild,_.southeastChild,_.northwestChild,_.northeastChild)}return!0};var me=new r;J.prototype.computeTileLoadPriority=function(e,t){var i=e.data;if(void 0===i)return 0;var n=i.orientedBoundingBox;if(void 0===n)return 0;var o=t.camera.positionWC,a=t.camera.directionWC,s=r.subtract(n.center,o,me),l=r.magnitude(s);return l<y.EPSILON5?0:(r.divideByScalar(s,l,s),(1-r.dot(s,a))*e._distance)};var _e=new C,ge=new C,ve=new n,ye=new n,Ce=new r,be=new r,Se=new r,Te=new r;J.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];c(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];c(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var l=e.data;c(l.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;var u=this._debug;++u.tilesRendered,u.texturesRendered+=i};var Ee=[new r,new r,new r,new r];J.prototype.computeDistanceToTile=function(e,t){var i=re(e,this.terrainProvider,t),r=e.data,n=r.tileBoundingRegion;if(void 0===i)return 9999999999;if(r.boundingVolumeSourceTile!==i){r.boundingVolumeSourceTile=i;var o=e.rectangle;c(o)&&o.width<y.PI_OVER_TWO+y.EPSILON5&&(r.orientedBoundingBox=b.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=ie(this,r.orientedBoundingBox.center,e.rectangle,n.maximumHeight,r.occludeePointInScaledSpace))}var a=n.minimumHeight,s=n.maximumHeight;if(r.boundingVolumeSourceTile!==e){var l=t.camera.positionCartographic.height;Math.abs(l-a)>Math.abs(l-s)?(n.minimumHeight=a,n.maximumHeight=a):(n.minimumHeight=s,n.maximumHeight=s)}var u=n.distanceToCamera(t);return n.minimumHeight=a,n.maximumHeight=s,u},J.prototype.isDestroyed=function(){return!1},J.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),h(this)},J.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider,r=this,n=e.imageryProvider,o=this._imageryLayersUpdatedEvent;n._reload=function(){e._imageryCache={},r._quadtree.forEachLoadedTile(function(t){if(!c(t._loadedCallbacks[e._layerIndex])){var r,n=t.data.imagery,o=n.length,a=-1,s=0;for(r=0;r<o;++r){var l=n[r];if(u(l.readyImagery,l.loadingImagery).imageryLayer===e)-1===a&&(a=r),++s;else if(-1!==a)break}if(-1!==a){var d=a+s;e._createTileImagerySkeletons(t,i,d)&&(t._loadedCallbacks[e._layerIndex]=ne(s,e,i),t.state=j.LOADING)}}})},this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=j.LOADING,0===t.level||t._lastSelectionResultFrame===r.quadtree._lastSelectionFrameNumber&&t._lastSelectionResult===V.RENDERED||(t.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}},J.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],l=s.loadingImagery;if(c(l)||(l=s.readyImagery),l.imageryLayer===e)-1===r&&(r=o),s.freeResources(),++n;else if(-1!==r)break}-1!==r&&i.splice(r,n)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},J.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},J.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Ae,we,xe,Pe=new C;!function(){function e(e){return new Y({geometryInstances:e,appearance:new q({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new m({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),a=new m({geometry:new A({radius:1})}),l=new C;Ae=function(t,r){return t===i?n:(xe(),i=t,l=C.fromRotationTranslation(t.halfAxes,t.center,l),o.modelMatrix=l,o.attributes.color=s.fromColor(r),n=e(o))},we=function(t,r){return t===i?n:(xe(),i=t,l=C.fromTranslation(t.center,l),l=C.multiplyByUniformScale(l,t.radius,l),a.modelMatrix=l,a.attributes.color=s.fromColor(r),n=e(a))},xe=function(){c(n)&&(n.destroy(),n=void 0,i=void 0)}}();var De=new n(0,0,0,0),Ie={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0};return J}),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){return e.indexOf(t)}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){t(i)?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return-1!==r&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},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-1!==this.indexOf(e)},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=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;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-1/1024),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+1/1024),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-1/1024),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+1/1024),s.contains(C,o)){var b=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(b)&&(f.push(b),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(){var e,i,r,n,o=!0,a=this._layers;for(r=0,n=a.length;r<n;++r)i=a[r],i._layerIndex=r,i.show?(i._isBaseLayer=o,o=!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(r=0,n=e.length;r<n;++r)i=e[r],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","./TileSelectionResult"],function(e,t,i,r,n,o){"use strict";function a(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._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=o.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function s(t){e(t)&&t.freeResources()}return a.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,o=0;o<i;++o)for(var s=0;s<t;++s)r[n++]=new a({tilingScheme:e,x:s,y:o,level:0});return r},a.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-1===n.indexOf(e)}),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(a.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 a({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 a({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 a({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 a({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}}}),a.prototype.findLevelZeroTile=function(e,t,i){var r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=r:t>=r&&(t-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(e){return e.x===t&&e.y===i})[0]},a.prototype.findTileToWest=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;var i=t.findTileToWest(e);if(void 0!==i)return t.southwestChild===this?i.southeastChild:i.northeastChild},a.prototype.findTileToEast=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;var i=t.findTileToEast(e);if(void 0!==i)return t.southeastChild===this?i.southwestChild:i.northwestChild},a.prototype.findTileToSouth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;var i=t.findTileToSouth(e);if(void 0!==i)return t.southwestChild===this?i.northwestChild:i.northeastChild},a.prototype.findTileToNorth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;var i=t.findTileToNorth(e);if(void 0!==i)return t.northwestChild===this?i.southwestChild:i.southeastChild},a.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),s(this._southwestChild),this._southwestChild=void 0,s(this._southeastChild),this._southeastChild=void 0,s(this._northwestChild),this._northwestChild=void 0,s(this._northeastChild),this._northeastChild=void 0},a}),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/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue","./TileSelectionResult"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function b(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-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 y,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new m({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function S(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,T(e);var i=e._levelZeroTiles;if(r(i))for(var n=0;n<i.length;++n){for(var o=i[n],a=o.customData,s=a.length,l=0;l<s;++l){var u=a[l];u.level=0,e._addHeightCallbacks.push(u)}i[n].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function T(e){var t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}function E(e,t){var i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;(i!==e._lastTileLoadQueueLength||e._tilesInvalidated)&&(t.afterRender.push(a.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i)),e._lastTileLoadQueueLength=i);var r=e._debug;r.enableDebugOutput&&!r.suspendLodUpdate&&(r.maxDepth=e._tilesToRender.reduce(function(e,t){return Math.max(e,t.level)},-1),
- r.tilesRendered=e._tilesToRender.length,r.tilesVisited===r.lastTilesVisited&&r.tilesRendered===r.lastTilesRendered&&r.tilesCulled===r.lastTilesCulled&&r.maxDepth===r.lastMaxDepth&&r.tilesWaitingForChildren===r.lastTilesWaitingForChildren&&r.maxDepthVisited===r.lastMaxDepthVisited||(console.log("Visited "+r.tilesVisited+", Rendered: "+r.tilesRendered+", Culled: "+r.tilesCulled+", Max Depth Rendered: "+r.maxDepth+", Max Depth Visited: "+r.maxDepthVisited+", Waiting for children: "+r.tilesWaitingForChildren),r.lastTilesVisited=r.tilesVisited,r.lastTilesRendered=r.tilesRendered,r.lastTilesCulled=r.tilesCulled,r.lastMaxDepth=r.maxDepth,r.lastTilesWaitingForChildren=r.tilesWaitingForChildren,r.lastMaxDepthVisited=r.maxDepthVisited))}function A(e,t){var i=p.center(e.rectangle,H),r=i.longitude-G.longitude,n=i.latitude-G.latitude;i=p.center(t.rectangle,H);var o=i.longitude-G.longitude,a=i.latitude-G.latitude;return r*r+n*n-(o*o+a*a)}function w(e,t){var i=e._debug;if(!i.suspendLodUpdate){e._tilesToRender.length=0;var n,o=e._tileProvider;if(!r(e._levelZeroTiles)){if(!o.ready)return;var a=o.tilingScheme;e._levelZeroTiles=_.createLevelZeroTiles(a);var s=e._levelZeroTiles.length;if(q.length<s)for(q=new Array(s),n=0;n<s;++n)void 0===q[n]&&(q[n]=new P)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,c=e._levelZeroTiles,d=c.length>1?e._occluders:void 0;G=t.camera.positionCartographic,c.sort(A);var h,p=e._addHeightCallbacks,f=e._removeHeightCallbacks,m=t.frameNumber;if(p.length>0||f.length>0){for(n=0,h=c.length;n<h;++n)l=c[n],l._updateCustomData(m,p,f);p.length=0,f.length=0}var g=t.camera;e._cameraPositionCartographic=g.positionCartographic;var v=u.getTranslation(g.transform,W);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(v,e._cameraReferenceFrameOriginCartographic),n=0,h=c.length;n<h;++n)l=c[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?O(e,l,o,t,d,!1,q[n]):(x(e,e._tileLoadQueueHigh,l,t),++i.tilesWaitingForChildren);e._lastSelectionFrameNumber=m}}function x(e,t,i,r){i.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,r)),t.push(i))}function P(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function D(){this.southwest=new P,this.southeast=new P,this.northwest=new P,this.northeast=new P}function I(e,t,i,n,o){var a=e._debug;++a.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>a.maxDepthVisited&&(a.maxDepthVisited=i.level);var s=L(e,t,i)<e.maximumScreenSpaceError,l=i.southwestChild,u=i.southeastChild,c=i.northwestChild,d=i.northeastChild,h=e._lastSelectionFrameNumber,p=i._lastSelectionResultFrame===h?i._lastSelectionResult:C.NONE,f=e.tileProvider;if(s||n){var m=C.originalResult(p)===C.RENDERED,_=C.originalResult(p)===C.CULLED||p===C.NONE,v=i.state===g.DONE,y=m||_||v;if(y||r(f.canRenderWithoutLosingDetail)&&(y=f.canRenderWithoutLosingDetail(i)),y)return s&&x(e,e._tileLoadQueueMedium,i,t),F(e,i),o.allAreRenderable=i.renderable,o.anyWereRenderedLastFrame=p===C.RENDERED,o.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=C.RENDERED,void(o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));n=!0,s&&x(e,e._tileLoadQueueHigh,i,t)}if(f.canRefine(i)){if(l.upsampledFromParent&&u.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent)return F(e,i),x(e,e._tileLoadQueueMedium,i,t),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),o.allAreRenderable=i.renderable,o.anyWereRenderedLastFrame=p===C.RENDERED,o.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=C.RENDERED,void(o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=C.REFINED;var b=e._tilesToRender.length,S=e._tileLoadQueueLow.length,T=e._tileLoadQueueMedium.length,E=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(M(e,l,u,c,d,t,n,o),b!==e._tilesToRender.length){var w=o.allAreRenderable,P=o.anyWereRenderedLastFrame,D=o.notYetRenderableCount,I=!1;if(!w&&!P){for(var R=e._tilesToRender,O=b;O<R.length;++O)for(var N=R[O];void 0!==N&&N._lastSelectionResult!==C.KICKED&&N!==i;)N._lastSelectionResult=C.kick(N._lastSelectionResult),N=N.parent;e._tilesToRender.length=b,e._tileToUpdateHeights.length=A,F(e,i),i._lastSelectionResult=C.RENDERED;var B=p===C.RENDERED;!B&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=S,e._tileLoadQueueMedium.length=T,e._tileLoadQueueHigh.length=E,x(e,e._tileLoadQueueMedium,i,t),o.notYetRenderableCount=i.renderable?0:1,I=!0),o.allAreRenderable=i.renderable,o.anyWereRenderedLastFrame=B,B||e._tileToUpdateHeights.push(i),++a.tilesWaitingForChildren}e.preloadAncestors&&!I&&x(e,e._tileLoadQueueLow,i,t)}}else i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=C.RENDERED,F(e,i),x(e,e._tileLoadQueueHigh,i,t),o.allAreRenderable=i.renderable,o.anyWereRenderedLastFrame=p===C.RENDERED,o.notYetRenderableCount=i.renderable?0:1}function M(e,t,i,r,n,o,a,s){var l=o.camera.positionCartographic,u=e._tileProvider,c=e._occluders,d=Y[t.level],h=d.southwest,p=d.southeast,f=d.northwest,m=d.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(O(e,t,u,o,c,a,h),O(e,i,u,o,c,a,p),O(e,r,u,o,c,a,f),O(e,n,u,o,c,a,m)):(O(e,r,u,o,c,a,f),O(e,t,u,o,c,a,h),O(e,n,u,o,c,a,m),O(e,i,u,o,c,a,p)):l.latitude<t.rectangle.north?(O(e,i,u,o,c,a,p),O(e,t,u,o,c,a,h),O(e,n,u,o,c,a,m),O(e,r,u,o,c,a,f)):(O(e,n,u,o,c,a,m),O(e,r,u,o,c,a,f),O(e,i,u,o,c,a,p),O(e,t,u,o,c,a,h)),d.combine(s)}function R(e,t){var i=t.rectangle;return r(e._cameraPositionCartographic)&&p.contains(i,e._cameraPositionCartographic)||r(e._cameraReferenceFrameOriginCartographic)&&p.contains(i,e._cameraReferenceFrameOriginCartographic)}function O(e,t,i,n,o,a,s){if(i.computeTileVisibility(t,n,o)!==f.NONE)return I(e,n,t,a,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,R(e,t)){r(t.data)&&r(t.data.vertexArray)||x(e,e._tileLoadQueueMedium,t,n);var l=e._lastSelectionFrameNumber,u=t._lastSelectionResultFrame===l?t._lastSelectionResult:C.NONE;u!==C.CULLED_BUT_NEEDED&&u!==C.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=C.CULLED_BUT_NEEDED}else e.preloadSiblings||0===t.level?(x(e,e._tileLoadQueueLow,t,n),t._lastSelectionResult=C.CULLED):t._lastSelectionResult=C.CULLED;t._lastSelectionResultFrame=n.frameNumber}function L(e,t,i){if(t.mode===v.SCENE2D||t.camera.frustum instanceof c||t.camera.frustum instanceof d)return N(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 N(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!==v.SCENE2D&&(h-=l.fog(i._distance,t.fog.density)*t.fog.sse),h}function F(e,t){e._tilesToRender.push(t)}function B(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var o=s()+e._loadQueueTimeSlice,a=e._tileProvider,l=z(e,t,a,o,i,!1);l=z(e,t,a,o,r,l),z(e,t,a,o,n,l)}}function k(e,t){return e._loadPriority-t._loadPriority}function z(e,t,i,r,n,o){void 0!==i.computeTileLoadPriority&&n.sort(k);for(var a=0,l=n.length;a<l&&(s()<r||!o);++a){var u=n[a];e._tileReplacementQueue.markTileRendered(u),i.loadTile(t,u),o=!0}return o}function V(n,o){if(n.tileProvider.ready){var a=Z;a.length=0;for(var l,u=n._tileToUpdateHeights,c=n._tileProvider.terrainProvider,d=s(),h=n._updateHeightsTimeSlice,f=d+h,m=o.mode,_=o.mapProjection,g=n.tileProvider.tilingScheme.ellipsoid;u.length>0;){var y=u[0];if(r(y.data)&&r(y.data.mesh)){var b=y.customData,S=b.length,T=!1;for(l=n._lastTileIndex;l<S;++l){var E=b[l];if(y.level>E.level){if(r(E.positionOnEllipsoidSurface)||(E.positionOnEllipsoidSurface=e.fromRadians(E.positionCartographic.longitude,E.positionCartographic.latitude,0,g)),m===v.SCENE3D){var A=g.geodeticSurfaceNormal(E.positionOnEllipsoidSurface,X.direction),w=g.getSurfaceNormalIntersectionWithZAxis(E.positionOnEllipsoidSurface,11500,X.origin);if(!r(w)){var x;r(y.data.tileBoundingRegion)&&(x=y.data.tileBoundingRegion.minimumHeight);var P=Math.min(i(x,0),-11500),D=e.multiplyByScalar(A,Math.abs(P)+1,K);e.subtract(E.positionOnEllipsoidSurface,D,X.origin)}}else t.clone(E.positionCartographic,Q),Q.height=-11500,_.project(Q,K),e.fromElements(K.z,K.x,K.y,K),e.clone(K,X.origin),e.clone(e.UNIT_X,X.direction);var I=y.data.pick(X,m,_,!1,K);r(I)&&(E.callback(I),E.level=y.level)}else if(y.level===E.level){for(var M,R=y.children,O=R.length,L=0;L<O&&(M=R[L],!p.contains(M.rectangle,E.positionCartographic));++L);var N=c.getTileDataAvailable(M.x,M.y,M.level),F=y.parent;(r(N)&&!N||r(F)&&r(F.data)&&r(F.data.terrainData)&&!F.data.terrainData.isChildAvailable(F.x,F.y,M.x,M.y))&&E.removeFunc()}if(s()>=f){T=!0;break}}if(T){n._lastTileIndex=l;break}n._lastTileIndex=0,u.shift()}else{var B=y._lastSelectionResultFrame===n._lastSelectionFrameNumber?y._lastSelectionResult:C.NONE;B!==C.RENDERED&&B!==C.CULLED_BUT_NEEDED||a.push(y),u.shift(),n._lastTileIndex=0}}for(l=0;l<a.length;l++)u.push(a[l])}}function U(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=0,o=r.length;n<o;++n){var a=r[n];i.showTileThisFrame(a,t)}}n(b.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),b.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},b.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==g.START&&e(t),t=t.replacementNext},b.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},b.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},b.prototype.update=function(e){r(this._tileProvider.update)&&this._tileProvider.update(e)},b.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(S(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),T(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},b.prototype.render=function(e){var t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),w(this,e),U(this,e),i.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&i.updateForPick(e)},b.prototype.endFrame=function(e){e.passes.render&&e.mode!==v.MORPHING&&(B(this,e),V(this,e),E(this,e))},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var G,H=new t,W=new e,q=[];D.prototype.combine=function(e){var t=this.southwest,i=this.southeast,r=this.northwest,n=this.northeast;e.allAreRenderable=t.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable&&n.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount+n.notYetRenderableCount};for(var Y=new Array(30),j=0;j<Y.length;++j)Y[j]=new D;var X=new h,Q=new t,K=new e,Z=[];return b}),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/Ray","../Core/Rectangle","../Core/Resource","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode","./TileSelectionResult"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P){"use strict";function D(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new E;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new S,this._material=void 0,this._surface=new A({tileProvider:new T({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new d,I(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new m({url:t("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.showGroundAtmosphere=!0,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=x.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0}function I(e){var t=[],i=o(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),r=[C];!o(e._material)||i&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.uniformMap=void 0:(r.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.uniformMap=e._material._uniforms),r.push(v),e._surfaceShaderSet.baseVertexShaderSource=new _({sources:[C,y],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new _({sources:r,defines:t}),e._surfaceShaderSet.material=e._material}function M(t){return function(i,r){return e.distanceSquaredTo(i.pickBoundingSphere,t)-e.distanceSquaredTo(r.pickBoundingSphere,t)}}function R(e,t){return f.contains(e.rectangle,t)?e:void 0}a(D.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return!o(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){o(e)||(e=f.clone(f.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),o(this._material)&&I(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,I(this))}}});var O=[],L={start:0,stop:0};D.prototype.pickWorldCoordinates=function(t,r,n){var a=r.mode,s=r.mapProjection,l=O;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;if(a!==w.SCENE3D)f.pickBoundingSphere=m=e.fromRectangleWithHeights2D(u.rectangle,s,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,m),i.fromElements(m.center.z,m.center.x,m.center.y,m.center);else{if(!o(f.renderedMesh))continue;e.clone(f.renderedMesh.boundingSphere3D,m)}var _=h.raySphere(t,m,L);o(_)&&l.push(f)}}l.sort(M(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var N=new r;D.prototype.pick=function(e,t,r){if(r=this.pickWorldCoordinates(e,t,r),o(r)&&t.mode!==w.SCENE3D){r=i.fromElements(r.y,r.z,r.x,r);var n=t.mapProjection.unproject(r,N);r=t.globe.ellipsoid.cartographicToCartesian(n,r)}return r};var F=new i,B=new i,k=new r,z=new p;return D.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!f.contains(r.rectangle,e));++a);if(!(a>=s)){for(;r._lastSelectionResult===P.REFINED;)r=R(r.southwestChild,e)||R(r.southeastChild,e)||R(r.northwestChild,e)||r.northeastChild;if(o(r.data)&&o(r.data.renderedMesh)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,F),c=z,d=l.geodeticSurfaceNormal(u,c.direction),h=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(h)){var p;o(r.data.tileBoundingRegion)&&(p=r.data.tileBoundingRegion.minimumHeight);var m=Math.min(n(p,0),-11500),_=i.multiplyByScalar(d,Math.abs(m)+1,B);i.subtract(u,_,c.origin)}var g=r.data.pick(c,void 0,void 0,!1,B);if(o(g))return l.cartesianToCartographic(g,k).height}}}},D.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},D.prototype.beginFrame=function(e){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;var a=this._oceanNormalMapResource,s=a.url;if(o(s)){var l=this;b(a.fetchImage(),function(t){s===l._oceanNormalMapResource.url&&(l._oceanNormalMap=l._oceanNormalMap&&l._oceanNormalMap.destroy(),l._oceanNormalMap=new g({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var u=e.passes,c=e.mode;u.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.nightFadeOutDistance=this.nightFadeOutDistance,i.nightFadeInDistance=this.nightFadeInDistance,i.zoomedOutOceanSpecularIntensity=c===w.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.showGroundAtmosphere=this.showGroundAtmosphere,i.shadows=this.shadows,i.hueShift=this.atmosphereHueShift,i.saturationShift=this.atmosphereSaturationShift,i.brightnessShift=this.atmosphereBrightnessShift,i.fillHighlightColor=this.fillHighlightColor,t.beginFrame(e))},D.prototype.render=function(e){this.show&&(o(this._material)&&this._material.update(e.context),this._surface.render(e))},D.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},D}),define("Shaders/PostProcessStages/DepthViewPacked",[],function(){"use strict";return"uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nfloat z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\nfloat scale = pow(z_ndc * 0.5 + 0.5, 8.0);\ngl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"}),define("Shaders/PostProcessStages/PassThrough",[],function(){"use strict";return"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n"}),define("Shaders/PostProcessStages/PassThroughDepth",[],function(){"use strict";return"uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n"}),define("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureWrap","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Shaders/PostProcessStages/DepthViewPacked","../Shaders/PostProcessStages/PassThrough","../Shaders/PostProcessStages/PassThroughDepth","./StencilConstants","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function b(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this._tempGlobeDepthTexture=void 0,this._tempCopyDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._tempCopyDepthFramebuffer=void 0,this._updateDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useLogDepth=void 0,this._useHdr=void 0,this._debugGlobeDepthViewportCommand=void 0}function S(e,t,r,n){if(!i(e._debugGlobeDepthViewportCommand)||n!==e._useLogDepth){var o=new u({defines:[n?"LOG_DEPTH":""],sources:["uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \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(o,{uniformMap:{u_depthTexture:function(){return e._globeDepthTexture}},owner:e}),e._useLogDepth=n}e._debugGlobeDepthViewportCommand.execute(t,r)}function T(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 E(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function A(e){e._tempCopyDepthFramebuffer=e._tempCopyDepthFramebuffer&&!e._tempCopyDepthFramebuffer.isDestroyed()&&e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer=e._updateDepthFramebuffer&&!e._updateDepthFramebuffer.isDestroyed()&&e._updateDepthFramebuffer.destroy(),e._tempGlobeDepthTexture=e._tempGlobeDepthTexture&&!e._tempGlobeDepthTexture.isDestroyed()&&e._tempGlobeDepthTexture.destroy()}function w(e,t,i,r,o){e._tempGlobeDepthTexture=new d({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new c({wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:f.NEAREST,magnificationFilter:p.NEAREST})}),e._tempCopyDepthFramebuffer=new a({context:t,colorTextures:[e._tempGlobeDepthTexture],destroyAttachments:!1}),e._updateDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],depthStencilTexture:o.framebuffer.depthStencilTexture,destroyAttachments:!1})}function x(e,t,i,r,o){var a=o?t.halfFloatingPointTexture?s.HALF_FLOAT:s.FLOAT:s.UNSIGNED_BYTE;e._colorTexture=new d({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:a,sampler:new c({wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:f.NEAREST,magnificationFilter:p.NEAREST})}),e._depthStencilTexture=new d({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new d({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new c({wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:f.NEAREST,magnificationFilter:p.NEAREST})})}function P(e,t){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 D(e,t,r,n,o){var a=e._colorTexture,s=!i(a)||a.width!==r||a.height!==n||o!==e._useHdr;i(e.framebuffer)&&!s||(T(e),E(e),x(e,t,r,n,o),P(e,t))}function I(r,n,a,s,u){r._viewport.width=a,r._viewport.height=s;var c=!e.equals(r._viewport,u.viewport),d=c!==r._useScissorTest;r._useScissorTest=c,e.equals(r._scissorRectangle,u.viewport)||(r._scissorRectangle=e.clone(u.viewport,r._scissorRectangle),d=!0),i(r._rs)&&e.equals(r._viewport,r._rs.viewport)&&!d||(r._rs=l.fromCache({viewport:r._viewport,scissorTest:{enabled:r._useScissorTest,rectangle:r._scissorRectangle}}),r._rsUpdate=l.fromCache({viewport:r._viewport,scissorTest:{enabled:r._useScissorTest,rectangle:r._scissorRectangle},stencilTest:{enabled:!0,frontFunction:y.EQUAL,frontOperation:{fail:C.KEEP,zFail:C.KEEP,zPass:C.KEEP},backFunction:y.NEVER,reference:v.CESIUM_3D_TILE_MASK,mask:v.CESIUM_3D_TILE_MASK}})),i(r._copyDepthCommand)||(r._copyDepthCommand=n.createViewportQuadCommand(g,{uniformMap:{u_depthTexture:function(){return r._depthStencilTexture}},owner:r})),r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,r._copyDepthCommand.renderState=r._rs,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(_,{uniformMap:{colorTexture:function(){return r._colorTexture}},owner:r})),r._copyColorCommand.renderState=r._rs,i(r._tempCopyDepthCommand)||(r._tempCopyDepthCommand=n.createViewportQuadCommand(g,{uniformMap:{u_depthTexture:function(){return r._tempCopyDepthTexture}},owner:r})),r._tempCopyDepthCommand.framebuffer=r._tempCopyDepthFramebuffer,r._tempCopyDepthCommand.renderState=r._rs,i(r._updateDepthCommand)||(r._updateDepthCommand=n.createViewportQuadCommand(_,{uniformMap:{colorTexture:function(){return r._tempGlobeDepthTexture}},owner:r})),r._updateDepthCommand.framebuffer=r._updateDepthFramebuffer,r._updateDepthCommand.renderState=r._rsUpdate,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return b.prototype.executeDebugGlobeDepth=function(e,t,i){S(this,e,t,i)},b.prototype.update=function(e,t,i,r){var n=i.width,o=i.height;D(this,e,n,o,r),I(this,e,n,o,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r},b.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},b.prototype.executeUpdateDepth=function(e,t,r){var n=t.framebuffer.depthStencilTexture;if(r||n!==this._depthStencilTexture){if(i(this._updateDepthCommand)){if(!i(this._updateDepthFramebuffer)||this._updateDepthFramebuffer.depthStencilTexture!==n||this._updateDepthFramebuffer.getColorTexture(0)!==this._globeDepthTexture){var o=this._globeDepthTexture.width,a=this._globeDepthTexture.height;A(this),w(this,e,o,a,t),I(this,e,o,a,t)}this._tempCopyDepthTexture=n,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}}else i(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},b.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},b.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){T(this),E(this),A(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)},b}),define("Scene/GoogleEarthEnterpriseImageryProvider",["../Core/Credit","../Core/decodeGoogleEarthEnterpriseData","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/GoogleEarthEnterpriseMetadata","../Core/loadImageFromTypedArray","../Core/Math","../Core/Rectangle","../Core/Request","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/protobuf-minimal","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(){this._image=new Image}function y(t){t=i(t,i.EMPTY_OBJECT);var n;if(r(t.metadata))n=t.metadata;else{var o=p.createIfNeeded(t.url);n=new l(o)}this._metadata=n,this._tileDiscardPolicy=t.tileDiscardPolicy,this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new d(-c.PI,-c.PI,c.PI,c.PI),ellipsoid:t.ellipsoid});var u=t.credit;"string"==typeof u&&(u=new e(u)),this._credit=u,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,r(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new v),this._errorEvent=new a,this._ready=!1;var h,_=this;this._readyPromise=n.readyPromise.then(function(e){if(!n.imageryPresent){var t=new f("The server "+n.url+" doesn't have imagery");return h=m.handleError(h,_,_._errorEvent,t.message,void 0,void 0,void 0,t),g.reject(t)}return m.handleSuccess(h),_._ready=e,e}).otherwise(function(e){return h=m.handleError(h,_,_._errorEvent,e.message,void 0,void 0,void 0,e),g.reject(e)})}function C(e,t,i,n,o,a){var s=l.tileXYToQuadKey(i,n,o),u=t.imageryVersion;return u=r(u)&&u>0?u:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+s+"-i."+u.toString(),request:a})}function b(e){var t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";var i="PNG";return e[1]===i.charCodeAt(0)&&e[2]===i.charCodeAt(1)&&e[3]===i.charCodeAt(2)?"image/png":void 0}function S(e){for(var t=_.Reader.create(e),i=t.len,n={};t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:n.imageType=t.uint32();break;case 2:n.imageData=t.bytes();break;case 3:n.alphaType=t.uint32();break;case 4:n.imageAlpha=t.bytes();break;case 5:var a=n.copyrightIds;if(r(a)||(a=n.copyrightIds=[]),2==(7&o))for(var s=t.uint32()+t.pos;t.pos<s;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&o)}}var l=n.imageType;if(r(l))switch(l){case 0:n.imageType="image/jpeg";break;case 4:
- n.imageType="image/png";break;default:throw new f("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}var u=n.alphaType;return r(u)&&0!==u&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete n.alphaType,delete n.imageAlpha),n}return v.prototype.isReady=function(){return!0},v.prototype.shouldDiscardImage=function(e){return e===this._image},n(y.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.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._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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),y.prototype.getTileCredits=function(e,t,i){var n=this._metadata,o=n.getTileInformation(e,t,i);if(r(o)){var a=n.providers[o.imageryProvider];if(r(a))return[a]}},y.prototype.requestImage=function(e,i,n,o){var a=this._tileDiscardPolicy._image,s=this._metadata,c=l.tileXYToQuadKey(e,i,n),d=s.getTileInformation(e,i,n);if(!r(d)){if(s.isValid(c)){var p=new h({throttle:o.throttle,throttleByServer:o.throttleByServer,type:o.type,priorityFunction:o.priorityFunction});return void s.populateSubtree(e,i,n,p)}return a}if(!d.hasImagery())return a;var f=C(this,d,e,i,n,o).fetchArrayBuffer();return r(f)?f.then(function(e){t(s.key,e);var i,n=new Uint8Array(e),o=s.protoImagery;if(r(o)&&o||(i=b(n)),!r(i)&&(!r(o)||o)){var l=S(n);i=l.imageType,n=l.imageData}return r(i)&&r(n)?u({uint8Array:n,format:i,flipY:!0}):a}):void 0},y.prototype.pickFeatures=function(e,t,i,r,n){},y}),define("Scene/GoogleEarthEnterpriseMapsProvider",["../Core/buildModuleUrl","../Core/Check","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){function t(t){var i;try{i=JSON.parse(t)}catch(e){i=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var r,o=0;o<i.layers.length;o++)if(i.layers[o].id===b._channel){r=i.layers[o];break}var s;if(!n(r))throw s="Could not find layer with channel (id) of "+b._channel+".",y=h.handleError(y,b,b._errorEvent,s,void 0,void 0,void 0,a),new d(s);if(!n(r.version))throw s="Could not find a version in channel (id) "+b._channel+".",y=h.handleError(y,b,b._errorEvent,s,void 0,void 0,void 0,a),new d(s);if(b._version=r.version,n(i.projection)&&"flat"===i.projection)b._tilingScheme=new l({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new u(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:e.ellipsoid});else{if(n(i.projection)&&"mercator"!==i.projection)throw s="Unsupported projection "+i.projection+".",y=h.handleError(y,b,b._errorEvent,s,void 0,void 0,void 0,a),new d(s);b._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid})}b._ready=!0,b._readyPromise.resolve(!0),h.handleSuccess(y)}function o(e){var t="An error occurred while accessing "+C.url+".";y=h.handleError(y,b,b._errorEvent,t,void 0,void 0,void 0,a),b._readyPromise.reject(new d(t))}function a(){var e=C.fetchText();f(e,t,o)}e=r(e,{});var m=e.url,g=r(e.path,"/default_map"),v=c.createIfNeeded(m).getDerivedResource({url:"/"===g[0]?g.substring(1):g});v.appendForwardSlash(),this._resource=v,this._url=m,this._path=g,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new i('<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="'+_.logoUrl+'" title="Google Imagery"/></a>'),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new s,this._ready=!1,this._readyPromise=f.defer();var y,C=v.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),b=this;a()}return o(_.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.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}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i,r){var n=this._resource.getDerivedResource({url:"query",request:r,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:i+1}});return m.loadImage(this,n)},_.prototype.pickFeatures=function(e,t,i,r,n){},_._logoUrl=void 0,o(_,{logoUrl:{get:function(){return n(_._logoUrl)||(_._logoUrl=e("Assets/Images/google_earth_credit.png")),_._logoUrl},set:function(e){_._logoUrl=e}}}),_}),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=this._canvasSize,i=0;i<=this._cells;++i){var r=i/this._cells,n=1+r*(t-1);e.moveTo(n,0),e.lineTo(n,t),e.moveTo(0,n),e.lineTo(t,n)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(0,0,t,t);var n=this._glowColor.toCssColorString();i.strokeStyle=n,i.lineWidth=this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i);var o=this._color.toCssColorString();return i.strokeStyle=o,i.lineWidth=2,i.strokeRect(0,0,t,t),i.lineWidth=1,this._drawGrid(i),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i,r){return this._canvas},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),define("Scene/InvertClassification",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessStages/PassThrough","./BlendingState","./StencilConstants","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y){"use strict";function C(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new o({color:new e(0,0,0,0),owner:this}),this._clearCommand=new o({color:new e(0,0,0,0),depth:1,stencil:0});var t=this;this._uniformMap={colorTexture:function(){return t._texture},depthTexture:function(){return t._depthStencilTexture},classifiedTexture:function(){return t._classifiedTexture}}}i(C.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),C.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var b={depthMask:!1,stencilTest:{enabled:!0,frontFunction:v.EQUAL,frontOperation:{fail:y.KEEP,zFail:y.KEEP,zPass:y.KEEP},backFunction:v.NEVER,reference:0,mask:g.CLASSIFICATION_MASK},blending:_.ALPHA_BLEND},S={depthMask:!1,stencilTest:{enabled:!0,frontFunction:v.NOT_EQUAL,frontOperation:{fail:y.KEEP,zFail:y.KEEP,zPass:y.KEEP},backFunction:v.NEVER,reference:0,mask:g.CLASSIFICATION_MASK},blending:_.ALPHA_BLEND},T={depthMask:!0,depthTest:{enabled:!0},stencilTest:g.setCesium3DTileBit(),stencilMask:g.CESIUM_3D_TILE_MASK,blending:_.ALPHA_BLEND};return C.prototype.update=function(e){var i=this._texture,r=!t(i)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var o=e.drawingBufferWidth,_=e.drawingBufferHeight,g=!t(i)||i.width!==o||i.height!==_;if((g||r)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new d({context:e,width:o,height:_,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new u({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:h.LINEAR})}),t(this._previousFramebuffer)||(this._classifiedTexture=new d({context:e,width:o,height:_,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new u({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:h.LINEAR})}),this._depthStencilTexture=new d({context:e,width:o,height:_,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}))),!t(this._fbo)||g||r){this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy();var v,y;t(this._previousFramebuffer)?(v=this._previousFramebuffer.depthStencilTexture,y=this._previousFramebuffer.depthStencilRenderbuffer):v=this._depthStencilTexture,this._fbo=new a({context:e,colorTextures:[this._texture],depthStencilTexture:v,depthStencilRenderbuffer:y,destroyAttachments:!1}),t(this._previousFramebuffer)||(this._fboClassified=new a({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:v,destroyAttachments:!1}))}if(t(this._rsUnclassified)||(this._rsUnclassified=l.fromCache(b),this._rsClassified=l.fromCache(S),this._rsDefault=l.fromCache(T)),!t(this._unclassifiedCommand)||r){t(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());var C=t(this._previousFramebuffer)?"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n gl_FragColor = color * czm_invertClassificationColor;\n#else\n gl_FragColor = color;\n#endif\n}\n":"#extension GL_EXT_frag_depth : enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n gl_FragColor = color * highlightColor;\n gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\n}\n",E=new c({defines:["UNCLASSIFIED"],sources:[C]}),A=new c({sources:[C]});this._unclassifiedCommand=e.createViewportQuadCommand(E,{renderState:t(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(A,{renderState:t(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),t(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),t(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(m,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},C.prototype.clear=function(e,i){var r=i.framebuffer;t(this._previousFramebuffer)?(i.framebuffer=this._fbo,this._clearColorCommand.execute(e,i)):(i.framebuffer=this._fbo,this._clearCommand.execute(e,i),i.framebuffer=this._fboClassified,this._clearCommand.execute(e,i)),i.framebuffer=r},C.prototype.executeClassified=function(e,i){if(!t(this._previousFramebuffer)){var r=i.framebuffer;i.framebuffer=this._fboClassified,this._translucentCommand.execute(e,i),i.framebuffer=r}this._classifiedCommand.execute(e,i)},C.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),t(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),r(this)},C}),define("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/isArray","../Core/Math","../Core/Rectangle","../Core/Resource","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(e){this._errorEvent=new u,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=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._tags=void 0,this._pickFeaturesTags=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function y(e,t,i,r,n){te=!1,re=!1;var o=e._resource,s=o.getUrlComponent(!0),l=e._tags,u={},c=s.match(J);return a(c)&&c.forEach(function(n){var o=n.substring(1,n.length-1);a(l[o])&&(u[o]=l[o](e,t,i,r))}),o.getDerivedResource({request:n,templateValues:u})}function C(e,t,i,r,n,o,s){te=!1,re=!1,oe=!1,se=!1;var l=e._pickFeaturesResource,u=l.getUrlComponent(!0),c=e._pickFeaturesTags,d={},h=u.match(J);return a(h)&&h.forEach(function(l){var u=l.substring(1,l.length-1);a(c[u])&&(d[u]=c[u](e,t,i,r,n,o,s))}),l.getDerivedResource({templateValues:d})}function b(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 S(e,t,i,r){return b(e,"{x}",t)}function T(e,t,i,r){return b(e,"{reverseX}",e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1)}function E(e,t,i,r){return b(e,"{y}",i)}function A(e,t,i,r){return b(e,"{reverseY}",e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1)}function w(e,t,i,r){var n=e.maximumLevel;return b(e,"{reverseZ}",a(n)&&r<n?n-r-1:r)}function x(e,t,i,r){return b(e,"{z}",r)}function P(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function D(e,t,i,r){te||(e.tilingScheme.tileXYToRectangle(t,i,r,ie),ie.west=h.toDegrees(ie.west),ie.south=h.toDegrees(ie.south),ie.east=h.toDegrees(ie.east),ie.north=h.toDegrees(ie.north),te=!0)}function I(e,t,i,r){return D(e,t,i,r),ie.west}function M(e,t,i,r){return D(e,t,i,r),ie.south}function R(e,t,i,r){return D(e,t,i,r),ie.east}function O(e,t,i,r){return D(e,t,i,r),ie.north}function L(e,t,i,r){re||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,ne),re=!0)}function N(e,t,i,r){return L(e,t,i,r),ne.west}function F(e,t,i,r){return L(e,t,i,r),ne.south}function B(e,t,i,r){return L(e,t,i,r),ne.east}function k(e,t,i,r){return L(e,t,i,r),ne.north}function z(e,t,i,r){return e.tileWidth}function V(e,t,i,r){return e.tileHeight}function U(e,t,i,r,n,o,a){return q(e,t,i,r,n,o),ae.x}function G(e,t,i,r,n,o,a){return q(e,t,i,r,n,o),ae.y}function H(e,t,i,r,n,o,a){return q(e,t,i,r,n,o),e.tileWidth-ae.x-1}function W(e,t,i,r,n,o,a){return q(e,t,i,r,n,o),e.tileHeight-ae.y-1}function q(e,t,i,r,n,o,a){if(!oe){K(e,t,i,r,n,o);var s=ue,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,le);ae.x=e.tileWidth*(s.x-l.west)/l.width|0,ae.y=e.tileHeight*(l.north-s.y)/l.height|0,oe=!0}}function Y(e,t,i,r,n,o,a){return h.toDegrees(n)}function j(e,t,i,r,n,o,a){return h.toDegrees(o)}function X(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),ue.x}function Q(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),ue.y}function K(e,t,i,r,n,o,a){if(!se){if(e.tilingScheme.projection instanceof c)ue.x=h.toDegrees(n),ue.y=h.toDegrees(o);else{var s=ce;s.longitude=n,s.latitude=o,e.tilingScheme.projection.project(s,ue)}se=!0}}function Z(e,t,i,r,n,o,a){return a}var J=/{[^}]+}/g,$={x:S,y:E,z:x,s:P,reverseX:T,reverseY:A,reverseZ:w,westDegrees:I,southDegrees:M,eastDegrees:R,northDegrees:O,westProjected:N,southProjected:F,eastProjected:B,northProjected:k,width:z,height:V},ee=r($,{i:U,j:G,reverseI:H,reverseJ:W,longitudeDegrees:Y,latitudeDegrees:j,longitudeProjected:X,latitudeProjected:Q,format:Z});s(v.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.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._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),v.prototype.reinitialize=function(e){var t=this;t._readyPromise=_(e).then(function(e){var i=e.customTags,s=r($,i),l=r(ee,i),u=f.createIfNeeded(e.url),c=f.createIfNeeded(e.pickFeaturesUrl);t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=o(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),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 m({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=p.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var h=e.credit;return"string"==typeof h&&(h=new n(h)),t._credit=h,t._resource=u,t._tags=s,t._pickFeaturesResource=c,t._pickFeaturesTags=l,!0})},v.prototype.getTileCredits=function(e,t,i){},v.prototype.requestImage=function(e,t,i,r){return g.loadImage(this,y(this,e,t,i,r))},v.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return _([]);var a=u._getFeatureInfoFormats[l],c=C(u,e,t,i,r,n,a.format);return++l,"json"===a.type?c.fetchJson().then(a.callback).otherwise(s):"xml"===a.type?c.fetchXML().then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?c.fetchText().then(a.callback).otherwise(s):c.fetch({responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var te=!1,ie=new p,re=!1,ne=new p,oe=!1,ae=new e,se=!1,le=new p,ue=new t,ce=new i;return v}),define("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/Rectangle","../Core/Resource","../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(l){for(var h,p,f,m=/tileformat/i,S=/tileset/i,T=/tilesets/i,E=/boundingbox/i,A=[],w=l.childNodes[0].childNodes,x=0;x<w.length;x++)if(m.test(w.item(x).nodeName))h=w.item(x);else if(T.test(w.item(x).nodeName)){f=w.item(x);for(var P=w.item(x).childNodes,D=0;D<P.length;D++)S.test(P.item(D).nodeName)&&A.push(P.item(D))}else E.test(w.item(x).nodeName)&&(p=w.item(x));var I;if(!r(f)||!r(p))return I="Unable to find expected tilesets or bbox attributes in "+y.url+".",g=c.handleError(g,b,b.errorEvent,I,void 0,void 0,void 0,_),void(g.retry||C.reject(new u(I)));var M=i(n.fileExtension,h.getAttribute("extension")),R=i(n.tileWidth,parseInt(h.getAttribute("width"),10)),O=i(n.tileHeight,parseInt(h.getAttribute("height"),10)),L=i(n.minimumLevel,parseInt(A[0].getAttribute("order"),10)),N=i(n.maximumLevel,parseInt(A[A.length-1].getAttribute("order"),10)),F=f.getAttribute("profile"),B=n.tilingScheme;if(!r(B))if("geodetic"===F||"global-geodetic"===F)B=new a({ellipsoid:n.ellipsoid});else{if("mercator"!==F&&"global-mercator"!==F)return I=y.url+"specifies an unsupported profile attribute, "+F+".",g=c.handleError(g,b,b.errorEvent,I,void 0,void 0,void 0,_),void(g.retry||C.reject(new u(I)));B=new d({ellipsoid:n.ellipsoid})}var k=s.clone(n.rectangle);if(!r(k)){var z,V,U,G;i(n.flipXY,!1)?(U=new e(parseFloat(p.getAttribute("miny")),parseFloat(p.getAttribute("minx"))),G=new e(parseFloat(p.getAttribute("maxy")),parseFloat(p.getAttribute("maxx")))):(U=new e(parseFloat(p.getAttribute("minx")),parseFloat(p.getAttribute("miny"))),G=new e(parseFloat(p.getAttribute("maxx")),parseFloat(p.getAttribute("maxy"))));var H="geodetic"===F||"mercator"===F;if(B.projection instanceof o||H)z=t.fromDegrees(U.x,U.y),V=t.fromDegrees(G.x,G.y);else{var W=B.projection;z=W.unproject(U),V=W.unproject(G)}k=new s(z.longitude,z.latitude,V.longitude,V.latitude)}k.west<B.rectangle.west&&(k.west=B.rectangle.west),k.east>B.rectangle.east&&(k.east=B.rectangle.east),k.south<B.rectangle.south&&(k.south=B.rectangle.south),k.north>B.rectangle.north&&(k.north=B.rectangle.north);var q=B.positionToTileXY(s.southwest(k),L),Y=B.positionToTileXY(s.northeast(k),L);(Math.abs(Y.x-q.x)+1)*(Math.abs(Y.y-q.y)+1)>4&&(L=0);var j=v.getDerivedResource({url:"{z}/{x}/{reverseY}."+M});C.resolve({url:j,tilingScheme:B,rectangle:k,tileWidth:R,tileHeight:O,minimumLevel:L,maximumLevel:N,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function m(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),a=i(n.tileHeight,256),s=i(n.minimumLevel,0),l=n.maximumLevel,u=r(n.tilingScheme)?n.tilingScheme:new d({ellipsoid:n.ellipsoid}),c=i(n.rectangle,u.rectangle),h=v.getDerivedResource({url:"{z}/{x}/{reverseY}."+t});C.resolve({url:h,tilingScheme:u,rectangle:c,tileWidth:o,tileHeight:a,minimumLevel:s,maximumLevel:l,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){y.fetchXML().then(f).otherwise(m)}n=i(n,{});var g,v,y,C=h.defer(),b=new p(C.promise);return h(n.url).then(function(e){v=l.createIfNeeded(e),v.appendForwardSlash(),y=v.getDerivedResource({url:"tilemapresource.xml"}),_()}).otherwise(function(e){C.reject(e)}),b}return f}),define("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","../Core/Resource","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s){"use strict";function l(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,l=r.url;i(l)||(l="https://{s}.tiles.mapbox.com/v4/"),this._url=l;var d=a.createIfNeeded(l),h=o.getAccessToken(r.accessToken);this._mapId=n,this._accessToken=h,this._accessTokenErrorCredit=e.clone(o.getErrorCredit(r.accessToken));var p=t(r.format,"png");/\./.test(p)||(p="."+p),this._format=p;var f=d.getUrlComponent();u.test(f)||(f+="/"),f+=n+"/{z}/{x}/{y}"+this._format,d.url=f,d.setQueryParameters({access_token:h});var m;i(r.credit)?"string"==typeof(m=r.credit)&&(m=new e(m)):m=c,this._resource=d,this._imageryProvider=new s({url:d,credit:m,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var u=/\/$/,c=new e('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');return r(l.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}}}),l.prototype.getTileCredits=function(e,t,r){if(i(this._accessTokenErrorCredit))return[this._accessTokenErrorCredit]},l.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},l.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},l._defaultCredit=c,l}),define("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(i){function r(e){v._image=e,v._tileWidth=e.width,v._tileHeight=e.height,v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(v._errorEvent)}function n(e){var t="Failed to load image "+p.url+".";g=c.handleError(g,v,v._errorEvent,t,0,0,0,h,e),v._readyPromise.reject(new u(t))}function h(){p.fetchImage().then(r).otherwise(n)}i=t(i,{});var p=l.createIfNeeded(i.url),f=t(i.rectangle,s.MAX_VALUE),m=new a({rectangle:f,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid});this._tilingScheme=m,this._resource=p,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 _=i.credit;"string"==typeof _&&(_=new e(_)),this._credit=_;var g,v=this;h()}return r(h.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.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,r){return this._image},h.prototype.pickFeatures=function(e,t,i,r,n){},h}),define("Scene/TimeDynamicImagery",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/JulianDate","../Core/Request","../Core/RequestType"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var i=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,i.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(i)}function u(e,t,i){return e+"-"+t+"-"+i}function c(e){var t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function d(e){var t=e._times;if(i(t)){var r=e._clock,n=r.currentTime,a=r.canAnimate&&r.shouldAnimate,s=r.multiplier;if(a||0===s){var l,u=t.indexOf(n);if(!(u<0)){var c=t.get(u);return s>0?(l=o.secondsDifference(c.stop,n),++u):(l=o.secondsDifference(c.start,n),--u),l/=s,u>=0&&l<=5?t.get(u):void 0}}}}function h(e,t,r){var n=e._times.indexOf(r.start),o=e._tileCache,l=o[n];i(l)||(l=o[n]={});var u=t.key;if(i(l[u]))return!0;var d=c(u),h=new a({throttle:!0,throttleByServer:!0,type:s.IMAGERY,priorityFunction:t.priorityFunction}),p=e._requestImageFunction(d.x,d.y,d.level,h,r);return!!i(p)&&(l[u]={promise:p,request:h},!0)}return r(l.prototype,{clock:{get:function(){return this._clock},set:function(e){
- this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),l.prototype.getFromCache=function(e,t,r,n){var o,a=u(e,t,r),s=this._tileCache[this._currentIntervalIndex];if(i(s)&&i(s[a])){var l=s[a];o=l.promise.otherwise(function(e){throw n.state=l.request.state,e}),delete s[a]}return o},l.prototype.checkApproachingInterval=function(e,t,r,n){var o=u(e,t,r),a=this._tilesRequestedForInterval,s=d(this),l={key:o,priorityFunction:n.priorityFunction};i(s)&&h(this,l,s)||a.push(l),a.length>=512&&a.splice(0,256)},l.prototype._clockOnTick=function(e){var t=e.currentTime,r=this._times,n=r.indexOf(t),o=this._currentIntervalIndex;if(n!==o){var a=this._tileCache[o];for(var s in a)a.hasOwnProperty(s)&&a[s].request.cancel();return delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=n,void this._reloadFunction()}var l=d(this);if(i(l))for(var u=this._tilesRequestedForInterval,c=!0;c&&0!==u.length;){var p=u.pop();(c=h(this,p,l))||u.push(p)}},l}),define("Scene/WebMapServiceImageryProvider",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/Resource","../Core/WebMercatorProjection","./GetFeatureInfoFormat","./TimeDynamicImagery","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(i){if(i=e(i,e.EMPTY_OBJECT),t(i.times)&&!t(i.clock))throw new r("options.times was specified, so options.clock is required.");var n=a.createIfNeeded(i.url),l=n.clone();n.setQueryParameters(d.DefaultParameters,!0),l.setQueryParameters(d.GetFeatureInfoDefaultParameters,!0),t(i.parameters)&&n.setQueryParameters(f(i.parameters)),t(i.getFeatureInfoParameters)&&l.setQueryParameters(f(i.getFeatureInfoParameters));var p=this;this._reload=void 0,t(i.times)&&(this._timeDynamicImagery=new u({clock:i.clock,times:i.times,requestImageFunction:function(e,t,i,r,n){return h(p,e,t,i,r,n)},reloadFunction:function(){t(p._reload)&&p._reload()}}));var m={};m.layers=i.layers,m.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",m.width="{width}",m.height="{height}",parseFloat(n.queryParameters.version)>=1.3?m.crs=e(i.crs,i.tilingScheme&&i.tilingScheme.projection instanceof s?"EPSG:3857":"CRS:84"):m.srs=e(i.srs,i.tilingScheme&&i.tilingScheme.projection instanceof s?"EPSG:3857":"EPSG:4326"),n.setQueryParameters(m,!0),l.setQueryParameters(m,!0);var _={query_layers:i.layers,x:"{i}",y:"{j}",info_format:"{format}"};l.setQueryParameters(_,!0),this._resource=n,this._pickFeaturesResource=l,this._layers=i.layers,this._tileProvider=new c({url:n,pickFeaturesUrl:l,tilingScheme:e(i.tilingScheme,new o({ellipsoid:i.ellipsoid})),rectangle:i.rectangle,tileWidth:i.tileWidth,tileHeight:i.tileHeight,minimumLevel:i.minimumLevel,maximumLevel:i.maximumLevel,subdomains:i.subdomains,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,getFeatureInfoFormats:e(i.getFeatureInfoFormats,d.DefaultGetFeatureInfoFormats),enablePickFeatures:i.enablePickFeatures})}function h(e,i,r,n,o,a){var s=t(a)?a.data:void 0,l=e._tileProvider;return t(s)&&l._resource.setQueryParameters(s),l.requestImage(i,r,n,o)}function p(e,i,r,n,o,a,s){var l=t(s)?s.data:void 0,u=e._tileProvider;return t(l)&&u._pickFeaturesResource.setQueryParameters(l),u.pickFeatures(i,r,n,o,a)}function f(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return i(d.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.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}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}}}),d.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},d.prototype.requestImage=function(e,i,r,n){var o,a,s=this._timeDynamicImagery;return t(s)&&(a=s.currentInterval,o=s.getFromCache(e,i,r,n)),t(o)||(o=h(this,e,i,r,n,a)),t(o)&&t(s)&&s.checkApproachingInterval(e,i,r,n),o},d.prototype.pickFeatures=function(e,i,r,n,o){var a=this._timeDynamicImagery;return p(this,e,i,r,n,o,t(a)?a.currentInterval:void 0)},d.DefaultParameters=n({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),d.GetFeatureInfoDefaultParameters=n({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),d.DefaultGetFeatureInfoFormats=n([n(new l("json","application/json")),n(new l("xml","text/xml")),n(new l("text","text/html"))]),d}),define("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/Rectangle","../Core/Resource","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider","./TimeDynamicImagery"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=i(e,i.EMPTY_OBJECT);var n=c.createIfNeeded(e.url),o=e.style,s=e.tileMatrixSetID;if(n.url.indexOf("{")>=0){var p={style:o,Style:o,TileMatrixSet:s};n.setTemplateValues(p),this._useKvp=!1}else n.setQueryParameters(g),this._useKvp=!0;this._resource=n,this._layer=e.layer,this._style=o,this._tileMatrixSetID=s,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new d({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var m=this;this._reload=void 0,r(e.times)&&(this._timeDynamicImagery=new f({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return _(m,e,t,i,r,n)},reloadFunction:function(){r(m._reload)&&m._reload()}})),this._readyPromise=h.resolve(!0);var v=this._tilingScheme.positionToTileXY(u.southwest(this._rectangle),this._minimumLevel),y=this._tilingScheme.positionToTileXY(u.northeast(this._rectangle),this._minimumLevel);Math.abs(y.x-v.x),Math.abs(y.y-v.y);this._errorEvent=new a;var C=e.credit;this._credit="string"==typeof C?new t(C):C,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 _(t,i,n,o,a,s){var l,u=t._tileMatrixLabels,c=r(u)?u[o]:o.toString(),d=t._subdomains,h=t._dimensions,f=r(s)?s.data:void 0;if(t._useKvp){var m={};m.tilematrix=c,m.layer=t._layer,m.style=t._style,m.tilerow=n,m.tilecol=i,m.tilematrixset=t._tileMatrixSetID,m.format=t._format,r(h)&&(m=e(m,h)),r(f)&&(m=e(m,f)),l=t._resource.getDerivedResource({queryParameters:m,request:a})}else{var _={TileMatrix:c,TileRow:n.toString(),TileCol:i.toString(),s:d[(i+n+o)%d.length]};l=t._resource.getDerivedResource({request:a}),l.setTemplateValues(_),r(h)&&l.setTemplateValues(h),r(f)&&l.setTemplateValues(f)}return p.loadImage(t,l)}var g=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(m.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.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}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,r(this._reload)&&this._reload())}}}),m.prototype.getTileCredits=function(e,t,i){},m.prototype.requestImage=function(e,t,i,n){var o,a,s=this._timeDynamicImagery;return r(s)&&(a=s.currentInterval,o=s.getFromCache(e,t,i,n)),r(o)||(o=_(this,e,t,i,n,a)),r(o)&&r(s)&&s.checkApproachingInterval(e,t,i,n),o},m.prototype.pickFeatures=function(e,t,i,r,n){},m}),define("Scene/IonImageryProvider",["../Core/Check","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/IonResource","../Core/RuntimeError","../ThirdParty/when","./ArcGisMapServerImageryProvider","./BingMapsImageryProvider","./createTileMapServiceImageryProvider","./GoogleEarthEnterpriseMapsProvider","./MapboxImageryProvider","./SingleTileImageryProvider","./UrlTemplateImageryProvider","./WebMapServiceImageryProvider","./WebMapTileServiceImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(e){return function(t){return new e(t)}}function C(e){e=i(e,i.EMPTY_OBJECT);var t=e.assetId;this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new a;var n=this,o=s._createEndpointResource(t,e),c=e.assetId.toString()+e.accessToken+e.server,d=C._endpointCache[c];r(d)||(d=o.fetchJson(),C._endpointCache[c]=d),this._readyPromise=d.then(function(e){if("IMAGERY"!==e.type)return u.reject(new l("Cesium ion asset "+t+" is not an imagery asset."));var i,a=e.externalType;if(r(a)){var c=b[a];if(!r(c))return u.reject(new l("Unrecognized Cesium ion imagery type: "+a));i=c(e.options)}else i=h({url:new s(e,o)});return n._tileCredits=s.getCreditsFromEndpoint(e,o),i.errorEvent.addEventListener(function(e){e.provider=n,n._errorEvent.raiseEvent(e)}),n._imageryProvider=i,i.readyPromise.then(function(){return n._ready=!0,!0})})}var b={ARCGIS_MAPSERVER:y(c),BING:y(d),GOOGLE_EARTH:y(p),MAPBOX:y(f),SINGLE_TILE:y(m),TMS:h,URL_TEMPLATE:y(_),WMS:y(g),WMTS:y(v)};return n(C.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._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._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),C.prototype.getTileCredits=function(e,t,i){var n=this._imageryProvider.getTileCredits(e,t,i);return r(n)?this._tileCredits.concat(n):this._tileCredits},C.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},C.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},C._endpointCache={},C}),define("Scene/IonWorldImageryStyle",["../Core/freezeObject"],function(e){"use strict";return e({AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4})});define("Scene/JobScheduler",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/getTimestamp","./JobType"],function(e,t,i,r,n){"use strict";function o(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function a(t){var i=new Array(n.NUMBER_OF_JOB_TYPES);i[n.TEXTURE]=new o(e(t)?t[n.TEXTURE]:10),i[n.PROGRAM]=new o(e(t)?t[n.PROGRAM]:10),i[n.BUFFER]=new o(e(t)?t[n.BUFFER]:30);var r,a=i.length,s=0;for(r=0;r<a;++r)s+=i[r].total;var l=new Array(a);for(r=0;r<a;++r)l[r]=!1;this._totalBudget=s,this._totalUsedThisFrame=0,this._budgets=i,this._executedThisFrame=l}return t(o.prototype,{total:{get:function(){return this._total}}}),a.getTimestamp=r,t(a.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),a.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},a.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,i=0;i<t;++i){var r=e[i];r.starvedLastFrame=r.starvedThisFrame,r.starvedThisFrame=!1,r.usedThisFrame=0,r.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},a.prototype.execute=function(e,t){var i=this._budgets,r=i[t],n=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&n)return r.starvedThisFrame=!0,!1;var o;if(r.usedThisFrame+r.stolenFromMeThisFrame>=r.total){var s,l=i.length;for(s=0;s<l&&(o=i[s],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total)||o.starvedLastFrame);++s);if(s===l&&n)return!1;n&&(r.starvedThisFrame=!0)}var u=a.getTimestamp();e.execute();var c=a.getTimestamp()-u;return this._totalUsedThisFrame+=c,o?o.stolenFromMeThisFrame+=c:r.usedThisFrame+=c,this._executedThisFrame[t]=!0,!0},a}),define("Scene/MapboxStyleImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","../Core/Resource","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s){"use strict";function l(r){r=t(r,t.EMPTY_OBJECT);var n=r.styleId,l=r.url;i(l)||(l="https://api.mapbox.com/styles/v1/"),this._url=l;var d=a.createIfNeeded(l),h=o.getAccessToken(r.accessToken);this._styleId=n,this._accessToken=h,this._accessTokenErrorCredit=e.clone(o.getErrorCredit(r.accessToken));var p=t(r.tilesize,512);this._tilesize=p;var f=t(r.username,"mapbox");this._username=f;var m=i(r.scaleFactor)?"@2x":"",_=d.getUrlComponent();u.test(_)||(_+="/"),_+=this._username+"/"+n+"/tiles/"+this._tilesize+"/{z}/{x}/{y}"+m,d.url=_,d.setQueryParameters({access_token:h});var g;i(r.credit)?"string"==typeof(g=r.credit)&&(g=new e(g)):g=c,this._resource=d,this._imageryProvider=new s({url:d,credit:g,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var u=/\/$/,c=new e('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');return r(l.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}}}),l.prototype.getTileCredits=function(e,t,r){if(i(this._accessTokenErrorCredit))return[this._accessTokenErrorCredit]},l.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},l.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},l._defaultCredit=c,l}),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;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\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.colorBufferFloat&&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,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}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 b(e,t,i,r){v(e),e._accumulationTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT});var o=new Float32Array(i*r*4);e._revealageTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r},flipY:!1})}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 T(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 E(e,t,i){return T(t,O,e._translucentRenderStateCache,i)}function A(e,t,i){return T(t,L,e._translucentRenderStateCache,i)}function w(e,t,i){return T(t,N,e._alphaRenderStateCache,i)}function x(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,(-1!==n.indexOf("gl_FragData")?"#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 x(e,t,"translucentMRT",F)}function D(e,t){return x(e,t,"translucentMultipass",B)}function I(e,t){return x(e,t,"alphaMultipass",k)}function M(e,t,r,n,o,a){var s,l,u,c=t.context,d=t.frameState.useLogDepth,h=t._hdr,p=n.framebuffer,f=o.length,m=t.frameState.shadowState.lightShadowsEnabled;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var _=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;u<f;++u)s=o[u],s=d?s.derivedCommands.logDepth.command:s,s=h?s.derivedCommands.hdr.command:s,l=m&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,r(l,t,c,n,_);for(i(a)&&(s=a.unclassifiedCommand,l=m&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,r(l,t,c,n,_)),n.framebuffer=e._alphaFBO,u=0;u<f;++u)s=o[u],s=d?s.derivedCommands.logDepth.command:s,s=h?s.derivedCommands.hdr.command:s,l=m&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,r(l,t,c,n,_);i(a)&&(s=a.unclassifiedCommand,l=m&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,r(l,t,c,n,_)),n.framebuffer=p}function R(e,t,r,n,o,a){var s=t.context,l=t.frameState.useLogDepth,u=t._hdr,c=n.framebuffer,d=o.length,h=t.frameState.shadowState.lightShadowsEnabled;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(s,n);var p=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var f,m,_=0;_<d;++_)f=o[_],f=l?f.derivedCommands.logDepth.command:f,f=u?f.derivedCommands.hdr.command:f,m=h&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,r(m,t,s,n,p);i(a)&&(f=a.unclassifiedCommand,m=h&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,r(m,t,s,n,p)),n.framebuffer=c}g.prototype.update=function(t,r,n,o){if(this.isSupported()){this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.depthStencilTexture;var a=this._opaqueTexture.width,s=this._opaqueTexture.height,l=this._accumulationTexture,u=!i(l)||l.width!==a||l.height!==s||o!==this._useHDR;if(u&&b(this,t,a,s),i(this._translucentFBO)&&!u||S(this,t)){this._useHDR=o;var h,m,_=this;i(this._compositeCommand)||(h=new d({sources:[f]}),this._translucentMRTSupport&&h.defines.push("MRT"),m={u_opaque:function(){return _._opaqueTexture},u_accumulation:function(){return _._accumulationTexture},u_revealage:function(){return _._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(h,{uniformMap:m,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new d({defines:["MRT"],sources:[p]}),m={u_bgColor:function(){return _._translucentMRTClearCommand.color},u_depthTexture:function(){return _._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(h,{uniformMap:m,owner:this})):this._translucentMultipassSupport&&(h=new d({sources:[p]}),m={u_bgColor:function(){return _._translucentMultipassClearCommand.color},u_depthTexture:function(){return _._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(h,{uniformMap:m,owner:this}),m={u_bgColor:function(){return _._alphaClearCommand.color},u_depthTexture:function(){return _._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(h,{uniformMap:m,owner:this}))),this._viewport.width=a,this._viewport.height=s;var g=!e.equals(this._viewport,r.viewport),v=g!==this._useScissorTest;this._useScissorTest=g,e.equals(this._scissorRectangle,r.viewport)||(this._scissorRectangle=e.clone(r.viewport,this._scissorRectangle),v=!0),i(this._rs)&&e.equals(this._viewport,this._rs.viewport)&&!v||(this._rs=c.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),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},L={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ONE,functionDestinationRgb:_.ONE,functionSourceAlpha:_.ONE,functionDestinationAlpha:_.ONE},N={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},F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",B=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",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=E(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=A(this,t,e.renderState),r.alphaCommand.shaderProgram=I(t,e.shaderProgram),r.alphaCommand.renderState=w(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},g.prototype.executeCommands=function(e,t,i,r,n){if(this._translucentMRTSupport)return void R(this,e,t,i,r,n);M(this,e,t,i,r,n)},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,
- (this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).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("Scene/Particle",["../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=n(i,n.EMPTY_OBJECT),this.mass=n(i.mass,1),this.position=t.clone(n(i.position,t.ZERO)),this.velocity=t.clone(n(i.velocity,t.ZERO)),this.life=n(i.life,Number.MAX_VALUE),this.image=i.image,this.startColor=r.clone(n(i.startColor,r.WHITE)),this.endColor=r.clone(n(i.endColor,r.WHITE)),this.startScale=n(i.startScale,1),this.endScale=n(i.endScale,1),this.imageSize=e.clone(n(i.imageSize,l)),this._age=0,this._normalizedAge=0,this._billboard=void 0}var l=new e(1,1);a(s.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var u=new t;return s.prototype.update=function(e,i){return t.multiplyByScalar(this.velocity,e,u),t.add(this.position,u,this.position),o(i)&&i(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life},s}),define("Scene/ParticleBurst",["../Core/defaultValue","../Core/defineProperties"],function(e,t){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.time=e(t.time,0),this.minimum=e(t.minimum,0),this.maximum=e(t.maximum,50),this._complete=!1}return t(i.prototype,{complete:{get:function(){return this._complete}}}),i}),define("Scene/ParticleEmitter",["../Core/DeveloperError"],function(e){"use strict";function t(e){}return t.prototype.emit=function(t){e.throwInstantiationError()},t}),define("Scene/ParticleSystem",["../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event","../Core/JulianDate","../Core/Math","../Core/Matrix4","./BillboardCollection","./CircleEmitter","./Particle"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(t){t=n(t,n.EMPTY_OBJECT),this.show=n(t.show,!0),this.updateCallback=t.updateCallback,this.loop=n(t.loop,!0),this.image=n(t.image,void 0);var i=t.emitter;o(i)||(i=new p(.5)),this._emitter=i,this._bursts=t.bursts,this._modelMatrix=d.clone(n(t.modelMatrix,d.IDENTITY)),this._emitterModelMatrix=d.clone(n(t.emitterModelMatrix,d.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new d,this._startColor=r.clone(n(t.color,n(t.startColor,r.WHITE))),this._endColor=r.clone(n(t.color,n(t.endColor,r.WHITE))),this._startScale=n(t.scale,n(t.startScale,1)),this._endScale=n(t.scale,n(t.endScale,1)),this._emissionRate=n(t.emissionRate,5),this._minimumSpeed=n(t.speed,n(t.minimumSpeed,1)),this._maximumSpeed=n(t.speed,n(t.maximumSpeed,1)),this._minimumParticleLife=n(t.particleLife,n(t.minimumParticleLife,5)),this._maximumParticleLife=n(t.particleLife,n(t.maximumParticleLife,5)),this._minimumMass=n(t.mass,n(t.minimumMass,1)),this._maximumMass=n(t.mass,n(t.maximumMass,1)),this._minimumImageSize=e.clone(n(t.imageSize,n(t.minimumImageSize,E))),this._maximumImageSize=e.clone(n(t.imageSize,n(t.maximumImageSize,E))),this._lifetime=n(t.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new l,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function _(e){var t=e._emissionRate,i=e._maximumParticleLife,r=0,n=e._bursts;if(o(n))for(var a=n.length,s=0;s<a;++s)r+=n[s].maximum;for(var l=e._billboardCollection,u=e.image,c=Math.ceil(t*i+r),d=e._particles,h=e._particlePool,p=Math.max(c-d.length-h.length,0),m=0;m<p;++m){var _=new f;_._billboard=l.add({image:u}),h.push(_)}e._particleEstimate=c}function g(e){var t=e._particlePool.pop();return o(t)||(t=new f),t}function v(e,t){e._particlePool.push(t)}function y(e){for(var t=e._particles,i=e._particlePool,r=e._billboardCollection,n=t.length,o=i.length,a=e._particleEstimate,s=o-Math.max(a-n-o,0),l=s;l<o;++l){var u=i[l];r.remove(u._billboard)}i.length=s}function C(e){o(e._billboard)&&(e._billboard.show=!1)}function b(e,t){var i=t._billboard;o(i)||(i=t._billboard=e._billboardCollection.add({image:t.image})),i.width=t.imageSize.x,i.height=t.imageSize.y,i.position=t.position,i.show=!0;var n=c.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),a=c.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),s=c.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),l=c.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);i.color=new r(n,a,s,l),i.scale=c.lerp(t.startScale,t.endScale,t.normalizedAge)}function S(e,i){i.startColor=r.clone(e._startColor,i.startColor),i.endColor=r.clone(e._endColor,i.endColor),i.startScale=e._startScale,i.endScale=e._endScale,i.image=e.image,i.life=c.randomBetween(e._minimumParticleLife,e._maximumParticleLife),i.mass=c.randomBetween(e._minimumMass,e._maximumMass),i.imageSize.x=c.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),i.imageSize.y=c.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),i._normalizedAge=0,i._age=0;var n=c.randomBetween(e._minimumSpeed,e._maximumSpeed);t.multiplyByScalar(i.velocity,n,i.velocity),e._particles.push(i)}function T(e,t){if(e._isComplete)return 0;t=c.mod(t,e._lifetime);var i=t*e._emissionRate,r=Math.floor(i);if(e._carryOver+=i-r,e._carryOver>1&&(r++,e._carryOver-=1),o(e.bursts))for(var n=e.bursts.length,a=0;a<n;a++){var s=e.bursts[a],l=e._currentTime;o(s)&&!s._complete&&l>s.time&&(r+=c.randomBetween(s.minimum,s.maximum),s._complete=!0)}return r}var E=new e(1,1);a(m.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!d.equals(this._modelMatrix,e),d.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!d.equals(this._emitterModelMatrix,e),d.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){r.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){r.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});var A=new t;return m.prototype.update=function(e){if(this.show){o(this._billboardCollection)||(this._billboardCollection=new h),this._updateParticlePool&&(_(this),this._updateParticlePool=!1);var i=0;this._previousTime&&(i=u.secondsDifference(e.time,this._previousTime)),i<0&&(i=0);var r,n,a=this._particles,s=this._emitter,l=this.updateCallback,p=a.length;for(r=0;r<p;++r)n=a[r],n.update(i,l)?b(this,n):(C(n),v(this,n),a[r]=a[p-1],--r,--p);a.length=p;var f=T(this,i);if(f>0&&o(s)){this._matrixDirty&&(this._combinedMatrix=d.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);var m=this._combinedMatrix;for(r=0;r<f;r++)n=g(this),this._emitter.emit(n),t.add(n.position,n.velocity,A),d.multiplyByPoint(m,A,A),n.position=d.multiplyByPoint(m,n.position,n.position),t.subtract(A,n.position,n.velocity),t.normalize(n.velocity,n.velocity),S(this,n),b(this,n)}if(this._billboardCollection.update(e),this._previousTime=u.clone(e.time,this._previousTime),this._currentTime+=i,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=c.mod(this._currentTime,this._lifetime),this.bursts){var E=this.bursts.length;for(r=0;r<E;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&y(this)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),s(this)},m}),define("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){e=document.getElementById(e)}return e}return t}),define("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=a(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 s=document.createElement("div");s.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),s.appendChild(this._msText),r.appendChild(s),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=o(),this._lastMsSampleTime=o(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;var l=document.createElement("div");l.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),l.appendChild(this._throttledText),r.appendChild(l)}return i(s.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),s.prototype.update=function(t){var i=o(),r=e(t,!0);this._fpsFrameCount++;var n=i-this._lastFpsSampleTime;if(n>1e3){var a="N/A";r&&(a=1e3*this._fpsFrameCount/n|0),this._fpsText.nodeValue=a+" FPS",this._lastFpsSampleTime=i,this._fpsFrameCount=0}this._msFrameCount++;var s=i-this._lastMsSampleTime;if(s>200){var l="N/A";r&&(l=(s/this._msFrameCount).toFixed(2)),this._msText.nodeValue=l+" MS",this._lastMsSampleTime=i,this._msFrameCount=0}},s.prototype.destroy=function(){return r(this)},s}),define("Scene/PickDepth",["../Core/Cartesian4","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Renderer/Texture"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this._framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._useLogDepth=void 0,this._debugPickDepthViewportCommand=void 0}function c(e,i,r,n){if(!t(e._debugPickDepthViewportCommand)||n!==e._useLogDepth){var o=new s({defines:[n?"LOG_DEPTH":""],sources:["uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \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._debugPickDepthViewportCommand=i.createViewportQuadCommand(o,{uniformMap:{u_texture:function(){return e._depthTexture}},owner:e}),e._useLogDepth=n}e._debugPickDepthViewportCommand.execute(i,r)}function d(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function h(e){e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy()}function p(e,t,i,n){e._depthTexture=new l({context:t,width:i,height:n,pixelFormat:r.RGBA,pixelDatatype:o.UNSIGNED_BYTE})}function f(e,t,i,r){d(e),h(e),p(e,t,i,r),e._framebuffer=new n({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function m(e,i,r){var n=r.width,o=r.height,a=e._depthTexture,s=!t(a)||a.width!==n||a.height!==o;t(e._framebuffer)&&!s||f(e,i,n,o)}function _(e,i,r){if(!t(e._copyDepthCommand)){e._copyDepthCommand=i.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:a.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=r,e._copyDepthCommand.framebuffer=e._framebuffer}u.prototype.executeDebugPickDepth=function(e,t,i){c(this,e,t,i)},u.prototype.update=function(e,t){m(this,e,t),_(this,e,t)};var g=new e,v=new e(1,1/255,1/65025,1/16581375);return u.prototype.getDepth=function(t,i,r){var n=t.readPixels({x:i,y:r,width:1,height:1,framebuffer:this._framebuffer}),o=e.unpack(n,0,g);return e.divideByScalar(o,255,o),e.dot(o,v)},u.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return d(this),h(this),this._copyDepthCommand.shaderProgram=t(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),i(this)},u}),define("Scene/PickDepthFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/Texture"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(){this._depthStencilTexture=void 0,this._framebuffer=void 0,this._passState=void 0}function p(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy()}function f(t,i){var r=i.drawingBufferWidth,n=i.drawingBufferHeight;t._depthStencilTexture=new d({context:i,width:r,height:n,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}),t._framebuffer=new a({context:i,depthStencilTexture:t._depthStencilTexture,destroyAttachments:!1});var u=new s(i);u.blendingEnabled=!1,u.scissorTest={enabled:!0,rectangle:new e},u.viewport=new e,t._passState=u}return h.prototype.update=function(e,t,i){var n=i.width,o=i.height;r(this._framebuffer)&&n===this._depthStencilTexture.width&&o===this._depthStencilTexture.height||(p(this),f(this,e));var a=this._framebuffer,s=this._passState;return s.framebuffer=a,s.viewport.width=n,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return p(this),n(this)},h}),define("Scene/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/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,i){var n=this._context,a=i.width,c=i.height;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===a&&this._height===c||(this._width=a,this._height=c,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:n,colorTextures:[new u({context:n,width:a,height:c})],depthStencilRenderbuffer:new s({context:n,width:a,height:c,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=a,this._passState.viewport.height=c,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("Scene/PostProcessStageSampleMode",[],function(){"use strict";return{NEAREST:0,LINEAR:1}}),define("Scene/PostProcessStage",["../Core/BoundingRectangle","../Core/Check","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/Resource","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../ThirdParty/when","./PostProcessStageSampleMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T){"use strict";function E(t){t=o(t,o.EMPTY_OBJECT);var r=t.fragmentShader,s=o(t.textureScale,1),l=o(t.pixelFormat,d.RGBA);this._fragmentShader=r,this._uniforms=t.uniforms,this._textureScale=s,this._forcePowerOfTwo=o(t.forcePowerOfTwo,!1),this._sampleMode=o(t.sampleMode,T.NEAREST),this._pixelFormat=l,this._pixelDatatype=o(t.pixelDatatype,f.UNSIGNED_BYTE),this._clearColor=o(t.clearColor,i.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;var u=new p;u.scissorTest={enabled:!0,rectangle:a(t.scissorRectangle)?e.clone(t.scissorRectangle):new e},this._passState=u,this._ready=!1;var c=t.name;a(c)||(c=n()),this._name=c,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}function A(e,t,i){var r=t[i];return("string"==typeof r||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData)&&e._dirtyUniforms.push(i),{get:function(){return t[i]},set:function(r){var n=t[i];t[i]=r;var o=e._actualUniforms,s=o[i];a(s)&&s!==n&&s instanceof v&&!a(e._textureCache.getStageByName(i))&&(e._texturesToRelease.push(s),delete o[i],delete o[i+"Dimensions"]),n instanceof v&&e._texturesToRelease.push(n),"string"==typeof r||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(i):o[i]=r}}}function w(e,t){return function(){var i=e._actualUniforms[t];return"function"==typeof i?i():i}}function x(e,t){return function(){var i=e[t]();if(a(i))return i.dimensions}}function P(e){if(!a(e._uniformMap)){var t={},i={},n=e._uniforms,o=e._actualUniforms;for(var l in n)if(n.hasOwnProperty(l)){"function"!=typeof n[l]?(t[l]=w(e,l),i[l]=A(e,n,l)):(t[l]=n[l],i[l]=n[l]),o[l]=n[l];var u=t[l]();("string"==typeof u||u instanceof v||u instanceof HTMLImageElement||u instanceof HTMLCanvasElement||u instanceof HTMLVideoElement)&&(t[l+"Dimensions"]=x(t,l))}e._uniforms={},s(e._uniforms,i),e._uniformMap=r(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}}function D(e,t){if(!a(e._command)||e._logDepthChanged||e._selectedDirty){var i=e._fragmentShader;if(a(e._selectedIdTexture)){var r=e._selectedIdTexture.width;i=i.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""),i="#define CZM_SELECTED_FEATURE \nuniform sampler2D czm_idTexture; \nuniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nvarying vec2 v_textureCoordinates; \nbool czm_selected(vec2 offset) \n{ \n bool selected = false;\n vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \n for (int i = 0; i < "+r+"; ++i) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2(float(i) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n } \n return false; \n} \n\nbool czm_selected() \n{ \n return czm_selected(vec2(0.0)); \n} \n\n"+i}var n=new g({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]});e._command=t.createViewportQuadCommand(n,{uniformMap:e._uniformMap,owner:e})}}function I(e){var t,i,r=e._sampleMode;r===T.LINEAR?(t=C.LINEAR,i=y.LINEAR):(t=C.NEAREST,i=y.NEAREST);var n=e._sampler;a(n)&&n.minificationFilter===t&&n.magnificationFilter===i||(e._sampler=new _({wrapS:b.CLAMP_TO_EDGE,wrapT:b.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}function M(e,t){return function(i){e._texturesToCreate.push({name:t,source:i})}}function R(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function O(e,t){var i,r,n,o=e._texturesToRelease,s=o.length;for(i=0;i<s;++i)r=o[i],r=r&&r.destroy();o.length=0;var l=e._texturesToCreate;for(s=l.length,i=0;i<s;++i){var u=l[i];n=u.name;var c=u.source;e._actualUniforms[n]=new v({context:t,source:c})}l.length=0;var d=e._dirtyUniforms;if(0===d.length&&!a(e._texturePromise))return void(e._ready=!0);if(0!==d.length&&!a(e._texturePromise)){s=d.length;var p=e._uniforms,f=[];for(i=0;i<s;++i){n=d[i];var m=p[n],_=e._textureCache.getStageByName(m);if(a(_))e._actualUniforms[n]=R(e,m);else if("string"==typeof m){var g=new h({url:m});f.push(g.fetchImage().then(M(e,n)))}else e._texturesToCreate.push({name:n,source:m})}d.length=0,f.length>0?(e._ready=!1,e._texturePromise=S.all(f).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}}function L(e){a(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();var t=e._textureCache;if(a(t)){var i=e._uniforms,r=e._actualUniforms;for(var n in r)r.hasOwnProperty(n)&&r[n]instanceof v&&(a(t.getStageByName(i[n]))||r[n].destroy(),e._dirtyUniforms.push(n))}}function N(e){var t=a(e._selected)?e._selected.length:0,i=a(e._parentSelected)?e._parentSelected:0,r=e._selected!==e._selectedShadow||t!==e._selectedLength;if(r=r||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,a(e._selected)&&a(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):a(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&a(e._combinedSelected)){if(!a(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(var n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}function F(e,t){if(e._selectedDirty){e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;var r=e._combinedSelected;if(a(r)){var n,o,s=0,l=r.length;for(n=0;n<l;++n)o=r[n],a(o.pickIds)?s+=o.pickIds.length:a(o.pickId)&&++s;if(0===l||0===s){var u=new Uint8Array(4);return u[0]=255,u[1]=255,u[2]=255,u[3]=255,void(e._selectedIdTexture=new v({context:t,pixelFormat:d.RGBA,pixelDatatype:f.UNSIGNED_BYTE,source:{arrayBufferView:u,width:1,height:1},sampler:new _({wrapS:b.CLAMP_TO_EDGE,wrapT:b.CLAMP_TO_EDGE,minificationFilter:C.NEAREST,magnificationFilter:y.NEAREST})}))}var c,h=0,p=new Uint8Array(4*s);for(n=0;n<l;++n)if(o=r[n],a(o.pickIds))for(var m=o.pickIds,g=m.length,S=0;S<g;++S)c=m[S].color,p[h]=i.floatToByte(c.red),p[h+1]=i.floatToByte(c.green),p[h+2]=i.floatToByte(c.blue),p[h+3]=i.floatToByte(c.alpha),h+=4;else a(o.pickId)&&(c=o.pickId.color,p[h]=i.floatToByte(c.red),p[h+1]=i.floatToByte(c.green),p[h+2]=i.floatToByte(c.blue),p[h+3]=i.floatToByte(c.alpha),h+=4);e._selectedIdTexture=new v({context:t,pixelFormat:d.RGBA,pixelDatatype:f.UNSIGNED_BYTE,source:{arrayBufferView:p,width:s,height:1},sampler:new _({wrapS:b.CLAMP_TO_EDGE,wrapT:b.CLAMP_TO_EDGE,minificationFilter:C.NEAREST,magnificationFilter:y.NEAREST})})}}}s(E.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(a(this._textureCache)){var e=this._textureCache.getFramebuffer(this._name);if(a(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var B=/uniform\s+sampler2D\s+depthTexture/g;return E.prototype._isSupported=function(e){return!B.test(this._fragmentShader)||e.depthTexture},E.prototype.update=function(t,i){if(this.enabled===this._enabled||this.enabled||L(this),this._enabled=this.enabled,this._enabled&&(this._logDepthChanged=i!==this._useLogDepth,this._useLogDepth=i,this._selectedDirty=N(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=a(this._selected)?this._selected.length:0,this._parentSelectedLength=a(this._parentSelected)?this._parentSelected.length:0,F(this,t),P(this),O(this,t),D(this,t),I(this),this._selectedDirty=!1,this._ready)){var r=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=r,a(r)){var n,o=r.getColorTexture(0);o.width===t.drawingBufferWidth&&o.height===t.drawingBufferHeight||(n=this._renderState,a(n)&&o.width===n.viewport.width&&o.height===n.viewport.height||(this._renderState=m.fromCache({viewport:new e(0,0,o.width,o.height)}))),this._command.renderState=n}}},E.prototype.execute=function(e,t,i,r){if(a(this._command)&&a(this._command.framebuffer)&&this._ready&&this._enabled){this._colorTexture=t,this._depthTexture=i,this._idTexture=r,_.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);var n=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;a(n)&&(n.context=e),this._command.execute(e,n)}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return L(this),l(this)},E}),define("Shaders/PostProcessStages/AcesTonemapping",[],function(){"use strict";return"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\ncolor /= texture2D(autoExposure, vec2(0.5)).r;\n#endif\nfloat g = 0.985;\nfloat a = 0.065;\nfloat b = 0.0001;\nfloat c = 0.433;\nfloat d = 0.238;\ncolor = (color * (color + a) - b) / (color * (g * color + c) + d);\ncolor = clamp(color, 0.0, 1.0);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n"}),define("Shaders/PostProcessStages/AmbientOcclusionGenerate",[],function(){"use strict"
- ;return"uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\nvarying vec2 v_textureCoordinates;\nvec4 clipToEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\nposEC = posEC / posEC.w;\nreturn posEC;\n}\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\nvec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\nvec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\nvec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\nvec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\nvec3 up = posInCamera.xyz - posInCameraUp.xyz;\nvec3 down = posInCameraDown.xyz - posInCamera.xyz;\nvec3 left = posInCamera.xyz - posInCameraLeft.xyz;\nvec3 right = posInCameraRight.xyz - posInCamera.xyz;\nvec3 DX = length(left) < length(right) ? left : right;\nvec3 DY = length(up) < length(down) ? up : down;\nreturn normalize(cross(DY, DX));\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\nif (posInCamera.z > frustumLength)\n{\ngl_FragColor = vec4(1.0);\nreturn;\n}\nvec2 pixelSize = 1.0 / czm_viewport.zw;\nfloat depthU = czm_readDepth(depthTexture, v_textureCoordinates- vec2(0.0, pixelSize.y));\nfloat depthD = czm_readDepth(depthTexture, v_textureCoordinates+ vec2(0.0, pixelSize.y));\nfloat depthL = czm_readDepth(depthTexture, v_textureCoordinates- vec2(pixelSize.x, 0.0));\nfloat depthR = czm_readDepth(depthTexture, v_textureCoordinates+ vec2(pixelSize.x, 0.0));\nvec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\nfloat ao = 0.0;\nvec2 sampleDirection = vec2(1.0, 0.0);\nfloat gapAngle = 90.0 * czm_radiansPerDegree;\nfloat randomVal = texture2D(randomTexture, v_textureCoordinates).x;\nfloat inverseViewportWidth = 1.0 / czm_viewport.z;\nfloat inverseViewportHeight = 1.0 / czm_viewport.w;\nfor (int i = 0; i < 4; i++)\n{\nfloat newGapAngle = gapAngle * (float(i) + randomVal);\nfloat cosVal = cos(newGapAngle);\nfloat sinVal = sin(newGapAngle);\nvec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\nfloat localAO = 0.0;\nfloat localStepSize = stepSize;\nfor (int j = 0; j < 6; j++)\n{\nvec2 directionWithStep = vec2(rotatedSampleDirection.x * localStepSize * inverseViewportWidth, rotatedSampleDirection.y * localStepSize * inverseViewportHeight);\nvec2 newCoords = directionWithStep + v_textureCoordinates;\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n{\nbreak;\n}\nfloat stepDepthInfo = czm_readDepth(depthTexture, newCoords);\nvec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\nvec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\nfloat len = length(diffVec);\nif (len > lengthCap)\n{\nbreak;\n}\nfloat dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\nfloat weight = len / lengthCap;\nweight = 1.0 - weight * weight;\nif (dotVal < bias)\n{\ndotVal = 0.0;\n}\nlocalAO = max(localAO, dotVal * weight);\nlocalStepSize += stepSize;\n}\nao += localAO;\n}\nao /= 4.0;\nao = 1.0 - clamp(ao, 0.0, 1.0);\nao = pow(ao, intensity);\ngl_FragColor = vec4(vec3(ao), 1.0);\n}\n"}),define("Shaders/PostProcessStages/AmbientOcclusionModulate",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\ngl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\n}\n"}),define("Shaders/PostProcessStages/BlackAndWhite",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform float gradations;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = vec4(rgb, 1.0);\nreturn;\n}\n#endif\nfloat luminance = czm_luminance(rgb);\nfloat darkness = luminance * gradations;\ndarkness = (darkness - fract(darkness)) / gradations;\ngl_FragColor = vec4(vec3(darkness), 1.0);\n}\n"}),define("Shaders/PostProcessStages/BloomComposite",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = glowOnly ? bloom : bloom + color;\n}\n"}),define("Shaders/PostProcessStages/Brightness",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 target = vec3(0.0);\ngl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n"}),define("Shaders/PostProcessStages/ContrastBias",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\nsceneColor = czm_RGBToHSB(sceneColor);\nsceneColor.z += brightness;\nsceneColor = czm_HSBToRGB(sceneColor);\nfloat factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\nsceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\ngl_FragColor = vec4(sceneColor, 1.0);\n}\n"}),define("Shaders/PostProcessStages/DepthOfField",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\nvarying vec2 v_textureCoordinates;\nvec4 toEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera = posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat computeDepthBlur(float depth)\n{\nfloat f;\nif (depth < focalDistance)\n{\nf = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n}\nelse\n{\nf = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\nf = pow(f, 0.1);\n}\nf *= f;\nf = clamp(f, 0.0, 1.0);\nreturn pow(f, 0.5);\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = toEye(v_textureCoordinates, depth);\nfloat d = computeDepthBlur(-posInCamera.z);\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\n}\n"}),define("Shaders/PostProcessStages/DepthView",[],function(){"use strict";return"uniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\ngl_FragColor = vec4(vec3(depth), 1.0);\n}\n"}),define("Shaders/PostProcessStages/EdgeDetection",[],function(){"use strict";return"uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat directions[3];\ndirections[0] = -1.0;\ndirections[1] = 0.0;\ndirections[2] = 1.0;\nfloat scalars[3];\nscalars[0] = 3.0;\nscalars[1] = 10.0;\nscalars[2] = 3.0;\nfloat padx = 1.0 / czm_viewport.z;\nfloat pady = 1.0 / czm_viewport.w;\n#ifdef CZM_SELECTED_FEATURE\nbool selected = false;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nselected = selected || czm_selected(vec2(-padx, dir * pady));\nselected = selected || czm_selected(vec2(padx, dir * pady));\nselected = selected || czm_selected(vec2(dir * padx, -pady));\nselected = selected || czm_selected(vec2(dir * padx, pady));\nif (selected)\n{\nbreak;\n}\n}\nif (!selected)\n{\ngl_FragColor = vec4(color.rgb, 0.0);\nreturn;\n}\n#endif\nfloat horizEdge = 0.0;\nfloat vertEdge = 0.0;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nfloat scale = scalars[i];\nhorizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\nhorizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\nvertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\nvertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n}\nfloat len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\ngl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n"}),define("Shaders/PostProcessStages/FilmicTonemapping",[],function(){"use strict";return"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\nconst float A = 0.22;\nconst float B = 0.30;\nconst float C = 0.10;\nconst float D = 0.20;\nconst float E = 0.01;\nconst float F = 0.30;\nconst float white = 11.2;\nvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\nfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\nc = czm_inverseGamma(c / w);\ngl_FragColor = vec4(c, fragmentColor.a);\n}\n"}),define("Shaders/PostProcessStages/FXAA",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\ncolorTexture,\nfxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(colorTexture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n"}),define("Shaders/PostProcessStages/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D colorTexture;\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\n#ifdef USE_STEP_SIZE\nvec2 step = vec2(stepSize / czm_viewport.zw);\n#else\nvec2 step = step;\n#endif\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(colorTexture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * step;\nresult += texture2D(colorTexture, st - offset) * g.x;\nresult += texture2D(colorTexture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),define("Shaders/PostProcessStages/LensFlare",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float earthRadius;\nuniform float intensity;\nvarying vec2 v_textureCoordinates;\n#define DISTANCE_TO_SPACE 6500000.0\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\nvec4 positionEC = czm_view * vec4(WC, 1.0);\npositionEC = vec4(positionEC.x + earthRadius , positionEC.y, positionEC.z, 1.0);\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nreturn czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\nvec2 NDC = texcoord * 2.0 - 1.0;\nvec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\nvec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\nNDC.xy -= earthPosSC.xy;\nfloat X = abs(NDC.x) * sceneSize.x;\nfloat Y = abs(NDC.y) * sceneSize.y;\nreturn clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\nvec2 sceneSize = czm_viewport.zw;\nvec3 color;\nif(isSpace)\n{\ncolor.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\n}\nelse\n{\ncolor.r = texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = texture2D(tex, texcoord + direction * distortion.b).b;\n}\nreturn vec4(clamp(color, 0.0, 1.0), 0.0);\n}\nvoid main(void)\n{\nvec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 rgb = originalColor.rgb;\nbool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nif(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n{\ngl_FragColor = originalColor;\nreturn;\n}\nvec2 texcoord = -v_textureCoordinates + vec2(1.0);\nvec2 texelSize = 1.0 / czm_viewport.zw;\nvec3 distortionVec = vec3(-texelSize.x * distortion, 0.0, texelSize.x * distortion);\nvec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\nvec3 direction = normalize(vec3(ghostVec, 0.0));\nvec4 result = vec4(0.0);\nvec4 ghost = vec4(0.0);\nfor (int i = 0; i < 4; ++i)\n{\nvec2 offset = fract(texcoord + ghostVec * float(i));\nghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n}\nresult += ghost;\nvec2 haloVec = normalize(ghostVec) * haloWidth;\nfloat weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\nweightForHalo = pow(1.0 - weightForHalo, 5.0);\nresult += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\nvec2 dirtTexCoords = (v_textureCoordinates * czm_viewport.zw) / dirtTextureDimensions;\nif (dirtTexCoords.x > 1.0)\n{\ndirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\n}\nif (dirtTexCoords.y > 1.0)\n{\ndirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\n}\nresult += texture2D(dirtTexture, dirtTexCoords);\nfloat camrot = czm_view[0].z + czm_view[1].y;\nfloat cosValue = cos(camrot);\nfloat sinValue = sin(camrot);\nmat3 rotation = mat3(\ncosValue, -sinValue, 0.0,\nsinValue, cosValue, 0.0,\n0.0, 0.0, 1.0\n);\nvec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\nvec3 st2 = vec3((rotation * st1).xy, 1.0);\nvec3 st3 = st2 * 0.5 + vec3(0.5);\nvec2 lensStarTexcoord = st3.xy;\nfloat weightForLensFlare = length(vec3(sunPos.xy, 0.0));\nfloat oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\nif (!isSpace)\n{\nresult *= oneMinusWeightForLensFlare * intensity * 0.2;\n}\nelse\n{\nresult *= oneMinusWeightForLensFlare * intensity;\nresult *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n}\nresult += texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = result;\n}\n"}),define("Shaders/PostProcessStages/ModifiedReinhardTonemapping",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform vec3 white;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = (color * (1.0 + color / white)) / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n"}),define("Shaders/PostProcessStages/NightVision",[],function(){"use strict";return"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat rand(vec2 co)\n{\nreturn fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\nvoid main(void)\n{\nfloat noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 green = vec3(0.0, 1.0, 0.0);\ngl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n"}),define("Shaders/PostProcessStages/ReinhardTonemapping",[],function(){"use strict";return"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = color / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n"}),define("Shaders/PostProcessStages/Silhouette",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n"}),define("ThirdParty/Shaders/FXAA3_11",[],function(){"use strict"
- ;return"#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n"}),define("Scene/PostProcessStageComposite",["../Core/Check","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject"],function(e,t,i,r,n,o){"use strict";function a(e){e=i(e,i.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=i(e.inputPreviousStageTexture,!0);var n=e.name;r(n)||(n=t()),this._name=n,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}function s(e){var t=r(e._selected)?e._selected.length:0,i=r(e._parentSelected)?e._parentSelected:0,n=e._selected!==e._selectedShadow||t!==e._selectedLength;if(n=n||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,r(e._selected)&&r(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):r(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!n&&r(e._combinedSelected)){if(!r(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(var o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return n}return n(a.prototype,{ready:{get:function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)if(!e[i].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)t[r].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}}),a.prototype._isSupported=function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)if(!t[r]._isSupported(e))return!1;return!0},a.prototype.get=function(e){return this._stages[e]},a.prototype.update=function(e,t){this._selectedDirty=s(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=r(this._selected)?this._selected.length:0,this._parentSelectedLength=r(this._parentSelected)?this._parentSelected.length:0;for(var i=this._stages,n=i.length,o=0;o<n;++o){var a=i[o];this._selectedDirty&&(a.parentSelected=this._combinedSelected),a.update(e,t)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)e[i].destroy();return o(this)},a}),define("Scene/PostProcessStageLibrary",["../Core/buildModuleUrl","../Core/createGuid","../Core/Color","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/Ellipsoid","../Shaders/PostProcessStages/AcesTonemapping","../Shaders/PostProcessStages/AmbientOcclusionGenerate","../Shaders/PostProcessStages/AmbientOcclusionModulate","../Shaders/PostProcessStages/BlackAndWhite","../Shaders/PostProcessStages/BloomComposite","../Shaders/PostProcessStages/Brightness","../Shaders/PostProcessStages/ContrastBias","../Shaders/PostProcessStages/DepthOfField","../Shaders/PostProcessStages/DepthView","../Shaders/PostProcessStages/EdgeDetection","../Shaders/PostProcessStages/FilmicTonemapping","../Shaders/PostProcessStages/FXAA","../Shaders/PostProcessStages/GaussianBlur1D","../Shaders/PostProcessStages/LensFlare","../Shaders/PostProcessStages/ModifiedReinhardTonemapping","../Shaders/PostProcessStages/NightVision","../Shaders/PostProcessStages/ReinhardTonemapping","../Shaders/PostProcessStages/Silhouette","../ThirdParty/Shaders/FXAA3_11","./AutoExposure","./PostProcessStage","./PostProcessStageComposite","./PostProcessStageSampleMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I){"use strict";function M(e){var t="#define USE_STEP_SIZE\n"+C,i=new P({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:I.LINEAR}),r=new P({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:I.LINEAR}),o={};return n(o,{delta:{get:function(){return i.uniforms.delta},set:function(e){var t=i.uniforms,n=r.uniforms;t.delta=n.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){var t=i.uniforms,n=r.uniforms;t.sigma=n.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){var t=i.uniforms,n=r.uniforms;t.stepSize=n.stepSize=e}}}),new D({name:e,stages:[i,r],uniforms:o})}function R(e){if(!r(e))return O.createEdgeDetectionStage();for(var t=new D({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},n="",o="",a=0;a<e.length;++a)n+="uniform sampler2D edgeTexture"+a+"; \n",o+=" vec4 edge"+a+" = texture2D(edgeTexture"+a+", v_textureCoordinates); \n if (edge"+a+".a > 0.0) \n { \n color = edge"+a+"; \n break; \n } \n",i["edgeTexture"+a]=e[a].name;var s=n+"varying vec2 v_textureCoordinates; \nvoid main() { \n vec4 color = vec4(0.0); \n for (int i = 0; i < "+e.length+"; i++) \n { \n"+o+" } \n gl_FragColor = color; \n} \n",l=new P({name:"czm_edge_detection_combine",fragmentShader:s,uniforms:i});return new D({name:"czm_edge_detection_composite",stages:[t,l]})}var O={};O.createBlurStage=function(){return M("czm_blur")},O.createDepthOfFieldStage=function(){var e=M("czm_depth_of_field_blur"),t=new P({name:"czm_depth_of_field_composite",fragmentShader:m,uniforms:{focalDistance:5,blurTexture:e.name}}),i={};return n(i,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(e){t.uniforms.focalDistance=e}},delta:{get:function(){return e.uniforms.delta},set:function(t){e.uniforms.delta=t}},sigma:{get:function(){return e.uniforms.sigma},set:function(t){e.uniforms.sigma=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}}}),new D({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:i})},O.isDepthOfFieldSupported=function(e){return e.context.depthTexture},O.createEdgeDetectionStage=function(){var e=t();return new P({name:"czm_edge_detection_"+e,fragmentShader:g,uniforms:{length:.25,color:i.clone(i.BLACK)}})},O.isEdgeDetectionSupported=function(e){return e.context.depthTexture},O.createSilhouetteStage=function(e){var t=R(e),i=new P({name:"czm_silhouette_color_edges",fragmentShader:A,uniforms:{silhouetteTexture:t.name}});return new D({name:"czm_silhouette",stages:[t,i],inputPreviousStageTexture:!1,uniforms:t.uniforms})},O.isSilhouetteSupported=function(e){return e.context.depthTexture},O.createBloomStage=function(){var e=new P({name:"czm_bloom_contrast_bias",fragmentShader:f,uniforms:{contrast:128,brightness:-.3}}),t=M("czm_bloom_blur"),i=new D({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),r=new P({name:"czm_bloom_generate_composite",fragmentShader:h,uniforms:{glowOnly:!1,bloomTexture:i.name}}),o={};return n(o,{glowOnly:{get:function(){return r.uniforms.glowOnly},set:function(e){r.uniforms.glowOnly=e}},contrast:{get:function(){return e.uniforms.contrast},set:function(t){e.uniforms.contrast=t}},brightness:{get:function(){return e.uniforms.brightness},set:function(t){e.uniforms.brightness=t}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new D({name:"czm_bloom",stages:[i,r],inputPreviousStageTexture:!1,uniforms:o})},O.createAmbientOcclusionStage=function(){var e=new P({name:"czm_ambient_occlusion_generate",fragmentShader:u,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=M("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;var i=new D({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),r=new P({name:"czm_ambient_occlusion_composite",fragmentShader:c,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:i.name}}),o={};return n(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(t){e.uniforms.intensity=t}},bias:{get:function(){return e.uniforms.bias},set:function(t){e.uniforms.bias=t}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(t){e.uniforms.lengthCap=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(t){e.uniforms.frustumLength=t}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(t){e.uniforms.randomTexture=t}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return r.uniforms.ambientOcclusionOnly},set:function(e){r.uniforms.ambientOcclusionOnly=e}}}),new D({name:"czm_ambient_occlusion",stages:[i,r],inputPreviousStageTexture:!1,uniforms:o})},O.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var L="#define FXAA_QUALITY_PRESET 39 \n"+w+"\n"+y;return O.createFXAAStage=function(){return new P({name:"czm_FXAA",fragmentShader:L,sampleMode:I.LINEAR})},O.createAcesTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return t+=l,new P({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})},O.createFilmicTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return t+=v,new P({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})},O.createReinhardTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return t+=E,new P({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})},O.createModifiedReinhardTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return t+=S,new P({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:i.WHITE,autoExposure:void 0}})},O.createAutoExposureStage=function(){return new x},O.createBlackAndWhiteStage=function(){return new P({name:"czm_black_and_white",fragmentShader:d,uniforms:{gradations:5}})},O.createBrightnessStage=function(){return new P({name:"czm_brightness",fragmentShader:p,uniforms:{brightness:.5}})},O.createNightVisionStage=function(){return new P({name:"czm_night_vision",fragmentShader:T})},O.createDepthViewStage=function(){return new P({name:"czm_depth_view",fragmentShader:_})},O.createLensFlareStage=function(){return new P({name:"czm_lens_flare",fragmentShader:b,uniforms:{dirtTexture:e("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:e("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,earthRadius:s.WGS84.maximumRadius}})},O}),define("Scene/PostProcessStageTextureCache",["../Core/Color","../Core/defined","../Core/Math","../Core/destroyObject","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function l(e){for(;t(e.length);)e=e.get(e.length-1);return e.name}function u(e,i,r,n,o){if(!n.enabled||!n._isSupported(i))return o;var a=r[n.name]={};if(t(o)){a[l(e.getStageByName(o))]=!0}var s=n.uniforms;if(t(s))for(var u=Object.getOwnPropertyNames(s),c=u.length,d=0;d<c;++d){var h=s[u[d]];if("string"==typeof h){var p=e.getStageByName(h);t(p)&&(a[l(p)]=!0)}}return n.name}function c(e,i,r,n,o){if(t(n.enabled)&&!n.enabled||t(n._isSupported)&&!n._isSupported(i))return o;for(var a=o,s=!t(n.inputPreviousStageTexture)||n.inputPreviousStageTexture,d=o,h=n.length,p=0;p<h;++p){var f=n.get(p);d=t(f.length)?c(e,i,r,f,o):u(e,i,r,f,o),s&&(o=d)}var m,_;if(s)for(m=1;m<h;++m)_=l(n.get(m)),t(r[_])||(r[_]={}),r[_][a]=!0;else for(m=1;m<h;++m){_=l(n.get(m));for(var g=r[_],v=0;v<m;++v)g[l(n.get(v))]=!0}return d}function d(e,i){var r={};if(t(e.ambientOcclusion)){var n=e.ambientOcclusion,o=e.bloom,a=e._tonemapping,s=e.fxaa,l=c(e,i,r,n,void 0);l=c(e,i,r,o,l),l=u(e,i,r,a,l),l=c(e,i,r,e,l),u(e,i,r,s,l)}else c(e,i,r,e,void 0);return r}function h(i,r,n){var o,a,s=i._collection,l=s.getStageByName(r),u=l._textureScale,c=l._forcePowerOfTwo,d=l._pixelFormat,h=l._pixelDatatype,p=l._clearColor,f=i._framebuffers,m=f.length;for(o=0;o<m;++o)if(a=f[o],u===a.textureScale&&c===a.forcePowerOfTwo&&d===a.pixelFormat&&h===a.pixelDatatype&&e.equals(p,a.clearColor)){for(var _=a.stages,g=_.length,v=!1,y=0;y<g;++y)if(n[_[y]]){v=!0;break}if(!v)break}return t(a)&&o<m?(a.stages.push(r),a):(a={textureScale:u,forcePowerOfTwo:c,pixelFormat:d,pixelDatatype:h,clearColor:p,stages:[r],buffer:void 0,clear:void 0},f.push(a),a)}function p(e,t){var i=d(e._collection,t);for(var r in i)i.hasOwnProperty(r)&&(e._stageNameToFramebuffer[r]=h(e,r,i[r]))}function f(e){for(var t=e._framebuffers,i=t.length,r=0;r<i;++r){var n=t[r];n.buffer=n.buffer&&n.buffer.destroy(),n.buffer=void 0}}function m(e,t){for(var r=e._width,s=e._height,l=e._framebuffers,u=l.length,c=0;c<u;++c){var d=l[c],h=d.textureScale,p=Math.ceil(r*h),f=Math.ceil(s*h),m=Math.min(p,f);d.forcePowerOfTwo&&(i.isPowerOfTwo(m)||(m=i.nextPowerOfTwo(m)),p=m,f=m),d.buffer=new o({context:t,colorTextures:[new a({context:t,width:p,height:f,pixelFormat:d.pixelFormat,pixelDatatype:d.pixelDatatype})]}),d.clear=new n({color:d.clearColor,framebuffer:d.buffer})}}return s.prototype.updateDependencies=function(){this._updateDependencies=!0},s.prototype.update=function(e){var i=this._collection,r=this._updateDependencies,n=t(i.ambientOcclusion)&&i.ambientOcclusion.enabled&&i.ambientOcclusion._isSupported(e),o=t(i.bloom)&&i.bloom.enabled&&i.bloom._isSupported(e),a=t(i._tonemapping)&&i._tonemapping.enabled&&i._tonemapping._isSupported(e),s=t(i.fxaa)&&i.fxaa.enabled&&i.fxaa._isSupported(e),l=!t(i._activeStages)||i._activeStages.length>0||n||o||a||s;if((r||!l&&this._framebuffers.length>0)&&(f(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),r||l){0===this._framebuffers.length&&p(this,e);var u=e.drawingBufferWidth,c=e.drawingBufferHeight,d=this._width!==u||this._height!==c;(r||d)&&(this._width=u,this._height=c,this._updateDependencies=!1,f(this),m(this,e))}},s.prototype.clear=function(e){for(var t=this._framebuffers,i=0;i<t.length;++i)t[i].clear.execute(e)},s.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},s.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},s.prototype.getFramebuffer=function(e){var i=this._stageNameToFramebuffer[e];if(t(i))return i.buffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return f(this),r(this)},s}),
- define("Scene/Tonemapper",["../Core/freezeObject"],function(e){"use strict";var t={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===t.REINHARD||e===t.MODIFIED_REINHARD||e===t.FILMIC||e===t.ACES}};return e(t)}),define("Scene/PostProcessStageCollection",["../Core/arraySlice","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessStages/PassThrough","./PostProcessStageLibrary","./PostProcessStageTextureCache","./Tonemapper"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(){var e=m.createFXAAStage(),t=m.createAmbientOcclusionStage(),i=m.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=m.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=g.ACES;var n=this._tonemapping;t.enabled=!1,i.enabled=!1,n.enabled=!1;var o=new _(this),a={},s=S;for(s.push(e,t,i,n);s.length>0;){var l=s.pop();a[l.name]=l,l._textureCache=o;var u=l.length;if(r(u))for(var c=0;c<u;++c)s.push(l.get(c))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;var d=this;t.uniforms.randomTexture=function(){return d._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._lastLength=void 0,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=a,this._textureCache=o}function y(e){if(e._stagesRemoved){e._stagesRemoved=!1;for(var t=[],i=e._stages,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._stages=t}}function C(e){for(;r(e.length);)e=e.get(e.length-1);return e.outputTexture}function b(e,t,i,n,o){if(r(e.execute))return void e.execute(t,i,n,o);var a,s=e.length;if(e.inputPreviousStageTexture)for(b(e.get(0),t,i,n,o),a=1;a<s;++a)b(e.get(a),t,C(e.get(a-1)),n,o);else for(a=0;a<s;++a)b(e.get(a),t,i,n,o)}var S=[];return n(v.prototype,{ready:{get:function(){for(var e=!1,t=this._stages,i=t.length,r=i-1;r>=0;--r){var n=t[r];e=e||n.ready&&n.enabled}var o=this._fxaa,a=this._ao,s=this._bloom,l=this._tonemapping;return e=e||o.ready&&o.enabled,e=e||a.ready&&a.enabled,e=e||s.ready&&s.enabled,e=e||l.ready&&l.enabled}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return y(this),this._stages.length}},outputTexture:{get:function(){var e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);for(var t=this._stages,i=t.length,n=i-1;n>=0;--n){var o=t[n];if(r(o)&&o.ready&&o.enabled)return this.getOutputTexture(o.name)}var a=this._tonemapping;if(a.enabled&&a.ready)return this.getOutputTexture(a.name);var s=this._bloom;if(s.enabled&&s.ready)return this.getOutputTexture(s.name);var l=this._ao;return l.enabled&&l.ready?this.getOutputTexture(l.name):void 0}},hasSelected:{get:function(){for(var t=e(this._stages);t.length>0;){var i=t.pop();if(r(i)){if(r(i.selected))return!0;var n=i.length;if(r(n))for(var o=0;o<n;++o)t.push(i.get(o))}}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper!==e){r(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());var t,i=this._autoExposureEnabled;switch(e){case g.REINHARD:t=m.createReinhardTonemappingStage(i);break;case g.MODIFIED_REINHARD:t=m.createModifiedReinhardTonemappingStage(i);break;case g.FILMIC:t=m.createFilmicTonemappingStage(i);break;default:t=m.createAcesTonemappingStage(i)}if(i){var n=this._autoExposure;t.uniforms.autoExposure=function(){return n.outputTexture}}this._tonemapper=e,this._tonemapping=t,r(this._stageNames)&&(this._stageNames[t.name]=t,t._textureCache=this._textureCache),this._textureCacheDirty=!0}}}}),v.prototype.add=function(e){var t=this._stageNames,i=S;for(i.push(e);i.length>0;){var n=i.pop();t[n.name]=n,n._textureCache=this._textureCache;var o=n.length;if(r(o))for(var a=0;a<o;++a)i.push(n.get(a))}var s=this._stages;return e._index=s.length,s.push(e),this._textureCacheDirty=!0,e},v.prototype.remove=function(e){if(!this.contains(e))return!1;var t=this._stageNames,i=S;for(i.push(e);i.length>0;){var n=i.pop();delete t[n.name];var o=n.length;if(r(o))for(var a=0;a<o;++a)i.push(n.get(a))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},v.prototype.contains=function(e){return r(e)&&r(e._index)&&e._textureCache===this._textureCache},v.prototype.get=function(e){return y(this),this._stages[e]},v.prototype.removeAll=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)this.remove(e[i]);e.length=0},v.prototype.getStageByName=function(e){return this._stageNames[e]},v.prototype.update=function(e,t,i){y(this);var n=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=n;var a,f,m=this._stages,_=o.length=m.length,g=0;for(a=0;a<_;++a)f=m[a],f.ready&&f.enabled&&f._isSupported(e)&&(o[g++]=f);o.length=g;var v=g!==n.length;if(!v)for(a=0;a<g;++a)if(o[a]!==n[a]){v=!0;break}var C=this._ao,b=this._bloom,S=this._autoExposure,T=this._tonemapping,E=this._fxaa;T.enabled=i;var A=C.enabled&&C._isSupported(e),w=b.enabled&&b._isSupported(e),x=T.enabled&&T._isSupported(e),P=E.enabled&&E._isSupported(e);if((v||this._textureCacheDirty||g!==this._lastLength||A!==this._aoEnabled||w!==this._bloomEnabled||x!==this._tonemappingEnabled||P!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._lastLength=g,this._aoEnabled=A,this._bloomEnabled=w,this._tonemappingEnabled=x,this._fxaaEnabled=P,this._textureCacheDirty=!1),r(this._randomTexture)&&!A&&(this._randomTexture.destroy(),this._randomTexture=void 0),!r(this._randomTexture)&&A){_=196608;var D=new Uint8Array(_);for(a=0;a<_;a+=3)D[a]=Math.floor(255*Math.random());this._randomTexture=new c({context:e,pixelFormat:s.RGB,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:D,width:256,height:256},sampler:new u({wrapS:p.REPEAT,wrapT:p.REPEAT,minificationFilter:h.NEAREST,magnificationFilter:d.NEAREST})})}for(this._textureCache.update(e),E.update(e,t),C.update(e,t),b.update(e,t),T.update(e,t),this._autoExposureEnabled&&S.update(e,t),_=m.length,a=0;a<_;++a)m[a].update(e,t)},v.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},v.prototype.getOutputTexture=function(e){var t=this.getStageByName(e);if(r(t))return C(t)},v.prototype.execute=function(e,t,i,r){var n=this._activeStages,o=n.length,a=this._fxaa,s=this._ao,l=this._bloom,u=this._autoExposure,c=this._tonemapping,d=s.enabled&&s._isSupported(e),h=l.enabled&&l._isSupported(e),p=this._autoExposureEnabled,f=c.enabled&&c._isSupported(e),m=a.enabled&&a._isSupported(e);if(m||d||h||f||0!==o){var _=t;d&&s.ready&&(b(s,e,_,i,r),_=C(s)),h&&l.ready&&(b(l,e,_,i,r),_=C(l)),p&&u.ready&&b(u,e,_,i,r),f&&c.ready&&(b(c,e,_,i,r),_=C(c));var g=_;if(o>0){b(n[0],e,_,i,r);for(var v=1;v<o;++v)b(n[v],e,C(n[v-1]),i,r);g=C(n[o-1])}m&&a.ready&&b(a,e,g,i,r)}},v.prototype.copy=function(e,t){if(!r(this._copyColorCommand)){var i=this;this._copyColorCommand=e.createViewportQuadCommand(f,{uniformMap:{colorTexture:function(){return i.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),o(this)},v}),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.update=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/Check","../Core/defined","../Core/destroyObject","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./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 h(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,p.LEFT_DOWN),e._morphHandler.setInputAction(i,p.MIDDLE_DOWN),e._morphHandler.setInputAction(i,p.RIGHT_DOWN),e._morphHandler.setInputAction(i,p.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=Y,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,X);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,Q),d=f.eastNorthUpToFixedFrame(c,t,K);return s.multiplyByPointAsVector(d,r.direction,a),s.multiplyByPointAsVector(d,r.up,l),n}function b(t,i,r,n){function a(t){T(c,p,t.time,u.position),T(d,f,t.time,u.direction),T(h,_,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,Z),d=e.clone(u.direction,J),h=e.clone(u.up,$),p=s.multiplyByPoint(m.TRANSFORM_2D_INVERSE,r.position,ee),f=s.multiplyByPointAsVector(m.TRANSFORM_2D_INVERSE,r.direction,te),_=s.multiplyByPointAsVector(m.TRANSFORM_2D_INVERSE,r.up,ie),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){I(t,l,0,1,i,n)}});t._currentTweens.push(g)}function S(t,i,r){i/=3;var n,o=t._scene,s=o.camera;i>0?(n=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,n.position),e.negate(n.position,n.direction),e.normalize(n.direction,n.direction),e.clone(e.UNIT_Z,n.up)):(s.position.z=s.frustum.right-s.frustum.left,n=C(t,r));var l;t._morphToOrthographic?(l=re,l.aspectRatio=o.drawingBufferWidth/o.drawingBufferHeight,l.width=s.frustum.right-s.frustum.left):(l=j,l.aspectRatio=o.drawingBufferWidth/o.drawingBufferHeight,l.fov=a.toRadians(60)),n.frustum=l;var u=M(n);v(t,u);var c;c=t._morphToOrthographic?function(){b(t,i,n,u)}:function(){x(t,i,n,function(){b(t,i,n,u)})},i>0?(o._mode=_.SCENE2D,s.flyTo({duration:i,destination:e.fromDegrees(0,0,5*r.maximumRadius,r,se),complete:function(){o._mode=_.MORPHING,c()}})):c()}function T(t,i,r,n){return e.lerp(t,i,r,n)}function E(e,t,i,r,n){function s(e){c.frustum.fov=a.lerp(d,h,e.time);var t=p/Math.tan(.5*c.frustum.fov);r(c,t)}var u=e._scene,c=u.camera;if(!(c.frustum instanceof l)){var d=c.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,p=i.position.z*Math.tan(.5*d);c.frustum.far=p/Math.tan(.5*h)+1e7;var f=u.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){c.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(f)}}function A(t,i){function n(t){T(c,_,t.time,u.position),T(d,p,t.time,u.direction),T(h,f,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}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ce),d=e.clone(u.direction,de),h=e.clone(u.up,he),p=e.negate(e.UNIT_Z,fe),f=e.clone(e.UNIT_Y,me),_=pe;if(i>0)e.clone(e.ZERO,pe),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,pe);var g=ge;s.multiplyByPoint(m.TRANSFORM_2D,c,g.origin),s.multiplyByPointAsVector(m.TRANSFORM_2D,d,g.direction);var y=l.globe;if(r(y)){var C=y.pickWorldCoordinates(g,l,ve);r(C)&&(s.multiplyByPoint(m.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var b=_e;b.right=.5*_.z,b.left=-b.right,b.top=b.right*(l.drawingBufferHeight/l.drawingBufferWidth),b.bottom=-b.top;var S=ye;S.position=_,S.direction=p,S.up=f,S.frustum=b;var A=R(S);v(t,A);var w=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,i,S,a,A)}});t._currentTweens.push(w)}function w(t,i,n){function o(e,t){e.position.x=t}function a(){E(t,i,c,o,T)}i*=.5;var l=t._scene,u=l.camera,c=be;if(i>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,Ce),l.mapProjection.project(Ce,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var d=Ee;e.clone(c.position2D,d.origin);var h=e.clone(u.directionWC,d.direction),p=n.scaleToGeodeticSurface(u.positionWC,we),_=f.eastNorthUpToFixedFrame(p,n,Ae);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,h,h),s.multiplyByPointAsVector(m.TRANSFORM_2D,h,h);var g=l.globe;if(r(g)){var y=g.pickWorldCoordinates(d,l,Te);if(r(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(m.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(m.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(m.TRANSFORM_2D,c.up,c.up2D);var b=c.frustum;b.right=.5*c.position.z,b.left=-b.right,b.top=b.right*(l.drawingBufferHeight/l.drawingBufferWidth),b.bottom=-b.top;var S=Se;s.multiplyByPoint(m.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=b;var T=R(S);v(t,T),D(t,i,c,a)}function x(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){T(h,u,t.time,l.position),T(p,c,t.time,l.direction),T(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,ne),p=e.clone(l.direction,oe),f=e.clone(l.up,ae);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,se),c=e.clone(r.direction,le),d=e.clone(r.up,ue);s._mode=_.MORPHING,t._morphToOrthographic?a():x(t,0,r,a)}function D(t,i,r,n){function a(t){T(u,h,t.time,l.position),T(c,p,t.time,l.direction),T(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,ne),c=e.clone(l.direction,oe),d=e.clone(l.up,ae),h=e.clone(r.position2D,se),p=e.clone(r.direction2D,le),f=e.clone(r.up2D,ue),m=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){I(t,s,1,0,i,n)}});t._currentTweens.push(m)}function I(e,t,i,n,a,s){var l={object:t,property:"morphTime",startValue:i,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};r(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function M(t){return function(i){var n=i._scene;n._mode=_.SCENE3D,n.morphTime=_.getMorphTime(_.SCENE3D),y(i);var o=n.camera;(i._previousMode!==_.MORPHING||i._morphCancelled)&&(i._morphCancelled=!1,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),o.frustum=t.frustum.clone());var a=o.frustum;n.frameState.useLogDepth&&(a.near=.1,a.far=1e10);var s=r(i._completeMorph);i._completeMorph=void 0,n.camera.update(n.mode),i._scene.morphComplete.raiseEvent(i,i._previousMode,_.SCENE3D,s)}}function R(t){return function(i){var n=i._scene;n._mode=_.SCENE2D,n.morphTime=_.getMorphTime(_.SCENE2D),y(i);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=r(i._completeMorph);i._completeMorph=void 0,n.camera.update(n.mode),i._scene.morphComplete.raiseEvent(i,i._previousMode,_.SCENE2D,a)}}function O(t){return function(i){var n=i._scene;n._mode=_.COLUMBUS_VIEW,n.morphTime=_.getMorphTime(_.COLUMBUS_VIEW),y(i);var o=n.camera;(i._previousModeMode!==_.MORPHING||i._morphCancelled)&&(i._morphCancelled=!1,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=o.frustum;n.frameState.useLogDepth&&(a.near=.1,a.far=1e10);var s=r(i._completeMorph);i._completeMorph=void 0,n.camera.update(n.mode),i._scene.morphComplete.raiseEvent(i,i._previousMode,_.COLUMBUS_VIEW,s)}}g.prototype.completeMorph=function(){r(this._completeMorph)&&this._completeMorph()},g.prototype.morphTo2D=function(e,t){r(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof l,this._previousMode!==_.SCENE2D&&this._previousMode!==_.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,_.SCENE2D,!0),i._mode=_.MORPHING,i.camera._setTransform(s.IDENTITY),this._previousMode===_.COLUMBUS_VIEW?A(this,e):w(this,e,t),0===e&&r(this._completeMorph)&&this._completeMorph())};var L=new e,N=new e,F=new e,B=new e,k=new e,z=new e,V=new e,U=new t,G=new s,H=new c,W=new l,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,i){r(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=L,l=N,u=F;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*i.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 d=i.scaleToGeodeticSurface(o,V),h=f.eastNorthUpToFixedFrame(d,i,G);s.inverseTransformation(h,h),n.mapProjection.project(i.cartesianToCartographic(o,U),o),s.multiplyByPointAsVector(h,l,l),s.multiplyByPointAsVector(h,u,u)}}var p;this._morphToOrthographic?(p=W,p.width=n.camera.frustum.right-n.camera.frustum.left,p.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(p=H,p.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,p.fov=a.toRadians(60));var g=q;g.position=o,g.direction=l,g.up=u,g.frustum=p;var y=O(g);v(this,y),this._previousMode===_.SCENE2D?P(this,t,g,y):(g.position2D=s.multiplyByPoint(m.TRANSFORM_2D,o,B),g.direction2D=s.multiplyByPointAsVector(m.TRANSFORM_2D,l,k),g.up2D=s.multiplyByPointAsVector(m.TRANSFORM_2D,u,z),n._mode=_.MORPHING,D(this,t,g,y)),0===t&&r(this._completeMorph)&&this._completeMorph()}};var Y={position:new e,direction:new e,up:new e,frustum:void 0},j=new c;g.prototype.morphTo3D=function(t,i){r(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,i);else{var o;t>0?(o=Y,e.fromDegrees(0,0,5*i.maximumRadius,i,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=C(this,i);var u,c=n.camera;c.frustum instanceof l?u=c.frustum.clone():(u=j,u.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,u.fov=a.toRadians(60)),o.frustum=u;var d=M(o);v(this,d),b(this,t,o,d)}0===t&&r(this._completeMorph)&&this._completeMorph()}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return y(this),n(this)};var X=new t,Q=new e,K=new s,Z=new e,J=new e,$=new e,ee=new e,te=new e,ie=new e,re=new l,ne=new e,oe=new e,ae=new e,se=new e,le=new e,ue=new e,ce=new e,de=new e,he=new e,pe=new e,fe=new e,me=new e,_e=new u,ge=new d,ve=new e,ye={position:void 0,direction:void 0,up:void 0,frustum:void 0},Ce=new t,be={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new u},Se={position:new e,direction:new e,up:new e,frustum:void 0},Te=new e,Ee=new d,Ae=new s,we=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-1!==t&&(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)&&-1!==this._tweens.indexOf(e)},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),t.splice(r,1))}},c}),define("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRoll","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w){"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=S.LEFT_DRAG,this.zoomEventTypes=[S.RIGHT_DRAG,S.WHEEL,S.PINCH],this.rotateEventTypes=S.LEFT_DRAG,this.tiltEventTypes=[S.MIDDLE_DRAG,S.PINCH,{eventType:S.LEFT_DRAG,modifier:h.CTRL},{eventType:S.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:S.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new b(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new w,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-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,p.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 P(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function D(t){return e.equalsEpsilon(t.startPosition,t.endPosition,p.EPSILON14)}function I(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<te){var m=P(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(_)||D(_))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)){a(s,t.getStartMousePosition(i,r),u)}}else u.active=!1}function M(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;d(i)||(ie[0]=i,i=ie);for(var l=i.length,u=0;u<l;++u){var c=i[u],h=o(c.eventType)?c.eventType:c,p=c.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&&I(s,h,p,n,r,e,a))}}}function R(i,r,n,a,s,l){var u=1;o(l)&&(u=p.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,d=i.maximumZoomDistance,h=s-c,f=a*h;f=p.clamp(f,i._minimumZoomRate,i._maximumZoomRate);var m=n.endPosition.y-n.startPosition.y,g=m/i._scene.canvas.clientHeight;g=Math.min(g,i.maximumMovementRatio);var v=f*g;if(!(v>0&&Math.abs(s-c)<1||v<0&&Math.abs(s-d)<1)){s-v<c?v=s-c-1:s-v>d&&(v=s-d);var y=i._scene,C=y.camera,b=y.mode,S=we.orientation;if(S.heading=C.heading,S.pitch=C.pitch,S.roll=C.roll,C.frustum instanceof _)return void(Math.abs(v)>0&&(C.zoomIn(v),C._adjustOrthographicFrustum()));var T,w=e.equals(r,i._zoomMouseStart),x=i._zoomingOnVector,P=i._rotatingZoom;if(w||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(b===E.SCENE2D?(T=C.getPickRay(r,re).origin,T=t.fromElements(T.y,T.z,T.x)):T=k(i,r,ne)),o(T)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(T,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,x=i._zoomingOnVector=!1,P=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void C.zoomIn(v);var D=b===E.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(P=!0),!w||P){if(b===E.SCENE2D){var I=i._zoomWorldPosition,M=C.position;if(!t.equals(I,M)&&C.positionCartographic.height<2*i._maxCoord.x){var R=C.position.x,O=t.subtract(I,M,ae);t.normalize(O,O);var L=t.distance(I,M)*v/(.5*C.getMagnitude());C.move(O,.5*L),(C.position.x<0&&R>0||C.position.x>0&&R<0)&&(T=C.getPickRay(r,re).origin,T=t.fromElements(T.y,T.z,T.x),i._zoomWorldPosition=t.clone(T,i._zoomWorldPosition))}}else if(b===E.SCENE3D){var N=t.normalize(C.position,he);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,N))<.6)D=!0;else{var F=y.canvas,B=se;B.x=F.clientWidth/2,B.y=F.clientHeight/2;var z=k(i,B,le);if(o(z)&&C.positionCartographic.height<1e6){var V=fe;t.clone(C.position,V);var U=i._zoomWorldPosition,G=pe;if(G=t.normalize(U,G),t.dot(G,N)<0)return;var H=Se,W=ge;t.clone(C.direction,W),t.add(V,t.multiplyByScalar(W,1e3,Te),H);var q=ve,Y=ye;t.subtract(U,V,q),t.normalize(q,Y);var j=t.dot(N,Y);if(j>=0)return void(i._zoomMouseStart.x=-1);var X=Math.acos(-j),Q=t.magnitude(V),K=t.magnitude(U),Z=Q-v,J=t.magnitude(q),$=Math.asin(p.clamp(J/K*Math.sin(X),-1,1)),ee=Math.asin(p.clamp(Z/K*Math.sin(X),-1,1)),te=$-ee+X,ie=me;t.normalize(V,ie);var xe=_e;xe=t.cross(Y,ie,xe),xe=t.normalize(xe,xe),t.normalize(t.cross(ie,xe,Te),W),t.multiplyByScalar(t.normalize(H,Te),t.magnitude(H)-v,H),t.normalize(V,V),t.multiplyByScalar(V,Z,V);var Pe=Ce
- ;t.multiplyByScalar(t.add(t.multiplyByScalar(ie,Math.cos(te)-1,Ee),t.multiplyByScalar(W,Math.sin(te),Ae),Te),Z,Pe),t.add(V,Pe,V),t.normalize(H,ie),t.normalize(t.cross(ie,xe,Te),W);var De=be;return t.multiplyByScalar(t.add(t.multiplyByScalar(ie,Math.cos(te)-1,Ee),t.multiplyByScalar(W,Math.sin(te),Ae),Te),t.magnitude(H),De),t.add(H,De,H),t.clone(V,C.position),t.normalize(t.subtract(H,V,Te),C.direction),t.clone(C.direction,C.direction),t.cross(C.direction,C.up,C.right),t.cross(C.right,C.direction,C.up),void C.setView(we)}if(o(z)){var Ie=t.normalize(z,ue),Me=t.normalize(i._zoomWorldPosition,ce),Re=t.dot(Me,Ie);if(Re>0&&Re<1){var Oe=p.acosClamped(Re),Le=t.cross(Me,Ie,de),Ne=Math.abs(Oe)>p.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-v,Fe=v/Ne;C.rotate(Le,Oe*Fe)}}else D=!0}}i._rotatingZoom=!D}if(!w&&D||x){var Be,ke=A.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,oe);Be=b!==E.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(ke)?C.getPickRay(ke,re):C.getPickRay(r,re);var ze=Be.direction;b!==E.COLUMBUS_VIEW&&b!==E.SCENE2D||t.fromElements(ze.y,ze.z,ze.x,ze),C.move(ze,v),i._zoomingOnVector=!0}else C.zoomIn(v);C.setView(we)}}function O(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,xe).origin,s=o.getPickRay(r.endPosition,Pe).origin;a=t.fromElements(a.y,a.z,a.x,a),s=t.fromElements(s.y,s.z,s.x,s);var l=t.subtract(a,s,De),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function L(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;R(e,t,i,e._zoomFactor,n.getMagnitude())}function N(t,i,r){if(o(r.angleAndHeight))return void F(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ie;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var d=Me;d.x=2/l*r.endPosition.x-1,d.y=2/u*(u-r.endPosition.y)-1,d=e.normalize(d,d);var h=p.acosClamped(c.x);c.y<0&&(h=p.TWO_PI-h);var f=p.acosClamped(d.x);d.y<0&&(f=p.TWO_PI-f);var m=f-h;a.twistRight(m)}function F(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===T.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(M(e,e.enableTranslate,e.translateEventTypes,O,e.inertiaTranslate,"_lastInertiaTranslateMovement"),M(e,e.enableZoom,e.zoomEventTypes,L,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&M(e,e.enableRotate,e.tiltEventTypes,N,e.inertiaSpin,"_lastInertiaTiltMovement")):(M(e,e.enableZoom,e.zoomEventTypes,L,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&M(e,e.enableRotate,e.translateEventTypes,N,e.inertiaSpin,"_lastInertiaSpinMovement"))}function k(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPositionWorldCoordinates(i,Oe));var u=s.getPickRay(i,Re),c=a.pickWorldCoordinates(u,n,Le);return(o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY)<(o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY)?t.clone(l,r):t.clone(c,r)}}function z(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void $(i,r,n);if(i._strafing)return void q(i,r,n);var a,s=i._scene,l=s.camera,u=e.clone(n.startPosition,Ge),d=e.clone(n.endPosition,He),h=l.getPickRay(u,Ne),f=t.clone(t.ZERO,Ve),m=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=k(i,u,Be),o(a)&&(f.x=a.x)),f.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,q(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var _=g.fromPointNormal(f,m,Ue);h=l.getPickRay(u,Ne);var v=c.rayPlane(h,_,Be),y=l.getPickRay(d,Fe),C=c.rayPlane(y,_,ke);if(!o(v)||!o(C))return i._looking=!0,$(i,r,n),void e.clone(r,i._translateMousePosition);var b=t.subtract(v,C,ze),S=b.x;b.x=b.y,b.y=b.z,b.z=S;var T=t.magnitude(b);T>p.EPSILON6&&(t.normalize(b,b),l.move(b,T))}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 $(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,U(t,i,r)):G(t,i,r)}function U(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=We;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var d,h=s.getPickRay(c,qe),f=t.UNIT_X,_=h.origin,g=h.direction,v=t.dot(f,g);if(Math.abs(v)>p.EPSILON6&&(d=-t.dot(f,_)/v),!o(d)||d<=0)return i._looking=!0,$(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var y=t.multiplyByScalar(g,d,Ye);t.add(_,y,y);var b=a.mapProjection,S=b.ellipsoid;t.fromElements(y.y,y.z,y.x,y);var T=b.unproject(y,$e);S.cartographicToCartesian(T,y);var E=C.eastNorthUpToFixedFrame(y,S,Xe),A=i._globe,w=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var x=m.clone(s.transform,et);s._setTransform(E),j(i,r,n,t.UNIT_Z),s._setTransform(x),i._globe=A,i._ellipsoid=w;var P=w.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function G(i,r,n){var a,s,u=i._scene,d=u.camera,h=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Ye);else{if(d.position.z<i._minimumPickingTerrainHeight&&(a=k(i,r,Ye)),!o(a)){s=d.getPickRay(r,qe);var _,y=s.origin,b=s.direction,S=t.dot(h,b);if(Math.abs(S)>p.EPSILON6&&(_=-t.dot(h,y)/S),!o(_)||_<=0)return i._looking=!0,$(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(b,_,Ye),t.add(y,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var T=u.canvas,E=We;E.x=T.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=d.getPickRay(E,qe);var A=t.clone(t.ZERO,Ke);A.x=a.x;var w=g.fromPointNormal(A,h,Ze),x=c.rayPlane(s,w,je),P=d._projection,D=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var I=P.unproject(a,$e);D.cartographicToCartesian(I,a);var M,R=C.eastNorthUpToFixedFrame(a,D,Xe);o(x)?(t.fromElements(x.y,x.z,x.x,x),I=P.unproject(x,$e),D.cartographicToCartesian(I,x),M=C.eastNorthUpToFixedFrame(x,D,Qe)):M=R;var O=i._globe,L=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var N=t.UNIT_Z,F=m.clone(d.transform,et);d._setTransform(R);var B=t.cross(t.UNIT_Z,t.normalize(d.position,Je),Je),z=t.dot(d.right,B);if(j(i,r,n,N,!1,!0),d._setTransform(M),z<0){n.startPosition.y>n.endPosition.y&&(N=void 0);var V=d.constrainedAxis;d.constrainedAxis=void 0,j(i,r,n,N,!0,!1),d.constrainedAxis=V}else j(i,r,n,N,!0,!1);if(o(d.constrainedAxis)){var U=t.cross(d.direction,d.constrainedAxis,rt);t.equalsEpsilon(U,t.ZERO,p.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(F),i._globe=O,i._ellipsoid=L;var G=L.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var H=t.clone(d.positionWC,Je);if(d._adjustHeightForTerrain(),!t.equals(d.positionWC,H)){d._setTransform(M),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=v.fromAxisAngle(Y,q,tt),Q=f.fromQuaternion(X,it);f.multiplyByVector(Q,d.direction,d.direction),f.multiplyByVector(Q,d.up,d.up),t.cross(d.direction,d.up,d.right),t.cross(d.right,d.direction,d.up),d._setTransform(F)}}function H(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=nt;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,ot);a.position.z<e._minimumPickingTerrainHeight&&(u=k(e,l,at));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)}R(e,i,r,e._zoomFactor,d)}function W(e){var t=e._scene,i=t.camera;if(m.equals(m.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),M(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),M(e,e.enableTranslate,e.translateEventTypes,z,e.inertiaTranslate,"_lastInertiaTranslateMovement"),M(e,e.enableZoom,e.zoomEventTypes,H,e.inertiaZoom,"_lastInertiaZoomMovement"),M(e,e.enableLook,e.lookEventTypes,$),!(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,Q,e.inertiaZoom,"_lastInertiaZoomMovement")}function q(e,i,r){var n=e._scene,a=n.camera,s=k(e,r.startPosition,dt);if(o(s)){var l=r.endPosition,u=a.getPickRay(l,st),d=t.clone(a.direction,ct);n.mode===E.COLUMBUS_VIEW&&t.fromElements(d.z,d.x,d.y,d);var h=g.fromPointNormal(s,d,lt),p=c.rayPlane(u,h,ut);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 Y(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void j(i,r,n);var u,c,d,h,p=i._ellipsoid.geodeticSurfaceNormal(s.position,_t),f=i._ellipsoid.cartesianToCartographic(s.positionWC,pt).height,_=i._globe,g=!1;if(o(_)&&f<i._minimumPickingTerrainHeight&&(h=k(i,n.startPosition,dt),o(h))){var v=s.getPickRay(n.startPosition,Re),y=i._ellipsoid.geodeticSurfaceNormal(h);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}if(e.equals(r,i._rotateMousePosition))return void(i._looking?$(i,r,n,p):i._rotating?j(i,r,n):i._strafing?(t.clone(h,i._strafeStartPosition),q(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=ft,c.x=c.y=c.z=u,d=l.fromCartesian3(c,mt),X(i,r,n,d)));i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&f<i._minimumPickingTerrainHeight?o(h)?t.magnitude(s.position)<t.magnitude(h)?(t.clone(h,i._strafeStartPosition),i._strafing=!0,q(i,r,n)):(u=t.magnitude(h),c=ft,c.x=c.y=c.z=u,d=l.fromCartesian3(c,mt),X(i,r,n,d),t.clone(h,i._rotateStartPosition)):(i._looking=!0,$(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,ht))?(X(i,r,n,i._ellipsoid),t.clone(ht,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,j(i,r,n)):(i._looking=!0,$(i,r,n,p)),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 X(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,Tt),c=e.clone(n.endPosition,Et),d=l.pickEllipsoid(u,a,gt),h=l.pickEllipsoid(c,a,vt);if(!o(d)||!o(h))return i._rotating=!0,void j(i,r,n);if(d=l.worldToCameraCoordinates(d,d),h=l.worldToCameraCoordinates(h,h),o(l.constrainedAxis)){var f=l.constrainedAxis,m=t.mostOrthogonalAxis(f,yt);t.cross(m,f,m),t.normalize(m,m);var _=t.cross(f,m,Ct),g=t.magnitude(d),v=t.dot(f,d),y=Math.acos(v/g),C=t.multiplyByScalar(f,v,bt);t.subtract(d,C,C),t.normalize(C,C);var b=t.magnitude(h),S=t.dot(f,h),T=Math.acos(S/b),E=t.multiplyByScalar(f,S,St);t.subtract(h,E,E),t.normalize(E,E);var A=Math.acos(t.dot(C,m));t.dot(C,_)<0&&(A=p.TWO_PI-A);var w=Math.acos(t.dot(E,m));t.dot(E,_)<0&&(w=p.TWO_PI-w);var x,P=A-w;x=t.equalsEpsilon(f,l.position,p.EPSILON2)?l.right:t.cross(f,l.position,yt);var D,I=t.cross(f,x,yt),M=t.dot(I,t.subtract(d,f,Ct)),R=t.dot(I,t.subtract(h,f,Ct));D=M>0&&R>0?T-y:M>0&&R<=0?t.dot(l.position,f)>0?-y-T:y+T:y-T,l.rotateRight(P),l.rotateUp(D)}else{t.normalize(d,d),t.normalize(h,h);var O=t.dot(d,h),L=t.cross(d,h,yt);if(O<1&&!t.equalsEpsilon(L,t.ZERO,p.EPSILON14)){var N=Math.acos(O);l.rotate(L,N)}}}function Q(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=nt;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,d=s.getPickRay(u,ot),h=n.cartesianToCartographic(s.position,wt).height;h<e._minimumPickingTerrainHeight&&(c=k(e,u,at));var p;p=o(c)?t.distance(d.origin,c):h;var f=t.normalize(s.position,At);R(e,i,r,e._zoomFactor,p,t.dot(f,s.direction))}function K(t,i,r){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){return void $(t,i,r,t._ellipsoid.geodeticSurfaceNormal(a.position,Bt))}var s=t._ellipsoid,l=s.cartesianToCartographic(a.position,Ft);t._tiltOnEllipsoid||l.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,i,r)):J(t,i,r)}}function Z(i,r,n){var a=i._ellipsoid,s=i._scene,u=s.camera,d=.25*i.minimumZoomDistance,h=a.cartesianToCartographic(u.positionWC,kt).height;if(!(h-d-1<p.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,_=xt;_.x=f.clientWidth/2,_.y=f.clientHeight/2;var g,v=u.getPickRay(_,Pt),b=c.rayEllipsoid(v,a);if(o(b))g=y.getPoint(v,b.start,Dt);else{if(!(h>i._minimumTrackBallHeight)){i._looking=!0;return $(i,r,n,i._ellipsoid.geodeticSurfaceNormal(u.position,Bt)),void e.clone(r,i._tiltCenterMousePosition)}var S=c.grazingAltitudeLocation(v,a);if(!o(S))return;var T=a.cartesianToCartographic(S,Ft);T.height=0,g=a.cartographicToCartesian(T,Dt)}var E=C.eastNorthUpToFixedFrame(g,a,Mt),A=i._globe,w=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var x=m.clone(u.transform,Ot);u._setTransform(E),j(i,r,n,t.UNIT_Z),u._setTransform(x),i._globe=A,i._ellipsoid=w;var P=w.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}}function J(i,r,n){var a,s,u,d=i._ellipsoid,h=i._scene,_=h.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Dt);else{if(a=k(i,r,Dt),!o(a)){if(s=_.getPickRay(r,Pt),u=c.rayEllipsoid(s,d),!o(u)){if(d.cartesianToCartographic(_.position,Ft).height<=i._minimumTrackBallHeight){i._looking=!0;$(i,r,n,i._ellipsoid.geodeticSurfaceNormal(_.position,Bt)),e.clone(r,i._tiltCenterMousePosition)}return}a=y.getPoint(s,u.start,Dt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var g=h.canvas,b=xt;b.x=g.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=_.getPickRay(b,Pt);var S=t.magnitude(a),T=t.fromElements(S,S,S,ft),E=l.fromCartesian3(T,mt);if(u=c.rayEllipsoid(s,E),o(u)){var A=t.magnitude(s.origin)>S?u.start:u.stop,w=y.getPoint(s,A,It),x=C.eastNorthUpToFixedFrame(a,d,Mt),P=C.eastNorthUpToFixedFrame(w,E,Rt),D=i._globe,I=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var M=t.UNIT_Z,R=m.clone(_.transform,Ot);_._setTransform(x);var O=t.cross(w,_.positionWC,rt),L=t.dot(_.rightWC,O);if(j(i,r,n,M,!1,!0),_._setTransform(P),L<0){n.startPosition.y>n.endPosition.y&&(M=void 0);var N=_.constrainedAxis;_.constrainedAxis=void 0,j(i,r,n,M,!0,!1),_.constrainedAxis=N}else j(i,r,n,M,!0,!1);if(o(_.constrainedAxis)){var F=t.cross(_.direction,_.constrainedAxis,rt);t.equalsEpsilon(F,t.ZERO,p.EPSILON6)||(t.dot(F,_.right)<0&&t.negate(F,F),t.cross(F,_.direction,_.up),t.cross(_.direction,_.up,_.right),t.normalize(_.up,_.up),t.normalize(_.right,_.right))}_._setTransform(R),i._globe=D,i._ellipsoid=I;var B=I.maximumRadius;i._rotateFactor=1/B,i._rotateRateRangeAdjustment=B;var z=t.clone(_.positionWC,rt);if(_._adjustHeightForTerrain(),!t.equals(_.positionWC,z)){_._setTransform(P),_.worldToCameraCoordinatesPoint(z,z);var V=t.magnitudeSquared(z);t.magnitudeSquared(_.position)>V&&(t.normalize(_.position,_.position),t.multiplyByScalar(_.position,Math.sqrt(V),_.position));var U=t.angleBetween(z,_.position),G=t.cross(z,_.position,z);t.normalize(G,G);var H=v.fromAxisAngle(G,U,Lt),W=f.fromQuaternion(H,Nt);f.multiplyByVector(W,_.direction,_.direction),f.multiplyByVector(W,_.up,_.up),t.cross(_.direction,_.up,_.right),t.cross(_.right,_.direction,_.up),_._setTransform(R)}}}function $(e,i,r,a){var s=e._scene,l=s.camera,u=zt;u.x=r.startPosition.x,u.y=0;var c=Vt;c.x=r.endPosition.x,c.y=0;var d,h,f=l.getPickRay(u,Ut),m=l.getPickRay(c,Gt),g=0;l.frustum instanceof _?(d=f.origin,h=m.origin,t.add(l.direction,d,d),t.add(l.direction,h,h),t.subtract(d,l.position,d),t.subtract(h,l.position,h),t.normalize(d,d),t.normalize(h,h)):(d=f.direction,h=m.direction);var v=t.dot(d,h);v<1&&(g=Math.acos(v)),g=r.startPosition.x>r.endPosition.x?-g:g;var y=e._horizontalRotationAxis;if(o(a)?l.look(a,-g):o(y)?l.look(y,-g):l.lookLeft(g),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,f=l.getPickRay(u,Ut),m=l.getPickRay(c,Gt),g=0,l.frustum instanceof _?(d=f.origin,h=m.origin,t.add(l.direction,d,d),t.add(l.direction,h,h),t.subtract(d,l.position,d),t.subtract(h,l.position,h),t.normalize(d,d),t.normalize(h,h)):(d=f.direction,h=m.direction),v=t.dot(d,h),v<1&&(g=Math.acos(v)),g=r.startPosition.y>r.endPosition.y?-g:g,a=n(a,y),o(a)){var C=l.direction,b=t.negate(a,Ht),S=t.equalsEpsilon(C,a,p.EPSILON2),T=t.equalsEpsilon(C,b,p.EPSILON2);if(S||T)(S&&g<0||T&&g>0)&&l.look(l.right,-g);else{v=t.dot(C,a);var E=p.acosClamped(v);g>0&&g>E&&(g=E-p.EPSILON4),v=t.dot(C,b),E=p.acosClamped(v),g<0&&-g>E&&(g=-E+p.EPSILON4);var A=t.cross(a,C,Wt);l.look(A,g)}}else l.lookUp(g)}function ee(e){M(e,e.enableRotate,e.rotateEventTypes,Y,e.inertiaSpin,"_lastInertiaSpinMovement"),M(e,e.enableZoom,e.zoomEventTypes,Q,e.inertiaZoom,"_lastInertiaZoomMovement"),M(e,e.enableTilt,e.tiltEventTypes,K,e.inertiaSpin,"_lastInertiaTiltMovement"),M(e,e.enableLook,e.lookEventTypes,$)}var te=.4,ie=[],re=new y,ne=new t,oe=new e,ae=new t,se=new e,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,be=new t,Se=new t,Te=new t,Ee=new t,Ae=new t,we={orientation:new u},xe=new y,Pe=new y,De=new t,Ie=new e,Me=new e,Re=new y,Oe=new t,Le=new t,Ne=new y,Fe=new y,Be=new t,ke=new t,ze=new t,Ve=new t,Ue=new g(t.UNIT_X,0),Ge=new e,He=new e,We=new e,qe=new y,Ye=new t,je=new t,Xe=new m,Qe=new m,Ke=new t,Ze=new g(t.UNIT_X,0),Je=new t,$e=new r,et=new m,tt=new v,it=new f,rt=new t,nt=new e,ot=new y,at=new t,st=new y,lt=new g(t.UNIT_X,0),ut=new t,ct=new t,dt=new t,ht=new t,pt=new r,ft=new t,mt=new l,_t=new t,gt=i.clone(i.UNIT_W),vt=i.clone(i.UNIT_W),yt=new t,Ct=new t,bt=new t,St=new t,Tt=new e,Et=new e,At=new t,wt=new r,xt=new e,Pt=new y,Dt=new t,It=new t,Mt=new m,Rt=new m,Ot=new m,Lt=new v,Nt=new f,Ft=new r,Bt=new t,kt=new r,zt=new e,Vt=new e,Ut=new y,Gt=new y,Ht=new t,Wt=new t;return x.prototype.update=function(){m.equals(this._scene.camera.transform,m.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===E.SCENE2D?B(this):r===E.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,W(this)):r===E.SCENE3D&&(this._horizontalRotationAxis=void 0,ee(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);o.push("SHADOW_MAP"),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");a.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}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+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_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){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(e._numberOfCascades>1)+e.debugCascadeColors+e.softShadows+t+i+r},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return n.push("SHADOW_MAP"),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),b=C.length,S=0;S<b;++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 T="";T+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n";var E;return E=c?" return vec4("+u+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n",T+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+E+"} \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",T+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",T+=" 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?T+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(T+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),T+=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",T+=" gl_FragColor.rgb *= visibility; \n} \n",C.push(T),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/CullingVolume","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../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","./DebugCameraPrimitive","./PerInstanceColorAppearance","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q){"use strict";function K(e){e=h(e,h.EMPTY_OBJECT);var i=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this._normalOffset=h(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=h(e.fromLightSource,!0),this.darkness=h(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=h(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(g.isInternetExplorer()||g.isEdge()||(g.isChrome()||g.isFirefox())&&g.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 b,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=h(e.isPointLight,!1),this._pointLightRadius=h(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&h(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?h(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new S:p(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new b,new b,new b,new b],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 Z(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 P({depth:1,color:new l}),
- this._clearPassState=new L(i),this._size=h(e.size,2048),this.size=this._size}function Z(e){this.camera=new fe,this.passState=new L(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function J(e,t){return k.fromCache({cull:{enabled:!0,face:q.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;p(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 z({wrapS:H.CLAMP_TO_EDGE,wrapT:H.CLAMP_TO_EDGE,minificationFilter:G.NEAREST,magnificationFilter:U.NEAREST})}function ie(e,t){for(var i=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,format:B.DEPTH_COMPONENT16}),r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:E.RGBA,pixelDatatype:N.UNSIGNED_BYTE,sampler:te()}),n=new R({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 V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:E.DEPTH_STENCIL,pixelDatatype:N.UNSIGNED_INT_24_8,sampler:te()}),r=new R({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 F({context:t,width:e._textureSize.x,height:e._textureSize.y,format:B.DEPTH_COMPONENT16}),r=new I({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:E.RGBA,pixelDatatype:N.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 R({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!==x.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,$(e),ee(e),oe(e,t))}function se(e,t){p(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=h(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=D.maximumCubeMapSize>=i?i:D.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=D.maximumTextureSize>=i?i:D.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=D.maximumTextureSize>=2*i?i:D.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 b(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=O.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;p(l)||(l=ce(t,r),t._debugShadowViewCommand=l),p(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=k.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function he(e,t){var r=new v({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new v({geometry:new w({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 Y({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 Y({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 Y({camera:e._passes[r].camera,color:xe[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!p(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=A.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,Pe),c=b.fromTranslationQuaternionRotationScale(o,a,u,Ee);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=he(c,l.YELLOW)}e._debugLightFrustum.update(t)}else p(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new Y({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new b,this.inverseViewMatrix=new b,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 b}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.shadowState.closestObjectSize<200&&(p=!0,h=.9);var f=Re,m=Ie;for(m[0]=s,m[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(d,_),v=s+c*_,y=C.lerp(v,g,h);m[i+1]=y,f[i]=y-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 T=r.frustum,E=T.left,A=T.right,w=T.bottom,x=T.top,P=T.near,D=T.far,I=r.positionWC,M=r.directionWC,R=r.upWC,O=a.frustum.clone(Me),L=r.getViewProjection();for(i=0;i<u;++i){O.near=m[i],O.far=m[i+1];for(var N=b.multiply(O.projectionMatrix,a.viewMatrix,Ee),F=b.inverse(N,Ee),B=b.multiply(L,F,Ee),k=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Oe),z=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Le),V=0;V<8;++V){var U=o.clone(Te[V],Ae[V]);b.multiplyByVector(B,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,k,k),n.maximumByComponent(U,z,z)}k.x=Math.max(k.x,0),k.y=Math.max(k.y,0),k.z=0,z.x=Math.min(z.x,1),z.y=Math.min(z.y,1),z.z=Math.min(z.z,1);var G=e._passes[i],H=G.camera;H.clone(r);var W=H.frustum;W.left=E+k.x*(A-E),W.right=E+z.x*(A-E),W.bottom=w+k.y*(x-w),W.top=w+z.y*(x-w),W.near=P+k.z*(D-P),W.far=P+z.z*(D-P),G.cullingVolume=H.frustum.computeCullingVolume(I,M,R);var q=e._cascadeMatrices[i];b.multiply(H.getViewProjection(),a.inverseViewMatrix,q),b.multiply(G.textureOffsets,q,q)}}function _e(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=b.multiply(r.frustum.projectionMatrix,r.viewMatrix,Ee),s=b.inverse(a,Ee),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Fe);u=n.cross(c,l,Be),n.normalize(u,u),n.normalize(c,c);for(var d=n.fromElements(0,0,0,ke),h=b.computeView(d,l,u,c,Ne),p=b.multiply(h,s,Ee),f=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Oe),m=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Le),_=0;_<8;++_){var g=o.clone(Te[_],Ae[_]);b.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=b.fromTranslation(v,Ee);h=b.multiply(y,h,h);var C=.5*(m.x-f.x),S=.5*(m.y-f.y),T=m.z-f.z,E=i.frustum;E.left=-C,E.right=C,E.bottom=-S,E.top=S,E.near=.01,E.far=T,b.clone(h,i.viewMatrix),b.inverse(h,i.inverseViewMatrix),b.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 T;i.fov=C.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=ze[r],n.upWC=Ve[r],n.rightWC=Ue[r],b.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),b.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=C.clamp(u/.1,0,1);if(e._darkness=C.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)===y.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)===y.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;b.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),b.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowState.nearPlane,e.maximumDistance),u=Math.min(t.shadowState.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=W.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=Ye;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function be(e,t,i,r,n,o){var a,l,u;if(p(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=M.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!p(a)||n!==i.shaderProgram.id||t){var c=i.shaderProgram,d=i.pass===O.GLOBE,h=i.pass!==O.TRANSLUCENT,f=e._isPointLight,m=e._usesDepthTexture,_=Q.getShadowCastShaderKeyword(f,d,m,h);if(a=r.shaderCache.getDerivedShaderProgram(c,_),!p(a)){var g=c.vertexShaderSource,v=c.fragmentShaderSource,y=Q.createShadowCastVertexShader(g,f,d),C=Q.createShadowCastFragmentShader(v,f,m,h);a=r.shaderCache.createDerivedShaderProgram(c,_,{vertexShaderSource:y,fragmentShaderSource:C,attributeLocations:c._attributeLocations})}l=e._primitiveRenderState,f?l=e._pointRenderState:d&&(l=e._terrainRenderState);i.renderState.cull.enabled||(l=s(l,!1),l.cull=s(l.cull,!1),l.cull.enabled=!1,l=k.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)},f(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,Te=new Array(8);Te[0]=new o(-1,-1,-1,1),Te[1]=new o(1,-1,-1,1),Te[2]=new o(1,1,-1,1),Te[3]=new o(-1,1,-1,1),Te[4]=new o(-1,-1,1,1),Te[5]=new o(1,-1,1,1),Te[6]=new o(1,1,1,1),Te[7]=new o(-1,1,1,1);for(var Ee=new b,Ae=new Array(8),we=0;we<8;++we)Ae[we]=new o;var xe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],Pe=new n;fe.prototype.clone=function(e){b.clone(e.viewMatrix,this.viewMatrix),b.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 b(.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 b.multiply(t,e,this.viewProjectionMatrix),b.multiply(De,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Me=new T,Re=new Array(4),Oe=new n,Le=new n,Ne=new b,Fe=new n,Be=new n,ke=new n,ze=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ve=[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=d.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;b.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&pe(this,e)},K.prototype.updatePass=function(e,t){le(this,e,t)};var Ye=new r;return K.createReceiveDerivedCommand=function(e,t,i,r,n){p(n)||(n={});var o=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,l=a.fragmentShaderSource,u=t.pass===O.GLOBE,c=!1;if(u&&(c=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){var d,h;p(n.receiveCommand)&&(d=n.receiveCommand.shaderProgram,h=n.receiveCommand.uniformMap),n.receiveCommand=M.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0;var f=n.receiveShaderCastShadows!==t.castShadows,m=n.receiveShaderProgramId!==t.shaderProgram.id;if(!p(d)||m||i||f){var _=Q.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,c);if(d=r.shaderCache.getDerivedShaderProgram(a,_),!p(d)){var g=Q.createShadowReceiveVertexShader(s,u,c),v=Q.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,c);d=r.shaderCache.createDerivedShaderProgram(a,_,{vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a._attributeLocations})}h=Ce(e[0],t.uniformMap,u)}n.receiveCommand.shaderProgram=d,n.receiveCommand.uniformMap=h,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows}return n},K.createCastDerivedCommand=function(e,t,i,r,n){if(p(n)||(n={}),t.castShadows){var o=n.castCommands;p(o)||(o=n.castCommands=[]);var a=n.castShaderProgramId,s=e.length;o.length=s;for(var l=0;l<s;++l)o[l]=be(e[l],i,t,r,a,o[l]);n.castShaderProgramId=t.shaderProgram.id}return n},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 m(this)},K}),define("Shaders/PostProcessStages/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\nuniform vec2 center;\nuniform float radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(colorTexture, v_textureCoordinates);\nvec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - center) / radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color1, t);\n}\n"}),define("Shaders/PostProcessStages/BrightPass",[],function(){"use strict";return"uniform sampler2D colorTexture;\nuniform float avgLuminance;\nuniform float threshold;\nuniform float 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(colorTexture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(avgLuminance) * luminance / avgLuminance;\nfloat brightLum = max(scaledLum - threshold, 0.0);\nfloat brightness = brightLum / (offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),define("Scene/SceneFramebuffer",["../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(){this._colorTexture=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._idFramebuffer=void 0,this._idClearColor=new e(0,0,0,0),this._useHdr=void 0,this._clearCommand=new n({color:new e(0,0,0,0),depth:1,owner:this})}function _(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._idFramebuffer=e._idFramebuffer&&e._idFramebuffer.destroy(),e._colorTexture=e._colorTexture&&e._colorTexture.destroy(),e._idTexture=e._idTexture&&e._idTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._depthStencilIdTexture=e._depthStencilIdTexture&&e._depthStencilIdTexture.destroy(),e._depthStencilIdRenderbuffer=e._depthStencilIdRenderbuffer&&e._depthStencilIdRenderbuffer.destroy(),e._framebuffer=void 0,e._idFramebuffer=void 0,e._colorTexture=void 0,e._idTexture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,e._depthStencilIdTexture=void 0,e._depthStencilIdRenderbuffer=void 0}return m.prototype.update=function(e,i,n){var u=i.width,m=i.height,g=this._colorTexture;if(!t(g)||g.width!==u||g.height!==m||n!==this._useHdr){_(this),this._useHdr=n;var v=n?e.halfFloatingPointTexture?a.HALF_FLOAT:a.FLOAT:a.UNSIGNED_BYTE;this._colorTexture=new d({context:e,width:u,height:m,pixelFormat:r.RGBA,pixelDatatype:v,sampler:new c({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.NEAREST,magnificationFilter:h.NEAREST})}),this._idTexture=new d({context:e,width:u,height:m,pixelFormat:r.RGBA,pixelDatatype:a.UNSIGNED_BYTE,sampler:new c({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.NEAREST,magnificationFilter:h.NEAREST})}),e.depthTexture?(this._depthStencilTexture=new d({context:e,width:u,height:m,pixelFormat:r.DEPTH_STENCIL,pixelDatatype:a.UNSIGNED_INT_24_8,sampler:new c({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.NEAREST,magnificationFilter:h.NEAREST})}),this._depthStencilIdTexture=new d({context:e,width:u,height:m,pixelFormat:r.DEPTH_STENCIL,pixelDatatype:a.UNSIGNED_INT_24_8,sampler:new c({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.NEAREST,magnificationFilter:h.NEAREST})})):(this._depthStencilRenderbuffer=new s({context:e,width:u,height:m,format:l.DEPTH_STENCIL}),this._depthStencilIdRenderbuffer=new s({context:e,width:u,height:m,format:l.DEPTH_STENCIL})),this._framebuffer=new o({context:e,colorTextures:[this._colorTexture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}),this._idFramebuffer=new o({context:e,colorTextures:[this._idTexture],depthStencilTexture:this._depthStencilIdTexture,depthStencilRenderbuffer:this._depthStencilIdRenderbuffer,destroyAttachments:!1})}},m.prototype.clear=function(t,i,r){var n=i.framebuffer;i.framebuffer=this._framebuffer,e.clone(r,this._clearCommand.color),this._clearCommand.execute(t,i),i.framebuffer=this._idFramebuffer,e.clone(this._idClearColor,this._clearCommand.color),this._clearCommand.execute(t,i),i.framebuffer=n},m.prototype.getFramebuffer=function(){return this._framebuffer},m.prototype.getIdFramebuffer=function(){return this._idFramebuffer},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return _(this),i(this)},m}),define("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/Transforms","../Shaders/PostProcessStages/AdditiveBlend","../Shaders/PostProcessStages/BrightPass","../Shaders/PostProcessStages/GaussianBlur1D","../Shaders/PostProcessStages/PassThrough","./PostProcessStage","./PostProcessStageComposite","./PostProcessStageSampleMode","./PostProcessStageTextureCache","./SceneFramebuffer"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(){this._sceneFramebuffer=new _;var e=new Array(6);e[0]=new h({fragmentShader:d,textureScale:.125,forcePowerOfTwo:!0,sampleMode:f.LINEAR});var i=e[1]=new h({fragmentShader:u,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.125,forcePowerOfTwo:!0}),r=this;this._delta=1,this._sigma=2,this._blurStep=new t,e[2]=new h({fragmentShader:c,uniforms:{step:function(){return r._blurStep.x=r._blurStep.y=1/i.outputTexture.width,r._blurStep},delta:function(){return r._delta},sigma:function(){return r._sigma},direction:0},textureScale:.125,forcePowerOfTwo:!0}),e[3]=new h({fragmentShader:c,uniforms:{step:function(){return r._blurStep.x=r._blurStep.y=1/i.outputTexture.width,r._blurStep},delta:function(){return r._delta},sigma:function(){return r._sigma},direction:1},textureScale:.125,forcePowerOfTwo:!0}),e[4]=new h({fragmentShader:d,sampleMode:f.LINEAR}),this._uCenter=new t,this._uRadius=void 0,e[5]=new h({fragmentShader:l,uniforms:{center:function(){return r._uCenter},radius:function(){return r._uRadius},colorTexture2:function(){return r._sceneFramebuffer.getFramebuffer().getColorTexture(0)}}}),this._stages=new p({stages:e});for(var n=new m(this),o=e.length,a=0;a<o;++a)e[a]._textureCache=n;this._textureCache=n,this.length=e.length}function v(i,r,n){var l=r.uniformState,u=l.sunPositionWC,c=l.view,d=l.viewProjection,h=l.projection,p=a.computeViewportTransformation(n,0,1,S),f=a.multiplyByPoint(c,u,y),m=s.pointToGLWindowCoordinates(d,p,u,C);f.x+=o.SOLAR_RADIUS;var _=s.pointToGLWindowCoordinates(h,p,f,f),g=30*t.magnitude(t.subtract(_,m,_))*2,v=b;v.x=g,v.y=g,i._uCenter=t.clone(m,i._uCenter),i._uRadius=.15*Math.max(v.x,v.y);var T=r.drawingBufferWidth,E=r.drawingBufferHeight,A=i._stages,w=A.get(0),x=w.outputTexture.width,P=w.outputTexture.height,D=new e;D.width=x,D.height=P,p=a.computeViewportTransformation(D,0,1,S),m=s.pointToGLWindowCoordinates(d,p,u,C),v.x*=x/T,v.y*=P/E;var I=w.scissorRectangle;I.x=Math.max(m.x-.5*v.x,0),I.y=Math.max(m.y-.5*v.y,0),I.width=Math.min(v.x,T),I.height=Math.min(v.y,E);for(var M=1;M<4;++M)e.clone(I,A.get(M).scissorRectangle)}g.prototype.get=function(e){return this._stages.get(e)},g.prototype.getStageByName=function(e){for(var t=this._stages.length,i=0;i<t;++i){var r=this._stages.get(i);if(r.name===e)return r}};var y=new i,C=new t,b=new t,S=new a;return g.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},g.prototype.update=function(e){var t=e.context,i=e.viewport,r=this._sceneFramebuffer;r.update(t,i);var n=r.getFramebuffer();return this._textureCache.update(t),this._stages.update(t,!1),v(this,t,i),n},g.prototype.execute=function(e){var t=this._sceneFramebuffer.getFramebuffer().getColorTexture(0),i=this._stages,r=i.length;i.get(0).execute(e,t);for(var n=1;n<r;++n)i.get(n).execute(e,i.get(n-1).outputTexture)},g.prototype.copy=function(e,t){if(!r(this._copyColorCommand)){var i=this;this._copyColorCommand=e.createViewportQuadCommand(d,{uniformMap:{colorTexture:function(){return i._stages.get(i._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),n(this)},g}),define("Scene/View",["../Core/BoundingRectangle","../Core/Cartesian3","../Core/CullingVolume","../Core/defined","../Core/getTimestamp","../Core/Interval","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Renderer/ClearCommand","../Renderer/Pass","../Renderer/PassState","./Camera","./FrustumCommands","./GlobeDepth","./OIT","./PickDepthFramebuffer","./PickFramebuffer","./SceneFramebuffer","./SceneMode","./ShadowMap"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b){"use strict";function S(t,i,r){var n=t.context,o=[],a=i.frustum.near,s=i.frustum.far,l=t.logarithmicDepthBuffer?t.logarithmicDepthFarToNearRatio:t.farToNearRatio;A(a,s,l,Math.ceil(Math.log(s/a)/Math.log(l)),t.logarithmicDepthBuffer,o,!1,void 0);var u;n.depthTexture&&(u=new m);var c;t._useOIT&&n.depthTexture&&(c=new _(n));var d=new h(n);d.viewport=e.clone(r),this.camera=i,this._cameraClone=p.clone(i),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=r,this.passState=d,this.pickFramebuffer=new v(n),this.pickDepthFramebuffer=new g,this.sceneFramebuffer=new y,this.globeDepth=u,this.oit=c,this.pickDepths=[],this.debugGlobeDepths=[],this.frustumCommandsList=o,this.debugFrustumStatistics=void 0,this.updateFrustums=!1}function T(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 E(e,i,r){var n=1/Math.max(1,T(e.position,i.position));return t.multiplyByScalar(e.position,n,x),t.multiplyByScalar(i.position,n,P),t.equalsEpsilon(x,P,r)&&t.equalsEpsilon(e.direction,i.direction,r)&&t.equalsEpsilon(e.up,i.up,r)&&t.equalsEpsilon(e.right,i.right,r)&&s.equalsEpsilon(e.transform,i.transform,r)&&e.frustum.equalsEpsilon(i.frustum,r)}function A(e,t,i,n,o,a,s,l){a.length=n;for(var u=0;u<n;++u){var c,d;s?(c=Math.min(t-l,e+u*l),d=Math.min(t,c+l)):(c=Math.max(e,Math.pow(i,u)*e),d=i*c,o||(d=Math.min(t,d)));var h=a[u];r(h)?(h.near=c,h.far=d):h=a[u]=new f(c,d)}}function w(e,t,i,n){e.debugShowFrustums&&(i.debugOverlappingFrustums=0);for(var o=t.frustumCommandsList,a=o.length,s=0;s<a;++s){var l=o[s],u=l.near,c=l.far;if(!(n.start>c)){if(n.stop<u)break;var d=i.pass,h=l.indices[d]++;if(l.commands[d][h]=i,e.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}}if(e.debugShowFrustums){var p=t.debugFrustumStatistics.commandsInFrustums;p[i.debugOverlappingFrustums]=r(p[i.debugOverlappingFrustums])?p[i.debugOverlappingFrustums]+1:1,++t.debugFrustumStatistics.totalCommands}e.updateDerivedCommands(i)}var x=new t,P=new t;S.prototype.checkForCameraUpdates=function(e){var t=this.camera,i=this._cameraClone;return E(t,i,a.EPSILON15)?(this._cameraStartFired&&n()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=n(),p.clone(t,i),!0)};var D=new i,I=new o
- ;return S.prototype.createPotentiallyVisibleSet=function(e){var t=e.frameState,i=t.camera,n=i.directionWC,o=i.positionWC,s=e._computeCommandList,l=e._overlayCommandList,u=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var h=this.frustumCommandsList,p=h.length,f=d.NUMBER_OF_PASSES,m=0;m<p;++m)for(var _=0;_<f;++_)h[m].indices[_]=0;s.length=0,l.length=0;for(var g=Number.MAX_VALUE,v=-Number.MAX_VALUE,y=!1,S=t.shadowState.shadowsEnabled,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,x=Number.MAX_VALUE,P=t.mode===C.SCENE3D?t.occluder:void 0,M=t.cullingVolume,R=D.planes,O=0;O<5;++O)R[O]=M.planes[O];M=D;for(var L=u.length,N=0;N<L;++N){var F=u[N],B=F.pass;if(B===d.COMPUTE)s.push(F);else if(B===d.OVERLAY)l.push(F);else{var k=F.boundingVolume;if(r(k)){if(!e.isVisible(F,M,P))continue;if(I=k.computePlaneDistances(o,n,I),g=Math.min(g,I.start),v=Math.max(v,I.stop),S&&F.receiveShadows&&I.start<b.MAXIMUM_DISTANCE&&!(B===d.GLOBE&&I.start<-100&&I.stop>100)){var z=I.stop-I.start;B!==d.GLOBE&&I.start<100&&(x=Math.min(x,z)),T=Math.min(T,I.start),E=Math.max(E,I.stop)}}else I.start=i.frustum.near,I.stop=i.frustum.far,y=!(F instanceof c);w(e,this,F,I)}}y?(g=i.frustum.near,v=i.frustum.far):(g=Math.min(Math.max(g,i.frustum.near),i.frustum.far),v=Math.max(Math.min(v,i.frustum.far),g),S&&(T=Math.min(Math.max(T,i.frustum.near),i.frustum.far),E=Math.max(Math.min(E,i.frustum.far),T))),S&&(t.shadowState.nearPlane=T,t.shadowState.farPlane=E,t.shadowState.closestObjectSize=x);var V,U=e.mode===C.SCENE2D,G=t.useLogDepth,H=G?e.logarithmicDepthFarToNearRatio:e.farToNearRatio;U?(v=Math.min(v,i.position.z+e.nearToFarDistance2D),g=Math.min(g,v),V=Math.ceil(Math.max(1,v-g)/e.nearToFarDistance2D)):V=Math.ceil(Math.log(v/g)/Math.log(H)),(this.updateFrustums||g!==Number.MAX_VALUE&&(V!==p||0!==h.length&&(g<h[0].near||v>h[p-1].far&&(G||!a.equalsEpsilon(v,h[p-1].far,a.EPSILON8)))))&&(this.updateFrustums=!1,A(g,v,H,V,G,h,U,e.nearToFarDistance2D),this.createPotentiallyVisibleSet(e));var W=t.frustumSplits;W.length=V+1;for(var q=0;q<V;++q)W[q]=h[q].near,q===V-1&&(W[q+1]=h[q].far)},S.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy();var e,t,i=this.pickDepths,r=this.debugGlobeDepths;for(t=i.length,e=0;e<t;++e)i[e].destroy();for(t=r.length,e=0;e<t;++e)r[e].destroy()},S}),define("Scene/Scene",["../Core/ApproximateTerrainHeights","../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/CullingVolume","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Intersect","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","../Core/PixelFormat","../Core/Ray","../Core/RequestScheduler","../Core/ShowGeometryInstanceAttribute","../Core/TaskProcessor","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../ThirdParty/when","./BrdfLutGenerator","./Camera","./Cesium3DTileFeature","./Cesium3DTilePass","./Cesium3DTilePassState","./Cesium3DTileset","./CreditDisplay","./DebugCameraPrimitive","./DepthPlane","./DerivedCommand","./DeviceOrientationCameraController","./Fog","./FrameState","./GlobeDepth","./InvertClassification","./JobScheduler","./MapMode2D","./OctahedralProjectedCubeMap","./PerformanceDisplay","./PerInstanceColorAppearance","./PickDepth","./PostProcessStageCollection","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./StencilConstants","./SunPostProcess","./TweenCollection","./View"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,be,Se,Te,Ee,Ae,we,xe,Pe,De){"use strict";function Ie(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1,this.deferred=K.defer(),this.promise=this.deferred.promise}function Me(e){e=h(e,h.EMPTY_OBJECT);var i=e.canvas,r=e.contextOptions,n=e.creditContainer,a=e.creditViewport,s=p(n),u=new V(i,r);s||(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)),p(a)||(a=i.parentNode),this._id=c(),this._jobScheduler=new he,this._frameState=new ue(u,new re(n," • ",a),this._jobScheduler),this._frameState.scene3DOnly=h(e.scene3DOnly,!1),this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=i,this._context=u,this._computeEngine=new z(u),this._globe=void 0,this._primitives=new Ce,this._groundPrimitives=new Ce,this._mostDetailedRayPicks=[],this._logDepthBuffer=u.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new Pe,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=h(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new oe,this._clearColorCommand=new k({color:new l,stencil:0,owner:this}),this._depthClearCommand=new k({depth:1,owner:this}),this._stencilClearCommand=new k({stencil:0}),this._classificationStencilClearCommand=new k({stencil:0,renderState:Y.fromCache({stencilMask:we.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._pickRenderStateCache={},this._transitioner=new Te(this),this._preUpdate=new v,this._postUpdate=new v,this._renderError=new v,this._preRender=new v,this._postRender=new v,this._pickPositionCache={},this._pickPositionCacheDirty=!1,this._minimumDisableDepthTestDistance=0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new v,this.morphComplete=new v,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=l.clone(l.BLACK),this._mode=be.SCENE3D,this._mapProjection=p(e.mapProjection)?e.mapProjection:new y,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new le,this._sunCamera=new J(this),this.shadowMap=new Ae({context:u,lightCamera:this._sunCamera,enabled:h(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=l.clone(l.WHITE),this._actualInvertClassificationColor=l.clone(this._invertClassificationColor),this._invertClassification=new de,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new ve,this._brdfLutGenerator=new Z,this._terrainExaggeration=h(e.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new Ee(this),this._mapMode2D=h(e.mapMode2D,pe.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,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=h(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=h(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=L.requestCompletedEvent.addEventListener(Ut(this)),this._removeTaskProcessorListenerCallback=F.taskCompletedEvent.addEventListener(Ut(this)),this._removeGlobeCallbacks=[];var d=new t(0,0,u.drawingBufferWidth,u.drawingBufferHeight),f=new J(this);this._logDepthBuffer&&(f.frustum.near=.1,f.frustum.far=1e10);var m=new t(0,0,1,1),_=new J(this);_.frustum=new P({width:.1,aspectRatio:1,near:.1}),this._pickOffscreenView=new De(this,_,m),this.preloadFlightCamera=new J(this),this.preloadFlightCullingVolume=void 0,this.pickOffscreenDefaultWidth=.1,this._defaultView=new De(this,f,d),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!0,this.gamma=2.2,this._sunColor=new o(1.8,1.85,2),this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,Fe(this,0,T.now()),Be(this),this.initializeFrame()}function Re(e,t){for(var i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;var r=[];p(t)&&(r.push(t.imageryLayersUpdatedEvent.addEventListener(Ut(e))),r.push(t.terrainProviderChanged.addEventListener(Ut(e)))),e._removeGlobeCallbacks=r}function Oe(e,t,i){var r=e._frameState,n=e._context,o=e._view.oit,a=r.shadowState.lightShadowMaps,s=r.shadowState.lightShadowsEnabled,l=t.derivedCommands;p(t.pickId)&&(l.picking=ae.createPickDerivedCommand(e,t,n,l.picking)),t.pickOnly||(l.depth=ae.createDepthOnlyDerivedCommand(e,t,n,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=ae.createHdrCommand(t,n,l.hdr),t=l.hdr.command,l=t.derivedCommands),s&&t.receiveShadows&&(l.shadows=Ae.createReceiveDerivedCommand(a,t,i,n,l.shadows)),t.pass===W.TRANSLUCENT&&p(o)&&o.isSupported()&&(s&&t.receiveShadows?(l.oit=p(l.oit)?l.oit:{},l.oit.shadows=o.createDerivedCommands(l.shadows.receiveCommand,n,l.oit.shadows)):l.oit=o.createDerivedCommands(t,n,l.oit))}function Le(e){var t=e.globe;if(e._mode===be.SCENE3D&&p(t)&&t.show){var i=t.ellipsoid;return Kt.radius=i.minimumRadius,Gt=x.fromBoundingSphere(Kt,e.camera.positionWC,Gt)}}function Ne(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1}function Fe(e,t,i){var r=e._frameState;r.frameNumber=t,r.time=T.clone(i,r.time)}function Be(e){var t=e.camera,i=e._frameState;i.commandList.length=0,i.shadowMaps.length=0,i.brdfLutGenerator=e._brdfLutGenerator,i.environmentMap=e.skyBox&&e.skyBox._cubeMap,i.mode=e._mode,i.morphTime=e.morphTime,i.mapProjection=e.mapProjection,i.camera=t,i.cullingVolume=t.frustum.computeCullingVolume(t.positionWC,t.directionWC,t.upWC),i.occluder=Le(e),i.terrainExaggeration=e._terrainExaggeration,i.minimumDisableDepthTestDistance=e._minimumDisableDepthTestDistance,i.invertClassification=e.invertClassification,i.useLogDepth=e._logDepthBuffer&&!(e.camera.frustum instanceof P||e.camera.frustum instanceof D),i.sunColor=e._sunColor,p(e._specularEnvironmentMapAtlas)&&e._specularEnvironmentMapAtlas.ready?(i.specularEnvironmentMaps=e._specularEnvironmentMapAtlas.texture,i.specularEnvironmentMapsMaximumLOD=e._specularEnvironmentMapAtlas.maximumMipmapLevel):(i.specularEnvironmentMaps=void 0,i.specularEnvironmentMapsMaximumLOD=void 0),i.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,e._actualInvertClassificationColor=l.clone(e.invertClassificationColor,e._actualInvertClassificationColor),de.isTranslucencySupported(e._context)||(e._actualInvertClassificationColor.alpha=1),i.invertClassificationColor=e._actualInvertClassificationColor,p(e.globe)?i.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:i.maximumScreenSpaceError=2,Ne(i.passes),i.tilesetPassState=void 0}function ke(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function ze(e,t,i){var r=t.context,n=h(i,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=X.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)-1===a.indexOf(t[1])&&a.push(t[1]);return e});var s,u=a.length,c="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){p(e._debugColor)||(e._debugColor=l.fromRandom());var d=e._debugColor;if(u>0)for(s=0;s<u;++s)c+=" gl_FragData["+a[s]+"].rgb *= vec3("+d.red+", "+d.green+", "+d.blue+"); \n";else c+=" gl_FragColor.rgb *= vec3("+d.red+", "+d.green+", "+d.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(s=0;s<u;++s)c+=" gl_FragData["+a[s]+"].rgb *= vec3("+f+", "+m+", "+_+"); \n";else c+=" gl_FragColor.rgb *= vec3("+f+", "+m+", "+_+"); \n"}c+="}",o.sources.push(c);var g=ke(n);return j.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:g})}function Ve(e,t,i){var r=G.shallowClone(e);r.shaderProgram=ze(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function Ue(e,t,i,n){var a=t._frameState,s=a.context,l=e.boundingVolume;p(t._debugVolume)&&t._debugVolume.destroy();var c,d=o.clone(l.center);if(a.mode!==be.SCENE3D){d=A.multiplyByPoint(Jt,d,d);var h=a.mapProjection,f=h.unproject(d);d=h.ellipsoid.cartographicToCartesian(f)}if(p(l.radius)){var m=l.radius;c=b.toWireframe(g.createGeometry(new g({radii:new o(m,m,m),vertexFormat:_e.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ye({geometryInstances:new C({geometry:c,modelMatrix:A.fromTranslation(d),attributes:{color:new u(1,0,0,1)}}),appearance:new _e({flat:!0,translucent:!1}),asynchronous:!1})}else{var _=l.halfAxes;c=b.toWireframe(r.createGeometry(r.fromDimensions({dimensions:new o(2,2,2),vertexFormat:_e.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ye({geometryInstances:new C({geometry:c,modelMatrix:A.fromRotationTranslation(_,d,new A),attributes:{color:new u(1,0,0,1)}}),appearance:new _e({flat:!0,translucent:!1}),asynchronous:!1})}var v=a.commandList,y=a.commandList=[];if(t._debugVolume.update(a),e=y[0],a.useLogDepth){e=ae.createLogDepthCommand(e,s).command}var S;p(n)&&(S=i.framebuffer,i.framebuffer=n),e.execute(s,i),p(S)&&(i.framebuffer=S),a.commandList=v}function Ge(e,t,i,r,n){var o=t._frameState;if(!p(t.debugCommandFilter)||t.debugCommandFilter(e)){if(e instanceof k)return void e.execute(i,r);e.debugShowBoundingVolume&&p(e.boundingVolume)&&Ue(e,t,r,n),o.useLogDepth&&p(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);var a=o.passes;if(!a.pick&&t._hdr&&p(e.derivedCommands)&&p(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth&&p(e.derivedCommands.picking))return e=e.derivedCommands.picking.pickCommand,void e.execute(i,r);if(p(e.derivedCommands.depth))return e=e.derivedCommands.depth.depthOnlyCommand,void e.execute(i,r)}if(t.debugShowCommands||t.debugShowFrustums)return void Ve(e,t,r);o.shadowState.lightShadowsEnabled&&e.receiveShadows&&p(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,r):e.execute(i,r)}}function He(e,t,i,r){var n=t._frameState,o=e.derivedCommands;p(o)&&(n.useLogDepth&&p(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,p(o.picking)?(e=o.picking.pickCommand,e.execute(i,r)):p(o.depth)&&(e=o.depth.depthOnlyCommand,e.execute(i,r)))}function We(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function qe(e,t,i){return e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+E.EPSILON12}function Ye(e,t,i,r,n){var o=e.context;w(r,We,e.camera.positionWC),p(n)&&t(n.unclassifiedCommand,e,o,i);for(var a=r.length,s=0;s<a;++s)t(r[s],e,o,i)}function je(e,t,i,r,n){var o=e.context;w(r,qe,e.camera.positionWC),p(n)&&t(n.unclassifiedCommand,e,o,i);for(var a=r.length,s=0;s<a;++s)t(r[s],e,o,i)}function Xe(e,t){var i=e._view.debugGlobeDepths,r=i[t];return!p(r)&&e.context.depthTexture&&(r=new ce,i[t]=r),r}function Qe(e,t){var i=e._view.pickDepths,r=i[t];return p(r)||(r=new ge,i[t]=r),r}function Ke(e,t){var i=e.camera,r=e.context,n=r.uniformState;n.updateCamera(i);var o;o=p(i.frustum.fov)?i.frustum.clone($t):p(i.frustum.infiniteProjectionMatrix)?i.frustum.clone(ei):p(i.frustum.width)?i.frustum.clone(ti):i.frustum.clone(ii),o.near=i.frustum.near,o.far=i.frustum.far,n.updateFrustum(o),n.updatePass(W.ENVIRONMENT);var a=e._frameState.passes,s=a.pick,l=e._environmentState,u=e._view,c=l.renderTranslucentDepthForPick,d=l.useWebVR;if(!s){var h=l.skyBoxCommand;if(p(h)&&Ge(h,e,r,t),l.isSkyAtmosphereVisible&&Ge(l.skyAtmosphereCommand,e,r,t),l.isSunVisible&&(l.sunDrawCommand.execute(r,t),e.sunBloom&&!d)){var f;f=l.useGlobeDepthFramebuffer?u.globeDepth.framebuffer:l.usePostProcess?u.sceneFramebuffer.getFramebuffer():l.originalFramebuffer,e._sunPostProcess.execute(r),e._sunPostProcess.copy(r,f),t.framebuffer=f}l.isMoonVisible&&l.moonCommand.execute(r,t)}var m;l.useOIT?(p(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r,n){u.oit.executeCommands(e,t,i,r,n)}),m=e._executeOITFunction):m=a.render?Ye:je;for(var _,g=l.clearGlobeDepth,v=l.useDepthPlane,y=e._depthClearCommand,C=e._stencilClearCommand,b=e._classificationStencilClearCommand,S=e._depthPlane,T=l.usePostProcessSelected,E=i.position.z,A=u.frustumCommandsList,w=A.length,x=0;x<w;++x){var P=w-x-1,D=A[P];e.mode===be.SCENE2D?(i.position.z=E-D.near+1,o.far=Math.max(1,D.far-D.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==P?D.near*e.opaqueFrustumNearOffset:D.near,o.far=D.far,n.updateFrustum(o));var I,M=e.debugShowGlobeDepth?Xe(e,P):u.globeDepth;e.debugShowGlobeDepth&&p(M)&&l.useGlobeDepthFramebuffer&&(M.update(r,t,u.viewport),M.clear(r,t,e._clearColorCommand.color),I=t.framebuffer,t.framebuffer=M.framebuffer),y.execute(r,t),r.stencilBuffer&&C.execute(r,t),n.updatePass(W.GLOBE);var R=D.commands[W.GLOBE],O=D.indices[W.GLOBE];for(_=0;_<O;++_)Ge(R[_],e,r,t);for(p(M)&&l.useGlobeDepthFramebuffer&&M.executeCopyDepth(r,t),e.debugShowGlobeDepth&&p(M)&&l.useGlobeDepthFramebuffer&&(t.framebuffer=I),n.updatePass(W.TERRAIN_CLASSIFICATION),R=D.commands[W.TERRAIN_CLASSIFICATION],O=D.indices[W.TERRAIN_CLASSIFICATION],_=0;_<O;++_)Ge(R[_],e,r,t);if(g&&(y.execute(r,t),v&&S.execute(r,t)),!l.useInvertClassification||s){for(n.updatePass(W.CESIUM_3D_TILE),R=D.commands[W.CESIUM_3D_TILE],O=D.indices[W.CESIUM_3D_TILE],_=0;_<O;++_)Ge(R[_],e,r,t);if(O>0)for(p(M)&&l.useGlobeDepthFramebuffer&&M.executeUpdateDepth(r,t,g),n.updatePass(W.CESIUM_3D_TILE_CLASSIFICATION),R=D.commands[W.CESIUM_3D_TILE_CLASSIFICATION],O=D.indices[W.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<O;++_)Ge(R[_],e,r,t)}else{e._invertClassification.clear(r,t);var L=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,n.updatePass(W.CESIUM_3D_TILE),R=D.commands[W.CESIUM_3D_TILE],O=D.indices[W.CESIUM_3D_TILE],_=0;_<O;++_)Ge(R[_],e,r,t);for(p(M)&&l.useGlobeDepthFramebuffer&&M.executeUpdateDepth(r,t,g),n.updatePass(W.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),R=D.commands[W.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],O=D.indices[W.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],_=0;_<O;++_)Ge(R[_],e,r,t);for(t.framebuffer=L,e._invertClassification.executeClassified(r,t),1===e.frameState.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(r,t),O>0&&r.stencilBuffer&&b.execute(r,t),n.updatePass(W.CESIUM_3D_TILE_CLASSIFICATION),R=D.commands[W.CESIUM_3D_TILE_CLASSIFICATION],O=D.indices[W.CESIUM_3D_TILE_CLASSIFICATION],_=0;_<O;++_)Ge(R[_],e,r,t)}for(O>0&&r.stencilBuffer&&C.execute(r,t),n.updatePass(W.OPAQUE),R=D.commands[W.OPAQUE],O=D.indices[W.OPAQUE],_=0;_<O;++_)Ge(R[_],e,r,t);0!==P&&e.mode!==be.SCENE2D&&(o.near=D.near,n.updateFrustum(o));var N;if(!s&&l.useInvertClassification&&e.frameState.invertClassificationColor.alpha<1&&(N=e._invertClassification),n.updatePass(W.TRANSLUCENT),R=D.commands[W.TRANSLUCENT],R.length=D.indices[W.TRANSLUCENT],m(e,Ge,t,R,N),r.depthTexture&&e.useDepthPicking&&(l.useGlobeDepthFramebuffer||c)){var F=c?t.framebuffer.depthStencilTexture:M.framebuffer.depthStencilTexture,B=Qe(e,P);B.update(r,F),B.executeCopyDepth(r,t)}if(!s&&T){var k=t.framebuffer;for(t.framebuffer=u.sceneFramebuffer.getIdFramebuffer(),o.near=0!==P?D.near*e.opaqueFrustumNearOffset:D.near,o.far=D.far,n.updateFrustum(o),n.updatePass(W.GLOBE),R=D.commands[W.GLOBE],O=D.indices[W.GLOBE],_=0;_<O;++_)He(R[_],e,r,t);for(g&&(y.framebuffer=t.framebuffer,y.execute(r,t),y.framebuffer=void 0),g&&v&&S.execute(r,t),n.updatePass(W.CESIUM_3D_TILE),R=D.commands[W.CESIUM_3D_TILE],O=D.indices[W.CESIUM_3D_TILE],_=0;_<O;++_)He(R[_],e,r,t);for(n.updatePass(W.OPAQUE),R=D.commands[W.OPAQUE],O=D.indices[W.OPAQUE],_=0;_<O;++_)He(R[_],e,r,t);for(n.updatePass(W.TRANSLUCENT),R=D.commands[W.TRANSLUCENT],O=D.indices[W.TRANSLUCENT],_=0;_<O;++_)He(R[_],e,r,t);t.framebuffer=k}}}function Ze(e){e.context.uniformState.updatePass(W.COMPUTE);var t=e._environmentState.sunComputeCommand;p(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;n<r;++n)i[n].execute(e._computeEngine)}function Je(e,t){e.context.uniformState.updatePass(W.OVERLAY);for(var i=e.context,r=e._overlayCommandList,n=r.length,o=0;o<n;++o)r[o].execute(i,t)}function $e(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(e.updateDerivedCommands(u),u.castShadows&&(u.pass===W.GLOBE||u.pass===W.CESIUM_3D_TILE||u.pass===W.OPAQUE||u.pass===W.TRANSLUCENT)&&e.isVisible(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(e.isVisible(u,p))o[h].commandList.push(u),d=!0;else if(d)break}}}function et(e){var t=e.frameState,i=t.shadowState.shadowMaps,r=i.length;if(t.shadowState.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($e(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),Ge(m.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}function tt(e,t,i){var r=e._frameState,n=r.mode;e._environmentState.useWebVR?it(e,t,i):n!==be.SCENE2D||e._mapMode2D===pe.ROTATE?nt(!0,e,t,i):(ut(e,t,i),rt(e,t))}function it(e,t,i){var r=e._view,n=r.camera,a=e._environmentState,s=a.renderTranslucentDepthForPick;ut(e,t,i),s||lt(e),r.createPotentiallyVisibleSet(e),s||(Ze(e),et(e));var l=t.viewport;l.x=0,l.y=0,l.width=.5*l.width;var u=J.clone(n,e._cameraVR);u.frustum=n.frustum;var c=n.frustum.near,d=c*h(e.focalLength,5),p=h(e.eyeSeparation,d/30),f=o.multiplyByScalar(u.right,.5*p,ri);n.frustum.aspectRatio=l.width/l.height;var m=.5*p*c/d;o.add(u.position,f,n.position),n.frustum.xOffset=m,Ke(e,t),l.x=l.width,o.subtract(u.position,f,n.position),n.frustum.xOffset=-m,Ke(e,t),J.clone(u,n)}function rt(e,i){var r=e.context,n=e.frameState,a=e.camera,s=i.viewport,l=t.clone(s,di);i.viewport=l;var u=ni,c=oi;e.mapProjection.project(u,c);var d=o.clone(a.position,ai),h=A.clone(a.transform,li),p=a.frustum.clone();a._setTransform(A.IDENTITY);var f=A.computeViewportTransformation(l,0,1,si),m=a.frustum.projectionMatrix,_=a.positionWC.y,g=o.fromElements(E.sign(_)*c.x-_,0,-a.positionWC.x,ui),v=B.pointToGLWindowCoordinates(m,f,g,ci);v.x=Math.floor(v.x);var y=l.x,C=l.width;if(0===_||v.x<=y||v.x>=y+C)nt(!0,e,i);else if(Math.abs(y+.5*C-v.x)<1)l.width=v.x-l.x,a.position.x*=E.sign(a.position.x),a.frustum.right=0,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(n),nt(!0,e,i),l.x=v.x,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=0,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(n),nt(!1,e,i);else if(v.x>y+.5*C){l.width=v.x-y;var b=a.frustum.right;a.frustum.right=c.x-_,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(n),nt(!0,e,i),l.x=v.x,l.width=y+C-v.x,a.position.x=-a.position.x,a.frustum.left=-a.frustum.right,a.frustum.right=b-2*a.frustum.right,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(n),nt(!1,e,i)}else{l.x=v.x,l.width=y+C-v.x;var S=a.frustum.left;a.frustum.left=-c.x-_,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(n),nt(!0,e,i),l.x=y,l.width=v.x-y,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=S-2*a.frustum.left,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(n),nt(!1,e,i)}a._setTransform(h),o.clone(d,a.position),a.frustum=p.clone(),i.viewport=s}function nt(e,t,i,r){var n=t._environmentState,o=t._view,a=n.renderTranslucentDepthForPick;e||a||(t.frameState.commandList.length=0),a||lt(t),o.createPotentiallyVisibleSet(t),e&&(p(r)&&ut(t,i,r),a||(Ze(t),et(t))),Ke(t,i)}function ot(e){var t=e._frameState,i=e._view,r=e._environmentState,n=t.passes.render,o=t.passes.offscreen,a=e.skyAtmosphere,s=e.globe;if(!n||e._mode!==be.SCENE2D&&i.camera.frustum instanceof P)r.skyAtmosphereCommand=void 0,r.skyBoxCommand=void 0,r.sunDrawCommand=void 0,r.sunComputeCommand=void 0,r.moonCommand=void 0;else{p(a)&&p(s)&&(a.setDynamicAtmosphereColor(s.enableLighting),r.isReadyForAtmosphere=r.isReadyForAtmosphere||s._surface._tilesToRender.length>0),r.skyAtmosphereCommand=p(a)?a.update(t):void 0,r.skyBoxCommand=p(e.skyBox)?e.skyBox.update(t,e._hdr):void 0;var l=p(e.sun)?e.sun.update(t,i.passState,e._hdr):void 0;r.sunDrawCommand=p(l)?l.drawCommand:void 0,r.sunComputeCommand=p(l)?l.computeCommand:void 0,r.moonCommand=p(e.moon)?e.moon.update(t):void 0}var u=r.clearGlobeDepth=p(s)&&(!s.depthTestAgainstTerrain||e.mode===be.SCENE2D);(r.useDepthPlane=u&&e.mode===be.SCENE3D)&&e._depthPlane.update(t),r.renderTranslucentDepthForPick=!1,r.useWebVR=e._useWebVR&&e.mode!==be.SCENE2D&&!o;for(var c=t.mode===be.SCENE3D?t.occluder:void 0,d=t.cullingVolume,h=Zt.planes,f=0;f<5;++f)h[f]=d.planes[f];d=Zt,r.isSkyAtmosphereVisible=p(r.skyAtmosphereCommand)&&r.isReadyForAtmosphere,r.isSunVisible=e.isVisible(r.sunDrawCommand,d,c),r.isMoonVisible=e.isVisible(r.moonCommand,d,c);var m=e.specularEnvironmentMaps,_=e._specularEnvironmentMapAtlas;!p(m)||p(_)&&_.url===m?!p(m)&&p(_)&&(_.destroy(),e._specularEnvironmentMapAtlas=void 0):(_=_&&_.destroy(),e._specularEnvironmentMapAtlas=new fe(m)),p(e._specularEnvironmentMapAtlas)&&e._specularEnvironmentMapAtlas.update(t)}function at(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new ne({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),p(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function st(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===be.SCENE3D;if(n!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=n),t.shadowState.lightShadowsEnabled=!1,n){for(var o=0;o<r;++o)if(i[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function lt(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),at(e),st(e),e._globe&&e._globe.render(t)}function ut(e,t,i){var r=e._context,n=e._frameState,o=e._environmentState,a=e._view,s=e._frameState.passes,u=s.pick,c=o.useWebVR;o.originalFramebuffer=t.framebuffer,p(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!c?e._sunPostProcess=new xe:p(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!p(e.sun)&&p(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var d=e._clearColorCommand;l.clone(i,d.color),d.execute(r,t);var h=o.useGlobeDepthFramebuffer=p(a.globeDepth);h&&(a.globeDepth.update(r,t,a.viewport,e._hdr),a.globeDepth.clear(r,t,i));var f=a.oit,m=o.useOIT=!u&&p(f)&&f.isSupported();m&&(f.update(r,t,a.globeDepth.framebuffer,e._hdr),f.clear(r,t,i),o.useOIT=f.isSupported());var _=e.postProcessStages,g=o.usePostProcess=!u&&(e._hdr||_.length>0||_.ambientOcclusion.enabled||_.fxaa.enabled||_.bloom.enabled);if(o.usePostProcessSelected=!1,g&&(a.sceneFramebuffer.update(r,a.viewport,e._hdr),a.sceneFramebuffer.clear(r,t,i),_.update(r,n.useLogDepth,e._hdr),_.clear(r),g=o.usePostProcess=_.ready,o.usePostProcessSelected=g&&_.hasSelected),o.isSunVisible&&e.sunBloom&&!c?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(r,t,i)):h?t.framebuffer=a.globeDepth.framebuffer:g&&(t.framebuffer=a.sceneFramebuffer.getFramebuffer()),p(t.framebuffer)&&d.execute(r,t),o.useInvertClassification=!u&&p(t.framebuffer)&&e.invertClassification){var v;if(1===e.frameState.invertClassificationColor.alpha&&o.useGlobeDepthFramebuffer&&(v=a.globeDepth.framebuffer),p(v)||r.depthTexture){if(e._invertClassification.previousFramebuffer=v,e._invertClassification.update(r),e._invertClassification.clear(r,t),e.frameState.invertClassificationColor.alpha<1&&m){var y=e._invertClassification.unclassifiedCommand,C=y.derivedCommands;C.oit=f.createDerivedCommands(y,r,C.oit)}}else o.useInvertClassification=!1}}function ct(e,t){var i=e._context,r=e._frameState,n=e._environmentState,o=e._view,a=n.useOIT,s=n.useGlobeDepthFramebuffer,l=n.usePostProcess,u=n.originalFramebuffer,c=s?o.globeDepth.framebuffer:void 0,d=o.sceneFramebuffer.getFramebuffer(),p=o.sceneFramebuffer.getIdFramebuffer();if(a&&(t.framebuffer=l?d:u,o.oit.execute(i,t)),l){var f=d;s&&!a&&(f=c);var m=e.postProcessStages,_=f.getColorTexture(0),g=p.getColorTexture(0),v=h(c,d).depthStencilTexture;m.execute(i,_,v,g),m.copy(i,u)}a||l||!s||(t.framebuffer=u,o.globeDepth.executeCopyColor(i,t));var y=r.useLogDepth;if(e.debugShowGlobeDepth&&s){Xe(e,e.debugShowDepthFrustum-1).executeDebugGlobeDepth(i,t,y)}if(e.debugShowPickDepth&&s){Qe(e,e.debugShowDepthFrustum-1).executeDebugPickDepth(i,t,y)}}function dt(e){for(var t=e._frameState.afterRender,i=0,r=t.length;i<r;++i)t[i](),e.requestRender();t.length=0}function ht(e,t){if(e.debugShowFramesPerSecond){if(!p(e._performanceDisplay)){var i=document.createElement("div");i.className="cesium-performanceDisplay-defaultContainer";e._canvas.parentNode.appendChild(i);var r=new me({container:i});e._performanceDisplay=r,e._performanceContainer=i}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else p(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function pt(e){e._jobScheduler.resetBudgets();var t=e._frameState;e.primitives.prePassesUpdate(t),p(e.globe)&&e.globe.update(t),e._pickPositionCacheDirty=!0,t.creditDisplay.update()}function ft(e){var t=e._frameState;e.primitives.postPassesUpdate(t),L.update()}function mt(e){var i=e._frameState,r=e.context,n=r.uniformState,a=e._defaultView;e._view=a,Be(e),i.passes.render=!0,
- i.passes.postProcess=e.postProcessStages.hasSelected,i.tilesetPassState=qt;var s=h(e.backgroundColor,l.BLACK);e._hdr&&(s=l.clone(s,hi),s.red=Math.pow(s.red,e.gamma),s.green=Math.pow(s.green,e.gamma),s.blue=Math.pow(s.blue,e.gamma)),i.backgroundColor=s,i.creditDisplay.beginFrame(),e.fog.update(i),n.update(i);var u=e.shadowMap;p(u)&&u.enabled&&(o.negate(n.sunDirectionWC,e._sunCamera.direction),i.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var c=a.viewport;c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;var d=a.passState;d.framebuffer=void 0,d.blendingEnabled=void 0,d.scissorTest=void 0,d.viewport=t.clone(c,d.viewport),p(e.globe)&&e.globe.beginFrame(i),ot(e),tt(e,d,s),ct(e,d),d.framebuffer=void 0,Je(e,d),p(e.globe)&&(e.globe.endFrame(i),e.globe.tilesLoaded||(e._renderRequested=!0)),i.creditDisplay.endFrame(),r.endFrame()}function _t(e,t){try{t(e)}catch(t){if(e._renderError.raiseEvent(e,t),e.rethrowRenderErrors)throw t}}function gt(e,t,i,r,n){var a=e.camera,s=a.frustum;p(s._offCenterFrustum)&&(s=s._offCenterFrustum);var l=2*(t.x-n.x)/n.width-1;l*=.5*(s.right-s.left);var u=2*(n.height-t.y-n.y)/n.height-1;u*=.5*(s.top-s.bottom);var c=A.clone(a.transform,gi);a._setTransform(A.IDENTITY);var d=o.clone(a.position,fi);o.multiplyByScalar(a.right,l,mi),o.add(mi,d,d),o.multiplyByScalar(a.up,u,mi),o.add(mi,d,d),a._setTransform(c),e.mode===be.SCENE2D&&o.fromElements(d.z,d.x,d.y,d);var h=s.getPixelDimensions(n.width,n.height,1,_i),f=pi;return f.right=.5*h.x,f.left=-f.right,f.top=.5*h.y,f.bottom=-f.top,f.near=s.near,f.far=s.far,f.computeCullingVolume(d,a.directionWC,a.upWC)}function vt(e,t,i,r,n){var o=e.camera,a=o.frustum,s=a.near,l=Math.tan(.5*a.fovy),u=a.aspectRatio*l,c=2*(t.x-n.x)/n.width-1,d=2*(n.height-t.y-n.y)/n.height-1,h=c*s*u,p=d*s*l,f=a.getPixelDimensions(n.width,n.height,1,_i),m=f.x*i*.5,_=f.y*r*.5,g=vi;return g.top=p+_,g.bottom=p-_,g.right=h+m,g.left=h-m,g.near=s,g.far=a.far,g.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function yt(e,t,i,r,n){var o=e.camera.frustum;return o instanceof P||o instanceof D?gt(e,t,i,r,n):vt(e,t,i,r,n)}function Ct(e,i){var r=e._context,n=e._frameState,o=e._environmentState,a=e._defaultView;e._view=a;var s=a.viewport;s.x=0,s.y=0,s.width=r.drawingBufferWidth,s.height=r.drawingBufferHeight;var l=a.passState;l.viewport=t.clone(s,l.viewport),Ne(n.passes),n.passes.pick=!0,n.passes.depth=!0,n.cullingVolume=yt(e,i,1,1,s),n.tilesetPassState=Yt,ot(e),o.renderTranslucentDepthForPick=!0,l=a.pickDepthFramebuffer.update(r,i,s),tt(e,l,Si),ct(e,l),r.endFrame()}function bt(e,t){var i,r,n=[],o=[],a=[],s=[];p(e)||(e=Number.MAX_VALUE);for(var l=t();p(l);){var u=l.object,c=l.position,d=l.exclude;if(p(c)&&!p(u)){n.push(l);break}if(!p(u)||!p(u.primitive))break;if(!d&&(n.push(l),0>=--e))break;var h=u.primitive,f=!1;"function"==typeof h.getGeometryInstanceAttributes&&p(u.id)&&(r=h.getGeometryInstanceAttributes(u.id),p(r)&&p(r.show)&&(f=!0,r.show=N.toValue(!1,r.show),a.push(r))),u instanceof $&&(f=!0,u.show=!1,s.push(u)),f||(h.show=!1,o.push(h)),l=t()}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=N.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}function St(e){var t=e._frameState;jt.camera=t.camera,jt.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,jt)}function Tt(e){var t=e._frameState;t.camera.hasCurrentFlight()&&(Xt.camera=e.preloadFlightCamera,Xt.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Xt))}function Et(e){e.primitives.updateForPass(e._frameState,Qt)}function At(e,t,i,r){var n=t.direction,a=o.mostOrthogonalAxis(n,Ai),s=o.cross(n,a,Ai),l=o.cross(n,s,wi);return r.position=t.origin,r.direction=n,r.up=l,r.right=s,r.frustum.width=h(i,e.pickOffscreenDefaultWidth),r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function wt(e,t){var i=e._frameState,r=t.ray,n=t.width,o=t.tilesets,a=e._pickOffscreenView.camera,s=At(e,r,n,a),l=Ht;l.camera=a,l.cullingVolume=s;for(var u=!0,c=o.length,d=0;d<c;++d){var h=o[d];h.show&&e.primitives.contains(h)&&(h.updateForPass(i,l),u=u&&l.ready)}return u&&t.deferred.resolve(),u}function xt(e){for(var t=e._mostDetailedRayPicks,i=0;i<t.length;++i)wt(e,t[i])&&t.splice(i--,1)}function Pt(e,t,i){for(var r=e.length,n=0;n<r;++n){var o=e.get(n);o.show&&(o instanceof ie?p(t)&&-1!==t.indexOf(o)||i.push(o):o instanceof Ce&&Pt(o,t,i))}}function Dt(e,t,i,r,n){var o=[];if(Pt(e.primitives,i,o),0===o.length)return K.resolve(n());var a=new Ie(t,r,o);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return n()})}function It(e,t){return!(!p(e)||!p(t)||0===t.length)&&(t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1)}function Mt(e,i,r,n,o,a){var s=e._context,l=s.uniformState,u=e._frameState,c=e._pickOffscreenView;e._view=c,At(e,i,n,c.camera),bi=t.clone(c.viewport,bi);var d=c.pickFramebuffer.begin(bi,c.viewport);e._jobScheduler.disableThisFrame(),Be(e),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,u.tilesetPassState=a?Wt:Yt,l.update(u),ot(e,c),tt(e,d,Si),ct(e,d);var h,f=c.pickFramebuffer.end(s);if(e._context.depthTexture)for(var m=c.frustumCommandsList.length,_=0;_<m;++_){var g=Qe(e,_),v=g.getDepth(s,0,0);if(v>0&&v<1){var y=c.frustumCommandsList[_],C=y.near*(0!==_?e.opaqueFrustumNearOffset:1),b=y.far,S=C+v*(b-C);h=O.getPoint(i,S);break}}if(e._view=e._defaultView,s.endFrame(),p(f)||p(h))return{object:f,position:h,exclude:!p(h)&&o||It(f,r)}}function Rt(e,t,i,r,n,o,a){return bt(i,function(){return Mt(e,t,r,n,o,a)})}function Ot(e,t,i,r,n,o){var a=Rt(e,t,1,i,r,n,o);if(a.length>0)return a[0]}function Lt(e,t,i,r,n,o,a){return Rt(e,t,i,r,n,o,a)}function Nt(e,t){var i=K.defer();return t.then(function(t){var r=e.postRender.addEventListener(function(){i.resolve(t),r()})}),i.promise}function Ft(t,i){var r=t.globe,n=p(r)?r.ellipsoid:t.mapProjection.ellipsoid,s=e._defaultMaxTerrainHeight,l=n.geodeticSurfaceNormalCartographic(i,Pi),u=a.toCartesian(i,n,xi),c=Di;c.origin=u,c.direction=l;var d=new O;return O.getPoint(c,s,d.origin),o.negate(l,d.direction),d}function Bt(e,t){var i=e.globe,r=p(i)?i.ellipsoid:e.mapProjection.ellipsoid;return Ft(e,a.fromCartesian(t,r,Ii))}function kt(e,t){var i=e.globe,r=p(i)?i.ellipsoid:e.mapProjection.ellipsoid;return a.fromCartesian(t,r,Ii).height}function zt(e,t,i,r){var n=Ft(e,t);return Dt(e,n,i,r,function(){var t=Ot(e,n,i,r,!0,!0);if(p(t))return kt(e,t.position)})}function Vt(e,t,i,r,n){var a=Bt(e,t);return Dt(e,a,i,r,function(){var t=Ot(e,a,i,r,!0,!0);if(p(t))return o.clone(t.position,n)})}var Ut=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};f(Me.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 U.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return U.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{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,Re(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},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(){if(p(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(p(this.globe))return this.globe.terrainProvider},set:function(e){p(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(p(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===be.SCENE2D?this.morphTo2D(0):e===be.SCENE3D?this.morphTo3D(0):e===be.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.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 J(this),p(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new se(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}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0,this._defaultView.updateFrustums=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){var t=this._context,i=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=i!==this._hdr,this._hdr=i}},highDynamicRangeSupported:{get:function(){var e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},sunColor:{get:function(){return this._sunColor},set:function(e){this._sunColor=e}},opaqueFrustumNearOffset:{get:function(){return this._frameState.useLogDepth?.9:.9999}}}),Me.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},Me.prototype.updateDerivedCommands=function(e){if(p(e.derivedCommands)){var t=this._frameState,i=this._context,r=!1,n=t.shadowState.lastDirtyTime;e.lastDirtyTime!==n&&(e.lastDirtyTime=n,e.dirty=!0,r=!0);var o=t.useLogDepth,a=this._hdr,s=e.derivedCommands,l=p(s.logDepth),u=p(s.hdr),c=p(s.originalCommand),d=o&&!l,h=a&&!u,f=!(o&&a||c);if(e.dirty=e.dirty||d||h||f,e.dirty){e.dirty=!1;var m=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(s.shadows=Ae.createCastDerivedCommand(m,e,r,i,s.shadows)),(l||d)&&(s.logDepth=ae.createLogDepthCommand(e,i,s.logDepth),Oe(this,s.logDepth.command,r)),(c||f)&&Oe(this,e,r)}}};var Gt,Ht=new te({pass:ee.MOST_DETAILED_PRELOAD}),Wt=new te({pass:ee.MOST_DETAILED_PICK}),qt=new te({pass:ee.RENDER}),Yt=new te({pass:ee.PICK}),jt=new te({pass:ee.PRELOAD}),Xt=new te({pass:ee.PRELOAD_FLIGHT}),Qt=new te({pass:ee.REQUEST_RENDER_MODE_DEFER_CHECK}),Kt=new i,Zt=new d;Me.prototype.isVisible=function(e,t,i){return p(e)&&(!p(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==S.OUTSIDE&&(!p(i)||!e.occlude||!e.boundingVolume.isOccluded(i)))};var Jt=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Jt=A.inverseTransformation(Jt,Jt);var $t=new I,ei=new M,ti=new P,ii=new D,ri=new o,ni=new a(Math.PI,E.PI_OVER_TWO),oi=new o,ai=new o,si=new A,li=new A,ui=new o,ci=new o,di=new t;Me.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._screenSpaceCameraController.update(),p(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};var hi=new l;Me.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);var t=this._frameState;t.newFrame=!1,p(e)||(e=T.now());var i=this._view.checkForCameraUpdates(this),r=!this.requestRenderMode||this._renderRequested||i||this._logDepthBufferDirty||this._hdrDirty||this.mode===be.MORPHING;if(!r&&p(this.maximumRenderTimeChange)&&p(this._lastRenderTime)){var n=Math.abs(T.secondsDifference(this._lastRenderTime,e));r=r||n>this.maximumRenderTimeChange}if(r){this._lastRenderTime=T.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;Fe(this,E.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0}_t(this,pt),_t(this,xt),_t(this,St),_t(this,Tt),r||_t(this,Et),this._postUpdate.raiseEvent(this,e),r&&(this._preRender.raiseEvent(this,e),_t(this,mt)),ht(this,r),_t(this,ft),dt(this),r&&this._postRender.raiseEvent(this,e)},Me.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Me.prototype.requestRender=function(){this._renderRequested=!0},Me.prototype.clampLineWidth=function(e){return Math.max(U.minimumAliasedLineWidth,Math.min(e,U.maximumAliasedLineWidth))};var pi=new D,fi=new o,mi=new o,_i=new n,gi=new A,vi=new M,yi=3,Ci=3,bi=new t(0,0,yi,Ci),Si=new l(0,0,0,0),Ti=new n;Me.prototype.pick=function(e,i,r){yi=h(i,3),Ci=h(r,yi);var n=this._context,o=n.uniformState,a=this._frameState,s=this._defaultView;this._view=s;var l=s.viewport;l.x=0,l.y=0,l.width=n.drawingBufferWidth,l.height=n.drawingBufferHeight;var u=s.passState;u.viewport=t.clone(l,u.viewport);var c=Se.transformWindowToDrawingBuffer(this,e,Ti);this._jobScheduler.disableThisFrame(),Be(this),a.cullingVolume=yt(this,c,yi,Ci,l),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=Yt,o.update(a),ot(this),bi.x=c.x-.5*(yi-1),bi.y=this.drawingBufferHeight-c.y-.5*(Ci-1),bi.width=yi,bi.height=Ci,u=s.pickFramebuffer.begin(bi,s.viewport),tt(this,u,Si),ct(this,u);var d=s.pickFramebuffer.end(bi);return n.endFrame(),d},Me.prototype.pickPositionWorldCoordinates=function(e,t){if(this.useDepthPicking){var i=e.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return o.clone(this._pickPositionCache[i],t);var r=this._frameState,n=this._context,a=n.uniformState,s=this._defaultView;this._view=s;var l=Se.transformWindowToDrawingBuffer(this,e,Ti);this.pickTranslucentDepth?Ct(this,l):(Be(this,r.frameNumber,r.time),a.update(r),ot(this)),l.y=this.drawingBufferHeight-l.y;var u,c=this.camera;u=p(c.frustum.fov)?c.frustum.clone($t):p(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(ei):p(c.frustum.width)?c.frustum.clone(ti):c.frustum.clone(ii);for(var d=s.frustumCommandsList,h=d.length,f=0;f<h;++f){var m=Qe(this,f),_=m.getDepth(n,l.x,l.y);if(_>0&&_<1){var g,v=d[f];return this.mode===be.SCENE2D?(g=c.position.z,c.position.z=g-v.near+1,u.far=Math.max(1,v.far-v.near),u.near=1,a.update(r),a.updateFrustum(u)):(u.near=v.near*(0!==f?this.opaqueFrustumNearOffset:1),u.far=v.far,a.updateFrustum(u)),t=Se.drawingBufferToWgs84Coordinates(this,l,_,t),this.mode===be.SCENE2D&&(c.position.z=g,a.update(r)),this._pickPositionCache[i]=o.clone(t),t}}this._pickPositionCache[i]=void 0}};var Ei=new a;Me.prototype.pickPosition=function(e,t){if(t=this.pickPositionWorldCoordinates(e,t),p(t)&&this.mode!==be.SCENE3D){o.fromElements(t.y,t.z,t.x,t);var i=this.mapProjection,r=i.ellipsoid,n=i.unproject(t,Ei);r.cartographicToCartesian(n,t)}return t},Me.prototype.drillPick=function(e,t,i,r){var n=this;return bt(t,function(){var t=n.pick(e,i,r);if(p(t))return{object:t,position:void 0,exclude:!1}}).map(function(e){return e.object})};var Ai=new o,wi=new o;Me.prototype.pickFromRay=function(e,t,i){return Ot(this,e,t,i,!1,!1)},Me.prototype.drillPickFromRay=function(e,t,i,r){return Lt(this,e,t,i,r,!1,!1)},Me.prototype.pickFromRayMostDetailed=function(e,t,i){var r=this;return e=O.clone(e),t=p(t)?t.slice():t,Nt(this,Dt(this,e,t,i,function(){return Ot(r,e,t,i,!1,!0)}))},Me.prototype.drillPickFromRayMostDetailed=function(e,t,i,r){var n=this;return e=O.clone(e),i=p(i)?i.slice():i,Nt(this,Dt(this,e,i,r,function(){return Lt(n,e,t,i,r,!1,!0)}))};var xi=new o,Pi=new o,Di=new O,Ii=new a;return Me.prototype.sampleHeight=function(e,t,i){var r=Ft(this,e),n=Ot(this,r,t,i,!0,!1);if(p(n))return kt(this,n.position)},Me.prototype.clampToHeight=function(e,t,i,r){var n=Bt(this,e),a=Ot(this,n,t,i,!0,!1);if(p(a))return o.clone(a.position,r)},Me.prototype.sampleHeightMostDetailed=function(e,t,i){t=p(t)?t.slice():t;for(var r=e.length,n=new Array(r),o=0;o<r;++o)n[o]=zt(this,e[o],t,i);return Nt(this,K.all(n).then(function(t){for(var i=t.length,r=0;r<i;++r)e[r].height=t[r];return e}))},Me.prototype.clampToHeightMostDetailed=function(e,t,i){t=p(t)?t.slice():t;for(var r=e.length,n=new Array(r),o=0;o<r;++o)n[o]=Vt(this,e[o],t,i,e[o]);return Nt(this,K.all(n).then(function(t){for(var i=t.length,r=0;r<i;++r)e[r]=t[r];return e}))},Me.prototype.cartesianToCanvasCoordinates=function(e,t){return Se.wgs84ToWindowCoordinates(this,e,t)},Me.prototype.completeMorph=function(){this._transitioner.completeMorph()},Me.prototype.morphTo2D=function(e){var t,i=this.globe;t=p(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=h(e,2),this._transitioner.morphTo2D(e,t)},Me.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=p(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=h(e,2),this._transitioner.morphToColumbusView(e,t)},Me.prototype.morphTo3D=function(e){var t,i=this.globe;t=p(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=h(e,2),this._transitioner.morphTo3D(e,t)},Me.prototype.isDestroyed=function(){return!1},Me.prototype.destroy=function(){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._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=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),p(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(var e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,m(this)},Me}),define("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat 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);\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\n#ifndef HDR\nconst float exposure = 1.1;\nrgb = vec3(1.0) - exp(-exposure * rgb);\n#endif\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(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 = czm_HSBToRGB(hsb);\n#endif\nfloat atmosphereAlpha = clamp((u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.x) / (u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.z), 0.0, 1.0);\nfloat nightAlpha = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? clamp(dot(normalize(czm_viewerPositionWC), normalize(czm_sunPositionWC)), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\ngl_FragColor = vec4(rgb, mix(rgb.b, 1.0, atmosphereAlpha) * 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,b){"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 T(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===b.SCENE3D||i===b.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,depthMask:!1});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=T(this);if(h&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var S=t.context,E=new m({defines:["SKY_FROM_SPACE"],sources:[v]}),A=new m({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=f.fromCache({context:S,vertexShaderSource:E,fragmentShaderSource:A}),E=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=f.fromCache({context:S,vertexShaderSource:E,fragmentShaderSource:A})}var w=t.camera.positionWC,x=e.magnitude(w);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>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{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).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/ShaderSource","../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,C){"use strict";function b(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,this._attributeLocations=void 0,this._useHdr=void 0}return b.prototype.update=function(i,n){var o=this;if(this.show&&(i.mode===C.SCENE3D||i.mode===C.MORPHING)&&i.passes.render){var s=i.context;if(this._sources!==this.sources){this._sources=this.sources;var d=this.sources;"string"==typeof d.positiveX?h(s,this._sources).then(function(e){o._cubeMap=o._cubeMap&&o._cubeMap.destroy(),o._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:s,source:d}))}var b=this._command;if(!r(b.vertexArray)){b.uniformMap={u_cubeMap:function(){return o._cubeMap}};var S=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),T=this._attributeLocations=a.createAttributeLocations(S);b.vertexArray=_.fromGeometry({context:s,geometry:S,attributeLocations:T,bufferUsage:u.STATIC_DRAW}),b.renderState=p.fromCache({blending:y.ALPHA_BLEND})}if(!r(b.shaderProgram)||this._useHdr!==n){var E=new m({defines:[n?"HDR":""],sources:[g]});b.shaderProgram=f.fromCache({context:s,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:this._attributeLocations}),this._useHdr=n}if(r(this._cubeMap))return b}},b.prototype.isDestroyed=function(){return!1},
- b.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},b}),define("Scene/SphereEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,i,r,n){"use strict";function o(e){e=i(e,1),this._radius=i(e,1)}return r(o.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),o.prototype.emit=function(t){var i=n.randomBetween(0,n.TWO_PI),r=n.randomBetween(0,n.PI),o=n.randomBetween(0,this._radius),a=o*Math.cos(i)*Math.sin(r),s=o*Math.sin(i)*Math.sin(r),l=o*Math.cos(r);t.position=e.fromElements(a,s,l,t.position),t.velocity=e.normalize(t.position,t.velocity)},o}),define("Scene/StyleExpression",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.evaluate=function(t,i){e.throwInstantiationError()},t.prototype.evaluateColor=function(t,i){e.throwInstantiationError()},t.prototype.getShaderFunction=function(t,i,r,n){e.throwInstantiationError()},t}),define("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\ngl_FragColor = czm_gammaCorrect(color);\n}\n"}),define("Shaders/SunTextureFS",[],function(){"use strict";return"uniform 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, float lengthScalar)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition) * lengthScalar;\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nfloat lengthScalar = 2.0 / sqrt(2.0);\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position) * lengthScalar;\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(vec2(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), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);\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/PixelDatatype","../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,b,S,T,E,A,w,x){"use strict";function P(){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,this._useHdr=void 0;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(P.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var D=new t,I=new t,M=new r,R=new r;return P.prototype.update=function(r,a,s){if(this.show){var h=r.mode;if(h!==w.SCENE2D&&h!==w.MORPHING&&r.passes.render){var _=r.context,P=a.viewport.width,O=a.viewport.height;if(!o(this._texture)||P!==this._drawingBufferWidth||O!==this._drawingBufferHeight||this._glowFactorDirty||s!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=P,this._drawingBufferHeight=O,this._glowFactorDirty=!1,this._useHdr=s;var L=Math.max(P,O);L=Math.pow(2,Math.ceil(Math.log(L)/Math.log(2))-2),L=Math.max(1,L);var N=s?_.halfFloatingPointTexture?g.HALF_FLOAT:g.FLOAT:g.UNSIGNED_BYTE;this._texture=new C({context:_,width:L,height:L,pixelFormat:d.RGBA,pixelDatatype:N}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var F=this,B={u_radiusTS:function(){return F._radiusTS}};this._commands.computeCommand=new m({fragmentShaderSource:T,outputTexture:this._texture,uniformMap:B,persists:!1,owner:this,postExecute:function(){F._commands.computeCommand=void 0}})}var k=this._drawCommand;if(!o(k.vertexArray)){var z={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var U=p.createVertexBuffer({context:_,typedArray:V,usage:f.STATIC_DRAW}),G=[{index:z.direction,vertexBuffer:U,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],H=p.createIndexBuffer({context:_,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:f.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});k.vertexArray=new b({context:_,attributes:G,indexBuffer:H}),k.shaderProgram=y.fromCache({context:_,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:z}),k.renderState=v.fromCache({blending:A.ALPHA_BLEND}),k.uniformMap=this._uniformMap}var W=_.uniformState.sunPositionWC,q=_.uniformState.sunPositionColumbusView,Y=this._boundingVolume,j=this._boundingVolume2D;i.clone(W,Y.center),j.center.x=q.z,j.center.y=q.x,j.center.z=q.y,Y.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,j.radius=Y.radius,h===w.SCENE3D?e.clone(Y,k.boundingVolume):h===w.COLUMBUS_VIEW&&e.clone(j,k.boundingVolume);var X=x.computeActualWgs84Position(r,W,R),Q=i.magnitude(i.subtract(X,r.camera.position,R)),K=_.uniformState.projection,Z=M;Z.x=0,Z.y=0,Z.z=-Q,Z.w=1;var J=c.multiplyByVector(K,Z,R),$=x.clipToGLWindowCoordinates(a.viewport,J,D);Z.x=u.SOLAR_RADIUS;var ee=c.multiplyByVector(K,Z,R),te=x.clipToGLWindowCoordinates(a.viewport,ee,I);return this._size=Math.ceil(t.magnitude(t.subtract(te,$,R))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},P.prototype.isDestroyed=function(){return!1},P.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)},P}),define("Scene/TileBoundingVolume",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.boundingVolume=void 0,t.prototype.boundingSphere=void 0,t.prototype.distanceToCamera=function(t){e.throwInstantiationError()},t.prototype.intersectPlane=function(t){e.throwInstantiationError()},t.prototype.createDebugVolume=function(t){e.throwInstantiationError()},t}),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,r){var n=document.createElement("canvas");n.width=256,n.height=256;var o=n.getContext("2d"),a=this._color.toCssColorString();o.strokeStyle=a,o.lineWidth=2,o.strokeRect(1,1,255,255);var s="L"+i+"X"+e+"Y"+t;return o.font="bold 25px Arial",o.textAlign="center",o.fillStyle="black",o.fillText(s,127,127),o.fillStyle=a,o.fillText(s,124,124),n},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";return e({START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3})}),define("Scene/TimeDynamicPointCloud",["../Core/arrayFill","../Core/Check","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event","../Core/getTimestamp","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/Resource","../ThirdParty/when","./ClippingPlaneCollection","./PointCloud","./PointCloudEyeDomeLighting","./PointCloudShading","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y){"use strict";function C(t){t=r(t,r.EMPTY_OBJECT),this.show=r(t.show,!0),this.modelMatrix=d.clone(r(t.modelMatrix,d.IDENTITY)),this.shadows=r(t.shadows,y.ENABLED),this.maximumMemoryUsage=r(t.maximumMemoryUsage,256),this.shading=new g(t.shading),this.style=t.style,this.frameFailed=new s,this.frameChanged=new s,this._clock=t.clock,this._intervals=t.intervals,this._clippingPlanes=void 0,this.clippingPlanes=t.clippingPlanes,this._pointCloudEyeDomeLighting=new _,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._readyPromise=p.defer(),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=e(new Array(5),0),this._runningAverage=0}function b(e){return"uniform vec4 czm_pickColor;\n"+e}function S(e){return function(t){return i(t,{czm_pickColor:function(){return e._pickId.color}})}}function T(){return"czm_pickColor"}function E(e){var t=e._clock,i=t.canAnimate&&t.shouldAnimate,r=t.multiplier;return i?r:0}function A(e,t){return e._intervals.indexOf(t.start)}function w(e,t){var i=e._intervals,r=e._clock,n=E(e);if(0!==n){var o=e._getAverageLoadTime(),a=u.addSeconds(r.currentTime,o*n,H),s=i.indexOf(a);return s===A(e,t)&&(n>=0?++s:--s),i.get(s)}}function x(e){var t=e._intervals,i=e._clock,r=i.currentTime,n=t.indexOf(r);return t.get(n)}function P(e,t,i){var r=E(e),n=A(e,t),o=A(e,i);return r>=0?n>=o:n<=o}function D(e,t){return function(i){var r=n(i.message)?i.message:i.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:r}):(console.log("A frame failed to load: "+t),console.log("Error: "+r))}}function I(e,t,i){var r=A(e,t),o=e._frames,a=o[r];if(!n(a)){var s=t.data.transform,u=n(s)?d.fromArray(s):void 0,c=t.data.uri;a={pointCloud:void 0,transform:u,timestamp:l(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},o[r]=a,h.fetchArrayBuffer({url:c}).then(function(t){return a.pointCloud=new m({arrayBuffer:t,cull:!0,fragmentShaderLoaded:b,uniformMapLoaded:S(e),pickIdLoaded:T}),a.pointCloud.readyPromise}).otherwise(D(e,c))}return a}function M(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function R(e,t,i,r){t.touchedFrameNumber<r.frameNumber-1&&(t.sequential=!1);var o=t.pointCloud;if(n(o)&&!t.ready){var a=r.commandList,s=a.length;if(N(e,t,i,r),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,a.length=s,t.sequential)){M(e,(l()-t.timestamp)/1e3)}}t.touchedFrameNumber=r.frameNumber}function O(e,t){var i=e.shading;return n(i)&&n(i.baseResolution)?i.baseResolution:n(t.boundingSphere)?c.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function L(e){var t=e.shading;return n(t)&&n(t.maximumAttenuation)?t.maximumAttenuation:10}function N(e,t,i,n){var o=r(e.shading,q),a=t.pointCloud,s=r(t.transform,d.IDENTITY);a.modelMatrix=d.multiplyTransformation(e.modelMatrix,s,W),a.style=e.style,a.time=i.timeSinceLoad,a.shadows=e.shadows,a.clippingPlanes=e._clippingPlanes,a.isClipped=i.isClipped,a.attenuation=o.attenuation,a.backFaceCulling=o.backFaceCulling,a.normalShading=o.normalShading,a.geometricError=O(e,a),a.geometricErrorScale=o.geometricErrorScale,a.maximumAttenuation=L(e),a.update(n),t.touchedFrameNumber=n.frameNumber}function F(e,t,i,r){R(e,I(e,t,r),i,r)}function B(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function k(e,t){for(var i=e._frames,r=i.length,o=0;o<r;++o){var a=i[o];if(n(a)&&(!n(t)||t(a))){var s=a.pointCloud;a.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),n(s)&&s.destroy(),a===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),i[o]=void 0}}}function z(e,t){var i=A(e,t),r=e._frames[i];if(n(r)&&r.ready)return r}function V(e,t,i,r,o){return!!n(i)&&(!!i.ready||(F(e,t,r,o),i.ready))}function U(e,t,i,r,n){var o,a,s,l=e._intervals,u=e._frames,c=A(e,i),d=A(e,t);if(c>=d){for(o=c;o>=d;--o)if(a=l.get(o),s=u[o],V(e,a,s,r,n))return a}else for(o=c;o<=d;++o)if(a=l.get(o),s=u[o],V(e,a,s,r,n))return a;return t}function G(e,t,i){for(var r=e._frames,o=r.length,a=0;a<o;++a){var s=r[a];n(s)&&n(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=i)}}o(C.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){f.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(n(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),C.prototype.makeStyleDirty=function(){this._styleDirty=!0},C.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};var H=new u,W=new d,q=new g,Y={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};return C.prototype.update=function(e){if(e.mode!==v.MORPHING&&this.show){n(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),n(this._loadTimestamp)||(this._loadTimestamp=u.clone(e.time));var t=Math.max(1e3*u.secondsDifference(e.time,this._loadTimestamp),0),i=this._clippingPlanes,r=0,o=!1,a=n(i)&&i.enabled;a&&(i.update(e),r=i.clippingPlanesState),this._clippingPlanesState!==r&&(this._clippingPlanesState=r,o=!0);var s=this._styleDirty;this._styleDirty=!1,(o||s)&&G(this,o,s),Y.timeSinceLoad=t,Y.isClipped=a;var l=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,h=d.length,p=this._previousInterval,f=this._nextInterval,m=x(this);if(n(m)){var _=!1,g=E(this),y=0===g;g!==this._clockMultiplier&&(_=!0,this._clockMultiplier=g),n(p)&&!y||(p=m),(!n(f)||_||P(this,m,f))&&(f=w(this,m)),p=U(this,p,m,Y,e);var C=z(this,p);n(C)||(F(this,p,Y,e),C=this._lastRenderedFrame),n(C)&&N(this,C,Y,e),n(f)&&F(this,f,Y,e);var b=this;n(C)&&!n(this._lastRenderedFrame)&&e.afterRender.push(function(){b._readyPromise.resolve(b)}),n(C)&&C!==this._lastRenderedFrame&&b.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){b.frameChanged.raiseEvent(b)}),this._previousInterval=p,this._nextInterval=f,this._lastRenderedFrame=C;this._totalMemoryUsageInBytes>1024*this.maximumMemoryUsage*1024&&k(this,B(e));var S=d.length,T=S-h;n(l)&&l.attenuation&&l.eyeDomeLighting&&T>0&&c.update(e,h,l)}}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return k(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},C}),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}));if(t.passes.render){var n=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var c=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=n.createViewportQuadCommand(c,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(n),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/computeFlyToLocationForRectangle",["../Core/defined","../Core/Rectangle","../Core/sampleTerrainMostDetailed","./SceneMode","../ThirdParty/when"],function(e,t,i,r,n){"use strict";function o(i,a){var s,l=a.terrainProvider,u=a.mapProjection,c=u.ellipsoid,d=a.camera.getRectangleCameraCoordinates(i);return s=a.mode===r.SCENE3D?c.cartesianToCartographic(d):u.unproject(d),e(l)?l.readyPromise.then(function(){var n=l.availability;if(!e(n)||a.mode===r.SCENE2D)return s;var u=[t.center(i),t.southeast(i),t.southwest(i),t.northeast(i),t.northwest(i)];return o._sampleTerrainMostDetailed(l,u).then(function(e){var t=e.reduce(function(e,t){return Math.max(t.height,e)},-Number.MAX_VALUE),i=s;return i.height+=t,i})}):n.resolve(s)}return o._sampleTerrainMostDetailed=i,o}),define("Scene/createOpenStreetMapImageryProvider",["../Core/appendForwardSlash","../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/Resource","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s){"use strict";function l(r){r=i(r,{});var l=i(r.url,"https://a.tile.openstreetmap.org/");l=e(l),l+="{z}/{x}/{y}."+i(r.fileExtension,"png");var c=o.createIfNeeded(l),d=new a({ellipsoid:r.ellipsoid}),h=i(r.minimumLevel,0),p=r.maximumLevel,f=i(r.rectangle,d.rectangle),m=d.positionToTileXY(n.southwest(f),h),_=d.positionToTileXY(n.northeast(f),h),g=(Math.abs(_.x-m.x),Math.abs(_.y-m.y),i(r.credit,u));return"string"==typeof g&&(g=new t(g)),new s({url:c,credit:g,tilingScheme:d,tileWidth:256,tileHeight:256,minimumLevel:h,maximumLevel:p,rectangle:f})}var u=new t("MapQuest, Open Street Map and contributors, CC-BY-SA");return l}),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/createWorldImagery",["./IonImageryProvider","./IonWorldImageryStyle","../Core/defaultValue"],function(e,t,i){"use strict";function r(r){r=i(r,i.EMPTY_OBJECT);var n=i(r.style,t.AERIAL);return new e({assetId:n})}return r}),function(){var e=function(){var e={};e.defaultNoDataValue=-3.4027999387901484e38,e.decode=function(o,a){a=a||{};var s=a.encodedMaskData||null===a.encodedMaskData,l=n(o,a.inputOffset||0,s),u=null!==a.noDataValue?a.noDataValue:e.defaultNoDataValue,c=t(l,a.pixelType||Float32Array,a.encodedMaskData,u,a.returnMask),d={width:l.width,height:l.height,pixelData:c.resultPixels,minValue:c.minValue,maxValue:l.pixels.maxValue,noDataValue:u};return c.resultMask&&(d.maskData=c.resultMask),a.returnEncodedMask&&l.mask&&(d.encodedMaskData=l.mask.bitset?l.mask.bitset:null),a.returnFileInfo&&(d.fileInfo=i(l),a.computeUsedBitDepths&&(d.fileInfo.bitDepths=r(l))),d};var t=function(e,t,i,r,n){var a,s=0,l=e.pixels.numBlocksX,u=e.pixels.numBlocksY,c=Math.floor(e.width/l),d=Math.floor(e.height/u),h=2*e.maxZError,p=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null);var f,m;f=new t(e.width*e.height),n&&i&&(m=new Uint8Array(e.width*e.height));for(var _,g,v=new Float32Array(c*d),y=0;y<=u;y++){var C=y!==u?d:e.height%u;if(0!==C)for(var b=0;b<=l;b++){var S=b!==l?c:e.width%l;if(0!==S){var T,E,A,w=y*e.width*d+b*c,x=e.width-S,P=e.pixels.blocks[s];P.encoding<2?(0===P.encoding?T=P.rawData:(o(P.stuffedData,P.bitsPerPixel,P.numValidPixels,P.offset,h,v,e.pixels.maxValue),T=v),E=0):A=2===P.encoding?0:P.offset;var D;if(i)for(g=0;g<C;g++){for(7&w&&(D=i[w>>3],D<<=7&w),_=0;_<S;_++)7&w||(D=i[w>>3]),128&D?(m&&(m[w]=1),a=P.encoding<2?T[E++]:A,p=p>a?a:p,f[w++]=a):(m&&(m[w]=0),f[w++]=r),D<<=1;w+=x}else if(P.encoding<2)for(g=0;g<C;g++){for(_=0;_<S;_++)a=T[E++],p=p>a?a:p,f[w++]=a;w+=x}else for(p=p>A?A:p,g=0;g<C;g++){for(_=0;_<S;_++)f[w++]=A;w+=x}if(1===P.encoding&&E!==P.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:f,resultMask:m,minValue:p}},i=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},r=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},r=0;r<t;r++){var n=e.pixels.blocks[r];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},n=function(e,t,i){var r={},n=new Uint8Array(e,t,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;t+=10;var o=new DataView(e,t,24);if(r.fileVersion=o.getInt32(0,!0),r.imageType=o.getInt32(4,!0),r.height=o.getUint32(8,!0),r.width=o.getUint32(12,!0),r.maxZError=o.getFloat64(16,!0),t+=24,!i)if(o=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=o.getUint32(0,!0),r.mask.numBlocksX=o.getUint32(4,!0),r.mask.numBytes=o.getUint32(8,!0),r.mask.maxValue=o.getFloat32(12,!0),t+=16,r.mask.numBytes>0){var a=new Uint8Array(Math.ceil(r.width*r.height/8));o=new DataView(e,t,r.mask.numBytes);var s=o.getInt16(0,!0),l=2,u=0;do{if(s>0)for(;s--;)a[u++]=o.getUint8(l++);else{var c=o.getUint8(l++);for(s=-s;s--;)a[u++]=c}s=o.getInt16(l,!0),l+=2}while(l<r.mask.numBytes);if(-32768!==s||u<a.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=a,t+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));o=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=o.getUint32(0,!0),r.pixels.numBlocksX=o.getUint32(4,!0),r.pixels.numBytes=o.getUint32(8,!0),r.pixels.maxValue=o.getFloat32(12,!0),t+=16;var d=r.pixels.numBlocksX,h=r.pixels.numBlocksY,p=d+(r.width%d>0?1:0),f=h+(r.height%h>0?1:0);r.pixels.blocks=new Array(p*f);for(var m=0,_=0;_<f;_++)for(var g=0;g<p;g++){var v=0,y=e.byteLength-t;o=new DataView(e,t,Math.min(10,y));var C={};r.pixels.blocks[m++]=C;var b=o.getUint8(0);if(v++,C.encoding=63&b,C.encoding>3)throw"Invalid block encoding ("+C.encoding+")";if(2!==C.encoding){if(0!==b&&2!==b){if(b>>=6,C.offsetType=b,2===b)C.offset=o.getInt8(1),v++;else if(1===b)C.offset=o.getInt16(1,!0),v+=2;else{if(0!==b)throw"Invalid block offset type";C.offset=o.getFloat32(1,!0),v+=4}if(1===C.encoding)if(b=o.getUint8(v),v++,C.bitsPerPixel=63&b,b>>=6,C.numValidPixelsType=b,2===b)C.numValidPixels=o.getUint8(v),v++;else if(1===b)C.numValidPixels=o.getUint16(v,!0),v+=2;else{if(0!==b)throw"Invalid valid pixel count type";C.numValidPixels=o.getUint32(v,!0),v+=4}}if(t+=v,3!==C.encoding){var S,T;if(0===C.encoding){var E=(r.pixels.numBytes-1)/4;if(E!==Math.floor(E))throw"uncompressed block has invalid length";S=new ArrayBuffer(4*E),T=new Uint8Array(S),T.set(new Uint8Array(e,t,4*E));var A=new Float32Array(S);C.rawData=A,t+=4*E}else if(1===C.encoding){var w=Math.ceil(C.numValidPixels*C.bitsPerPixel/8),x=Math.ceil(w/4);S=new ArrayBuffer(4*x),T=new Uint8Array(S),T.set(new Uint8Array(e,t,w)),C.stuffedData=new Uint32Array(S),t+=w}}}else t++}return r.eofOffset=t,r},o=function(e,t,i,r,n,o,a){var s,l,u,c=(1<<t)-1,d=0,h=0,p=Math.ceil((a-r)/n),f=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*f,s=0;s<i;s++){if(0===h&&(u=e[d++],h=32),h>=t)l=u>>>h-t&c,h-=t;else{var m=t-h;l=(u&c)<<m&c,u=e[d++],h=32-m,l+=u>>>h}o[s]=l<p?r+l*n:a}return o};return e}(),t=function(){"use strict";var e={unstuff:function(e,t,i,r,n,o,a,s){var l,u,c,d,h,p=(1<<i)-1,f=0,m=0,_=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*_,n)for(l=0;l<r;l++)0===m&&(c=e[f++],m=32),m>=i?(u=c>>>m-i&p,m-=i):(d=i-m,u=(c&p)<<d&p,c=e[f++],m=32-d,u+=c>>>m),t[l]=n[u];else for(h=Math.ceil((s-o)/a),l=0;l<r;l++)0===m&&(c=e[f++],m=32),m>=i?(u=c>>>m-i&p,m-=i):(d=i-m,u=(c&p)<<d&p,c=e[f++],m=32-d,u+=c>>>m),t[l]=u<h?o+u*a:s},unstuffLUT:function(e,t,i,r,n,o){var a,s=(1<<t)-1,l=0,u=0,c=0,d=0,h=0,p=[],f=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*f;var m=Math.ceil((o-r)/n);for(u=0;u<i;u++)0===d&&(a=e[l++],d=32),d>=t?(h=a>>>d-t&s,d-=t):(c=t-d,h=(a&s)<<c&s,a=e[l++],d=32-c,h+=a>>>d),p[u]=h<m?r+h*n:o;return p.unshift(r),p},unstuff2:function(e,t,i,r,n,o,a,s){var l,u,c,d,h=(1<<i)-1,p=0,f=0,m=0;if(n)for(l=0;l<r;l++)0===f&&(c=e[p++],f=32,m=0),f>=i?(u=c>>>m&h,f-=i,m+=i):(d=i-f,u=c>>>m&h,c=e[p++],f=32-d,u|=(c&(1<<d)-1)<<i-d,m=d),t[l]=n[u];else{var _=Math.ceil((s-o)/a);for(l=0;l<r;l++)0===f&&(c=e[p++],f=32,m=0),f>=i?(u=c>>>m&h,f-=i,m+=i):(d=i-f,u=c>>>m&h,c=e[p++],f=32-d,u|=(c&(1<<d)-1)<<i-d,m=d),t[l]=u<_?o+u*a:s}return t},unstuffLUT2:function(e,t,i,r,n,o){var a,s=(1<<t)-1,l=0,u=0,c=0,d=0,h=0,p=0,f=[],m=Math.ceil((o-r)/n);for(u=0;u<i;u++)0===d&&(a=e[l++],d=32,p=0),d>=t?(h=a>>>p&s,d-=t,p+=t):(c=t-d,h=a>>>p&s,a=e[l++],d=32-c,h|=(a&(1<<c)-1)<<t-c,p=c),f[u]=h<m?r+h*n:o;return f.unshift(r),f},originalUnstuff:function(e,t,i,r){var n,o,a,s,l=(1<<i)-1,u=0,c=0,d=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*d,n=0;n<r;n++)0===c&&(a=e[u++],c=32),c>=i?(o=a>>>c-i&l,c-=i):(s=i-c,o=(a&l)<<s&l,a=e[u++],c=32-s,o+=a>>>c),t[n]=o;return t},originalUnstuff2:function(e,t,i,r){var n,o,a,s,l=(1<<i)-1,u=0,c=0,d=0;for(n=0;n<r;n++)0===c&&(a=e[u++],c=32,d=0),c>=i?(o=a>>>d&l,c-=i,d+=i):(s=i-c,o=a>>>d&l,a=e[u++],c=32-s,o|=(a&(1<<s)-1)<<i-s,d=s),t[n]=o;return t}},t={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,n=Math.floor(r/2),o=0;n;){var a=n>=359?359:n;n-=a;do{t+=e[o++]<<8,i+=t+=e[o++]}while(--a);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[o]<<8),t=(65535&t)+(t>>>16),((i=(65535&i)+(i>>>16))<<16|t)>>>0},readHeaderInfo:function(e,t){var i=t.ptr,r=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,r),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var o=new DataView(e,i,8),a=o.getInt32(0,!0);n.fileVersion=a,i+=4,a>=3&&(n.checksum=o.getUint32(4,!0),i+=4),o=new DataView(e,i,12),n.height=o.getUint32(0,!0),n.width=o.getUint32(4,!0),i+=8,a>=4?(n.numDims=o.getUint32(8,!0),i+=4):n.numDims=1,o=new DataView(e,i,40),n.numValidPixel=o.getUint32(0,!0),n.microBlockSize=o.getInt32(4,!0),n.blobSize=o.getInt32(8,!0),n.imageType=o.getInt32(12,!0),n.maxZError=o.getFloat64(16,!0),n.zMin=o.getFloat64(24,!0),n.zMax=o.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i;var s;if(a>=3&&(s=a>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-s,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,r=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),o=this.readSubArray(e,t.ptr,r,n),a=this.readSubArray(e,t.ptr+n,r,n);t.ptr+=2*n;var s,l=!0;for(s=0;s<i.numDims;s++)if(o[s]!==a[s]){l=!1;break}return i.minValues=o,i.maxValues=a,l},readSubArray:function(e,t,i,r){var n;if(i===Uint8Array)n=new Uint8Array(e,t,r);else{var o=new ArrayBuffer(r);new Uint8Array(o).set(new Uint8Array(e,t,r)),n=new i(o)}return n},readMask:function(e,t){var i=t.ptr,r=t.headerInfo,n=r.width*r.height,o=r.numValidPixel,a=new DataView(e,i,4),s={};if(s.numBytes=a.getUint32(0,!0),i+=4,(0===o||n===o)&&0!==s.numBytes)throw"invalid mask";var l,u;if(0===o)l=new Uint8Array(Math.ceil(n/8)),s.bitset=l,u=new Uint8Array(n),t.pixels.resultMask=u,i+=s.numBytes;else if(s.numBytes>0){l=new Uint8Array(Math.ceil(n/8)),a=new DataView(e,i,s.numBytes);var c=a.getInt16(0,!0),d=2,h=0,p=0;do{if(c>0)for(;c--;)l[h++]=a.getUint8(d++);else for(p=a.getUint8(d++),c=-c;c--;)l[h++]=p;c=a.getInt16(d,!0),d+=2}while(d<s.numBytes);if(-32768!==c||h<l.length)throw"Unexpected end of mask RLE encoding";u=new Uint8Array(n);var f=0,m=0;for(m=0;m<n;m++)7&m?(f=l[m>>3],f<<=7&m):f=l[m>>3],128&f&&(u[m]=1);t.pixels.resultMask=u,s.bitset=l,i+=s.numBytes}
- return t.ptr=i,t.mask=s,!0},readDataOneSweep:function(e,i,r){var n,o=i.ptr,a=i.headerInfo,s=a.numDims,l=a.width*a.height,u=a.imageType,c=a.numValidPixel*t.getDataTypeSize(u)*s,d=i.pixels.resultMask;if(r===Uint8Array)n=new Uint8Array(e,o,c);else{var h=new ArrayBuffer(c);new Uint8Array(h).set(new Uint8Array(e,o,c)),n=new r(h)}if(n.length===l*s)i.pixels.resultPixels=n;else{i.pixels.resultPixels=new r(l*s);var p=0,f=0,m=0,_=0;if(s>1)for(m=0;m<s;m++)for(_=m*l,f=0;f<l;f++)d[f]&&(i.pixels.resultPixels[_+f]=n[p++]);else for(f=0;f<l;f++)d[f]&&(i.pixels.resultPixels[f]=n[p++])}return o+=c,i.ptr=o,!0},readHuffmanTree:function(e,r){var n=this.HUFFMAN_LUT_BITS_MAX,o=new DataView(e,r.ptr,16);if(r.ptr+=16,o.getInt32(0,!0)<2)throw"unsupported Huffman version";var a=o.getInt32(4,!0),s=o.getInt32(8,!0),l=o.getInt32(12,!0);if(s>=l)return!1;var u=new Uint32Array(l-s);t.decodeBits(e,r,u);var c,d,h,p,f=[];for(c=s;c<l;c++)d=c-(c<a?0:a),f[d]={first:u[c-s],second:null};var m=e.byteLength-r.ptr,_=Math.ceil(m/4),g=new ArrayBuffer(4*_);new Uint8Array(g).set(new Uint8Array(e,r.ptr,m));var v,y=new Uint32Array(g),C=0,b=0;for(v=y[0],c=s;c<l;c++)d=c-(c<a?0:a),(p=f[d].first)>0&&(f[d].second=v<<C>>>32-p,32-C>=p?32===(C+=p)&&(C=0,b++,v=y[b]):(C+=p-32,b++,v=y[b],f[d].second|=v>>>32-C));var S=0,T=0,E=new i;for(c=0;c<f.length;c++)void 0!==f[c]&&(S=Math.max(S,f[c].first));T=S>=n?n:S,S>=30&&console.log("WARning, large NUM LUT BITS IS "+S);var A,w,x,P,D,I,M=[];for(c=s;c<l;c++)if(d=c-(c<a?0:a),(p=f[d].first)>0)if(A=[p,d],p<=T)for(w=f[d].second<<T-p,x=1<<T-p,h=0;h<x;h++)M[w|h]=A;else for(w=f[d].second,I=E,P=p-1;P>=0;P--)D=w>>>P&1,D?(I.right||(I.right=new i),I=I.right):(I.left||(I.left=new i),I=I.left),0!==P||I.val||(I.val=A[1]);return{decodeLut:M,numBitsLUTQick:T,numBitsLUT:S,tree:E,stuffedData:y,srcPtr:b,bitPos:C}},readHuffman:function(e,t,i){var r,n,o,a,s,l,u,c,d,h,p=t.headerInfo,f=p.numDims,m=t.headerInfo.height,_=t.headerInfo.width,g=_*m,v=this.readHuffmanTree(e,t),y=v.decodeLut,C=v.tree,b=v.stuffedData,S=v.srcPtr,T=v.bitPos,E=v.numBitsLUTQick,A=v.numBitsLUT,w=0===t.headerInfo.imageType?128:0,x=t.pixels.resultMask,P=0;T>0&&(S++,T=0);var D,I=b[S],M=1===t.encodeMode,R=new i(g*f),O=R;for(D=0;D<p.numDims;D++){if(f>1&&(O=new i(R.buffer,g*D,g),P=0),t.headerInfo.numValidPixel===_*m)for(d=0,u=0;u<m;u++)for(c=0;c<_;c++,d++){if(n=0,a=I<<T>>>32-E,s=a,32-T<E&&(a|=b[S+1]>>>64-T-E,s=a),y[s])n=y[s][1],T+=y[s][0];else for(a=I<<T>>>32-A,s=a,32-T<A&&(a|=b[S+1]>>>64-T-A,s=a),r=C,h=0;h<A;h++)if(l=a>>>A-h-1&1,r=l?r.right:r.left,!r.left&&!r.right){n=r.val,T=T+h+1;break}T>=32&&(T-=32,S++,I=b[S]),o=n-w,M?(o+=c>0?P:u>0?O[d-_]:P,o&=255,O[d]=o,P=o):O[d]=o}else for(d=0,u=0;u<m;u++)for(c=0;c<_;c++,d++)if(x[d]){if(n=0,a=I<<T>>>32-E,s=a,32-T<E&&(a|=b[S+1]>>>64-T-E,s=a),y[s])n=y[s][1],T+=y[s][0];else for(a=I<<T>>>32-A,s=a,32-T<A&&(a|=b[S+1]>>>64-T-A,s=a),r=C,h=0;h<A;h++)if(l=a>>>A-h-1&1,r=l?r.right:r.left,!r.left&&!r.right){n=r.val,T=T+h+1;break}T>=32&&(T-=32,S++,I=b[S]),o=n-w,M?(c>0&&x[d-1]?o+=P:u>0&&x[d-_]?o+=O[d-_]:o+=P,o&=255,O[d]=o,P=o):O[d]=o}t.ptr=t.ptr+4*(S+1)+(T>0?4:0)}t.pixels.resultPixels=R},decodeBits:function(t,i,r,n,o){var a=i.headerInfo,s=a.fileVersion,l=0,u=t.byteLength-i.ptr>=5?5:t.byteLength-i.ptr,c=new DataView(t,i.ptr,u),d=c.getUint8(0);l++;var h=d>>6,p=0===h?4:3-h,f=(32&d)>0,m=31&d,_=0;if(1===p)_=c.getUint8(l),l++;else if(2===p)_=c.getUint16(l,!0),l+=2;else{if(4!==p)throw"Invalid valid pixel count type";_=c.getUint32(l,!0),l+=4}var g,v,y,C,b,S,T,E,A,w=2*a.maxZError,x=a.numDims>1?a.maxValues[o]:a.zMax;if(f){for(i.counter.lut++,E=c.getUint8(l),m,l++,C=Math.ceil((E-1)*m/8),b=Math.ceil(C/4),v=new ArrayBuffer(4*b),y=new Uint8Array(v),i.ptr+=l,y.set(new Uint8Array(t,i.ptr,C)),T=new Uint32Array(v),i.ptr+=C,A=0;E-1>>>A;)A++;C=Math.ceil(_*A/8),b=Math.ceil(C/4),v=new ArrayBuffer(4*b),y=new Uint8Array(v),y.set(new Uint8Array(t,i.ptr,C)),g=new Uint32Array(v),i.ptr+=C,S=s>=3?e.unstuffLUT2(T,m,E-1,n,w,x):e.unstuffLUT(T,m,E-1,n,w,x),s>=3?e.unstuff2(g,r,A,_,S):e.unstuff(g,r,A,_,S)}else i.counter.bitstuffer++,A=m,i.ptr+=l,A>0&&(C=Math.ceil(_*A/8),b=Math.ceil(C/4),v=new ArrayBuffer(4*b),y=new Uint8Array(v),y.set(new Uint8Array(t,i.ptr,C)),g=new Uint32Array(v),i.ptr+=C,s>=3?null===n?e.originalUnstuff2(g,r,A,_):e.unstuff2(g,r,A,_,!1,n,w,x):null===n?e.originalUnstuff(g,r,A,_):e.unstuff(g,r,A,_,!1,n,w,x))},readTiles:function(e,i,r){var n=i.headerInfo,o=n.width,a=n.height,s=n.microBlockSize,l=n.imageType,u=t.getDataTypeSize(l),c=Math.ceil(o/s),d=Math.ceil(a/s);i.pixels.numBlocksY=d,i.pixels.numBlocksX=c,i.pixels.ptr=0;var h,p,f,m,_,g,v,y,C,b=0,S=0,T=0,E=0,A=0,w=0,x=0,P=0,D=0,I=0,M=0,R=0,O=0,L=0,N=0,F=new r(s*s),B=a%s||s,k=o%s||s,z=n.numDims,V=i.pixels.resultMask,U=i.pixels.resultPixels;for(T=0;T<d;T++)for(A=T!==d-1?s:B,E=0;E<c;E++)for(w=E!==c-1?s:k,I=T*o*s+E*s,M=o-w,C=0;C<z;C++){if(z>1&&(U=new r(i.pixels.resultPixels.buffer,o*a*C*u,o*a)),x=e.byteLength-i.ptr,h=new DataView(e,i.ptr,Math.min(10,x)),p={},N=0,P=h.getUint8(0),N++,D=P>>6&255,(P>>2&15)!==(E*s>>3&15))throw"integrity issue";if((g=3&P)>3)throw i.ptr+=N,"Invalid block encoding ("+g+")";if(2!==g)if(0===g){if(i.counter.uncompressed++,i.ptr+=N,R=A*w*u,O=e.byteLength-i.ptr,R=R<O?R:O,f=new ArrayBuffer(R%u==0?R:R+u-R%u),m=new Uint8Array(f),m.set(new Uint8Array(e,i.ptr,R)),_=new r(f),L=0,V)for(b=0;b<A;b++){for(S=0;S<w;S++)V[I]&&(U[I]=_[L++]),I++;I+=M}else for(b=0;b<A;b++){for(S=0;S<w;S++)U[I++]=_[L++];I+=M}i.ptr+=L*u}else if(v=t.getDataTypeUsed(l,D),y=t.getOnePixel(p,N,v,h),N+=t.getDataTypeSize(v),3===g)if(i.ptr+=N,i.counter.constantoffset++,V)for(b=0;b<A;b++){for(S=0;S<w;S++)V[I]&&(U[I]=y),I++;I+=M}else for(b=0;b<A;b++){for(S=0;S<w;S++)U[I++]=y;I+=M}else if(i.ptr+=N,t.decodeBits(e,i,F,y,C),N=0,V)for(b=0;b<A;b++){for(S=0;S<w;S++)V[I]&&(U[I]=F[N++]),I++;I+=M}else for(b=0;b<A;b++){for(S=0;S<w;S++)U[I++]=F[N++];I+=M}else i.counter.constant++,i.ptr+=N}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:t.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,r=e.headerInfo.height*e.headerInfo.width,n=r*i,o=0,a=0,s=0,l=e.pixels.resultMask;if(l)if(i>1)for(o=0;o<i;o++)for(s=o*r,a=0;a<r;a++)l[a]&&(e.pixels.resultPixels[s+a]=t);else for(a=0;a<r;a++)l[a]&&(e.pixels.resultPixels[a]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(a=0;a<n;a++)e.pixels.resultPixels[a]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-3.4027999387901484e38&&t<=3.4027999387901484e38;break;case 7:i=t>=5e-324&&t<=1.7976931348623157e308;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,r){var n=0;switch(i){case 0:n=r.getInt8(t);break;case 1:n=r.getUint8(t);break;case 2:n=r.getInt16(t,!0);break;case 3:n=r.getUint16(t,!0);break;case 4:n=r.getInt32(t,!0);break;case 5:n=r.getUInt32(t,!0);break;case 6:n=r.getFloat32(t,!0);break;case 7:n=r.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},i=function(e,t,i){this.val=e,this.left=t,this.right=i};return{decode:function(e,i){i=i||{};var r=i.noDataValue,n=0,o={};if(o.ptr=i.inputOffset||0,o.pixels={},t.readHeaderInfo(e,o)){var a=o.headerInfo,s=a.fileVersion,l=t.getDataTypeArray(a.imageType);t.readMask(e,o),a.numValidPixel===a.width*a.height||o.pixels.resultMask||(o.pixels.resultMask=i.maskData);var u=a.width*a.height;if(o.pixels.resultPixels=new l(u*a.numDims),o.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==a.numValidPixel)if(a.zMax===a.zMin)t.constructConstantSurface(o);else if(s>=4&&t.checkMinMaxRanges(e,o))t.constructConstantSurface(o);else{var c=new DataView(e,o.ptr,2),d=c.getUint8(0);if(o.ptr++,d)t.readDataOneSweep(e,o,l);else if(s>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var h=c.getUint8(1);if(o.ptr++,o.encodeMode=h,h>2||s<4&&h>1)throw"Invalid Huffman flag "+h;h?t.readHuffman(e,o,l):t.readTiles(e,o,l)}else t.readTiles(e,o,l)}o.eofOffset=o.ptr;var p;i.inputOffset?(p=o.headerInfo.blobSize+i.inputOffset-o.ptr,Math.abs(p)>=1&&(o.eofOffset=i.inputOffset+o.headerInfo.blobSize)):(p=o.headerInfo.blobSize-o.ptr,Math.abs(p)>=1&&(o.eofOffset=o.headerInfo.blobSize));var f={width:a.width,height:a.height,pixelData:o.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:o.pixels.resultMask};if(o.pixels.resultMask&&t.isValidPixelValue(a.imageType,r)){var m=o.pixels.resultMask;for(n=0;n<u;n++)m[n]||(f.pixelData[n]=r);f.noDataValue=r}return o.noDataValue=r,i.returnFileInfo&&(f.fileInfo=t.formatFileInfo(o)),f}},getBandCount:function(e){var i=0,r=0,n={};for(n.ptr=0,n.pixels={};r<e.byteLength-58;)t.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,i++,n.ptr=r;return i}}}(),i=function(){var e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,1===t[0]}(),r={decode:function(r,n){if(!i)throw"Big endian system is not supported.";n=n||{};var o,a,s=n.inputOffset||0,l=new Uint8Array(r,s,10),u=String.fromCharCode.apply(null,l);if("CntZImage"===u.trim())o=e,a=1;else{if("Lerc2"!==u.substring(0,5))throw"Unexpected file identifier string: "+u;o=t,a=2}for(var c,d,h,p=0,f=r.byteLength-10,m=[],_={width:0,height:0,pixels:[],pixelType:n.pixelType,mask:null,statistics:[]};s<f;){var g=o.decode(r,{inputOffset:s,encodedMaskData:c,maskData:h,returnMask:0===p,returnEncodedMask:0===p,returnFileInfo:!0,pixelType:n.pixelType||null,noDataValue:n.noDataValue||null});s=g.fileInfo.eofOffset,0===p&&(c=g.encodedMaskData,h=g.maskData,_.width=g.width,_.height=g.height,_.dimCount=g.dimCount||1,_.pixelType=g.pixelType||g.fileInfo.pixelType,_.mask=g.maskData),a>1&&g.fileInfo.mask&&g.fileInfo.mask.numBytes>0&&m.push(g.maskData),p++,_.pixels.push(g.pixelData),_.statistics.push({minValue:g.minValue,maxValue:g.maxValue,noDataValue:g.noDataValue,dimStats:g.dimStats})}var v,y,C;if(a>1&&m.length>1){for(C=_.width*_.height,_.bandMasks=m,h=new Uint8Array(C),h.set(m[0]),v=1;v<m.length;v++)for(d=m[v],y=0;y<C;y++)h[y]=h[y]&d[y];_.maskData=h}return _}};"function"==typeof define&&define.amd?define("ThirdParty/LercDecode",[],function(){return r}):"undefined"!=typeof module&&module.exports?module.exports=r:this.Lerc=r}(),function(e,t){"function"==typeof define&&define.amd?define("ThirdParty/NoSleep",[],t):"object"==typeof exports?exports.NoSleep=t():e.NoSleep=t()}(this,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),o=i(1),a="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,s=function(){function e(){r(this,e),a?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this.noSleepVideo.setAttribute("src",o),this.noSleepVideo.addEventListener("timeupdate",function(e){this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return n(e,[{key:"enable",value:function(){a?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location.href="/",window.setTimeout(window.stop,0)},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){a?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=s},function(e,t,i){"use strict";e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}),function(){!function(e){var t=this||(0,eval)("this"),i=t.document,r=t.navigator,n=t.jQuery,o=t.JSON;n||"undefined"==typeof jQuery||(n=jQuery),function(e){"function"==typeof define&&define.amd?define("ThirdParty/knockout-3.5.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 m)&&e===t}function u(t,i){var r;return function(){r||(r=f.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=f.a.setTimeout(e,t)}}function d(e,t){t&&"change"!==t?"beforeChange"===t?this.oc(e):this.bb(e,t):this.pc(e)}function h(e,t){null!==t&&t.s&&t.s()}function p(e,t){var i=this.pd,r=i[C];r.qa||(this.Pb&&this.kb[t]?(i.tc(t,e,this.kb[t]),this.kb[t]=null,--this.Pb):r.F[t]||i.tc(t,e,r.G?{da:e}:i.Zc(e)),e.Ka&&e.fd())}var f=void 0!==a?a:{};f.b=function(e,t){for(var i=e.split("."),r=f,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},f.J=function(e,t,i){e[t]=i},f.version="3.5.0",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function a(e,t){for(var i in e)c.call(e,i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)c.call(t,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(y)||[];f.a.C(i.match(y),function(e){f.a.Oa(n,e,r)}),e[t]=n.join(" ")}var c=Object.prototype.hasOwnProperty,d={__proto__:[]}instanceof Array,h="function"==typeof Symbol,p={},m={};p[r&&/Firefox\/2/i.test(r.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],p.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(p,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)m[t[i]]=e});var _,g={propertychange:!0},v=i&&function(){for(var t=3,r=i.createElement("div"),n=r.getElementsByTagName("i");r.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:e}(),y=/\S+/g;return{Ic:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],C:function(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e[r],r,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Lb:function(t,i,r){for(var n=0,o=t.length;n<o;n++)if(i.call(r,t[n],n,t))return t[n];return e},hb:function(e,t){var i=f.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},vc:function(e){var t=[];return e&&f.a.C(e,function(e){0>f.a.A(t,e)&&t.push(e)}),t},Mb:function(e,t,i){var r=[];if(e)for(var n=0,o=e.length;n<o;n++)r.push(t.call(i,e[n],n));return r},fb:function(e,t,i){var r=[];if(e)for(var n=0,o=e.length;n<o;n++)t.call(i,e[n],n)&&r.push(e[n]);return r},gb: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},Oa:function(e,t,i){var r=f.a.A(f.a.$b(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},Ba:d,extend:s,setPrototypeOf:l,zb:d?l:s,O:a,Ha:function(e,t,i){if(!e)return e;var r,n={};for(r in e)c.call(e,r)&&(n[r]=t.call(i,e[r],r,e));return n},Sb:function(e){for(;e.firstChild;)f.removeNode(e.firstChild)},Xb:function(e){e=f.a.la(e);for(var t=(e[0]&&e[0].ownerDocument||i).createElement("div"),r=0,n=e.length;r<n;r++)t.appendChild(f.na(e[r]));return t},Ca:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?f.na(o):o)}return n},ua:function(e,t){if(f.a.Sb(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},Wc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)f.removeNode(i[o])}},Ua: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},Yc:function(e,t){7>v?e.setAttribute("selected",t):e.selected=t},Cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Td:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},ud:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Rb:function(e){return f.a.ud(e,e.ownerDocument.documentElement)},jd:function(e){return!!f.a.Lb(e,f.a.Rb)},P:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},zc:function(e){return f.onError?function(){try{return e.apply(this,arguments)}catch(e){throw f.onError&&f.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(f.a.zc(e),t)},Fc:function(e){setTimeout(function(){throw f.onError&&f.onError(e),e},0)},H:function(e,t,i){var r=f.a.zc(i);if(i=g[t],f.options.useOnlyNativeEvents||i||!n)if(i||"function"!=typeof e.addEventListener){if(void 0===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),f.a.I.za(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,r,!1);else _||(_="function"==typeof n(e).on?"on":"bind"),n(e)[_](t,r)},Fb:function(e,r){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===f.a.P(e)&&e.type&&"click"==r.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,f.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(m[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(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+r)}else n(e).trigger(r)},c:function(e){return f.N(e)?e():e},$b:function(e){return f.N(e)?e.w():e},Eb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],f.a.C(t.match(y),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Ab:function(t,i){var r=f.a.c(i);null!==r&&r!==e||(r="");var n=f.h.firstChild(t);!n||3!=n.nodeType||f.h.nextSibling(n)?f.h.ua(t,[t.ownerDocument.createTextNode(r)]):n.data=r,f.a.zd(t)},Xc:function(e,t){if(e.name=t,7>=v)try{var r=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(i.createElement("<input name='"+r+"'/>"),!1)}catch(e){}},zd:function(e){9<=v&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},vd:function(e){if(v){var t=e.style.width;e.style.width=0,e.style.width=t}},Od:function(e,t){e=f.a.c(e),t=f.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},la:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Da:function(e){return h?Symbol(e):e},Xd:6===v,Yd:7===v,W:v,Kc:function(e,t){for(var i=f.a.la(e.getElementsByTagName("input")).concat(f.a.la(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},Md:function(e){return"string"==typeof e&&(e=f.a.Cb(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},fc: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(f.a.c(e),t,i)},Nd:function(e,t,r){r=r||{};var n=r.params||{},o=r.includeFields||this.Ic,s=e;if("object"==typeof e&&"form"===f.a.P(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var u=f.a.Kc(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value;t=f.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=f.a.fc(f.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)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.C),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.fb),f.b("utils.arrayGetDistinctValues",f.a.vc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.gb),f.b("utils.arrayRemoveItem",f.a.hb),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Ic),f.b("utils.getFormFields",f.a.Kc),f.b("utils.objectMap",f.a.Ha),f.b("utils.peekObservable",f.a.$b),f.b("utils.postJson",f.a.Nd),f.b("utils.parseJson",f.a.Md),f.b("utils.registerEventHandler",f.a.H),f.b("utils.stringifyJson",f.a.fc),f.b("utils.range",f.a.Od),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.c),f.b("utils.objectForEach",f.a.O),f.b("utils.addOrRemoveItem",f.a.Oa),f.b("utils.setTextContent",f.a.Ab),f.b("unwrap",f.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),f.a.g=new function(){var t,i,r=0,n="__ko__"+(new Date).getTime(),o={};return f.a.W?(t=function(t,i){var a=t[n];if(!a||"null"===a||!o[a]){if(!i)return e;a=t[n]="ko"+r++,o[a]={}}return o[a]},i=function(e){var t=e[n];return!!t&&(delete o[t],e[n]=null,!0)}):(t=function(e,t){var i=e[n];return!i&&t&&(i=e[n]={}),i},i=function(e){return!!e[n]&&(delete e[n],!0)}),{get:function(e,i){var r=t(e,!1);return r&&r[i]},set:function(i,r,n){(i=t(i,n!==e))&&(i[r]=n)},Tb:function(e,i,r){return e=t(e,!0),e[i]||(e[i]=r)},clear:i,Z:function(){return r+++n}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.I=new function(){function t(t,i){var r=f.a.g.get(t,o);return r===e&&i&&(r=[],f.a.g.set(t,o,r)),r}function i(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;n<i.length;n++)i[n](e);f.a.g.clear(e),f.a.I.cleanExternalData(e),s[e.nodeType]&&r(e.childNodes,!0)}function r(e,t){for(var r,n=[],o=0;o<e.length;o++)if((!t||8===e[o].nodeType)&&(i(n[n.length]=r=e[o]),e[o]!==r))for(;o--&&-1==f.a.A(n,e[o]););}var o=f.a.g.Z(),a={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},xb:function(i,r){var n=t(i,!1);n&&(f.a.hb(n,r),0==n.length&&f.a.g.set(i,o,e))},na:function(e){return a[e.nodeType]&&(i(e),s[e.nodeType]&&r(e.getElementsByTagName("*"))),e},removeNode:function(e){f.na(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},f.na=f.a.I.na,f.removeNode=f.a.I.removeNode,f.b("cleanNode",f.na),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.I),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.I.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.I.xb),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>=f.a.W;f.a.ta=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=f.a.Cb(e).toLowerCase(),h=a.createElement("div");for(c=(d=d.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&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.body.appendChild(h),h.innerHTML=c,u&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=f.a.la(h.lastChild.childNodes)}return a},f.a.Ld=function(e,t){var i=f.a.ta(e,t);return i.length&&i[0].parentElement||f.a.Xb(i)},f.a.dc=function(t,i){if(f.a.Sb(t),null!==(i=f.a.c(i))&&i!==e)if("string"!=typeof i&&(i=i.toString()),n)n(t).html(i);else for(var r=f.a.ta(i,t.ownerDocument),o=0;o<r.length;o++)t.appendChild(r[o])}}(),f.b("utils.parseHtmlFragment",f.a.ta),f.b("utils.setHtml",f.a.dc),f.aa=function(){function t(e,i){if(e)if(8==e.nodeType){var r=f.aa.Tc(e.nodeValue);null!=r&&i.push({sd:e,Jd: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,"\x3c!--[ko_memo:"+t+"]--\x3e"},ad: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]}},bd:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].sd,s=[a];i&&f.a.gb(s,i),f.aa.ad(r[n].Jd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Tc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Wb),f.b("memoization.unmemoize",f.aa.ad),f.b("memoization.parseMemoText",f.aa.Tc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.bd),f.ma=function(){function e(){if(a)for(var e,t=a,i=0;l<a;)if(e=o[l++]){if(l>t){if(5e3<=++i){l=a,f.a.Fc(Error("'Too much recursion' after processing "+i+" task groups."));break}t=a}try{e()}catch(e){f.a.Fc(e)}}}function r(){e(),l=a=o.length=0}var n,o=[],a=0,s=1,l=0;return n=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)},{scheduler:n,yb:function(e){return a||f.ma.scheduler(r),o[a++]=e,s++},cancel:function(e){(e-=s-a)>=l&&e<a&&(o[e]=null)},resetForTesting:function(){var e=a-l;return l=a=o.length=0,e},Rd:e}}(),f.b("tasks",f.ma),f.b("tasks.schedule",f.ma.yb),f.b("tasks.runEarly",f.ma.Rd),f.Ta={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return f.$({read:e,write:function(r){clearTimeout(i),i=f.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.Hb=!1,n="function"==typeof r?r:"notifyWhenChangesStop"==r?c:u,e.tb(function(e){return n(e,i,t)})},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.Hb||(t.Hb=!0,t.tb(function(i){var r,n=!1;return function(){if(!n){f.ma.cancel(r),r=f.ma.yb(i);try{n=!0,t.notifySubscribers(e,"dirty")}finally{n=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var m={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.gc=function(e,t,i){this.da=e,this.kc=t,this.lc=i,this.Ib=!1,this.ab=this.Jb=null,f.J(this,"dispose",this.s),f.J(this,"disposeWhenNodeIsRemoved",this.l)},f.gc.prototype.s=function(){this.Ib||(this.ab&&f.a.I.xb(this.Jb,this.ab),this.Ib=!0,this.lc(),this.da=this.kc=this.lc=this.Jb=this.ab=null)},f.gc.prototype.l=function(e){this.Jb=e,f.a.I.za(e,this.ab=this.s.bind(this))},f.R=function(){f.a.zb(this,_),_.ob(this)};var _={ob:function(e){e.S={change:[]},e.rc=1},subscribe:function(e,t,i){var r=this;i=i||"change";var n=new f.gc(r,t?e.bind(t):e,function(){f.a.hb(r.S[i],n),r.cb&&r.cb(i)});return r.Qa&&r.Qa(i),r.S[i]||(r.S[i]=[]),r.S[i].push(n),n},notifySubscribers:function(e,t){if(t=t||"change","change"===t&&this.Gb(),this.Wa(t)){var i="change"===t&&this.dd||this.S[t].slice(0);try{f.v.wc();for(var r,n=0;r=i[n];++n)r.Ib||r.kc(e)}finally{f.v.end()}}},mb:function(){return this.rc},Cd:function(e){return this.mb()!==e},Gb:function(){++this.rc},tb:function(e){var t,i,r,n,o,a=this,s=f.N(a);a.bb||(a.bb=a.notifySubscribers,a.notifySubscribers=d);var l=e(function(){a.Ka=!1,s&&n===a&&(n=a.mc?a.mc():a());var e=i||o&&a.qb(r,n);o=i=t=!1,e&&a.bb(r=n)});a.pc=function(e,i){i&&a.Ka||(o=!i),a.dd=a.S.change.slice(0),a.Ka=t=!0,n=e,l()},a.oc=function(e){t||(r=e,a.bb(e,"beforeChange"))},a.qc=function(){o=!0},a.fd=function(){a.qb(r,a.w(!0))&&(i=!0)}},Wa:function(e){return this.S[e]&&this.S[e].length},Ad:function(e){if(e)return this.S[e]&&this.S[e].length||0;var t=0;return f.a.O(this.S,function(e,i){"dirty"!==e&&(t+=i.length)}),t},qb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var t=this;return e&&f.a.O(e,function(e,i){var r=f.Ta[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};f.J(_,"init",_.ob),f.J(_,"subscribe",_.subscribe),f.J(_,"extend",_.extend),f.J(_,"getSubscriptionsCount",_.Ad),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.R.fn=_,f.Pc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},f.b("subscribable",f.R),f.b("isSubscribable",f.Pc),f.U=f.v=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{wc:e,end:t,ac:function(e){if(i){if(!f.Pc(e))throw Error("Only subscribable things can act as dependencies");i.nd.call(i.od,e,e.ed||(e.ed=++n))}},K:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},pa:function(){if(i)return i.o.pa()},Va:function(){if(i)return i.o.Va()},rb:function(){if(i)return i.rb},o:function(){if(i)return i.o}}}(),f.b("computedContext",f.U),f.b("computedContext.getDependenciesCount",f.U.pa),f.b("computedContext.getDependencies",f.U.Va),f.b("computedContext.isInitial",f.U.rb),f.b("computedContext.registerDependency",f.U.ac),f.b("ignoreDependencies",f.Wd=f.v.K);var g=f.a.Da("_latestValue");f.sa=function(e){function t(){return 0<arguments.length?(t.qb(t[g],arguments[0])&&(t.xa(),t[g]=arguments[0],t.wa()),this):(f.v.ac(t),t[g])}return t[g]=e,f.a.Ba||f.a.extend(t,f.R.fn),f.R.fn.ob(t),f.a.zb(t,v),f.options.deferUpdates&&f.Ta.deferred(t,!0),t};var v={equalityComparer:l,w:function(){return this[g]},wa:function(){this.notifySubscribers(this[g],"spectate"),this.notifySubscribers(this[g])},xa:function(){this.notifySubscribers(this[g],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(v,f.R.fn);var y=f.sa.Na="__ko_proto__";v[y]=f.sa,f.N=function(e){if((e="function"==typeof e&&e[y])&&e!==v[y]&&e!==f.o.fn[y])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},f.Ya=function(e){return"function"==typeof e&&(e[y]===v[y]||e[y]===f.o.fn[y]&&e.Mc)},f.b("observable",f.sa),f.b("isObservable",f.N),f.b("isWriteableObservable",f.Ya),f.b("isWritableObservable",f.Ya),f.b("observable.fn",v),f.J(v,"peek",v.w),f.J(v,"valueHasMutated",v.wa),f.J(v,"valueWillMutate",v.xa),f.Ia=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=f.sa(e),f.a.zb(e,f.Ia.fn),e.extend({trackArrayChanges:!0})},f.Ia.fn={remove:function(e){for(var t=this.w(),i=[],r="function"!=typeof e||f.N(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];if(r(o)){if(0===i.length&&this.xa(),t[n]!==o)throw Error("Array modified during remove; cannot remove item");i.push(o),t.splice(n,1),n--}}return i.length&&this.wa(),i},removeAll:function(t){if(t===e){var i=this.w(),r=i.slice(0);return this.xa(),i.splice(0,i.length),this.wa(),r}return t?this.remove(function(e){return 0<=f.a.A(t,e)}):[]},destroy:function(e){var t=this.w(),i="function"!=typeof e||f.N(e)?function(t){return t===e}:e;this.xa();for(var r=t.length-1;0<=r;r--){var n=t[r];i(n)&&(n._destroy=!0)}this.wa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=f.a.A(t,e)}):[]},indexOf:function(e){var t=this();return f.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.xa(),this.w()[i]=t,this.wa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ia.fn,f.sa.fn),f.a.C("pop push reverse shift sort splice unshift".split(" "),function(e){f.Ia.fn[e]=function(){var t=this.w();this.xa(),this.yc(t,e,arguments);var i=t[e].apply(t,arguments);return this.wa(),i===t?this:i}}),f.a.C(["slice"],function(e){f.Ia.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),f.Oc=function(e){return f.N(e)&&"function"==typeof e.remove&&"function"==typeof e.push},f.b("observableArray",f.Ia),f.b("isObservableArray",f.Oc),f.Ta.trackArrayChanges=function(t,i){function r(){function e(){if(u){var e=[].concat(t.w()||[]);if(t.Wa("arrayChange")){var i;(!l||1<u)&&(l=f.a.Ob(o,e,t.Nb)),i=l}o=e,l=null,u=0,i&&i.length&&t.notifySubscribers(i,"arrayChange")}}s?e():(s=!0,a=t.notifySubscribers,t.notifySubscribers=function(e,t){return t&&"change"!==t||++u,a.apply(this,arguments)},o=[].concat(t.w()||[]),l=null,n=t.subscribe(e))}if(t.Nb={},i&&"object"==typeof i&&f.a.extend(t.Nb,i),t.Nb.sparse=!0,!t.yc){var n,o,a,s=!1,l=null,u=0,c=t.Qa,d=t.cb;t.Qa=function(e){c&&c.call(t,e),"arrayChange"===e&&r()},t.cb=function(i){d&&d.call(t,i),"arrayChange"!==i||t.Wa("arrayChange")||(a&&(t.notifySubscribers=a,a=e),n&&n.s(),n=null,s=!1,o=e)},t.yc=function(e,t,i){function r(e,t,i){return n[n.length]={status:e,value:t,index:i}}if(s&&!u){var n=[],o=e.length,a=i.length,c=0;switch(t){case"push":c=o;case"unshift":for(t=0;t<a;t++)r("added",i[t],c+t);break;case"pop":c=o-1;case"shift":o&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?o+i[0]:i[0]),o);for(var o=1===a?o:Math.min(t+(i[1]||0),o),a=t+a-2,c=Math.max(o,a),d=[],h=[],p=2;t<c;++t,++p)t<o&&h.push(r("deleted",e[t],t)),t<a&&d.push(r("added",i[p],t));f.a.Jc(h,d);break;default:return}l=n}}}};var C=f.a.Da("_state");f.o=f.$=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.lb,arguments),this}return a.qa||f.v.ac(n),(a.ka||a.G&&n.Xa())&&n.ha(),a.X}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={X:e,ra:!0,ka:!0,pb:!1,hc:!1,qa:!1,vb:!1,G:!1,Vc:r.read,lb:i||r.owner,l:r.disposeWhenNodeIsRemoved||r.l||null,Sa:r.disposeWhen||r.Sa,Qb:null,F:{},V:0,Hc:null};return n[C]=a,n.Mc="function"==typeof o,f.a.Ba||f.a.extend(n,f.R.fn),f.R.fn.ob(n),f.a.zb(n,b),r.pure?(a.vb=!0,a.G=!0,f.a.extend(n,S)):r.deferEvaluation&&f.a.extend(n,T),f.options.deferUpdates&&f.Ta.deferred(n,!0),a.l&&(a.hc=!0,a.l.nodeType||(a.l=null)),a.G||r.deferEvaluation||n.ha(),a.l&&n.ja()&&f.a.I.za(a.l,a.Qb=function(){n.s()}),n};var b={equalityComparer:l,pa:function(){return this[C].V},Va:function(){var e=[];return f.a.O(this[C].F,function(t,i){e[i.La]=i.da}),e},Ub:function(e){if(!this[C].V)return!1;var t=this.Va();return-1!==f.a.A(t,e)||!!f.a.Lb(t,function(t){return t.Ub&&t.Ub(e)})},tc:function(e,t,i){if(this[C].vb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[C].F[e]=i,i.La=this[C].V++,i.Ma=t.mb()},Xa:function(){var e,t,i=this[C].F;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&(t=i[e],this.Ja&&t.da.Ka||t.da.Cd(t.Ma)))return!0},Id:function(){this.Ja&&!this[C].pb&&this.Ja(!1)},ja:function(){var e=this[C];return e.ka||0<e.V},Qd:function(){this.Ka?this[C].ka&&(this[C].ra=!0):this.Gc()},Zc:function(e){if(e.Hb){var t=e.subscribe(this.Id,this,"dirty"),i=e.subscribe(this.Qd,this);return{da:e,s:function(){t.s(),i.s()}}}return e.subscribe(this.Gc,this)},Gc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[C].Hc),this[C].Hc=f.a.setTimeout(function(){e.ha(!0)},t)):e.Ja?e.Ja(!0):e.ha(!0)},ha:function(e){var t=this[C],i=t.Sa,r=!1;if(!t.pb&&!t.qa){if(t.l&&!f.a.Rb(t.l)||i&&i()){if(!t.hc)return void this.s()}else t.hc=!1;t.pb=!0;try{r=this.yd(e)}finally{t.pb=!1}return r}},yd:function(t){var i=this[C],r=!1,n=i.vb?e:!i.V,r={pd:this,kb:i.F,Pb:i.V};f.v.wc({od:r,nd:p,o:this,rb:n}),i.F={},i.V=0;var o=this.xd(i,r);return i.V?r=this.qb(i.X,o):(this.s(),r=!0),r&&(i.G?this.Gb():this.notifySubscribers(i.X,"beforeChange"),i.X=o,this.notifySubscribers(i.X,"spectate"),!i.G&&t&&this.notifySubscribers(i.X),this.qc&&this.qc()),n&&this.notifySubscribers(i.X,"awake"),r},xd:function(e,t){try{var i=e.Vc;return e.lb?i.call(e.lb):i()}finally{f.v.end(),t.Pb&&!e.G&&f.a.O(t.kb,h),e.ra=e.ka=!1}},w:function(e){var t=this[C];return(t.ka&&(e||!t.V)||t.G&&this.Xa())&&this.ha(),t.X},tb:function(e){f.R.fn.tb.call(this,e),this.mc=function(){return this[C].G||(this[C].ra?this.ha():this[C].ka=!1),this[C].X},this.Ja=function(e){this.oc(this[C].X),this[C].ka=!0,e&&(this[C].ra=!0),this.pc(this,!e)}},s:function(){var t=this[C];!t.G&&t.F&&f.a.O(t.F,function(e,t){t.s&&t.s()}),t.l&&t.Qb&&f.a.I.xb(t.l,t.Qb),t.F=e,t.V=0,t.qa=!0,t.ra=!1,t.ka=!1,t.G=!1,t.l=e,t.Sa=e,t.Vc=e,this.Mc||(t.lb=e)}},S={Qa:function(e){var t=this,i=t[C];if(!i.qa&&i.G&&"change"==e){if(i.G=!1,i.ra||t.Xa())i.F=null,i.V=0,t.ha()&&t.Gb();else{var r=[];f.a.O(i.F,function(e,t){r[t.La]=e}),f.a.C(r,function(e,r){var n=i.F[e],o=t.Zc(n.da);o.La=r,o.Ma=n.Ma,i.F[e]=o}),t.Xa()&&t.ha()&&t.Gb()}i.qa||t.notifySubscribers(i.X,"awake")}},cb:function(t){var i=this[C];i.qa||"change"!=t||this.Wa("change")||(f.a.O(i.F,function(e,t){t.s&&(i.F[e]={da:t.da,La:t.La,Ma:t.Ma},t.s())}),i.G=!0,this.notifySubscribers(e,"asleep"))},mb:function(){var e=this[C];return e.G&&(e.ra||this.Xa())&&this.ha(),f.R.fn.mb.call(this)}},T={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.w()}};f.a.Ba&&f.a.setPrototypeOf(b,f.R.fn);var E=f.sa.Na;b[E]=f.o,f.Nc=function(e){return"function"==typeof e&&e[E]===b[E]},f.Ed=function(e){return f.Nc(e)&&e[C]&&e[C].vb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Nc),f.b("isPureComputed",f.Ed),f.b("computed.fn",b),f.J(b,"peek",b.w),f.J(b,"dispose",b.s),f.J(b,"isActive",b.ja),f.J(b,"getDependenciesCount",b.pa),f.J(b,"getDependencies",b.Va),f.wb=function(e,t){return"function"==typeof e?f.o(e,t,{pure:!0}):(e=f.a.extend({},e),e.pure=!0,f.o(e,t))},f.b("pureComputed",f.wb),function(){function t(n,o,a){if(a=a||new r,"object"!=typeof(n=o(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.values=[]}f.$c=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;f.N(e)&&10>t;t++)e=e();return e})},f.toJSON=function(e,t,i){return e=f.$c(e),f.a.fc(e,t,i)},r.prototype={constructor:r,save:function(e,t){var i=f.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(t){return t=f.a.A(this.keys,t),0<=t?this.values[t]:e}}}(),f.b("toJS",f.$c),f.b("toJSON",f.toJSON),f.Vd=function(e,t,i){function r(t){var r=f.wb(e,i).extend({Ga:"always"}),n=r.subscribe(function(e){e&&(n.s(),t(e))});return r.notifySubscribers(r.w()),n}return"function"!=typeof Promise||t?r(t.bind(i)):new Promise(r)},f.b("when",f.Vd),function(){f.u={L:function(t){switch(f.a.P(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?f.a.g.get(t,f.f.options.Yb):7>=f.a.W?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?f.u.L(t.options[t.selectedIndex]):e;default:return t.value}},ya:function(t,i,r){switch(f.a.P(t)){case"option":"string"==typeof i?(f.a.g.set(t,f.f.options.Yb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i):(f.a.g.set(t,f.f.options.Yb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:"");break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if((n=f.u.L(t.options[a]))==i||""===n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o,6===f.a.W&&f.a.setTimeout(function(){t.selectedIndex=o},0));break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),f.b("selectExtensions",f.u),f.b("selectExtensions.readValue",f.u.L),f.b("selectExtensions.writeValue",f.u.ya),f.m=function(){function e(e){e=f.a.Cb(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1)),e+="\n,";var t,i=[],a=e.match(r),s=[],l=0;if(1<a.length){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{if(47===d&&1<u.length&&(47===u.charCodeAt(1)||42===u.charCodeAt(1)))continue;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),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)}if(0<l)throw Error("Unbalanced parentheses, braces, or brackets")}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{Ra:[],va:a,Zb:e,ub:function(r,n){function o(e,r){var n;if(!c){var d=f.getBindingHandler(e);if(d&&d.preprocess&&!(r=d.preprocess(r,e,o)))return;(d=a[e])&&(n=r,0<=f.a.A(t,n)?n=!1:(d=n.match(i),n=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:n)),d=n),d&&l.push("'"+("string"==typeof a[e]?a[e]: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 f.a.C(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},Hd:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},$a:function(e,t,i,r,n){e&&f.N(e)?!f.Ya(e)||n&&e.w()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.Zb),f.b("expressionRewriting.preProcessBindings",f.m.ub),f.b("expressionRewriting._twoWayBindings",f.m.va),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.ub),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)&&(f.a.g.set(n,u,!0),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&&"\x3c!--test--\x3e"===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},u="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(t){return e(t)?r(t):t.childNodes},Ea:function(t){if(e(t)){t=f.h.childNodes(t);for(var i=0,r=t.length;i<r;i++)f.removeNode(t[i])}else f.a.Sb(t)},ua:function(t,i){if(e(t)){f.h.Ea(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else f.a.ua(t,i)},Uc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},Vb:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):f.h.Uc(t,i)},firstChild:function(i){if(e(i))return!i.nextSibling||t(i.nextSibling)?null:i.nextSibling;if(i.firstChild&&t(i.firstChild))throw Error("Found invalid end comment, as the first child of "+i);return i.firstChild},nextSibling:function(i){if(e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)){var r=i.nextSibling;if(t(r)&&!f.a.g.get(r,u))throw Error("Found end comment without a matching opening comment, as child of "+i);return null}return i.nextSibling},Bd:e,Ud:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Rc:function(i){if(l[f.a.P(i)]){var r=i.firstChild;if(r)do{if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do{if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o])}while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}}while(r=r.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Vb),f.b("virtualElements.prepend",f.h.Uc),f.b("virtualElements.setDomNodeChildren",f.h.ua),function(){f.ga=function(){this.md={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||f.i.getComponentNameForNode(e);case 8:return f.h.Bd(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return f.i.sc(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return f.i.sc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return f.h.Ud(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.md,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+f.m.ub(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function r(e){var t=(e=f.a.g.get(e,S))&&e.M;t&&(e.M=null,t.Sc())}function o(e,t,i){this.node=e,this.xc=t,this.ib=[],this.T=!1,t.M||f.a.I.za(e,r),i&&i.M&&(i.M.ib.push(e),this.Kb=i)}function a(e){return function(){return e}}function s(e){return e()}function l(e){return f.a.Ha(f.v.K(e),function(t,i){return function(){return e()[i]}})}function u(e,t,i){return"function"==typeof e?l(e.bind(null,t,i)):f.a.Ha(e,a)}function c(e,t){return l(this.getBindings.bind(this,e,t))}function d(e,t){var i=f.h.firstChild(t);if(i){var r,n=f.ga.instance,o=n.preprocessNode;if(o){for(;r=i;)i=f.h.nextSibling(r),o.call(n,r);i=f.h.firstChild(t)}for(;r=i;)i=f.h.nextSibling(r),h(e,r)}f.j.Ga(t,f.j.T)}function h(e,t){var i=e,r=1===t.nodeType;r&&f.h.Rc(t),(r||f.ga.instance.nodeHasBindings(t))&&(i=m(t,null,e).bindingContextForDescendants),i&&!C[f.a.P(t)]&&d(i,t)}function p(e){var t=[],i={},r=[];return f.a.O(e,function n(o){if(!i[o]){var a=f.getBindingHandler(o);a&&(a.after&&(r.push(o),f.a.C(a.after,function(t){if(e[t]){if(-1!==f.a.A(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,Lc:a})),i[o]=!0}}),t}function m(t,i,r){var n=f.a.g.Tb(t,S,{}),o=n.gd;if(!i){if(o)throw Error("You cannot apply bindings multiple times to the same element.");n.gd=!0}o||(n.context=r);var a;if(i&&"function"!=typeof i)a=i;else{var l=f.ga.instance,u=l.getBindingAccessors||c,d=f.$(function(){return(a=i?i(r,t):u.call(l,t,r))&&(r[g]&&r[g](),r[y]&&r[y]()),a},null,{l:t});a&&d.ja()||(d=null)}var h,m=r;if(a){var _=function(){return f.a.Ha(d?d():a,s)},v=d?function(e){return function(){return s(d()[e])}}:function(e){return a[e]};_.get=function(e){return a[e]&&s(v(e))},_.has=function(e){return e in a},f.j.T in a&&f.j.subscribe(t,f.j.T,function(){var e=(0,a[f.j.T])();if(e){var i=f.h.childNodes(t);i.length&&e(i,f.Dc(i[0]))}}),f.j.oa in a&&(m=f.j.Bb(t,r),f.j.subscribe(t,f.j.oa,function(){var e=(0,a[f.j.oa])();e&&f.h.firstChild(t)&&e(t)})),n=p(a),f.a.C(n,function(i){var r=i.Lc.init,n=i.Lc.update,o=i.key;if(8===t.nodeType&&!f.h.ea[o])throw Error("The binding '"+o+"' cannot be used with virtual elements");try{"function"==typeof r&&f.v.K(function(){var i=r(t,v(o),_,m.$data,m);if(i&&i.controlsDescendantBindings){if(h!==e)throw Error("Multiple bindings ("+h+" and "+o+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");h=o}}),"function"==typeof n&&f.$(function(){n(t,v(o),_,m.$data,m)},null,{l:t})}catch(e){throw e.message='Unable to process binding "'+o+": "+a[o]+'"\nMessage: '+e.message,e}})}return n=h===e,{shouldBindDescendants:n,bindingContextForDescendants:n&&m}}function _(t,i){return t&&t instanceof f.fa?t:new f.fa(t,e,e,i)}var g=f.a.Da("_subscribable"),v=f.a.Da("_ancestorBindingInfo"),y=f.a.Da("_dataDependency");f.f={};var C={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(e){return f.f[e]};var b={};f.fa=function(t,i,r,n,o){function a(){var e=d?c():c,t=f.a.c(e);return i?(f.a.extend(l,i),v in i&&(l[v]=i[v])):(l.$parents=[],l.$root=t,l.ko=f),l[g]=s,u?t=l.$data:(l.$rawData=e,l.$data=t),r&&(l[r]=t),n&&n(l,i,t),i&&i[g]&&!f.U.o().Ub(i[g])&&i[g](),h&&(l[y]=h),l.$data}var s,l=this,u=t===b,c=u?e:t,d="function"==typeof c&&!f.N(c),h=o&&o.dataDependency;o&&o.exportDependencies?a():(s=f.wb(a),s.w(),s.ja()?s.equalityComparer=null:l[g]=e)},f.fa.prototype.createChildContext=function(e,t,i,r){if(!r&&t&&"object"==typeof t&&(r=t,t=r.as,i=r.extend),t&&r&&r.noChildContext){var n="function"==typeof e&&!f.N(e);return new f.fa(b,this,null,function(r){i&&i(r),r[t]=n?e():e},r)}return new f.fa(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)},r)},f.fa.prototype.extend=function(e,t){return new f.fa(b,this,null,function(t){f.a.extend(t,"function"==typeof e?e(t):e)},t)};var S=f.a.g.Z();o.prototype.Sc=function(){this.Kb&&this.Kb.M&&this.Kb.M.rd(this.node)},o.prototype.rd=function(e){f.a.hb(this.ib,e),!this.ib.length&&this.T&&this.Bc()},o.prototype.Bc=function(){this.T=!0,this.xc.M&&!this.ib.length&&(this.xc.M=null,f.a.I.xb(this.node,r),f.j.Ga(this.node,f.j.oa),this.Sc())},f.j={T:"childrenComplete",oa:"descendantsComplete",subscribe:function(e,t,i,r){return e=f.a.g.Tb(e,S,{}),e.Fa||(e.Fa=new f.R),e.Fa.subscribe(i,r,t)},Ga:function(t,i){var r=f.a.g.get(t,S);if(r&&(r.Fa&&r.Fa.notifySubscribers(t,i),i==f.j.T))if(r.M)r.M.Bc();else if(r.M===e&&r.Fa&&r.Fa.Wa(f.j.oa))throw Error("descendantsComplete event not supported for bindings on this node")},Bb:function(e,t){var i=f.a.g.Tb(e,S,{});return i.M||(i.M=new o(e,i,t[v])),t[v]==i?t:t.extend(function(e){e[v]=i})}},f.Sd=function(e){return(e=f.a.g.get(e,S))&&e.context},f.eb=function(e,t,i){return 1===e.nodeType&&f.h.Rc(e),m(e,t,_(i))},f.kd=function(e,t,i){return i=_(i),f.eb(e,u(t,i,e),i)},f.Pa=function(e,t){1!==t.nodeType&&8!==t.nodeType||d(_(e),t)},f.uc=function(e,r,o){if(!n&&t.jQuery&&(n=t.jQuery),2>arguments.length){if(!(r=i.body))throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!r||1!==r.nodeType&&8!==r.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");h(_(e,o),r)},f.Cc=function(t){return!t||1!==t.nodeType&&8!==t.nodeType?e:f.Sd(t)},f.Dc=function(t){return(t=f.Cc(t))?t.$data:e},f.b("bindingHandlers",f.f),f.b("bindingEvent",f.j),f.b("bindingEvent.subscribe",f.j.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.j.Bb),f.b("applyBindings",f.uc),f.b("applyBindingsToDescendants",f.Pa),f.b("applyBindingAccessorsToNode",f.eb),f.b("applyBindingsToNode",f.kd),f.b("contextFor",f.Cc),f.b("dataFor",f.Dc)}(),function(e){function t(t,r){var a,s=Object.prototype.hasOwnProperty.call(n,t)?n[t]:e;s?s.subscribe(r):(s=n[t]=new f.R,s.subscribe(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Fd:r},delete n[t],a||r?s.notifySubscribers(e):f.ma.yb(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=f.i.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};f.i={get:function(i,r){var n=Object.prototype.hasOwnProperty.call(o,i)?o[i]:e;n?n.Fd?f.v.K(function(){r(n.definition)}):f.ma.yb(function(){r(n.definition)}):t(i,r)},Ac:function(e){delete o[e]},nc:r},f.i.loaders=[],f.b("components",f.i),f.b("components.get",f.i.get),f.b("components.clearCachedDefinition",f.i.Ac)}(),function(){function e(e,t,i,r){function n(){0==--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){f.i.nc("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){f.i.nc("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(f.a.P(e)){case"script":return f.a.ta(e.text);case"textarea":return f.a.ta(e.value);case"template":if(o(e.content))return f.a.Ca(e.content.childNodes)}return f.a.Ca(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};f.i.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(f.i.sb(e))throw Error("Component "+e+" is already registered");u[e]=t},f.i.sb=function(e){return Object.prototype.hasOwnProperty.call(u,e)},f.i.unregister=function(e){delete u[e],f.i.Ac(e)},f.i.Ec={getConfig:function(e,t){t(f.i.sb(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(f.a.ta(r));else if(r instanceof Array)a(r);else if(o(r))a(f.a.la(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";f.b("components.register",f.i.register),f.b("components.isRegistered",f.i.sb),f.b("components.unregister",f.i.unregister),f.b("components.defaultLoader",f.i.Ec),f.i.loaders.push(f.i.Ec),f.i.cd=u}(),function(){function e(e,i){var r=e.getAttribute("params")
- ;if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=f.a.Ha(r,function(t){return f.o(t,null,{l:e})}),n=f.a.Ha(r,function(t){var i=t.w();return t.ja()?f.o({read:function(){return f.a.c(t())},write:f.Ya(i)&&function(e){t()(e)},l:e}):i});return Object.prototype.hasOwnProperty.call(n,"$raw")||(n.$raw=r),n}return{$raw:{}}}f.i.getComponentNameForNode=function(e){var t=f.a.P(e);if(f.i.sb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=f.a.W&&e.tagName===t))return t},f.i.sc=function(t,i,r,n){if(1===i.nodeType){var o=f.i.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new f.ga;9>f.a.W&&(f.i.register=function(e){return function(t){return e.apply(this,arguments)}}(f.i.register),i.createDocumentFragment=function(e){return function(){var t,i=e(),r=f.i.cd;for(t in r);return i}}(i.createDocumentFragment))}(),function(){function e(e,t,i){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=f.a.Ca(t),f.h.ua(i,e)}function t(e,t,i){var r=e.createViewModel;return r?r.call(e,t,i):t}var i=0;f.f.component={init:function(r,n,o,a,s){function l(){var e=u&&u.dispose;"function"==typeof e&&e.call(u),d&&d.s(),c=u=d=null}var u,c,d,h=f.a.la(f.h.childNodes(r));return f.h.Ea(r),f.a.I.za(r,l),f.o(function(){var o,a,p=f.a.c(n());if("string"==typeof p?o=p:(o=f.a.c(p.name),a=f.a.c(p.params)),!o)throw Error("No component name specified");var m=f.j.Bb(r,s),_=c=++i;f.i.get(o,function(i){if(c===_){if(l(),!i)throw Error("Unknown component '"+o+"'");e(o,i,r);var n=t(i,a,{element:r,templateNodes:h});i=m.createChildContext(n,{extend:function(e){e.$component=n,e.$componentTemplateNodes=h}}),n&&n.koDescendantsComplete&&(d=f.j.subscribe(r,f.j.oa,n.koDescendantsComplete,n)),u=n,f.Pa(i,r)}})},null,{l:r}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var A={class:"className",for:"htmlFor"};f.f.attr={update:function(t,i){var r=f.a.c(i())||{};f.a.O(r,function(i,r){r=f.a.c(r);var n=i.indexOf(":"),n="lookupNamespaceURI"in t&&0<n&&t.lookupNamespaceURI(i.substr(0,n)),o=!1===r||null===r||r===e;o?n?t.removeAttributeNS(n,i):t.removeAttribute(i):r=r.toString(),8>=f.a.W&&i in A?(i=A[i],o?t.removeAttribute(i):t[i]=r):o||(n?t.setAttributeNS(n,i,r):t.setAttribute(i,r)),"name"===i&&f.a.Xc(t,o?"":r)})}},function(){f.f.checked={after:["value","attr"],init:function(t,i,r){function n(){var n=t.checked,o=a();if(!f.U.rb()&&(n||!l&&!f.U.pa())){var u=f.v.K(i);if(c){var h=d?u.w():u,m=p;p=o,m!==o?n&&(f.a.Oa(h,o,!0),f.a.Oa(h,m,!1)):f.a.Oa(h,o,n),d&&f.Ya(u)&&u(h)}else s&&(o===e?o=n:n||(o=e)),f.m.$a(u,r,"checked",o,!0)}}function o(){var r=f.a.c(i()),n=a();c?(t.checked=0<=f.a.A(r,n),p=n):t.checked=s&&n===e?!!r:a()===r}var a=f.wb(function(){return r.has("checkedValue")?f.a.c(r.get("checkedValue")):h?r.has("value")?f.a.c(r.get("value")):t.value:void 0}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&f.a.c(u)instanceof Array,d=!(c&&u.push&&u.splice),h=l||c,p=c?a():e;l&&!t.name&&f.f.uniqueName.init(t,function(){return!0}),f.o(n,null,{l:t}),f.a.H(t,"click",n),f.o(o,null,{l:t}),u=e}}},f.m.va.checked=!0,f.f.checkedValue={update:function(e,t){e.value=f.a.c(t())}}}(),f.f.class={update:function(e,t){var i=f.a.Cb(f.a.c(t()));f.a.Eb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,f.a.Eb(e,i,!0)}},f.f.css={update:function(e,t){var i=f.a.c(t());null!==i&&"object"==typeof i?f.a.O(i,function(t,i){i=f.a.c(i),f.a.Eb(e,t,i)}):f.f.class.update(e,t)}},f.f.enable={update:function(e,t){var i=f.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},f.f.disable={update:function(e,t){f.f.enable.update(e,function(){return!f.a.c(t())})}},f.f.event={init:function(e,t,i,r,n){var o=t()||{};f.a.O(o,function(o){"string"==typeof o&&f.a.H(e,o,function(e){var a,s=t()[o];if(s){try{var l=f.a.la(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},f.f.foreach={Qc:function(e){return function(){var t=e(),i=f.a.$b(t);return i&&"number"!=typeof i.length?(f.a.c(t),{foreach:i.data,as:i.as,noChildContext:i.noChildContext,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:f.ba.Na}):{foreach:t,templateEngine:f.ba.Na}}},init:function(e,t){return f.f.template.init(e,f.f.foreach.Qc(t))},update:function(e,t,i,r,n){return f.f.template.update(e,f.f.foreach.Qc(t),i,r,n)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.f.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),f.m.$a(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);f.a.H(e,"focus",n),f.a.H(e,"focusin",n),f.a.H(e,"blur",o),f.a.H(e,"focusout",o),e.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!f.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),f.v.K(f.a.Fb,null,[e,i?"focusin":"focusout"]))}},f.m.va.hasfocus=!0,f.f.hasFocus=f.f.hasfocus,f.m.va.hasFocus="hasfocus",f.f.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.dc(e,t())}},function(){function e(e,t,i){f.f[e]={init:function(e,r,n,o,a){var s,l,u,c,d,h={};if(t){o=n.get("as");var p=n.get("noChildContext");d=!(o&&p),h={as:o,noChildContext:p,exportDependencies:d}}return c=(u="render"==n.get("completeOn"))||n.has(f.j.oa),f.o(function(){var n,o=f.a.c(r()),p=!i!=!o,m=!l;(d||p!==s)&&(c&&(a=f.j.Bb(e,a)),p&&(t&&!d||(h.dataDependency=f.U.o()),n=t?a.createChildContext("function"==typeof o?o:r,h):f.U.pa()?a.extend(null,h):a),m&&f.U.pa()&&(l=f.a.Ca(f.h.childNodes(e),!0)),p?(m||f.h.ua(e,f.a.Ca(l)),f.Pa(n,e)):(f.h.Ea(e),u||f.j.Ga(e,f.j.T)),s=p)},null,{l:e}),{controlsDescendantBindings:!0}}},f.m.Ra[e]=!1,f.h.ea[e]=!0}e("if"),e("ifnot",!1,!0),e("with",!0)}(),f.f.let={init:function(e,t,i,r,n){return t=n.extend(t),f.Pa(t,e),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var w={};f.f.options={init:function(e){if("select"!==f.a.P(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return f.a.fb(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(m&&c)f.u.ya(t,f.a.c(r.get("value")),!0);else if(p.length){var n=0<=f.a.A(p,f.u.L(i[0]));f.a.Yc(i[0],n),m&&!n&&f.v.K(f.a.Fb,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=f.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),d=r.get("optionsIncludeDestroyed");i={};var h,p=[];c||(s?p=f.a.Mb(n(),f.u.L):0<=t.selectedIndex&&p.push(f.u.L(t.options[t.selectedIndex]))),u&&(void 0===u.length&&(u=[u]),h=f.a.fb(u,function(t){return d||t===e||null===t||!f.a.c(t._destroy)}),r.has("optionsCaption")&&null!==(u=f.a.c(r.get("optionsCaption")))&&u!==e&&h.unshift(w));var m=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),f.v.K(r.get("optionsAfterRender"),null,[i[0],t!==w?t:e])}),f.a.cc(t,h,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[f.u.L(a[0])]:[],m=!0),n=t.ownerDocument.createElement("option"),i===w?(f.a.Ab(n,r.get("optionsCaption")),f.u.ya(n,e)):(a=o(i,r.get("optionsValue"),i),f.u.ya(n,f.a.c(a)),i=o(i,r.get("optionsText"),a),f.a.Ab(n,i)),[n]},i,u),f.v.K(function(){if(c)f.u.ya(t,f.a.c(r.get("value")),!0);else{var e;e=s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?f.u.L(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex,e&&f.a.Fb(t,"change")}}),f.a.vd(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},f.f.options.Yb=f.a.g.Z(),f.f.selectedOptions={after:["options","foreach"],init:function(e,t,i){f.a.H(e,"change",function(){var r=t(),n=[];f.a.C(e.getElementsByTagName("option"),function(e){e.selected&&n.push(f.u.L(e))}),f.m.$a(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=f.a.P(e))throw Error("values binding applies only to SELECT elements");var i=f.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&f.a.C(e.getElementsByTagName("option"),function(e){var t=0<=f.a.A(i,f.u.L(e));e.selected!=t&&f.a.Yc(e,t)}),e.scrollTop=r}},f.m.va.selectedOptions=!0,f.f.style={update:function(t,i){var r=f.a.c(i()||{});f.a.O(r,function(i,r){if(r=f.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),n)n(t).css(i,r);else if(/^--/.test(i))t.style.setProperty(i,r);else{i=i.replace(/-(\w)/g,function(e,t){return t.toUpperCase()});var o=t.style[i];t.style[i]=r,r===o||t.style[i]!=o||isNaN(r)||(t.style[i]=r+"px")}})}},f.f.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");f.a.H(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},f.f.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Ab(e,t())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var i,r,n,o,a,s=function(e){if(e)return parseFloat(e[1])},l=t.navigator.userAgent;(i=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(a=s(l.match(/Edge\/([^ ]+)$/)))||s(l.match(/Chrome\/([^ ]+)/))||(r=s(l.match(/Version\/([^ ]+) Safari/)))||(n=s(l.match(/Firefox\/([^ ]+)/)))||(o=f.a.W||s(l.match(/MSIE ([^ ]+)/)))||(o=s(l.match(/rv:([^ )]+)/)))}if(8<=o&&10>o)var u=f.a.g.Z(),c=f.a.g.Z(),d=function(e){var t=this.activeElement;(t=t&&f.a.g.get(t,c))&&t(e)},h=function(e,t){var i=e.ownerDocument;f.a.g.get(i,u)||(f.a.g.set(i,u,!0),f.a.H(i,"selectionchange",d)),f.a.g.set(e,c,t)};f.f.textInput={init:function(t,s,l){function u(e,i){f.a.H(t,e,i)}function c(){var i=f.a.c(s());null!==i&&i!==e||(i=""),_!==e&&i===_?f.a.setTimeout(c,4):t.value!==i&&(y=!0,t.value=i,y=!1,g=t.value)}function d(){m||(_=t.value,m=f.a.setTimeout(p,4))}function p(){clearTimeout(m),_=m=e;var i=t.value;g!==i&&(g=i,f.m.$a(s(),l,"textInput",i))}var m,_,g=t.value,v=9==f.a.W?d:p,y=!1;o&&u("keypress",p),11>o&&u("propertychange",function(e){y||"value"!==e.propertyName||v(e)}),8==o&&(u("keyup",p),u("keydown",p)),h&&(h(t,v),u("dragend",d)),(!o||9<=o)&&u("input",v),5>r&&"textarea"===f.a.P(t)?(u("keydown",d),u("paste",d),u("cut",d)):11>i?u("keydown",d):4>n?(u("DOMAutoComplete",p),u("dragdrop",p),u("drop",p)):a&&"number"===t.type&&u("keydown",d),u("change",p),u("blur",p),f.o(c,null,{l:t})}},f.m.va.textInput=!0,f.f.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),f.f.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++f.f.uniqueName.qd;f.a.Xc(e,i)}}},f.f.uniqueName.qd=0,f.f.using={init:function(e,t,i,r,n){var o;return i.has("as")&&(o={as:i.get("as"),noChildContext:i.get("noChildContext")}),t=n.createChildContext(t,o),f.Pa(t,e),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.f.value={after:["options","foreach"],init:function(t,i,r){var n=f.a.P(t),o="input"==n;if(!o||"checkbox"!=t.type&&"radio"!=t.type){var a=["change"],s=r.get("valueUpdate"),l=!1,u=null;s&&("string"==typeof s&&(s=[s]),f.a.gb(a,s),a=f.a.vc(a));var c=function(){u=null,l=!1;var e=i(),n=f.u.L(t);f.m.$a(e,r,"value",n)};!f.a.W||!o||"text"!=t.type||"off"==t.autocomplete||t.form&&"off"==t.form.autocomplete||-1!=f.a.A(a,"propertychange")||(f.a.H(t,"propertychange",function(){l=!0}),f.a.H(t,"focus",function(){l=!1}),f.a.H(t,"blur",function(){l&&c()})),f.a.C(a,function(e){var i=c;f.a.Td(e,"after")&&(i=function(){u=f.u.L(t),f.a.setTimeout(c,0)},e=e.substring(5)),f.a.H(t,e,i)});var d;d=o&&"file"==t.type?function(){var r=f.a.c(i());null===r||r===e||""===r?t.value="":f.v.K(c)}:function(){var o=f.a.c(i()),a=f.u.L(t);null!==u&&o===u?f.a.setTimeout(d,0):o===a&&a!==e||("select"===n?(a=r.get("valueAllowUnset"),f.u.ya(t,o,a),a||o===f.u.L(t)||f.v.K(c)):f.u.ya(t,o))},f.o(d,null,{l:t})}else f.eb(t,{checkedValue:i})},update:function(){}},f.m.va.value=!0,f.f.visible={update:function(e,t){var i=f.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},f.f.hidden={update:function(e,t){f.f.visible.update(e,function(){return!f.a.c(t())})}},function(e){f.f[e]={init:function(t,i,r,n,o){return f.f.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.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 f.B.D(r)}if(1==e.nodeType||8==e.nodeType)return new f.B.ia(e);throw Error("Unknown template type: "+e)},f.ca.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},f.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.ic=function(){function e(e,t,i,r){e=f.m.Zb(e);for(var n=f.m.Ra,o=0;o<e.length;o++){var a=e[o].key;if(Object.prototype.hasOwnProperty.call(n,a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.ub(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{wd:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return f.ic.Kd(e,t)},i)},Kd: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,"\x3c!-- ko --\x3e","#comment",n)})},ld:function(e,t){return f.aa.Wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&f.eb(n,e,r)})}}}(),f.b("__tr_ambtns",f.ic.ld),function(){f.B={},f.B.D=function(e){if(this.D=e){var t=f.a.P(e);this.Db="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},f.B.D.prototype.text=function(){var e=1===this.Db?"text":2===this.Db?"value":"innerHTML";if(0==arguments.length)return this.D[e];var t=arguments[0];"innerHTML"===e?f.a.dc(this.D,t):this.D[e]=t};var t=f.a.g.Z()+"_";f.B.D.prototype.data=function(e){if(1===arguments.length)return f.a.g.get(this.D,t+e);f.a.g.set(this.D,t+e,arguments[1])};var i=f.a.g.Z();f.B.D.prototype.nodes=function(){var t=this.D;if(0==arguments.length){var r=f.a.g.get(t,i)||{},n=r.jb||(3===this.Db?t.content:4===this.Db?t:e);return n&&!r.hd||(r=this.text())&&(n=f.a.Ld(r,t.ownerDocument),this.text(""),f.a.g.set(t,i,{jb:n,hd:!0})),n}f.a.g.set(t,i,{jb:arguments[0]})},f.B.ia=function(e){this.D=e},f.B.ia.prototype=new f.B.D,f.B.ia.prototype.constructor=f.B.ia,f.B.ia.prototype.text=function(){if(0==arguments.length){var t=f.a.g.get(this.D,i)||{};return t.jc===e&&t.jb&&(t.jc=t.jb.innerHTML),t.jc}f.a.g.set(this.D,i,{jc:arguments[0]})},f.b("templateSources",f.B),f.b("templateSources.domElement",f.B.D),f.b("templateSources.anonymousTemplate",f.B.ia)}(),function(){function t(e,t,i){var r;for(t=f.h.nextSibling(t);e&&(r=e)!==t;)e=f.h.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=f.ga.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),f.a.Ua(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.uc(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.aa.bd(e,[i])}),f.a.Ua(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(f.ic.wd(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":f.h.ua(e,n),l=!0;break;case"replaceNode":f.a.Wc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&f.v.K(s.afterRender,null,[n,o[s.as||"$data"]]),"replaceChildren"==t&&f.j.Ga(e,f.j.T)),n}function o(e,t,i){return f.N(e)?e():"function"==typeof e?e(t,i):e}var a;f.ec=function(t){if(t!=e&&!(t instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");a=t},f.bc=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return f.$(function(){var e=i&&i instanceof f.fa?i:new f.fa(i,null,null,null,{exportDependencies:!0}),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{Sa:function(){return!c||!f.a.Rb(c)},l:c&&"replaceNode"==u?c.parentNode:c})}return f.aa.Wb(function(e){f.bc(t,i,s,e,"replaceNode")})},f.Pd=function(t,r,a,s,l){function u(e,t){f.v.K(f.a.cc,null,[s,e,d,a,c,t]),f.j.Ga(s,f.j.T)}function c(e,t){i(t,h),a.afterRender&&a.afterRender(t,e),h=null}function d(e,i){h=l.createChildContext(e,{as:p,noChildContext:a.noChildContext,extend:function(e){e.$index=i,p&&(e[p+"Index"]=i)}});var r=o(t,e,h);return n(s,"ignoreTargetNode",r,h,a)}var h,p=a.as,m=!1===a.includeDestroyed||f.options.foreachHidesDestroyed&&!a.includeDestroyed;if(m||a.beforeRemove||!f.Oc(r))return f.$(function(){var t=f.a.c(r)||[];void 0===t.length&&(t=[t]),m&&(t=f.a.fb(t,function(t){return t===e||null===t||!f.a.c(t._destroy)})),u(t)},null,{l:s});u(r.w());var _=r.subscribe(function(e){u(r(),e)},null,"arrayChange");return _.l(s),_};var s=f.a.g.Z(),l=f.a.g.Z();f.f.template={init:function(e,t){var i=f.a.c(t());if("string"==typeof i||i.name)f.h.Ea(e);else if("nodes"in i){if(i=i.nodes||[],f.N(i))throw Error('The "nodes" option must be a plain, non-observable array.');var r=i[0]&&i[0].parentNode;r&&f.a.g.get(r,l)||(r=f.a.Xb(i),f.a.g.set(r,l,!0)),new f.B.ia(e).nodes(r)}else{if(i=f.h.childNodes(e),!(0<i.length))throw Error("Anonymous template defined, but no template content was provided");r=f.a.Xb(i),new f.B.ia(e).nodes(r)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a=i();i=f.a.c(a),r=!0,n=null,"string"==typeof i?i={}:(a=i.name,"if"in i&&(r=f.a.c(i.if)),r&&"ifnot"in i&&(r=!f.a.c(i.ifnot))),"foreach"in i?n=f.Pd(a||t,r&&i.foreach||[],i,t,o):r?(r=o,"data"in i&&(r=o.createChildContext(i.data,{as:i.as,noChildContext:i.noChildContext,exportDependencies:!0})),n=f.bc(a||t,r,i,t)):f.h.Ea(t),o=n,(i=f.a.g.get(t,s))&&"function"==typeof i.s&&i.s(),f.a.g.set(t,s,!o||o.ja&&!o.ja()?e:o)}},f.m.Ra.template=function(e){return e=f.m.Zb(e),1==e.length&&e[0].unknown||f.m.Hd(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.ec),f.b("renderTemplate",f.bc),f.a.Jc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},f.a.Ob=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,m=t.length,_=m-p||1,g=p+m+1;for(o=0;o<=p;o++)for(l=s,h.push(s=[]),u=c(m,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=m;o||a;)m=h[o][a]-1,a&&m===h[o][a-1]?d.push(c[c.length]={status:i,value:t[--a],index:a}):o&&m===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 f.a.Jc(_,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)}}(),f.b("utils.compareArrays",f.a.Ob),function(){function t(t,i,r,n,o){var a=[],s=f.$(function(){var e=i(r,o,f.a.Ua(a,t))||[];0<a.length&&(f.a.Wc(a,e),n&&f.v.K(n,null,[r,e,o])),a.length=0,f.a.gb(a,e)},null,{l:t,Sa:function(){return!f.a.jd(a)}});return{Y:a,$:s.ja()?s:e}}var i=f.a.g.Z(),r=f.a.g.Z();f.a.cc=function(n,o,a,s,l,u){function c(e){p={Aa:e,nb:f.sa(y++)},g.push(p),_||E.push(p)}function d(e){p=m[e],y!==p.nb.w()&&T.push(p),p.nb(y++),f.a.Ua(p.Y,n),g.push(p)}function h(e,t){if(e)for(var i=0,r=t.length;i<r;i++)f.a.C(t[i].Y,function(r){e(r,i,t[i].Aa)})}o=o||[],void 0===o.length&&(o=[o]),s=s||{};var p,m=f.a.g.get(n,i),_=!m,g=[],v=0,y=0,C=[],b=[],S=[],T=[],E=[],A=0;if(_)f.a.C(o,c);else{if(!u||m&&m._countWaitingForRemove){var w=f.a.Mb(m,function(e){return e.Aa});u=f.a.Ob(w,o,{dontLimitMoves:s.dontLimitMoves,sparse:!0})}for(var x,P,D,w=0;x=u[w];w++)switch(P=x.moved,D=x.index,x.status){case"deleted":for(;v<D;)d(v++);P===e&&(p=m[v],p.$&&(p.$.s(),p.$=e),f.a.Ua(p.Y,n).length&&(s.beforeRemove&&(g.push(p),A++,p.Aa===r?p=null:S.push(p)),p&&C.push.apply(C,p.Y))),v++;break;case"added":for(;y<D;)d(v++);P!==e?(b.push(g.length),d(P)):c(x.value)}for(;y<o.length;)d(v++);g._countWaitingForRemove=A}f.a.g.set(n,i,g),h(s.beforeMove,T),f.a.C(C,s.beforeRemove?f.na:f.removeNode);var I,M,R;try{R=n.ownerDocument.activeElement}catch(e){}if(b.length)for(;(w=b.shift())!=e;){for(p=g[w],I=e;w;)if((M=g[--w].Y)&&M.length){I=M[M.length-1];break}for(o=0;v=p.Y[o];I=v,o++)f.h.Vb(n,v,I)}for(w=0,b=f.h.firstChild(n);p=g[w];w++){for(p.Y||f.a.extend(p,t(n,a,p.Aa,l,p.nb)),o=0;v=p.Y[o];b=v.nextSibling,I=v,o++)v!==b&&f.h.Vb(n,v,I);!p.Dd&&l&&(l(p.Aa,p.Y,p.nb),p.Dd=!0,I=p.Y[p.Y.length-1])}for(R&&n.ownerDocument.activeElement!=R&&R.focus(),h(s.beforeRemove,S),w=0;w<S.length;++w)S[w].Aa=r;h(s.afterMove,T),h(s.afterAdd,E)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.cc),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>f.a.W?0:e.nodes)?e.nodes():null)?f.a.la(t.cloneNode(!0).childNodes):(e=e.text(),f.a.ta(e,r))},f.ba.Na=new f.ba,f.ec(f.ba.Na),f.b("nativeTemplateEngine",f.ba),function(){f.Za=function(){var e=this.Gd=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:"} "})},f.Za.prototype=new f.ca,f.Za.prototype.constructor=f.Za;var e=new f.Za;0<e.Gd&&f.ec(e),f.b("jqueryTmplTemplateEngine",f.Za)}()})}()}(),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){return o(e,i).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!0!==i.pause&&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";return{register:function(t){t.bindingHandlers.cesiumSvgPath={init:function(i,r){var n=document.createElementNS(e,"svg:svg");n.setAttribute("class","cesium-svgPath-svg");var o=document.createElementNS(e,"path");return n.appendChild(o),t.virtualElements.setDomNodeChildren(i,[n]),t.computed({read:function(){var e=t.unwrap(r());o.setAttribute("d",t.unwrap(e.path));var i=t.unwrap(e.width),a=t.unwrap(e.height);n.setAttribute("width",i),n.setAttribute("height",a),n.setAttribute("viewBox","0 0 "+i+" "+a),e.css&&n.setAttribute("class","cesium-svgPath-svg "+t.unwrap(e.css))},disposeWhenNodeIsRemoved:i}),{controlsDescendantBindings:!0}}},t.virtualElements.allowedBindings.cesiumSvgPath=!0}}}),define("ThirdParty/knockout",["./knockout-3.5.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),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/InspectorShared",["../Core/defined","../Core/Check"],function(e,t){"use strict";var i={};return i.createCheckbox=function(t,i,r){var n=document.createElement("div"),o=document.createElement("label"),a=document.createElement("input");a.type="checkbox";var s="checked: "+i;return e(r)&&(s+=", enable: "+r),a.setAttribute("data-bind",s),o.appendChild(a),o.appendChild(document.createTextNode(t)),n.appendChild(o),n},i.createSection=function(e,t,i,r){var n=document.createElement("div");n.className="cesium-cesiumInspector-section",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-section-collapsed": !'+i+" }"),e.appendChild(n);var o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind","click: "+r),n.appendChild(o);var a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",n.appendChild(a),a},i}),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/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/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){return l({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:""}]})}function p(e,t,i){return l({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:""}]})}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(A,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 b=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var T=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),E=document.createElementNS(v,"g");E.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),d.appendChild(E),d.appendChild(b),d.appendChild(_),E.appendChild(g),E.appendChild(C),E.appendChild(this._shuttleRingPointer),b.appendChild(this._knobOuter),b.appendChild(S),b.appendChild(this._knobDate),b.appendChild(this._knobTime),b.appendChild(this._knobStatus),b.appendChild(T),s.appendChild(d),e.appendChild(s);var A=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 w,x=this._knobTime.childNodes[0],P=this._knobDate.childNodes[0],D=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){w!==e&&(w=e,w?A._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):A._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(A._shuttleRingPointer,A._knobOuter,e)}),a(t,"dateLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"timeLabel",function(e){x.textContent!==e&&(x.textContent=e)}),a(t,"multiplierLabel",function(e){D.textContent!==e&&(D.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)"),b=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),T=e.fromCssColorString("rgba(255,255,255,0.086)"),E=e.fromCssColorString("rgba(255,255,255,0.267)"),A=e.fromCssColorString("rgba(255,255,255,0)"),w=e.fromCssColorString("rgba(66,67,68,0.3)"),x=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(){t(this._observer)&&(this._observer.disconnect(),this._observer=void 0);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 i=this._subscriptions,n=0,o=i.length;n<o;n++)i[n].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=e,n=t;0===e&&0===t?(r=200,n=132):0===e?(n=t,r=t/132*200):0===t&&(r=e,n=e/200*132);var o=r/200,a=n/132;i.style.cssText="width: "+r+"px; height: "+n+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",r),i.setAttribute("height",n),i.setAttribute("viewBox","0 0 "+r+" "+n),this._topG.setAttribute("transform","scale("+o+","+a+")"),this._centerX=Math.max(1,100*o),this._centerY=Math.max(1,100*a),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){if(!document.body.contains(this._container)){if(t(this._observer))return;var e=this;return e._observer=new MutationObserver(function(){document.body.contains(e._container)&&(e._observer.disconnect(),e._observer=void 0,e.applyThemeChanges())}),void e._observer.observe(document,{childList:!0,subtree:!0})}var i=s(this._themeNormal),r=s(this._themeHover),n=s(this._themeSelect),o=s(this._themeDisabled),a=s(this._themeKnob),u=s(this._themePointer),c=s(this._themeSwoosh),h=s(this._themeSwooshHover),p=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(i,C)},{tagName:"stop",offset:"12%","stop-color":d(i,b)},{tagName:"stop",offset:"46%","stop-color":d(i,S)},{tagName:"stop",offset:"81%","stop-color":d(i,T)}]},{id:"animation_buttonHovered",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,b)},{tagName:"stop",offset:"46%","stop-color":d(r,S)},{tagName:"stop",offset:"81%","stop-color":d(r,T)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(n,C)},{tagName:"stop",offset:"12%","stop-color":d(n,b)},{tagName:"stop",offset:"46%","stop-color":d(n,S)},{tagName:"stop",offset:"81%","stop-color":d(n,T)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(o,E)},{tagName:"stop",offset:"75%","stop-color":d(o,A)}]},{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":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_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":h.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":d(u,x)},{tagName:"stop",offset:"100%","stop-color":d(u,x)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(a,C)},{tagName:"stop",offset:"60%","stop-color":d(a,w)},{tagName:"stop",offset:"85%","stop-color":d(a,b)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(a,w)},{tagName:"stop",offset:"60%","stop-color":d(a,C)},{tagName:"stop",offset:"85%","stop-color":d(a,T)}]},{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(p,this._defsElement):this._svgNode.appendChild(p),this._defsElement=p},_}),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;return e>0?(i=Math.log(t[t.length-1]),r=(i-0)/(o-n),Math.exp(0+r*(e-n))):(i=Math.log(-t[0]),r=(i-0)/(o-n),-Math.exp(0+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;return e>0?(o=Math.log(n),a=(o-0)/(l-s),(Math.log(e)-0)/a+s):(o=Math.log(-t[0]),a=(o-0)/(l-s),-((Math.log(Math.abs(e))-0)/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;if(e.clockRange===t.UNBOUNDED)return!0;var i=e.systemTime;return a.greaterThanOrEquals(i,e.startTime)&&a.lessThanOrEquals(i,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)0!==(r=o[t])&&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"]);var c=a.getObservable(this,"imageryProviderViewModels"),d=a.pureComputed(function(){var e,i=c(),r={};for(e=0;e<i.length;e++){var n=i[e],o=n.category;t(r[o])?r[o].push(n):r[o]=[n]}var a=Object.keys(r),s=[];for(e=0;e<a.length;e++){var l=a[e];s.push({name:l,providers:r[l]})}return s});this._imageryProviders=d;var h=a.getObservable(this,"terrainProviderViewModels"),p=a.pureComputed(function(){var e,i=h(),r={};for(e=0;e<i.length;e++){var n=i[e],o=n.category;t(r[o])?r[o].push(n):r[o]=[n]}var a=Object.keys(r),s=[];for(e=0;e<a.length;e++){var l=a[e];s.push({name:l,providers:r[l]})}return s});this._terrainProviders=p,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;if(t(e))return e.iconUrl}),this.selectedImagery=void 0;var f=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return f()},set:function(e){if(f()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers,s=!1;for(i=0;i<n;i++)for(var l=a.length,u=0;u<l;u++){var c=a.get(u);if(c.imageryProvider===r[i]){a.remove(c),s=!0;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 if(this._currentImageryProviders=[d],s)a.addImageryProvider(d,0);else{var p=a.get(0);t(p)&&a.remove(p),a.addImageryProvider(d,0)}}f(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var m=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return m()},set:function(e){if(m()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,m(e),this.dropDownVisible=!1}});var _=this;this._toggleDropDown=s(function(){_.dropDownVisible=!_.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 }, visible: !!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-section",d.setAttribute("data-bind","foreach: _imageryProviders"),u.appendChild(d);var h=document.createElement("div");h.className="cesium-baseLayerPicker-category",d.appendChild(h);var p=document.createElement("div");p.className="cesium-baseLayerPicker-categoryTitle",p.setAttribute("data-bind","text: name"),h.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),h.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(m);var _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),m.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),m.appendChild(g);var v=document.createElement("div");v.className="cesium-baseLayerPicker-sectionTitle",v.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),v.innerHTML="Terrain",u.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),u.appendChild(y);var C=document.createElement("div");C.className="cesium-baseLayerPicker-category",y.appendChild(C);var b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),C.appendChild(b);var S=document.createElement("div");S.className="cesium-baseLayerPicker-choices",S.setAttribute("data-bind","foreach: providers"),C.appendChild(S);var T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),S.appendChild(T);var E=document.createElement("img")
- ;E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);var A=document.createElement("div");A.className="cesium-baseLayerPicker-itemLabel",A.setAttribute("data-bind","text: name"),T.appendChild(A),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/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o){"use strict";function a(i){var r=i.creationFunction;t(r.canExecute)||(r=o(r)),this._creationCommand=r,this.name=i.name,this.tooltip=i.tooltip,this.iconUrl=i.iconUrl,this._category=e(i.category,""),n.track(this,["name","tooltip","iconUrl"])}return i(a.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}}),a}),define("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/IonWorldImageryStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/createWorldImagery","../../Scene/IonImageryProvider","../../Scene/MapboxStyleImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){var u=[];return u.push(new l({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return o({style:i.AERIAL})}})),u.push(new l({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return o({style:i.AERIAL_WITH_LABELS})}})),u.push(new l({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return o({style:i.ROAD})}})),u.push(new l({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),category:"Other",creationFunction:function(){return new s({styleId:"satellite-v9"})}})),u.push(new l({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),category:"Other",creationFunction:function(){return new s({styleId:"satellite-streets-v11"})}})),u.push(new l({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),category:"Other",creationFunction:function(){return new s({styleId:"streets-v11"})}})),u.push(new l({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",category:"Other",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),u.push(new l({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",category:"Other",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),u.push(new l({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",category:"Other",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),u.push(new l({name:"OpenStreetMap",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",category:"Other",creationFunction:function(){return r({url:"https://a.tile.openstreetmap.org/"})}})),u.push(new l({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",category:"Other",creationFunction:function(){return r({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."})}})),u.push(new l({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return r({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."})}})),u.push(new l({name:"Sentinel-2",iconUrl:e("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return new a({assetId:3954})}})),u.push(new l({name:"Blue Marble",iconUrl:e("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new a({assetId:3845})}})),u.push(new l({name:"Earth at night",iconUrl:e("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return new a({assetId:3812})}})),u.push(new l({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",category:"Cesium ion",creationFunction:function(){return n({url:e("Assets/Textures/NaturalEarthII")})}})),u}return u}),define("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/createWorldTerrain","../../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",category:"Cesium ion",creationFunction:function(){return new i}})),n.push(new r({name:"Cesium World Terrain",iconUrl:e("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return t({requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),define("Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel",["../../Core/Check","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/Cesium3DTileColorBlendMode","../../Scene/Cesium3DTileFeature","../../Scene/Cesium3DTilePass","../../Scene/Cesium3DTileset","../../Scene/Cesium3DTileStyle","../../Scene/PerformanceDisplay","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){return function(t){var r=e._scene.pick(t.position);i(r)&&r.primitive instanceof c&&(e.tileset=r.primitive),e.pickActive=!1}}function m(e,t){t?e._eventHandler.setInputAction(function(t){var r=e._scene.pick(t.endPosition);i(r)&&r.primitive instanceof c&&(e.tileset=r.primitive)},a.MOUSE_MOVE):(e._eventHandler.removeInputAction(a.MOUSE_MOVE),e.picking=e.picking)}function _(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,C):Math.round(t).toLocaleString()}function g(e,t){if(!i(e))return"";var r=t?e._statisticsPerPass[u.PICK]:e._statisticsPerPass[u.RENDER],n='<ul class="cesium-cesiumInspector-statistics">';return n+="<li><strong>Visited: </strong>"+r.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+r.selected.toLocaleString()+"</li><li><strong>Commands: </strong>"+r.numberOfCommands.toLocaleString()+"</li>",n+="</ul>",t||(n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Requests: </strong>"+r.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+r.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+r.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+r.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+r.numberOfTilesTotal.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Features Selected: </strong>"+r.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+r.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+r.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+r.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+r.numberOfTrianglesSelected.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Tiles styled: </strong>"+r.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+r.numberOfFeaturesStyled.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Children Union Culled: </strong>"+r.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Geometry Memory (MB): </strong>"+_(r.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+_(r.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+_(r.batchTableByteLength)+"</li>",n+="</ul>"),n}function v(e,t){var r=this,n=e.canvas;this._eventHandler=new o(n),this._scene=e,this._performanceContainer=t,this._canvas=n,this._performanceDisplay=new h({container:t}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,p.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=p.observable({}),this.properties=[],p.defineProperty(this,"properties",function(){var e=[],t=r._properties();for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e});var u=p.observable();p.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return u()},set:function(e){u(e),i(r._tileset)&&(r._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var c=p.observable();p.defineProperty(this,"colorBlendMode",{get:function(){return c()},set:function(e){c(e),i(r._tileset)&&(r._tileset.colorBlendMode=e,r._scene.requestRender())}}),this.colorBlendMode=s.HIGHLIGHT;var d=p.observable();p.defineProperty(this,"picking",{get:function(){return d()},set:function(t){d(t),t?r._eventHandler.setInputAction(function(t){var n=e.pick(t.endPosition);if(n instanceof l?(r.feature=n,r.tile=n.content.tile):i(n)&&i(n.content)?(r.feature=void 0,r.tile=n.content.tile):(r.feature=void 0,r.tile=void 0),i(r._tileset)){if(S&&i(n)&&i(n.content)){var o;e.pickPositionSupported&&(o=e.pickPosition(t.endPosition),i(o)&&(r._tileset.debugPickPosition=o)),r._tileset.debugPickedTile=n.content.tile}else r._tileset.debugPickedTile=void 0;r._scene.requestRender()}},a.MOUSE_MOVE):(r.feature=void 0,r.tile=void 0,r._eventHandler.removeInputAction(a.MOUSE_MOVE))}}),this.picking=!0;var _=p.observable();p.defineProperty(this,"colorize",{get:function(){return _()},set:function(e){_(e),i(r._tileset)&&(r._tileset.debugColorizeTiles=e,r._scene.requestRender())}}),this.colorize=!1;var g=p.observable();p.defineProperty(this,"wireframe",{get:function(){return g()},set:function(e){g(e),i(r._tileset)&&(r._tileset.debugWireframe=e,r._scene.requestRender())}}),this.wireframe=!1;var v=p.observable();p.defineProperty(this,"showBoundingVolumes",{get:function(){return v()},set:function(e){v(e),i(r._tileset)&&(r._tileset.debugShowBoundingVolume=e,r._scene.requestRender())}}),this.showBoundingVolumes=!1;var y=p.observable();p.defineProperty(this,"showContentBoundingVolumes",{get:function(){return y()},set:function(e){y(e),i(r._tileset)&&(r._tileset.debugShowContentBoundingVolume=e,r._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var C=p.observable();p.defineProperty(this,"showRequestVolumes",{get:function(){return C()},set:function(e){C(e),i(r._tileset)&&(r._tileset.debugShowViewerRequestVolume=e,r._scene.requestRender())}}),this.showRequestVolumes=!1;var b=p.observable();p.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(e){b(e),i(r._tileset)&&(r._tileset.debugFreezeFrame=e,r._scene.debugShowFrustumPlanes=e,r._scene.requestRender())}}),this.freezeFrame=!1;var S=p.observable();p.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return S()},set:function(e){S(e),i(r._tileset)&&(r._tileset.debugPickedTileLabelOnly=e,r._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var T=p.observable();p.defineProperty(this,"showGeometricError",{get:function(){return T()},set:function(e){T(e),i(r._tileset)&&(r._tileset.debugShowGeometricError=e,r._scene.requestRender())}}),this.showGeometricError=!1;var E=p.observable();p.defineProperty(this,"showRenderingStatistics",{get:function(){return E()},set:function(e){E(e),i(r._tileset)&&(r._tileset.debugShowRenderingStatistics=e,r._scene.requestRender())}}),this.showRenderingStatistics=!1;var A=p.observable();p.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(e){A(e),i(r._tileset)&&(r._tileset.debugShowMemoryUsage=e,r._scene.requestRender())}}),this.showMemoryUsage=!1;var w=p.observable();p.defineProperty(this,"showUrl",{get:function(){return w()},set:function(e){w(e),i(r._tileset)&&(r._tileset.debugShowUrl=e,r._scene.requestRender())}}),this.showUrl=!1;var x=p.observable();p.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(e){e=Number(e),isNaN(e)||(x(e),i(r._tileset)&&(r._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var P=p.observable();p.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),i(r._tileset)&&(r._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,p.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(P(),1/6)},set:function(e){P(Math.pow(e,6))}});var D=p.observable();p.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),i(r._tileset)&&(r._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var I=f(this),M=p.observable();p.defineProperty(this,"pickActive",{get:function(){return M()},set:function(e){M(e),e?r._eventHandler.setInputAction(I,a.LEFT_CLICK):r._eventHandler.removeInputAction(a.LEFT_CLICK)}});var R=p.observable();p.defineProperty(this,"pointCloudShading",{get:function(){return R()},set:function(e){R(e),i(r._tileset)&&(r._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var O=p.observable();p.defineProperty(this,"geometricErrorScale",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),i(r._tileset)&&(r._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var L=p.observable();p.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(e){e=Number(e),isNaN(e)||(L(e),i(r._tileset)&&(r._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var N=p.observable();p.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(e){e=Number(e),isNaN(e)||(N(e),i(r._tileset)&&(r._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var F=p.observable();p.defineProperty(this,"eyeDomeLighting",{get:function(){return F()},set:function(e){F(e),i(r._tileset)&&(r._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var B=p.observable();p.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return B()},set:function(e){e=Number(e),isNaN(e)||(B(e),i(r._tileset)&&(r._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var k=p.observable();p.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return k()},set:function(e){e=Number(e),isNaN(e)||(k(e),i(r._tileset)&&(r._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var z=p.observable();p.defineProperty(this,"skipLevelOfDetail",{get:function(){return z()},set:function(e){z(e),i(r._tileset)&&(r._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var V=p.observable();p.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return V()},set:function(e){e=Number(e),isNaN(e)||(V(e),i(r._tileset)&&(r._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var U=p.observable();p.defineProperty(this,"baseScreenSpaceError",{get:function(){return U()},set:function(e){e=Number(e),isNaN(e)||(U(e),i(r._tileset)&&(r._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var G=p.observable();p.defineProperty(this,"skipLevels",{get:function(){return G()},set:function(e){e=Number(e),isNaN(e)||(G(e),i(r._tileset)&&(r._tileset.skipLevels=e))}}),this.skipLevels=1;var H=p.observable();p.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return H()},set:function(e){H(e),i(r._tileset)&&(r._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var W=p.observable();p.defineProperty(this,"loadSiblings",{get:function(){return W()},set:function(e){W(e),i(r._tileset)&&(r._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){r._update()}),i(this._tileset)||m(this,!0)}function y(e){if(e.featuresLength>0)return!0;var t=e.innerContents;if(i(t)){for(var r=t.length,n=0;n<r;++n)if(!y(t[n]))return!1;return!0}return!1}var C={maximumFractionDigits:3},b=[{text:"Highlight",value:s.HIGHLIGHT},{text:"Replace",value:s.REPLACE},{text:"Mix",value:s.MIX}],S=new t(1,1,0,.4),T=new t,E=new t;return r(v.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},colorBlendModes:{get:function(){return b}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,i(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var r=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=r.length,o=0;o<n;++o){var a=r[o];this[a]=this[a]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings;var s=e.pointCloudShading;this.pointCloudShading=s.attenuation,this.geometricErrorScale=s.geometricErrorScale,this.maximumAttenuation=s.maximumAttenuation?s.maximumAttenuation:0,this.baseResolution=s.baseResolution?s.baseResolution:0,this.eyeDomeLighting=s.eyeDomeLighting,this.eyeDomeLightingStrength=s.eyeDomeLightingStrength,this.eyeDomeLightingRadius=s.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=g(e,!1),this._pickStatisticsText=g(e,!0),m(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature!==e){var r=this._feature;i(r)&&!r.content.isDestroyed()&&(!this.colorize&&i(this._style)?r.color=i(this._style.color)?this._style.color.evaluateColor(r,T):t.WHITE:r.color=E,this._scene.requestRender()),i(e)&&(t.clone(e.color,E),e.color=S,this._scene.requestRender()),this._feature=e}}},tile:{get:function(){return this._tile},set:function(e){if(this._tile!==e){var r=this._tile;!i(r)||r.isDestroyed()||y(r.content)||(r.color=E,this._scene.requestRender()),i(e)&&!y(e.content)&&(t.clone(e.color,E),e.color=S,this._scene.requestRender()),this._tile=e}}}}),v.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},v.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},v.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},v.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},v.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},v.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},v.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},v.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},v.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},v.prototype.trimTilesCache=function(){i(this._tileset)&&this._tileset.trimLoadedTiles()},v.prototype.compileStyle=function(){var e=this._tileset;if(i(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new d(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},v.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var i,r=t.target,n=r.selectionStart,o=r.selectionEnd,a=o,s=r.value.slice(n,o),l=s.split("\n"),u=l.length;if(t.shiftKey)for(i=0;i<u;++i)" "===l[i][0]&&(" "===l[i][1]?(l[i]=l[i].substr(2),a-=2):(l[i]=l[i].substr(1),a-=1));else for(i=0;i<u;++i)l[i]=" "+l[i],a+=2;var c=l.join("\n");r.value=r.value.slice(0,n)+c+r.value.slice(o),r.selectionStart=n!==o?n:a,r.selectionEnd=a}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},v.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),i(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=g(e,!1),this._pickStatisticsText=g(e,!0))},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var e=this;return this._definedProperties.forEach(function(t){p.getObservable(e,t).dispose()}),n(this)},v.getStatistics=g,v}),define("Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector",["../../Core/Check","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../ThirdParty/knockout","../getElement","../InspectorShared","./Cesium3DTilesInspectorViewModel"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t){e=a(e);var i=document.createElement("div"),r=document.createElement("div");r.setAttribute("data-bind","visible: performance");var n=new l(t,r);this._viewModel=n,this._container=e,this._element=i;var u=document.createElement("div");u.textContent="3D Tiles Inspector",u.className="cesium-cesiumInspector-button",u.setAttribute("data-bind","click: toggleInspector"),i.appendChild(u),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(i);var h=document.createElement("div");this._panel=h,h.className="cesium-cesiumInspector-dropDown",i.appendChild(h);var p=s.createSection,f=s.createCheckbox,m=p(h,"Tileset","tilesetVisible","toggleTileset"),_=p(h,"Display","displayVisible","toggleDisplay"),g=p(h,"Update","updateVisible","toggleUpdate"),v=p(h,"Logging","loggingVisible","toggleLogging"),y=p(h,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),C=p(h,"Style","styleVisible","toggleStyle"),b=p(h,"Optimization","optimizationVisible","toggleOptimization"),S=document.createElement("div");S.className="field-group";var T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));var E=document.createElement("div");E.setAttribute("data-bind","text: properties"),S.appendChild(T),S.appendChild(E),m.appendChild(S),m.appendChild(d("togglePickTileset","Pick Tileset","pickActive")),m.appendChild(d("trimTilesCache","Trim Tiles Cache")),m.appendChild(f("Enable Picking","picking")),_.appendChild(f("Colorize","colorize")),_.appendChild(f("Wireframe","wireframe")),_.appendChild(f("Bounding Volumes","showBoundingVolumes")),_.appendChild(f("Content Volumes","showContentBoundingVolumes")),_.appendChild(f("Request Volumes","showRequestVolumes")),_.appendChild(f("Point Cloud Shading","pointCloudShading"));var A=document.createElement("div");A.setAttribute("data-bind","visible: pointCloudShading"),A.appendChild(c("geometricErrorScale",0,2,.01,"Geometric Error Scale")),A.appendChild(c("maximumAttenuation",0,32,1,"Maximum Attenuation")),A.appendChild(c("baseResolution",0,1,.01,"Base Resolution")),A.appendChild(f("Eye Dome Lighting (EDL)","eyeDomeLighting")),_.appendChild(A);var w=document.createElement("div");w.setAttribute("data-bind","visible: eyeDomeLighting"),w.appendChild(c("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),w.appendChild(c("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),A.appendChild(w),g.appendChild(f("Freeze Frame","freezeFrame")),g.appendChild(f("Dynamic Screen Space Error","dynamicScreenSpaceError"));var x=document.createElement("div");x.appendChild(c("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),g.appendChild(x);var P=document.createElement("div");P.setAttribute("data-bind","visible: dynamicScreenSpaceError"),P.appendChild(c("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),P.appendChild(c("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),g.appendChild(P),v.appendChild(f("Performance","performance")),v.appendChild(r),v.appendChild(f("Statistics","showStatistics"));var D=document.createElement("div");D.className="cesium-3dTilesInspector-statistics",D.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),v.appendChild(D),v.appendChild(f("Pick Statistics","showPickStatistics"));var I=document.createElement("div");I.className="cesium-3dTilesInspector-statistics",I.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),v.appendChild(I);var M=document.createElement("div");C.appendChild(M),M.appendChild(document.createTextNode("Color Blend Mode: "));var R=document.createElement("select");R.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),M.appendChild(R);var O=document.createElement("textarea")
- ;O.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),M.className="cesium-cesiumInspector-styleEditor",M.appendChild(O);var L=d("compileStyle","Compile (Ctrl+Enter)");M.appendChild(L);var N=document.createElement("div");N.className="cesium-cesiumInspector-error",N.setAttribute("data-bind","text: editorError"),M.appendChild(N),y.appendChild(f("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(f("Geometric Error","showGeometricError")),y.appendChild(f("Rendering Statistics","showRenderingStatistics")),y.appendChild(f("Memory Usage (MB)","showMemoryUsage")),y.appendChild(f("Url","showUrl")),b.appendChild(f("Skip Tile LODs","skipLevelOfDetail"));var F=document.createElement("div");F.appendChild(c("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),b.appendChild(F);var B=document.createElement("div");B.appendChild(c("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),b.appendChild(B);var k=document.createElement("div");k.appendChild(c("skipLevels",0,10,1,"Min. levels to skip")),b.appendChild(k),b.appendChild(f("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(f("Load siblings of visible tiles","loadSiblings")),o.applyBindings(n,i)}function c(e,i,r,n,o,a){a=t(a,e);var s=document.createElement("input");s.setAttribute("data-bind","value: "+a),s.type="number";var l=document.createElement("input");l.type="range",l.min=i,l.max=r,l.step=n,l.setAttribute("data-bind",'valueUpdate: "input", value: '+e);var u=document.createElement("div");u.appendChild(l);var c=document.createElement("div");return c.className="cesium-cesiumInspector-slider",c.appendChild(document.createTextNode(o)),c.appendChild(s),c.appendChild(u),c}function d(e,t,r){var n=document.createElement("button");n.type="button",n.textContent=t,n.className="cesium-cesiumInspector-pickButton";var o="click: "+e;return i(r)&&(o+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+r+"}"),n.setAttribute("data-bind",o),n}return r(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return o.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),n(this)},u}),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> "+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._scene.requestRender(),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="",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,f._scene.requestRender()}),this._frustumPlanesSubscription=c.getObservable(this,"frustumPlanes").subscribe(function(e){f._scene.debugShowFrustumPlanes=e,f._scene.requestRender()}),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,f._scene.requestRender(),!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 f._scene.requestRender(),!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(),f._scene.requestRender()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){g._surface.tileProvider._debug.wireframe=e,f._scene.requestRender()}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){f._scene.debugShowGlobeDepth=e,f._scene.requestRender()}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){f._scene.debugShowPickDepth=e,f._scene.requestRender()}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){f._scene.debugShowDepthFrustum=e,f._scene.requestRender()}),this._incrementDepthFrustum=d(function(){var e=f.depthFrustum+1;return f.depthFrustum=p(1,f._numberOfFrustums,e),f._scene.requestRender(),!0}),this._decrementDepthFrustum=d(function(){var e=f.depthFrustum-1;return f.depthFrustum=p(1,f._numberOfFrustums,e),f._scene.requestRender(),!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(),f._scene.requestRender()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){f._showTileBoundingSphere(),f._scene.requestRender()}),this._showTileBoundingSphere=d(function(){return f.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=f._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,f._scene.requestRender(),!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(),f._scene.requestRender()}),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)}),this._removePostRenderEvent=t.postRender.addEventListener(function(){f._update()})}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:{get:function(){return this._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())}},tile:{get:function(){return this._tile},set:function(t){if(e(t)){this.hasPickedTile=!0;if(t!==this._tile){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 i=t.data;e(i)&&e(i.tileBoundingRegion)?this.tileText+="<br>Min: "+i.tileBoundingRegion.minimumHeight+" Max: "+i.tileBoundingRegion.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),f.prototype._update=function(){this.frustums&&(this.frustumStatisticText=h(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=p(1,e,this.depthFrustum),this.depthFrustumText=this.depthFrustum+" of "+e,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText="Cached shaders: "+this._scene.context.shaderCache.numberOfShaders},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),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","../InspectorShared","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e);var i=document.createElement("div"),r=new s(t,i);this._viewModel=r,this._container=e;var l=document.createElement("div");this._element=l;var u=document.createElement("div");u.textContent="Cesium Inspector",u.className="cesium-cesiumInspector-button",u.setAttribute("data-bind","click: toggleDropDown"),l.appendChild(u),l.className="cesium-cesiumInspector",l.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var c=document.createElement("div");this._panel=c,c.className="cesium-cesiumInspector-dropDown",l.appendChild(c);var d=a.createSection,h=a.createCheckbox,p=d(c,"General","generalVisible","toggleGeneral"),f=h("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(m),p.appendChild(f),p.appendChild(h("Show Frustum Planes","frustumPlanes")),p.appendChild(h("Performance Display","performance")),i.className="cesium-cesiumInspector-performanceDisplay",p.appendChild(i);var _=document.createElement("div");_.className="cesium-cesiumInspector-shaderCache",_.setAttribute("data-bind","html: shaderCacheText"),p.appendChild(_);var g=document.createElement("div");p.appendChild(g);var v=document.createElement("span");v.setAttribute("data-bind",'html: " Frustum:"'),g.appendChild(v);var y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);var C=document.createElement("input");C.type="button",C.value="-",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(C);var b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);var S=d(c,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",S.appendChild(T);var E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var A=document.createElement("div");A.className="cesium-cesiumInspector-center",A.appendChild(E),T.appendChild(A),T.appendChild(h("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(h("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=h("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);var w=d(c,"Terrain","terrainVisible","toggleTerrain"),x=document.createElement("div");x.className="cesium-cesiumInspector-pickSection",w.appendChild(x);var P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),A=document.createElement("div"),A.appendChild(P),A.className="cesium-cesiumInspector-center",x.appendChild(A);var D=document.createElement("div");x.appendChild(D);var I=document.createElement("input");I.type="button",I.value="Parent",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectParent");var M=document.createElement("input");M.type="button",M.value="NW",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: selectNW");var R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");var O=document.createElement("input");O.type="button",O.value="SW",O.className="cesium-cesiumInspector-pickButton",O.setAttribute("data-bind","click: selectSW");var L=document.createElement("input");L.type="button",L.value="SE",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectSE");var N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",D.className="cesium-cesiumInspector-frustumStatistics",D.appendChild(N),D.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");var F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",D.appendChild(F);var B=document.createElement("table"),k=document.createElement("tr"),z=document.createElement("tr"),V=document.createElement("td");V.appendChild(I);var U=document.createElement("td");U.appendChild(M);var G=document.createElement("td");G.appendChild(R),k.appendChild(V),k.appendChild(U),k.appendChild(G);var H=document.createElement("td"),W=document.createElement("td");W.appendChild(O);var q=document.createElement("td");q.appendChild(L),z.appendChild(H),z.appendChild(W),z.appendChild(q),B.appendChild(k),B.appendChild(z),D.appendChild(B),x.appendChild(h("Show bounding volume","tileBoundingSphere","hasPickedTile")),x.appendChild(h("Show only selected","filterTile","hasPickedTile")),w.appendChild(h("Wireframe","wireframe")),w.appendChild(h("Suspend LOD update","suspendUpdates")),w.appendChild(h("Show tile coordinates","tileCoordinates")),n.applyBindings(r,this._element)}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.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},l}),define("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/createWorldImagery","../../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,b,S){"use strict";function T(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function E(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var o=e._targetFrameRate;if(n(o)){var a=1e3/o,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function A(e){var t=e._canvas,i=t.clientWidth,n=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=r(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=n,i*=o,n*=o,t.width=i,t.height=n,e._canRender=0!==i&&0!==n}function w(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var o=e._scene.camera.frustum;n(o.aspectRatio)?o.aspectRatio=i/r:(o.top=o.right*(r/i),o.bottom=-o.top)}}function x(e,o){e=S(e),o=r(o,{});var a=document.createElement("div");a.className="cesium-widget",e.appendChild(a);var s=document.createElement("canvas"),c=u.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=c,c&&(s.style.imageRendering=u.imageRenderingValue()),s.oncontextmenu=function(){return!1},s.onselectstart=function(){return!1},a.appendChild(s);var d=document.createElement("div");d.className="cesium-widget-credits";var E=n(o.creditContainer)?S(o.creditContainer):a;E.appendChild(d);var x=n(o.creditViewport)?S(o.creditViewport):a,P=r(o.showRenderLoopErrors,!0);this._element=a,this._container=e,this._canvas=s,this._canvasWidth=0,this._canvasHeight=0,this._creditViewport=x,this._creditContainer=E,this._innerCreditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=n(o.clock)?o.clock:new i,A(this);try{var D=new _({canvas:s,contextOptions:o.contextOptions,creditContainer:d,creditViewport:x,mapProjection:o.mapProjection,orderIndependentTranslucency:o.orderIndependentTranslucency,scene3DOnly:r(o.scene3DOnly,!1),terrainExaggeration:o.terrainExaggeration,shadows:o.shadows,mapMode2D:o.mapMode2D,requestRenderMode:o.requestRenderMode,maximumRenderTimeChange:o.maximumRenderTimeChange});this._scene=D,D.camera.constrainedAxis=t.UNIT_Z,w(this);var I=r(D.mapProjection.ellipsoid,l.WGS84),M=o.globe;n(M)||(M=new f(I)),!1!==M&&(D.globe=M,D.globe.shadows=r(o.terrainShadows,v.RECEIVE_ONLY));var R=o.skyBox;n(R)||(R=new C({sources:{positiveX:T("px"),negativeX:T("mx"),positiveY:T("py"),negativeY:T("my"),positiveZ:T("pz"),negativeZ:T("mz")}})),!1!==R&&(D.skyBox=R,D.sun=new b,D.moon=new m);var O=o.skyAtmosphere;n(O)||(O=new y(I)),!1!==O&&(D.skyAtmosphere=O);var L=!1!==o.globe&&o.imageryProvider;n(L)||(L=p()),!1!==L&&D.imageryLayers.addImageryProvider(L),n(o.terrainProvider)&&!1!==o.globe&&(D.terrainProvider=o.terrainProvider),this._screenSpaceEventHandler=new h(s,!1),n(o.sceneMode)&&(o.sceneMode===g.SCENE2D&&this._scene.morphTo2D(0),o.sceneMode===g.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=r(o.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=o.targetFrameRate;var N=this;D.renderError.addEventListener(function(e,t){if(N._useDefaultRenderLoop=!1,N._renderLoopRunning=!1,N._showRenderLoopErrors){N.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}})}catch(e){if(P){this.showErrorPanel("Error constructing CesiumWidget.",'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:',e)}throw e}}return o(x.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},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&&E(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),x.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*o.clientHeight-100),30)+"px"}var o=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(),n(window.addEventListener)&&window.addEventListener("resize",r,!1),n(t)){var d=document.createElement("div");d.className="cesium-widget-errorPanel-message",d.innerHTML="<p>"+t+"</p>",u.appendChild(d)}var h="(no error details available)";n(i)&&(h=c(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(){n(r)&&n(window.removeEventListener)&&window.removeEventListener("resize",r,!1),o.removeChild(a)},f.appendChild(m),o.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+h)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),a(this)},x.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,A(this),w(this),this._scene.requestRender())},x.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},x}),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/IonGeocoderService","../../Core/CartographicGeocoderService","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/GeocodeType","../../Core/Math","../../Core/Matrix4","../../Core/Rectangle","../../Core/sampleTerrainMostDetailed","../../Scene/computeFlyToLocationForRectangle","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){
- "use strict";function g(n){r(n.geocoderServices)?this._geocoderServices=n.geocoderServices:this._geocoderServices=[new t,new e({scene:n.scene})],this._viewContainer=n.container,this._scene=n.scene,this._flightDuration=n.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new a,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=y,this._handleArrowUp=v;var o=this;this._suggestionsVisible=p.pureComputed(function(){var e=p.getObservable(o,"_suggestions"),t=e().length>0,i=p.getObservable(o,"_showSuggestions")();return t&&i}),this._searchCommand=m(function(e){if(e=i(e,s.SEARCH),o._focusTextbox=!1,r(o._selectedSuggestion))return o.activateSuggestion(o._selectedSuggestion),!1;o.hideSuggestions(),o.isSearchInProgress?A(o):T(o,o._geocoderServices,e)}),this.deselectSuggestion=function(){o._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,n="Enter"===t.key||13===t.keyCode;return r?v(o):i?y(o):n&&o._searchCommand(),!0},this.activateSuggestion=function(e){o.hideSuggestions(),o._searchText=e.displayName;var t=e.destination;x(o),o.destinationFound(o,t)},this.hideSuggestions=function(){o._showSuggestions=!1,o._selectedSuggestion=void 0},this.showSuggestions=function(){o._showSuggestions=!0},this.handleMouseover=function(e,t){e!==o._selectedSuggestion&&(o._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=i(n.autocomplete,!0),this.destinationFound=i(n.destinationFound,g.flyToDestination),this._focusTextbox=!1,p.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var l=p.getObservable(this,"_searchText");l.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=l.subscribe(function(){g._updateSearchSuggestions(o)}),this.isSearchInProgress=void 0,p.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,p.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,p.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function v(e){if(0!==e._suggestions.length){var t,i=e._suggestions.indexOf(e._selectedSuggestion);if(-1===i||0===i)return void(e._selectedSuggestion=void 0);t=i-1,e._selectedSuggestion=e._suggestions[t],g._adjustSuggestionsScroll(e,t)}}function y(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],g._adjustSuggestionsScroll(e,r)}}function C(e,t){var i=r(t)?t.availability:void 0;return r(i)?d(t,[e]).then(function(t){return e=t[0],e.height+=D,e}):(e.height+=D,f.resolve(e))}function b(e,t){var i,n=e._scene,o=n.mapProjection,a=o.ellipsoid,s=n.camera,d=n.terrainProvider,p=t;t instanceof c?l.equalsEpsilon(t.south,t.north,l.EPSILON7)&&l.equalsEpsilon(t.east,t.west,l.EPSILON7)?t=c.center(t):i=h(t,n):t=a.cartesianToCartographic(t),r(i)||(i=C(t,d)),i.then(function(e){p=a.cartographicToCartesian(e)}).always(function(){s.flyTo({destination:p,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:u.IDENTITY})})}function S(e,t,i,n){return e.then(function(e){return r(e)&&"fulfilled"===e.state&&e.value.length>0?e:t.geocode(i,n).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function T(e,t,i){var n=e._searchText;if(w(n))return void e.showSuggestions();e._isSearchInProgress=!0;for(var o=f.resolve(),a=0;a<t.length;a++)o=S(o,t[a],n,i);e._geocodePromise=o,o.then(function(t){if(!o.cancel){e._isSearchInProgress=!1;var i=t.value;if("fulfilled"===t.state&&r(i)&&i.length>0)return e._searchText=i[0].displayName,void e.destinationFound(e,i[0].destination);e._searchText=n+" (not found)"}})}function E(e,t){var i=_(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 A(e){e._isSearchInProgress=!1,r(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function w(e){return/^\s*$/.test(e)}function x(e){p.getObservable(e,"_suggestions").removeAll()}function P(e){if(e.autoComplete){var t=e._searchText;if(x(e),!w(t)){var i=f.resolve([]);e._geocoderServices.forEach(function(e){i=i.then(function(i){return i.length>=5?i:e.geocode(t,s.AUTOCOMPLETE).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])})}}}var D=1e3;return n(g.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}}}),g.prototype.destroy=function(){this._suggestionSubscription.dispose()},g.flyToDestination=b,g._updateSearchSuggestions=P,g._adjustSuggestionsScroll=E,g}),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/Check","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){t=s(t);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),t.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="×",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=t,this._element=n,this._frame=h,this._viewModel=p,this._descriptionSubscription=void 0;var f=this;h.addEventListener("load",function(){var t=h.contentDocument,o=t.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=t.createElement("div");a.className="cesium-infoBox-description",t.head.appendChild(o),t.body.appendChild(a),f._descriptionSubscription=l(p,"description",function(e){h.style.height="5px",a.innerHTML=e;var t=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=i.fromCssColorString(l);r(u)&&0!==u.alpha&&(t=s["background-color"])}}n.style["background-color"]=t;var c=a.getBoundingClientRect().height;h.style.height=c+"px"})}),h.setAttribute("src","about:blank")}return n(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),r(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),o(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="×",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/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/OrthographicFrustum","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){this._scene=t,this._orthographic=t.camera.frustum instanceof o,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=t.mode,s.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var i=this;s.defineProperty(this,"selectedTooltip",function(){return i._orthographic?i.tooltipOrthographic:i.tooltipPerspective}),this._toggleDropDown=l(function(){i.sceneMode===a.SCENE2D||i._flightInProgress||(i.dropDownVisible=!i.dropDownVisible)}),this._eventHelper=new n,this._eventHelper.add(t.morphComplete,function(e,t,r,n){i.sceneMode=r,i._orthographic=r===a.SCENE2D||i._scene.camera.frustum instanceof o}),this._eventHelper.add(t.preRender,function(){i._flightInProgress=e(t.camera._currentFlight)}),this._switchToPerspective=l(function(){i.sceneMode!==a.SCENE2D&&(i._scene.camera.switchToPerspectiveFrustum(),i._orthographic=!1,i.dropDownVisible=!1)}),this._switchToOrthographic=l(function(){i.sceneMode!==a.SCENE2D&&(i._scene.camera.switchToOrthographicFrustum(),i._orthographic=!0,i.dropDownVisible=!1)}),this._sceneMode=a}return t(u.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}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},u}),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='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',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='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',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=document.createElementNS(r,"svg:svg");s.setAttribute("width",160),s.setAttribute("height",160),s.setAttribute("viewBox","0 0 160 160");var l=document.createElementNS(r,"g");l.setAttribute("transform","translate(80,80)"),s.appendChild(l);var u=document.createElementNS(r,"path");u.setAttribute("data-bind","attr: { transform: _transform }"),u.setAttribute("d","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.appendChild(u),i.appendChild(s);var c=new a(t,this._element,this._container);this._viewModel=c,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)>=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],b=["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 b[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(y/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-y)/p}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=0,p=this._timeBarSecondsSpan;p<.01?(p=.01,this._timeBarSecondsSpan=.01,this._endJulian=n.addSeconds(this._startJulian,.01,new n)):p>31536e6&&(p=31536e6,this._timeBarSecondsSpan=31536e6,this._endJulian=n.addSeconds(this._startJulian,31536e6,new n));var f=this._timeBarEle.clientWidth;f<10&&(f=10);var m,_=this._startJulian,g=Math.min(p/f*1e-5,.4),v=n.toGregorianDate(_);m=p>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(v.year/100),0))):p>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(v.year/10),0))):p>86400?n.fromDate(new Date(Date.UTC(v.year,0))):n.fromDate(new Date(Date.UTC(v.year,v.month,v.day)));var y=n.secondsDifference(this._startJulian,n.addSeconds(m,g,new n)),b=y+p;this._epochJulian=m,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-.01,new n));var S=this._rulerEle.offsetWidth+20;S<30&&(S=180);var T=h;h-=1e-10;var E={startTime:y,startJulian:_,epochJulian:m,duration:p,timeBarWidth:f,getAlpha:i};this._highlightRanges.forEach(function(e){d+=e.render(E)});var A=0,w=0,x=0,P=S/f;P>1&&(P=1),P*=this._timeBarSecondsSpan;var D,I=-1,M=-1,R=C.length;for(D=0;D<R;++D){var O=C[D];if(++I,A=O,O>P&&O>h)break;M<0&&f*(O/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=I)}if(I>0){for(;I>0;)if(--I,Math.abs(r(A,C[I]))<1e-5){C[I]>=h&&(w=C[I]);break}if(M>=0)for(;M<I;){if(Math.abs(r(w,C[M]))<1e-5&&C[M]>=h){x=C[M];break}++M}}(h=T)>1e-10&&x<1e-5&&Math.abs(h-A)>1e-10&&(x=h,h<=A+1e-10&&(w=0));var L,N=-999999;if(f*(x/this._timeBarSecondsSpan)>=3)for(o=e(x);o<=b;o=t(o,x))d+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(f*i(o)).toString()+'px;"></span>';if(f*(w/this._timeBarSecondsSpan)>=3)for(o=e(w);o<=b;o=t(o,w))d+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(f*i(o)).toString()+'px;"></span>';if(f*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,b+=A,o=e(A);for(var F=n.computeTaiMinusUtc(m);o<=b;){var B=n.addSeconds(_,o-y,new n);if(A>2.1){var k=n.computeTaiMinusUtc(B);Math.abs(k-F)>.1&&(o+=k-F,B=n.addSeconds(_,o-y,new n))}var z=Math.round(f*i(o)),V=this.makeLabel(B);this._rulerEle.innerHTML=V,L=this._rulerEle.offsetWidth,L<10&&(L=S);var U=z-(L/2-1);U>N?(N=U+L+5,d+='<span class="cesium-timeline-ticMain" style="left: '+z.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+U.toString()+'px;">'+V+"</span>"):d+='<span class="cesium-timeline-ticSub" style="left: '+z.toString()+'px;"></span>',o=t(o,A)}}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),E.y=0,this._trackList.forEach(function(e){e.render(c._context,E),E.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","../../Core/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/Cartographic","../../Core/Clock","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/EventHelper","../../Core/HeadingPitchRange","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/Cesium3DTileset","../../Scene/computeFlyToLocationForRectangle","../../Scene/ImageryLayer","../../Scene/SceneMode","../../Scene/TimeDynamicPointCloud","../../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,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X){"use strict";function Q(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function K(e,t){var i=e.scene.pick(t.position);if(o(i)){var r=n(i.id,i.primitive.id);if(r instanceof C)return r}if(o(e.scene.globe))return J(e,t.position)}function Z(e,t,i){if(o(i)){var r=i.clock;o(r)&&(r.getValue(t),o(e)&&(e.updateFromClock(),e.zoomTo(r.startTime,r.stopTime)))}}function J(e,t){var i=e.scene,r=i.camera.getPickRay(t),n=i.imageryLayers.pickImageryLayerFeatures(r,i);if(o(n)){var a=new C({id:"Loading...",description:"Loading feature information..."});return D(n,function(t){if(e.selectedEntity===a){if(!o(t)||0===t.length)return void(e.selectedEntity=$());var i=t[0],r=new C({id:i.name,description:i.description});if(o(i.position)){var n=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,le);r.position=new g(n)}e.selectedEntity=r}},function(){e.selectedEntity===a&&(e.selectedEntity=$())}),a}}function $(){return new C({id:"None",description:"No features found."})}function ee(e,t){var i=e._geocoder,r=e._homeButton,n=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(o(i)&&(i.container.style.visibility=p),o(r)&&(r.container.style.visibility=p),o(n)&&(n.container.style.visibility=p),o(a)&&(a.container.style.visibility=p),o(s)&&(s.container.style.visibility=p),o(l)&&(l.container.style.visibility=p),o(u)&&(u.container.style.visibility=p),o(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=p),o(d)&&(d.container.style.visibility=p),o(h)&&(h.container.style.visibility=p),e._container){var f=t||!o(c)?0:c.container.clientWidth;e._vrButton.container.style.right=f+"px",e.forceResize()}}function te(e,t){function i(e){var t=K(l,e);o(t)?S.getValueOrUndefined(t.position,l.clock.currentTime)?l.trackedEntity=t:l.zoomTo(t):o(l.trackedEntity)&&(l.trackedEntity=void 0)}function a(e){l.selectedEntity=K(l,e)}e=z(e),t=n(t,n.EMPTY_OBJECT);var s=!(o(t.globe)&&!1===t.globe||o(t.baseLayerPicker)&&!1===t.baseLayerPicker),l=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,C=n(t.scene3DOnly,!1),b=!1;o(t.clockViewModel)?(g=t.clockViewModel,_=g.clock):(_=new r,g=new F(_),b=!0),o(t.shouldAnimate)&&(_.shouldAnimate=t.shouldAnimate);var T=new N(p,{imageryProvider:!s&&!o(t.imageryProvider)&&void 0,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:o(t.creditContainer)?t.creditContainer:f,creditViewport:t.creditViewport,scene3DOnly:C,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange}),E=t.dataSources,A=!1;o(E)||(E=new v,A=!0);var w=T.scene,x=new y({scene:w,dataSourceCollection:E}),D=new c;D.add(_.onTick,te.prototype._onTick,this),D.add(w.morphStart,te.prototype._clearTrackedObject,this);var Z;if(!o(t.selectionIndicator)||!1!==t.selectionIndicator){var J=document.createElement("div");J.className="cesium-viewer-selectionIndicatorContainer",d.appendChild(J),Z=new q(J,w)}var $;if(!o(t.infoBox)||!1!==t.infoBox){var ie=document.createElement("div");ie.className="cesium-viewer-infoBoxContainer",d.appendChild(ie),$=new U(ie);var re=$.viewModel;D.add(re.cameraClicked,te.prototype._onInfoBoxCameraClicked,this),D.add(re.closeClicked,te.prototype._onInfoBoxClockClicked,this)}var ne=document.createElement("div");ne.className="cesium-viewer-toolbar",d.appendChild(ne);var oe;if(!o(t.geocoder)||!1!==t.geocoder){var ae=document.createElement("div");ae.className="cesium-viewer-geocoderContainer",ne.appendChild(ae);var se;o(t.geocoder)&&"boolean"!=typeof t.geocoder&&(se=h(t.geocoder)?t.geocoder:[t.geocoder]),oe=new k({container:ae,geocoderServices:se,scene:w}),D.add(oe.viewModel.search.beforeExecute,te.prototype._clearObjects,this)}var le;o(t.homeButton)&&!1===t.homeButton||(le=new V(ne,w),o(oe)&&D.add(le.viewModel.command.afterExecute,function(){var e=oe.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),D.add(le.viewModel.command.beforeExecute,te.prototype._clearTrackedObject,this));var ue;C||o(t.sceneModePicker)&&!1===t.sceneModePicker||(ue=new W(ne,w));var ce;t.projectionPicker&&(ce=new H(ne,w));var de,he;if(s){var pe=n(t.imageryProviderViewModels,O()),fe=n(t.terrainProviderViewModels,L());de=new R(ne,{globe:w.globe,imageryProviderViewModels:pe,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:fe,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});he=ne.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}o(t.imageryProvider)&&!1!==t.imageryProvider&&(s&&(de.viewModel.selectedImagery=void 0),w.imageryLayers.removeAll(),w.imageryLayers.addImageryProvider(t.imageryProvider)),o(t.terrainProvider)&&(s&&(de.viewModel.selectedTerrain=void 0),w.terrainProvider=t.terrainProvider);var me;if(!o(t.navigationHelpButton)||!1!==t.navigationHelpButton){var _e=!0;try{if(o(window.localStorage)){var ge=window.localStorage.getItem("cesium-hasSeenNavHelp");o(ge)&&Boolean(ge)?_e=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}me=new G({container:ne,instructionsInitiallyVisible:n(t.navigationInstructionsInitiallyVisible,_e)})}var ve;if(!o(t.animation)||!1!==t.animation){var ye=document.createElement("div");ye.className="cesium-viewer-animationContainer",d.appendChild(ye),ve=new I(ye,new M(g))}var Ce;if(!o(t.timeline)||!1!==t.timeline){var be=document.createElement("div");be.className="cesium-viewer-timelineContainer",d.appendChild(be),Ce=new j(be,_),Ce.addEventListener("settime",Q,!1),Ce.zoomTo(_.startTime,_.stopTime)}var Se,Te,Ee;o(t.fullscreenButton)&&!1===t.fullscreenButton||(Ee=document.createElement("div"),Ee.className="cesium-viewer-fullscreenContainer",d.appendChild(Ee),Se=new B(Ee,t.fullscreenElement),Te=Y(Se.viewModel,"isFullscreenEnabled",function(e){Ee.style.display=e?"block":"none",o(Ce)&&(Ce.container.style.right=Ee.clientWidth+"px",Ce.resize())}));var Ae,we,xe;if(t.vrButton){var Pe=document.createElement("div");Pe.className="cesium-viewer-vrContainer",d.appendChild(Pe),Ae=new X(Pe,w,t.fullScreenElement),we=Y(Ae.viewModel,"isVREnabled",function(e){Pe.style.display=e?"block":"none",o(Se)&&(Pe.style.right=Ee.clientWidth+"px"),o(Ce)&&(Ce.container.style.right=Pe.clientWidth+"px",Ce.resize())}),xe=Y(Ae.viewModel,"isVRMode",function(e){ee(l,e)})}this._baseLayerPickerDropDown=he,this._fullscreenSubscription=Te,this._vrSubscription=we,this._vrModeSubscription=xe,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=n(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=f,this._element=d,this._cesiumWidget=T,this._selectionIndicator=Z,this._infoBox=$,this._dataSourceCollection=E,this._destroyDataSourceCollection=A,this._dataSourceDisplay=x,this._clockViewModel=g,this._destroyClockViewModel=b,this._toolbar=ne,this._homeButton=le,this._sceneModePicker=ue,this._projectionPicker=ce,this._baseLayerPicker=de,this._navigationHelpButton=me,this._animation=ve,this._timeline=Ce,this._fullscreenButton=Se,this._vrButton=Ae,this._geocoder=oe,this._eventHelper=D,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=o($)||o(Z),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new u,this._trackedEntityChanged=new u,P.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),D.add(E.dataSourceAdded,te.prototype._onDataSourceAdded,this),D.add(E.dataSourceRemoved,te.prototype._onDataSourceRemoved,this),D.add(w.postUpdate,te.prototype.resize,this),D.add(w.postRender,te.prototype._postRender,this);for(var De=E.length,Ie=0;Ie<De;Ie++)this._dataSourceAdded(E,E.get(Ie));this._dataSourceAdded(void 0,x.defaultDataSource),D.add(E.dataSourceAdded,te.prototype._dataSourceAdded,this),D.add(E.dataSourceRemoved,te.prototype._dataSourceRemoved,this),T.screenSpaceEventHandler.setInputAction(a,m.LEFT_CLICK),T.screenSpaceEventHandler.setInputAction(i,m.LEFT_DOUBLE_CLICK)}function ie(e,t,i,r){ne(e);var a=D.defer();return e._zoomPromise=a,e._zoomIsFlight=r,e._zoomOptions=i,D(t,function(t){if(e._zoomPromise===a){if(t instanceof A)return void t.getViewableRectangle().then(function(t){return E(t,e.scene)}).then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t instanceof T)return void(e._zoomTarget=t);if(t instanceof x)return void(e._zoomTarget=t);if(t.isLoading&&o(t.loadingEvent))var i=t.loadingEvent.addEventListener(function(){i(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(h(t))return void(e._zoomTarget=t.slice(0));t=n(t.values,t),o(t.entities)&&(t=t.entities.values),h(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),e.scene.requestRender(),a.promise}function re(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function ne(e){var t=e._zoomPromise;o(t)&&(re(e),t.resolve(!1))}function oe(t){var r=t._zoomTarget;if(o(r)&&t.scene.mode!==w.MORPHING){var a,s,l=t.scene,u=l.camera,c=t._zoomPromise,h=n(t._zoomOptions,{});if(r instanceof T)return r.readyPromise.then(function(){var e=r.boundingSphere;o(h.offset)||(h.offset=new d(0,-.5,e.radius)),a={offset:h.offset,duration:h.duration,maximumHeight:h.maximumHeight,complete:function(){c.resolve(!0)},cancel:function(){c.resolve(!1)}},t._zoomIsFlight?u.flyToBoundingSphere(r.boundingSphere,a):(u.viewBoundingSphere(e,h.offset),u.lookAtTransform(p.IDENTITY),c.resolve(!0)),re(t)});if(r instanceof x)return r.readyPromise.then(function(){var e=r.boundingSphere;o(h.offset)||(h.offset=new d(0,-.5,e.radius)),a={offset:h.offset,duration:h.duration,maximumHeight:h.maximumHeight,complete:function(){c.resolve(!0)},cancel:function(){c.resolve(!1)}},t._zoomIsFlight?u.flyToBoundingSphere(e,a):(u.viewBoundingSphere(e,h.offset),u.lookAtTransform(p.IDENTITY),c.resolve(!0)),re(t)});if(r instanceof i)return a={destination:l.mapProjection.ellipsoid.cartographicToCartesian(r),duration:h.duration,maximumHeight:h.maximumHeight,complete:function(){c.resolve(!0)},cancel:function(){c.resolve(!1)}},t._zoomIsFlight?u.flyTo(a):(u.setView(a),c.resolve(!0)),void re(t);for(var f=r,m=[],g=0,v=f.length;g<v;g++){var y=t._dataSourceDisplay.getBoundingSphere(f[g],!1,se);if(y===_.PENDING)return;y!==_.FAILED&&m.push(e.clone(se))}if(0===m.length)return void ne(t);t.trackedEntity=void 0,s=e.fromBoundingSpheres(m),t._zoomIsFlight?(re(t),u.flyToBoundingSphere(s,{duration:h.duration,maximumHeight:h.maximumHeight,complete:function(){c.resolve(!0)},cancel:function(){c.resolve(!1)},offset:h.offset})):(u.viewBoundingSphere(s,h.offset),u.lookAtTransform(p.IDENTITY),re(t),c.resolve(!0))}}function ae(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,r=S.getValueOrUndefined(t.position,i);if(o(r)){var n=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,se);if(a!==_.PENDING){var s=n.mode;s!==w.COLUMBUS_VIEW&&s!==w.SCENE2D||(n.screenSpaceCameraController.enableTranslate=!1),s!==w.COLUMBUS_VIEW&&s!==w.SCENE3D||(n.screenSpaceCameraController.enableTilt=!1);var l=a!==_.FAILED?se:void 0;e._entityView=new b(t,n,n.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var se=new e,le=new t;return a(te.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}},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}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},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,ne(this);var t=this.scene,i=t.mode;o(e)&&o(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(p.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=o(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;o(e)?o(t)&&t.animateAppear():o(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,Z(this._timeline,this.clock,e))}}}),te.prototype.extend=function(e,t){e(this,t)},te.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,r=t.clientHeight,n=o(this._animation),a=o(this._timeline);if(this._forceResize||i!==this._lastWidth||r!==this._lastHeight){e.resize(),this._forceResize=!1;var s=r-125,l=this._baseLayerPickerDropDown;if(o(l)&&(l.style.maxHeight=s+"px"),o(this._geocoder)){this._geocoder.searchSuggestionsContainer.style.maxHeight=s+"px"}o(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,d=0,h=0,p=0;if(n&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var f=this._lastWidth;u=this._animation.container,i>900?(d=169,f<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(d=136,(f<600||f>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(d=106,(f>600||0===f)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=d+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var m=this._fullscreenButton,_=this._vrButton,g=c.container,v=g.style;p=g.clientHeight+3,v.left=d+"px";var y=0;o(m)&&(y+=m.container.clientWidth),o(_)&&(y+=_.container.clientWidth),v.right=y+"px",c.resize()}this._bottomContainer.style.left=h+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=i,this._lastHeight=r}},te.prototype.forceResize=function(){this._lastWidth=0,this.resize()},te.prototype.render=function(){this._cesiumWidget.render()},te.prototype.isDestroyed=function(){return!1},te.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(m.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(m.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(),o(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),o(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),o(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),o(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),o(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),o(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),o(this._timeline)&&(this._timeline.removeEventListener("settime",Q,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),o(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),o(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),o(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),o(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),s(this)},te.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(te.prototype._onEntityCollectionChanged,this)},te.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(te.prototype._onEntityCollectionChanged,this),o(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),o(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},te.prototype._onTick=function(e){var i=e.currentTime,r=this._dataSourceDisplay.update(i);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=r);var a=this._entityView;if(o(a)){var s=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(s,!1,se)===_.DONE&&a.update(i,se)}var l,u=!1,c=this.selectedEntity,d=o(c)&&this._enableInfoOrSelection;if(d&&c.isShowing&&c.isAvailable(i)){this._dataSourceDisplay.getBoundingSphere(c,!0,se)!==_.FAILED?l=se.center:o(c.position)&&(l=c.position.getValue(i,l)),u=o(l)}var h=o(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;o(h)&&(h.position=t.clone(l,h.position),h.showSelection=d&&u,h.update());var p=o(this._infoBox)?this._infoBox.viewModel:void 0;o(p)&&(p.showInfo=d,p.enableCamera=u,p.isCameraTracking=this.trackedEntity===this.selectedEntity,d?(p.titleText=n(c.name,c.id),p.description=S.getValueOrDefault(c.description,i,"")):(p.titleText="",p.description=""))},te.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)}},te.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;o(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},te.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},te.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},te.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},te.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Z(this.timeline,this.clock,e)},te.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,te.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},te.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}},te.prototype.zoomTo=function(e,t){return ie(this,e,{offset:t},!1)},te.prototype.flyTo=function(e,t){return ie(this,e,t,!0)},te.prototype._postRender=function(){oe(this),ae(this)},te}),define("Widgets/Viewer/viewerCesium3DTilesInspectorMixin",["../../Core/Check","../../Core/defineProperties","../Cesium3DTilesInspector/Cesium3DTilesInspector"],function(e,t,i){"use strict";function r(e){var r=document.createElement("div");r.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(r);var n=new i(r,e.scene);t(e,{cesium3DTilesInspector:{get:function(){return n}}})}return r}),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}}})}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,clampToGround:n})}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",["../ThirdParty/when","../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i,r){"use strict";function n(t,i,r){try{return t(i,r)}catch(t){return e.reject(t)}}function o(o){var a;return function(s){var l=s.data,u=[],c={id:l.id,result:void 0,error:void 0};return e(n(o,l.parameters,u)).then(function(e){c.result=e}).otherwise(function(e){e instanceof Error?c.error={name:e.name,message:e.message,stack:e.stack}:c.error=e}).always(function(){i(a)||(a=t(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(u.length=0);try{a(c,u)}catch(e){c.result=void 0,c.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(c),a(c)}})}}return o}),
- define("Cesium",["./Core/ApproximateTerrainHeights","./Core/ArcGISTiledElevationTerrainProvider","./Core/ArcType","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./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/Color","./Core/ColorGeometryInstanceAttribute","./Core/ComponentDatatype","./Core/CompressedTextureBuffer","./Core/CoplanarPolygonGeometry","./Core/CoplanarPolygonGeometryLibrary","./Core/CoplanarPolygonOutlineGeometry","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/Credit","./Core/CubicRealPolynomial","./Core/CullingVolume","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/DoublyLinkedList","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidRhumbLine","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EllipsoidalOccluder","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/FrustumGeometry","./Core/FrustumOutlineGeometry","./Core/Fullscreen","./Core/GeocodeType","./Core/GeocoderService","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryOffsetAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/GoogleEarthEnterpriseMetadata","./Core/GoogleEarthEnterpriseTerrainData","./Core/GoogleEarthEnterpriseTerrainProvider","./Core/GoogleEarthEnterpriseTileInformation","./Core/GregorianDate","./Core/GroundPolylineGeometry","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/Heap","./Core/HeightmapEncoding","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/IntersectionTests","./Core/Intersections2D","./Core/Interval","./Core/Ion","./Core/IonGeocoderService","./Core/IonResource","./Core/Iso8601","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/ManagedArray","./Core/MapProjection","./Core/MapboxApi","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/NearFarScalar","./Core/Occluder","./Core/OffsetGeometryInstanceAttribute","./Core/OpenCageGeocoderService","./Core/OrientedBoundingBox","./Core/OrthographicFrustum","./Core/OrthographicOffCenterFrustum","./Core/Packable","./Core/PackableForInterpolation","./Core/PeliasGeocoderService","./Core/PerspectiveFrustum","./Core/PerspectiveOffCenterFrustum","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PlaneGeometry","./Core/PlaneOutlineGeometry","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleCollisionChecker","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/Request","./Core/RequestErrorEvent","./Core/RequestScheduler","./Core/RequestState","./Core/RequestType","./Core/Resource","./Core/RuntimeError","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/TileAvailability","./Core/TileEdge","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VRTheWorldTerrainProvider","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WeightSpline","./Core/WindingOrder","./Core/appendForwardSlash","./Core/arrayFill","./Core/arrayRemoveDuplicates","./Core/arraySlice","./Core/barycentricCoordinates","./Core/binarySearch","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/clone","./Core/combine","./Core/createGuid","./Core/createWorldTerrain","./Core/decodeGoogleEarthEnterpriseData","./Core/defaultValue","./Core/defineProperties","./Core/defined","./Core/deprecationWarning","./Core/destroyObject","./Core/formatError","./Core/freezeObject","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/isArray","./Core/isBitSet","./Core/isBlobUri","./Core/isCrossOriginUrl","./Core/isDataUri","./Core/isLeapYear","./Core/loadAndExecuteScript","./Core/loadCRN","./Core/loadImageFromTypedArray","./Core/loadKTX","./Core/mergeSort","./Core/objectToQuery","./Core/oneTimeWarning","./Core/parseResponseHeaders","./Core/pointInsideTriangle","./Core/queryToObject","./Core/requestAnimationFrame","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./Core/scaleToGeodeticSurface","./Core/subdivideArray","./Core/webGLConstantToGlslType","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/DynamicGeometryBatch","./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/GroundGeometryUpdater","./DataSources/ImageMaterialProperty","./DataSources/KmlCamera","./DataSources/KmlDataSource","./DataSources/KmlLookAt","./DataSources/KmlTour","./DataSources/KmlTourFlyTo","./DataSources/KmlTourWait","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PlaneGeometryUpdater","./DataSources/PlaneGraphics","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineDashMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVisualizer","./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/StaticGroundGeometryPerMaterialBatch","./DataSources/StaticGroundPolylinePerMaterialBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TerrainOffsetProperty","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/exportKml","./DataSources/heightReferenceOnEntityPropertyChanged","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PixelDatatype","./Renderer/RenderState","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureCache","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/freezeRenderState","./Renderer/loadCubeMap","./Renderer/modernizeShader","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/AttributeType","./Scene/AutoExposure","./Scene/Axis","./Scene/BatchTable","./Scene/Batched3DModel3DTileContent","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendOption","./Scene/BlendingState","./Scene/BoxEmitter","./Scene/BrdfLutGenerator","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/Cesium3DTile","./Scene/Cesium3DTileBatchTable","./Scene/Cesium3DTileColorBlendMode","./Scene/Cesium3DTileContent","./Scene/Cesium3DTileContentFactory","./Scene/Cesium3DTileContentState","./Scene/Cesium3DTileFeature","./Scene/Cesium3DTileFeatureTable","./Scene/Cesium3DTileOptimizationHint","./Scene/Cesium3DTileOptimizations","./Scene/Cesium3DTilePass","./Scene/Cesium3DTilePassState","./Scene/Cesium3DTilePointFeature","./Scene/Cesium3DTileRefine","./Scene/Cesium3DTileStyle","./Scene/Cesium3DTileStyleEngine","./Scene/Cesium3DTileset","./Scene/Cesium3DTilesetCache","./Scene/Cesium3DTilesetHeatmap","./Scene/Cesium3DTilesetMostDetailedTraversal","./Scene/Cesium3DTilesetStatistics","./Scene/Cesium3DTilesetTraversal","./Scene/CircleEmitter","./Scene/ClassificationModel","./Scene/ClassificationPrimitive","./Scene/ClassificationType","./Scene/ClippingPlane","./Scene/ClippingPlaneCollection","./Scene/ColorBlendMode","./Scene/Composite3DTileContent","./Scene/ConditionsExpression","./Scene/ConeEmitter","./Scene/CreditDisplay","./Scene/CullFace","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DerivedCommand","./Scene/DeviceOrientationCameraController","./Scene/DiscardEmptyTileImagePolicy","./Scene/DiscardMissingTileImagePolicy","./Scene/DracoLoader","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Empty3DTileContent","./Scene/Expression","./Scene/ExpressionNodeType","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/Geometry3DTileContent","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthEnterpriseImageryProvider","./Scene/GoogleEarthEnterpriseMapsProvider","./Scene/GridImageryProvider","./Scene/GroundPolylinePrimitive","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/Instanced3DModel3DTileContent","./Scene/InvertClassification","./Scene/IonImageryProvider","./Scene/IonWorldImageryStyle","./Scene/JobScheduler","./Scene/JobType","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapMode2D","./Scene/MapboxImageryProvider","./Scene/MapboxStyleImageryProvider","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelInstance","./Scene/ModelInstanceCollection","./Scene/ModelLoadResources","./Scene/ModelMaterial","./Scene/ModelMesh","./Scene/ModelNode","./Scene/ModelUtility","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OctahedralProjectedCubeMap","./Scene/OrderedGroundPrimitiveCollection","./Scene/Particle","./Scene/ParticleBurst","./Scene/ParticleEmitter","./Scene/ParticleSystem","./Scene/PerInstanceColorAppearance","./Scene/PerformanceDisplay","./Scene/PickDepth","./Scene/PickDepthFramebuffer","./Scene/PickFramebuffer","./Scene/PointCloud","./Scene/PointCloud3DTileContent","./Scene/PointCloudEyeDomeLighting","./Scene/PointCloudShading","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/PostProcessStage","./Scene/PostProcessStageCollection","./Scene/PostProcessStageComposite","./Scene/PostProcessStageLibrary","./Scene/PostProcessStageSampleMode","./Scene/PostProcessStageTextureCache","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/SDFSettings","./Scene/Scene","./Scene/SceneFramebuffer","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/ShadowVolumeAppearance","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/SphereEmitter","./Scene/StencilConstants","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/StyleExpression","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainFillMesh","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingRegion","./Scene/TileBoundingSphere","./Scene/TileBoundingVolume","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileOrientedBoundingBox","./Scene/TileReplacementQueue","./Scene/TileSelectionResult","./Scene/TileState","./Scene/Tileset3DTileContent","./Scene/TimeDynamicImagery","./Scene/TimeDynamicPointCloud","./Scene/Tonemapper","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/Vector3DTileBatch","./Scene/Vector3DTileContent","./Scene/Vector3DTileGeometry","./Scene/Vector3DTilePoints","./Scene/Vector3DTilePolygons","./Scene/Vector3DTilePolylines","./Scene/Vector3DTilePrimitive","./Scene/VerticalOrigin","./Scene/View","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Scene/computeFlyToLocationForRectangle","./Scene/createBillboardPointCallback","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/createWorldImagery","./Scene/getBinaryAccessor","./Scene/getClipAndStyleCode","./Scene/getClippingFunction","./Scene/processModelMaterialsCommon","./Scene/processPbrMaterials","./Shaders/AdjustTranslucentFS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/BrdfLutGeneratorFS","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/OctahedralProjectionAtlasFS","./Shaders/OctahedralProjectionFS","./Shaders/OctahedralProjectionVS","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineShadowVolumeFS","./Shaders/PolylineShadowVolumeMorphFS","./Shaders/PolylineShadowVolumeMorphVS","./Shaders/PolylineShadowVolumeVS","./Shaders/PolylineVS","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeAppearanceFS","./Shaders/ShadowVolumeAppearanceVS","./Shaders/ShadowVolumeFS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/Vector3DTilePolylinesVS","./Shaders/VectorTileVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/LercDecode","./ThirdParty/NoSleep","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/bitmap-sdf","./ThirdParty/earcut-2.1.1","./ThirdParty/jsep","./ThirdParty/kdbush","./ThirdParty/knockout-3.5.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/protobuf-minimal","./ThirdParty/purify","./ThirdParty/quickselect","./ThirdParty/rbush","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/when","./ThirdParty/zip","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/InspectorShared","./Widgets/SvgPathBindingHandler","./Widgets/ToggleButtonViewModel","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/Builtin/CzmBuiltins","./Shaders/Materials/AspectRampMaterial","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/ElevationContourMaterial","./Shaders/Materials/ElevationRampMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineDashMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/SlopeRampMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PostProcessStages/AcesTonemapping","./Shaders/PostProcessStages/AdditiveBlend","./Shaders/PostProcessStages/AmbientOcclusionGenerate","./Shaders/PostProcessStages/AmbientOcclusionModulate","./Shaders/PostProcessStages/BlackAndWhite","./Shaders/PostProcessStages/BloomComposite","./Shaders/PostProcessStages/BrightPass","./Shaders/PostProcessStages/Brightness","./Shaders/PostProcessStages/ContrastBias","./Shaders/PostProcessStages/DepthOfField","./Shaders/PostProcessStages/DepthView","./Shaders/PostProcessStages/DepthViewPacked","./Shaders/PostProcessStages/EdgeDetection","./Shaders/PostProcessStages/FXAA","./Shaders/PostProcessStages/FilmicTonemapping","./Shaders/PostProcessStages/GaussianBlur1D","./Shaders/PostProcessStages/LensFlare","./Shaders/PostProcessStages/ModifiedReinhardTonemapping","./Shaders/PostProcessStages/NightVision","./Shaders/PostProcessStages/PassThrough","./Shaders/PostProcessStages/PassThroughDepth","./Shaders/PostProcessStages/PointCloudEyeDomeLighting","./Shaders/PostProcessStages/ReinhardTonemapping","./Shaders/PostProcessStages/Silhouette","./ThirdParty/GltfPipeline/ForEach","./ThirdParty/GltfPipeline/addBuffer","./ThirdParty/GltfPipeline/addDefaults","./ThirdParty/GltfPipeline/addExtensionsRequired","./ThirdParty/GltfPipeline/addExtensionsUsed","./ThirdParty/GltfPipeline/addPipelineExtras","./ThirdParty/GltfPipeline/addToArray","./ThirdParty/GltfPipeline/findAccessorMinMax","./ThirdParty/GltfPipeline/getAccessorByteStride","./ThirdParty/GltfPipeline/getComponentReader","./ThirdParty/GltfPipeline/hasExtension","./ThirdParty/GltfPipeline/moveTechniqueRenderStates","./ThirdParty/GltfPipeline/moveTechniquesToExtension","./ThirdParty/GltfPipeline/numberOfComponentsForType","./ThirdParty/GltfPipeline/parseGlb","./ThirdParty/GltfPipeline/readAccessorPacked","./ThirdParty/GltfPipeline/removeExtensionsRequired","./ThirdParty/GltfPipeline/removeExtensionsUsed","./ThirdParty/GltfPipeline/removePipelineExtras","./ThirdParty/GltfPipeline/removeUnusedElements","./ThirdParty/GltfPipeline/updateAccessorComponentTypes","./ThirdParty/GltfPipeline/updateVersion","./ThirdParty/Shaders/FXAA3_11","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector","./Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/ProjectionPicker/ProjectionPicker","./Widgets/ProjectionPicker/ProjectionPickerViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesium3DTilesInspectorMixin","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/ellipsoidInverseRadii","./Shaders/Builtin/Constants/ellipsoidRadii","./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/passCesium3DTile","./Shaders/Builtin/Constants/passCesium3DTileClassification","./Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow","./Shaders/Builtin/Constants/passClassification","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTerrainClassification","./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/Functions/HSBToRGB","./Shaders/Builtin/Functions/HSLToRGB","./Shaders/Builtin/Functions/RGBToHSB","./Shaders/Builtin/Functions/RGBToHSL","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/approximateSphericalCoordinates","./Shaders/Builtin/Functions/branchFreeTernary","./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/depthClampFarPlane","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fastApproximateAtan","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/gammaCorrect","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/inverseGamma","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/lineDistance","./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/planeDistance","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/readDepth","./Shaders/Builtin/Functions/reverseLogDepth","./Shaders/Builtin/Functions/sampleOctahedralProjection","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/sphericalHarmonics","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/transformPlane","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/unpackFloat","./Shaders/Builtin/Functions/vertexLogDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/writeDepthClampedToFarPlane","./Shaders/Builtin/Functions/writeLogDepth","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,b,S,T,E,A,w,x,P,D,I,M,R,O,L,N,F,B,k,z,V,U,G,H,W,q,Y,j,X,Q,K,Z,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,be,Se,Te,Ee,Ae,we,xe,Pe,De,Ie,Me,Re,Oe,Le,Ne,Fe,Be,ke,ze,Ve,Ue,Ge,He,We,qe,Ye,je,Xe,Qe,Ke,Ze,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,dt,ht,pt,ft,mt,_t,gt,vt,yt,Ct,bt,St,Tt,Et,At,wt,xt,Pt,Dt,It,Mt,Rt,Ot,Lt,Nt,Ft,Bt,kt,zt,Vt,Ut,Gt,Ht,Wt,qt,Yt,jt,Xt,Qt,Kt,Zt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,di,hi,pi,fi,mi,_i,gi,vi,yi,Ci,bi,Si,Ti,Ei,Ai,wi,xi,Pi,Di,Ii,Mi,Ri,Oi,Li,Ni,Fi,Bi,ki,zi,Vi,Ui,Gi,Hi,Wi,qi,Yi,ji,Xi,Qi,Ki,Zi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,dr,hr,pr,fr,mr,_r,gr,vr,yr,Cr,br,Sr,Tr,Er,Ar,wr,xr,Pr,Dr,Ir,Mr,Rr,Or,Lr,Nr,Fr,Br,kr,zr,Vr,Ur,Gr,Hr,Wr,qr,Yr,jr,Xr,Qr,Kr,Zr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,dn,hn,pn,fn,mn,_n,gn,vn,yn,Cn,bn,Sn,Tn,En,An,wn,xn,Pn,Dn,In,Mn,Rn,On,Ln,Nn,Fn,Bn,kn,zn,Vn,Un,Gn,Hn,Wn,qn,Yn,jn,Xn,Qn,Kn,Zn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,fo,mo,_o,go,vo,yo,Co,bo,So,To,Eo,Ao,wo,xo,Po,Do,Io,Mo,Ro,Oo,Lo,No,Fo,Bo,ko,zo,Vo,Uo,Go,Ho,Wo,qo,Yo,jo,Xo,Qo,Ko,Zo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,da,ha,pa,fa,ma,_a,ga,va,ya,Ca,ba,Sa,Ta,Ea,Aa,wa,xa,Pa,Da,Ia,Ma,Ra,Oa,La,Na,Fa,Ba,ka,za,Va,Ua,Ga,Ha,Wa,qa,Ya,ja,Xa,Qa,Ka,Za,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,_s,gs,vs,ys,Cs,bs,Ss,Ts,Es,As,ws,xs,Ps,Ds,Is,Ms,Rs,Os,Ls,Ns,Fs,Bs,ks,zs,Vs,Us,Gs,Hs,Ws,qs,Ys,js,Xs,Qs,Ks,Zs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,_l,gl,vl,yl,Cl,bl,Sl,Tl,El,Al,wl,xl,Pl,Dl,Il,Ml,Rl,Ol,Ll,Nl,Fl,Bl,kl,zl,Vl,Ul,Gl,Hl,Wl,ql,Yl,jl,Xl,Ql,Kl,Zl,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,_u,gu,vu,yu,Cu,bu,Su,Tu,Eu,Au,wu,xu,Pu,Du,Iu,Mu,Ru,Ou,Lu,Nu,Fu,Bu,ku,zu,Vu,Uu,Gu,Hu,Wu,qu,Yu,ju,Xu,Qu,Ku,Zu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,_c,gc,vc,yc,Cc,bc,Sc,Tc,Ec,Ac,wc,xc,Pc,Dc,Ic,Mc,Rc,Oc,Lc,Nc,Fc,Bc,kc,zc,Vc,Uc,Gc,Hc,Wc,qc,Yc,jc,Xc,Qc,Kc,Zc,Jc,$c,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,_d,gd,vd,yd,Cd,bd,Sd,Td,Ed,Ad,wd,xd,Pd,Dd,Id,Md,Rd,Od,Ld,Nd,Fd,Bd,kd,zd,Vd,Ud,Gd,Hd,Wd,qd,Yd,jd,Xd,Qd,Kd,Zd,Jd,$d,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,_h,gh,vh,yh,Ch,bh,Sh,Th,Eh,Ah,wh,xh,Ph,Dh,Ih,Mh,Rh,Oh,Lh,Nh,Fh,Bh,kh,zh,Vh,Uh,Gh,Hh,Wh,qh,Yh,jh,Xh,Qh,Kh,Zh,Jh,$h,ep,tp,ip,rp,np,op,ap,sp,lp,up,cp,dp,hp,pp,fp,mp,_p,gp,vp,yp,Cp,bp,Sp,Tp,Ep,Ap,wp,xp,Pp,Dp,Ip,Mp,Rp,Op,Lp,Np,Fp,Bp,kp,zp,Vp,Up,Gp,Hp,Wp,qp,Yp,jp,Xp,Qp,Kp,Zp,Jp,$p,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf,ff,mf,_f,gf,vf,yf,Cf,bf,Sf,Tf,Ef,Af,wf,xf,Pf,Df,If,Mf,Rf,Of,Lf,Nf,Ff,Bf,kf,zf,Vf,Uf,Gf,Hf,Wf,qf,Yf,jf,Xf,Qf,Kf,Zf,Jf,$f,em,tm,im,rm,nm,om,am,sm,lm,um,cm,dm,hm,pm,fm,mm,_m,gm,vm,ym,Cm,bm,Sm,Tm,Em,Am,wm,xm,Pm,Dm,Im,Mm,Rm,Om,Lm,Nm,Fm,Bm,km,zm,Vm,Um,Gm,Hm,Wm,qm,Ym,jm,Xm,Qm,Km,Zm,Jm,$m,e_,t_,i_,r_,n_,o_,a_,s_,l_,u_,c_,d_,h_,p_){
- "use strict";var f_={VERSION:"1.60",_shaders:{}};return f_.ApproximateTerrainHeights=e,f_.ArcGISTiledElevationTerrainProvider=t,f_.ArcType=i,f_.AssociativeArray=r,f_.AttributeCompression=n,f_.AxisAlignedBoundingBox=o,f_.BingMapsApi=a,f_.BingMapsGeocoderService=s,f_.BoundingRectangle=l,f_.BoundingSphere=u,f_.BoxGeometry=c,f_.BoxOutlineGeometry=d,f_.Cartesian2=h,f_.Cartesian3=p,f_.Cartesian4=f,f_.Cartographic=m,f_.CartographicGeocoderService=_,f_.CatmullRomSpline=g,f_.CesiumTerrainProvider=v,f_.Check=y,f_.CircleGeometry=C,f_.CircleOutlineGeometry=b,f_.Clock=S,f_.ClockRange=T,f_.ClockStep=E,f_.Color=A,f_.ColorGeometryInstanceAttribute=w,f_.ComponentDatatype=x,f_.CompressedTextureBuffer=P,f_.CoplanarPolygonGeometry=D,f_.CoplanarPolygonGeometryLibrary=I,f_.CoplanarPolygonOutlineGeometry=M,f_.CornerType=R,f_.CorridorGeometry=O,f_.CorridorGeometryLibrary=L,f_.CorridorOutlineGeometry=N,f_.Credit=F,f_.CubicRealPolynomial=B,f_.CullingVolume=k,f_.CylinderGeometry=z,f_.CylinderGeometryLibrary=V,f_.CylinderOutlineGeometry=U,f_.DefaultProxy=G,f_.DeveloperError=H,f_.DistanceDisplayCondition=W,f_.DistanceDisplayConditionGeometryInstanceAttribute=q,f_.DoublyLinkedList=Y,f_.EarthOrientationParameters=j,f_.EarthOrientationParametersSample=X,f_.EasingFunction=Q,f_.EllipseGeometry=K,f_.EllipseGeometryLibrary=Z,f_.EllipseOutlineGeometry=J,f_.Ellipsoid=$,f_.EllipsoidGeodesic=ee,f_.EllipsoidGeometry=te,f_.EllipsoidOutlineGeometry=ie,f_.EllipsoidRhumbLine=re,f_.EllipsoidTangentPlane=ne,f_.EllipsoidTerrainProvider=oe,f_.EllipsoidalOccluder=ae,f_.EncodedCartesian3=se,f_.Event=le,f_.EventHelper=ue,f_.ExtrapolationType=ce,f_.FeatureDetection=de,f_.FrustumGeometry=he,f_.FrustumOutlineGeometry=pe,f_.Fullscreen=fe,f_.GeocodeType=me,f_.GeocoderService=_e,f_.GeographicProjection=ge,f_.GeographicTilingScheme=ve,f_.Geometry=ye,f_.GeometryAttribute=Ce,f_.GeometryAttributes=be,f_.GeometryInstance=Se,f_.GeometryInstanceAttribute=Te,f_.GeometryOffsetAttribute=Ee,f_.GeometryPipeline=Ae,f_.GeometryType=we,f_.GoogleEarthEnterpriseMetadata=xe,f_.GoogleEarthEnterpriseTerrainData=Pe,f_.GoogleEarthEnterpriseTerrainProvider=De,f_.GoogleEarthEnterpriseTileInformation=Ie,f_.GregorianDate=Me,f_.GroundPolylineGeometry=Re,f_.HeadingPitchRange=Oe,f_.HeadingPitchRoll=Le,f_.Heap=Ne,f_.HeightmapEncoding=Fe,f_.HeightmapTerrainData=Be,f_.HeightmapTessellator=ke,f_.HermitePolynomialApproximation=ze,f_.HermiteSpline=Ve,f_.Iau2000Orientation=Ue,f_.Iau2006XysData=Ge,f_.Iau2006XysSample=He,f_.IauOrientationAxes=We,f_.IauOrientationParameters=qe,f_.IndexDatatype=Ye,f_.InterpolationAlgorithm=je,f_.Intersect=Xe,f_.IntersectionTests=Qe,f_.Intersections2D=Ke,f_.Interval=Ze,f_.Ion=Je,f_.IonGeocoderService=$e,f_.IonResource=et,f_.Iso8601=tt,f_.JulianDate=it,f_.KeyboardEventModifier=rt,f_.LagrangePolynomialApproximation=nt,f_.LeapSecond=ot,f_.LinearApproximation=at,f_.LinearSpline=st,f_.ManagedArray=lt,f_.MapProjection=ut,f_.MapboxApi=ct,f_.Math=dt,f_.Matrix2=ht,f_.Matrix3=pt,f_.Matrix4=ft,f_.NearFarScalar=mt,f_.Occluder=_t,f_.OffsetGeometryInstanceAttribute=gt,f_.OpenCageGeocoderService=vt,f_.OrientedBoundingBox=yt,f_.OrthographicFrustum=Ct,f_.OrthographicOffCenterFrustum=bt,f_.Packable=St,f_.PackableForInterpolation=Tt,f_.PeliasGeocoderService=Et,f_.PerspectiveFrustum=At,f_.PerspectiveOffCenterFrustum=wt,f_.PinBuilder=xt,f_.PixelFormat=Pt,f_.Plane=Dt,f_.PlaneGeometry=It,f_.PlaneOutlineGeometry=Mt,f_.PolygonGeometry=Rt,f_.PolygonGeometryLibrary=Ot,f_.PolygonHierarchy=Lt,f_.PolygonOutlineGeometry=Nt,f_.PolygonPipeline=Ft,f_.PolylineGeometry=Bt,f_.PolylinePipeline=kt,f_.PolylineVolumeGeometry=zt,f_.PolylineVolumeGeometryLibrary=Vt,f_.PolylineVolumeOutlineGeometry=Ut,f_.PrimitiveType=Gt,f_.QuadraticRealPolynomial=Ht,f_.QuantizedMeshTerrainData=Wt,f_.QuarticRealPolynomial=qt,f_.Quaternion=Yt,f_.QuaternionSpline=jt,f_.Queue=Xt,f_.Ray=Qt,f_.Rectangle=Kt,f_.RectangleCollisionChecker=Zt,f_.RectangleGeometry=Jt,f_.RectangleGeometryLibrary=$t,f_.RectangleOutlineGeometry=ei,f_.ReferenceFrame=ti,f_.Request=ii,f_.RequestErrorEvent=ri,f_.RequestScheduler=ni,f_.RequestState=oi,f_.RequestType=ai,f_.Resource=si,f_.RuntimeError=li,f_.ScreenSpaceEventHandler=ui,f_.ScreenSpaceEventType=ci,f_.ShowGeometryInstanceAttribute=di,f_.Simon1994PlanetaryPositions=hi,f_.SimplePolylineGeometry=pi,f_.SphereGeometry=fi,f_.SphereOutlineGeometry=mi,f_.Spherical=_i,f_.Spline=gi,f_.TaskProcessor=vi,f_.TerrainData=yi,f_.TerrainEncoding=Ci,f_.TerrainMesh=bi,f_.TerrainProvider=Si,f_.TerrainQuantization=Ti,f_.TileAvailability=Ei,f_.TileEdge=Ai,f_.TileProviderError=wi,f_.TilingScheme=xi,f_.TimeConstants=Pi,f_.TimeInterval=Di,f_.TimeIntervalCollection=Ii,f_.TimeStandard=Mi,f_.Tipsify=Ri,f_.Transforms=Oi,f_.TranslationRotationScale=Li,f_.TridiagonalSystemSolver=Ni,f_.TrustedServers=Fi,f_.VRTheWorldTerrainProvider=Bi,f_.VertexFormat=ki,f_.VideoSynchronizer=zi,f_.Visibility=Vi,f_.WallGeometry=Ui,f_.WallGeometryLibrary=Gi,f_.WallOutlineGeometry=Hi,f_.WebGLConstants=Wi,f_.WebMercatorProjection=qi,f_.WebMercatorTilingScheme=Yi,f_.WeightSpline=ji,f_.WindingOrder=Xi,f_.appendForwardSlash=Qi,f_.arrayFill=Ki,f_.arrayRemoveDuplicates=Zi,f_.arraySlice=Ji,f_.barycentricCoordinates=$i,f_.binarySearch=er,f_.buildModuleUrl=tr,f_.cancelAnimationFrame=ir,f_.clone=rr,f_.combine=nr,f_.createGuid=or,f_.createWorldTerrain=ar,f_.decodeGoogleEarthEnterpriseData=sr,f_.defaultValue=lr,f_.defineProperties=ur,f_.defined=cr,f_.deprecationWarning=dr,f_.destroyObject=hr,f_.formatError=pr,f_.freezeObject=fr,f_.getAbsoluteUri=mr,f_.getBaseUri=_r,f_.getExtensionFromUri=gr,f_.getFilenameFromUri=vr,f_.getImagePixels=yr,f_.getMagic=Cr,f_.getStringFromTypedArray=br,f_.getTimestamp=Sr,f_.isArray=Tr,f_.isBitSet=Er,f_.isBlobUri=Ar,f_.isCrossOriginUrl=wr,f_.isDataUri=xr,f_.isLeapYear=Pr,f_.loadAndExecuteScript=Dr,f_.loadCRN=Ir,f_.loadImageFromTypedArray=Mr,f_.loadKTX=Rr,f_.mergeSort=Or,f_.objectToQuery=Lr,f_.oneTimeWarning=Nr,f_.parseResponseHeaders=Fr,f_.pointInsideTriangle=Br,f_.queryToObject=kr,f_.requestAnimationFrame=zr,f_.sampleTerrain=Vr,f_.sampleTerrainMostDetailed=Ur,f_.scaleToGeodeticSurface=Gr,f_.subdivideArray=Hr,f_.webGLConstantToGlslType=Wr,f_.wrapFunction=qr,f_.writeTextToCanvas=Yr,f_.BillboardGraphics=jr,f_.BillboardVisualizer=Xr,f_.BoundingSphereState=Qr,f_.BoxGeometryUpdater=Kr,f_.BoxGraphics=Zr,f_.CallbackProperty=Jr,f_.CheckerboardMaterialProperty=$r,f_.ColorMaterialProperty=en,f_.CompositeEntityCollection=tn,f_.CompositeMaterialProperty=rn,f_.CompositePositionProperty=nn,f_.CompositeProperty=on,f_.ConstantPositionProperty=an,f_.ConstantProperty=sn,f_.CorridorGeometryUpdater=ln,f_.CorridorGraphics=un,f_.CustomDataSource=cn,f_.CylinderGeometryUpdater=dn,f_.CylinderGraphics=hn,f_.CzmlDataSource=pn,f_.DataSource=fn,f_.DataSourceClock=mn,f_.DataSourceCollection=_n,f_.DataSourceDisplay=gn,f_.DynamicGeometryBatch=vn,f_.DynamicGeometryUpdater=yn,f_.EllipseGeometryUpdater=Cn,f_.EllipseGraphics=bn,f_.EllipsoidGeometryUpdater=Sn,f_.EllipsoidGraphics=Tn,f_.Entity=En,f_.EntityCluster=An,f_.EntityCollection=wn,f_.EntityView=xn,f_.GeoJsonDataSource=Pn,f_.GeometryUpdater=Dn,f_.GeometryVisualizer=In,f_.GridMaterialProperty=Mn,f_.GroundGeometryUpdater=Rn,f_.ImageMaterialProperty=On,f_.KmlCamera=Ln,f_.KmlDataSource=Nn,f_.KmlLookAt=Fn,f_.KmlTour=Bn,f_.KmlTourFlyTo=kn,f_.KmlTourWait=zn,f_.LabelGraphics=Vn,f_.LabelVisualizer=Un,f_.MaterialProperty=Gn,f_.ModelGraphics=Hn,f_.ModelVisualizer=Wn,f_.NodeTransformationProperty=qn,f_.PathGraphics=Yn,f_.PathVisualizer=jn,f_.PlaneGeometryUpdater=Xn,f_.PlaneGraphics=Qn,f_.PointGraphics=Kn,f_.PointVisualizer=Zn,f_.PolygonGeometryUpdater=Jn,f_.PolygonGraphics=$n,f_.PolylineArrowMaterialProperty=eo,f_.PolylineDashMaterialProperty=to,f_.PolylineGeometryUpdater=io,f_.PolylineGlowMaterialProperty=ro,f_.PolylineGraphics=no,f_.PolylineOutlineMaterialProperty=oo,f_.PolylineVisualizer=ao,f_.PolylineVolumeGeometryUpdater=so,f_.PolylineVolumeGraphics=lo,f_.PositionProperty=uo,f_.PositionPropertyArray=co,f_.Property=ho,f_.PropertyArray=po,f_.PropertyBag=fo,f_.RectangleGeometryUpdater=mo,f_.RectangleGraphics=_o,f_.ReferenceProperty=go,f_.Rotation=vo,f_.SampledPositionProperty=yo,f_.SampledProperty=Co,f_.ScaledPositionProperty=bo,f_.StaticGeometryColorBatch=So,f_.StaticGeometryPerMaterialBatch=To,f_.StaticGroundGeometryColorBatch=Eo,f_.StaticGroundGeometryPerMaterialBatch=Ao,f_.StaticGroundPolylinePerMaterialBatch=wo,f_.StaticOutlineGeometryBatch=xo,f_.StripeMaterialProperty=Po,f_.StripeOrientation=Do,f_.TerrainOffsetProperty=Io,f_.TimeIntervalCollectionPositionProperty=Mo,f_.TimeIntervalCollectionProperty=Ro,f_.VelocityOrientationProperty=Oo,f_.VelocityVectorProperty=Lo,f_.Visualizer=No,f_.WallGeometryUpdater=Fo,f_.WallGraphics=Bo,f_.createMaterialPropertyDescriptor=ko,f_.createPropertyDescriptor=zo,f_.createRawPropertyDescriptor=Vo,f_.exportKml=Uo,f_.heightReferenceOnEntityPropertyChanged=Go,f_.AutomaticUniforms=Ho,f_.Buffer=Wo,f_.BufferUsage=qo,f_.ClearCommand=Yo,f_.ComputeCommand=jo,f_.ComputeEngine=Xo,f_.Context=Qo,f_.ContextLimits=Ko,f_.CubeMap=Zo,f_.CubeMapFace=Jo,f_.DrawCommand=$o,f_.Framebuffer=ea,f_.MipmapHint=ta,f_.Pass=ia,f_.PassState=ra,f_.PixelDatatype=na,f_.RenderState=oa,f_.Renderbuffer=aa,f_.RenderbufferFormat=sa,f_.Sampler=la,f_.ShaderCache=ua,f_.ShaderProgram=ca,f_.ShaderSource=da,f_.Texture=ha,f_.TextureCache=pa,f_.TextureMagnificationFilter=fa,f_.TextureMinificationFilter=ma,f_.TextureWrap=_a,f_.UniformState=ga,f_.VertexArray=va,f_.VertexArrayFacade=ya,f_.createUniform=Ca,f_.createUniformArray=ba,f_.freezeRenderState=Sa,f_.loadCubeMap=Ta,f_.modernizeShader=Ea,f_.Appearance=Aa,f_.ArcGisMapServerImageryProvider=wa,f_.AttributeType=xa,f_.AutoExposure=Pa,f_.Axis=Da,f_.BatchTable=Ia,f_.Batched3DModel3DTileContent=Ma,f_.Billboard=Ra,f_.BillboardCollection=Oa,f_.BingMapsImageryProvider=La,f_.BingMapsStyle=Na,f_.BlendEquation=Fa,f_.BlendFunction=Ba,f_.BlendOption=ka,f_.BlendingState=za,f_.BoxEmitter=Va,f_.BrdfLutGenerator=Ua,f_.Camera=Ga,f_.CameraEventAggregator=Ha,f_.CameraEventType=Wa,f_.CameraFlightPath=qa,f_.Cesium3DTile=Ya,f_.Cesium3DTileBatchTable=ja,f_.Cesium3DTileColorBlendMode=Xa,f_.Cesium3DTileContent=Qa,f_.Cesium3DTileContentFactory=Ka,f_.Cesium3DTileContentState=Za,f_.Cesium3DTileFeature=Ja,f_.Cesium3DTileFeatureTable=$a,f_.Cesium3DTileOptimizationHint=es,f_.Cesium3DTileOptimizations=ts,f_.Cesium3DTilePass=is,f_.Cesium3DTilePassState=rs,f_.Cesium3DTilePointFeature=ns,f_.Cesium3DTileRefine=os,f_.Cesium3DTileStyle=as,f_.Cesium3DTileStyleEngine=ss,f_.Cesium3DTileset=ls,f_.Cesium3DTilesetCache=us,f_.Cesium3DTilesetHeatmap=cs,f_.Cesium3DTilesetMostDetailedTraversal=ds,f_.Cesium3DTilesetStatistics=hs,f_.Cesium3DTilesetTraversal=ps,f_.CircleEmitter=fs,f_.ClassificationModel=ms,f_.ClassificationPrimitive=_s,f_.ClassificationType=gs,f_.ClippingPlane=vs,f_.ClippingPlaneCollection=ys,f_.ColorBlendMode=Cs,f_.Composite3DTileContent=bs,f_.ConditionsExpression=Ss,f_.ConeEmitter=Ts,f_.CreditDisplay=Es,f_.CullFace=As,f_.DebugAppearance=ws,f_.DebugCameraPrimitive=xs,f_.DebugModelMatrixPrimitive=Ps,f_.DepthFunction=Ds,f_.DepthPlane=Is,f_.DerivedCommand=Ms,f_.DeviceOrientationCameraController=Rs,f_.DiscardEmptyTileImagePolicy=Os,f_.DiscardMissingTileImagePolicy=Ls,f_.DracoLoader=Ns,f_.EllipsoidPrimitive=Fs,f_.EllipsoidSurfaceAppearance=Bs,f_.Empty3DTileContent=ks,f_.Expression=zs,f_.ExpressionNodeType=Vs,f_.Fog=Us,f_.FrameRateMonitor=Gs,f_.FrameState=Hs,f_.FrustumCommands=Ws,f_.Geometry3DTileContent=qs,f_.GetFeatureInfoFormat=Ys,f_.Globe=js,f_.GlobeDepth=Xs,f_.GlobeSurfaceShaderSet=Qs,f_.GlobeSurfaceTile=Ks,f_.GlobeSurfaceTileProvider=Zs,f_.GoogleEarthEnterpriseImageryProvider=Js,f_.GoogleEarthEnterpriseMapsProvider=$s,f_.GridImageryProvider=el,f_.GroundPolylinePrimitive=tl,f_.GroundPrimitive=il,f_.HeightReference=rl,f_.HorizontalOrigin=nl,f_.Imagery=ol,f_.ImageryLayer=al,f_.ImageryLayerCollection=sl,f_.ImageryLayerFeatureInfo=ll,f_.ImageryProvider=ul,f_.ImagerySplitDirection=cl,f_.ImageryState=dl,f_.Instanced3DModel3DTileContent=hl,f_.InvertClassification=pl,f_.IonImageryProvider=fl,f_.IonWorldImageryStyle=ml,f_.JobScheduler=_l,f_.JobType=gl,f_.Label=vl,f_.LabelCollection=yl,f_.LabelStyle=Cl,f_.MapMode2D=bl,f_.MapboxImageryProvider=Sl,f_.MapboxStyleImageryProvider=Tl,f_.Material=El,f_.MaterialAppearance=Al,f_.Model=wl,f_.ModelAnimation=xl,f_.ModelAnimationCache=Pl,f_.ModelAnimationCollection=Dl,f_.ModelAnimationLoop=Il,f_.ModelAnimationState=Ml,f_.ModelInstance=Rl,f_.ModelInstanceCollection=Ol,f_.ModelLoadResources=Ll,f_.ModelMaterial=Nl,f_.ModelMesh=Fl,f_.ModelNode=Bl,f_.ModelUtility=kl,f_.Moon=zl,f_.NeverTileDiscardPolicy=Vl,f_.OIT=Ul,f_.OctahedralProjectedCubeMap=Gl,f_.OrderedGroundPrimitiveCollection=Hl,f_.Particle=Wl,f_.ParticleBurst=ql,f_.ParticleEmitter=Yl,f_.ParticleSystem=jl,f_.PerInstanceColorAppearance=Xl,f_.PerformanceDisplay=Ql,f_.PickDepth=Kl,f_.PickDepthFramebuffer=Zl,f_.PickFramebuffer=Jl,f_.PointCloud=$l,f_.PointCloud3DTileContent=eu,f_.PointCloudEyeDomeLighting=tu,f_.PointCloudShading=iu,f_.PointPrimitive=ru,f_.PointPrimitiveCollection=nu,f_.Polyline=ou,f_.PolylineCollection=au,f_.PolylineColorAppearance=su,f_.PolylineMaterialAppearance=lu,f_.PostProcessStage=uu,f_.PostProcessStageCollection=cu,f_.PostProcessStageComposite=du,f_.PostProcessStageLibrary=hu,f_.PostProcessStageSampleMode=pu,f_.PostProcessStageTextureCache=fu,f_.Primitive=mu,f_.PrimitiveCollection=_u,f_.PrimitivePipeline=gu,f_.PrimitiveState=vu,f_.QuadtreeOccluders=yu,f_.QuadtreePrimitive=Cu,f_.QuadtreeTile=bu,f_.QuadtreeTileLoadState=Su,f_.QuadtreeTileProvider=Tu,f_.SDFSettings=Eu,f_.Scene=Au,f_.SceneFramebuffer=wu,f_.SceneMode=xu,f_.SceneTransforms=Pu,f_.SceneTransitioner=Du,f_.ScreenSpaceCameraController=Iu,f_.ShadowMap=Mu,f_.ShadowMapShader=Ru,f_.ShadowMode=Ou,f_.ShadowVolumeAppearance=Lu,f_.SingleTileImageryProvider=Nu,f_.SkyAtmosphere=Fu,f_.SkyBox=Bu,f_.SphereEmitter=ku,f_.StencilConstants=zu,f_.StencilFunction=Vu,f_.StencilOperation=Uu,f_.StyleExpression=Gu,f_.Sun=Hu,f_.SunPostProcess=Wu,f_.TerrainFillMesh=qu,f_.TerrainState=Yu,f_.TextureAtlas=ju,f_.TileBoundingRegion=Xu,f_.TileBoundingSphere=Qu,f_.TileBoundingVolume=Ku,f_.TileCoordinatesImageryProvider=Zu,f_.TileDiscardPolicy=Ju,f_.TileImagery=$u,f_.TileOrientedBoundingBox=ec,f_.TileReplacementQueue=tc,f_.TileSelectionResult=ic,f_.TileState=rc,f_.Tileset3DTileContent=nc,f_.TimeDynamicImagery=oc,f_.TimeDynamicPointCloud=ac,f_.Tonemapper=sc,f_.TweenCollection=lc,f_.UrlTemplateImageryProvider=uc,f_.Vector3DTileBatch=cc,f_.Vector3DTileContent=dc,f_.Vector3DTileGeometry=hc,f_.Vector3DTilePoints=pc,f_.Vector3DTilePolygons=fc,f_.Vector3DTilePolylines=mc,f_.Vector3DTilePrimitive=_c,f_.VerticalOrigin=gc,f_.View=vc,f_.ViewportQuad=yc,f_.WebMapServiceImageryProvider=Cc,f_.WebMapTileServiceImageryProvider=bc,f_.computeFlyToLocationForRectangle=Sc,f_.createBillboardPointCallback=Tc,f_.createOpenStreetMapImageryProvider=Ec,f_.createTangentSpaceDebugPrimitive=Ac,f_.createTileMapServiceImageryProvider=wc,f_.createWorldImagery=xc,f_.getBinaryAccessor=Pc,f_.getClipAndStyleCode=Dc,f_.getClippingFunction=Ic,f_.processModelMaterialsCommon=Mc,f_.processPbrMaterials=Rc,f_._shaders.AdjustTranslucentFS=Oc,f_._shaders.BillboardCollectionFS=Lc,f_._shaders.BillboardCollectionVS=Nc,f_._shaders.BrdfLutGeneratorFS=Fc,f_._shaders.CompositeOITFS=Bc,f_._shaders.DepthPlaneFS=kc,f_._shaders.DepthPlaneVS=zc,f_._shaders.EllipsoidFS=Vc,f_._shaders.EllipsoidVS=Uc,f_._shaders.GlobeFS=Gc,f_._shaders.GlobeVS=Hc,f_._shaders.GroundAtmosphere=Wc,f_._shaders.OctahedralProjectionAtlasFS=qc,f_._shaders.OctahedralProjectionFS=Yc,f_._shaders.OctahedralProjectionVS=jc,f_._shaders.PointPrimitiveCollectionFS=Xc,f_._shaders.PointPrimitiveCollectionVS=Qc,f_._shaders.PolylineCommon=Kc,f_._shaders.PolylineFS=Zc,f_._shaders.PolylineShadowVolumeFS=Jc,f_._shaders.PolylineShadowVolumeMorphFS=$c,f_._shaders.PolylineShadowVolumeMorphVS=ed,f_._shaders.PolylineShadowVolumeVS=td,f_._shaders.PolylineVS=id,f_._shaders.ReprojectWebMercatorFS=rd,f_._shaders.ReprojectWebMercatorVS=nd,f_._shaders.ShadowVolumeAppearanceFS=od,f_._shaders.ShadowVolumeAppearanceVS=ad,f_._shaders.ShadowVolumeFS=sd,f_._shaders.SkyAtmosphereFS=ld,f_._shaders.SkyAtmosphereVS=ud,f_._shaders.SkyBoxFS=cd,f_._shaders.SkyBoxVS=dd,f_._shaders.SunFS=hd,f_._shaders.SunTextureFS=pd,f_._shaders.SunVS=fd,f_._shaders.Vector3DTilePolylinesVS=md,f_._shaders.VectorTileVS=_d,f_._shaders.ViewportQuadFS=gd,f_._shaders.ViewportQuadVS=vd,f_.Autolinker=yd,f_.LercDecode=Cd,f_.NoSleep=bd,f_.Tween=Sd,f_.Uri=Td,f_["bitmap-sdf"]=Ed,f_["earcut-2.1.1"]=Ad,f_.jsep=wd,f_.kdbush=xd,f_["knockout-3.5.0"]=Pd,f_["knockout-es5"]=Dd,f_.knockout=Id,f_.measureText=Md,f_["mersenne-twister"]=Rd,f_["protobuf-minimal"]=Od,f_.purify=Ld,f_.quickselect=Nd,f_.rbush=Fd,f_.sprintf=Bd,f_.topojson=kd,f_.when=zd,f_.zip=Vd,f_.ClockViewModel=Ud,f_.Command=Gd,f_.InspectorShared=Hd,f_.SvgPathBindingHandler=Wd,f_.ToggleButtonViewModel=qd,f_.createCommand=Yd,f_.getElement=jd,f_.subscribeAndEvaluate=Xd,f_._shaders.AllMaterialAppearanceFS=Qd,f_._shaders.AllMaterialAppearanceVS=Kd,f_._shaders.BasicMaterialAppearanceFS=Zd,f_._shaders.BasicMaterialAppearanceVS=Jd,f_._shaders.EllipsoidSurfaceAppearanceFS=$d,f_._shaders.EllipsoidSurfaceAppearanceVS=eh,f_._shaders.PerInstanceColorAppearanceFS=th,f_._shaders.PerInstanceColorAppearanceVS=ih,f_._shaders.PerInstanceFlatColorAppearanceFS=rh,f_._shaders.PerInstanceFlatColorAppearanceVS=nh,f_._shaders.PolylineColorAppearanceVS=oh,f_._shaders.PolylineMaterialAppearanceVS=ah,f_._shaders.TexturedMaterialAppearanceFS=sh,f_._shaders.TexturedMaterialAppearanceVS=lh,f_._shaders.CzmBuiltins=uh,f_._shaders.AspectRampMaterial=ch,f_._shaders.BumpMapMaterial=dh,f_._shaders.CheckerboardMaterial=hh,f_._shaders.DotMaterial=ph,f_._shaders.ElevationContourMaterial=fh,f_._shaders.ElevationRampMaterial=mh,f_._shaders.FadeMaterial=_h,f_._shaders.GridMaterial=gh,f_._shaders.NormalMapMaterial=vh,f_._shaders.PolylineArrowMaterial=yh,f_._shaders.PolylineDashMaterial=Ch,f_._shaders.PolylineGlowMaterial=bh,f_._shaders.PolylineOutlineMaterial=Sh,f_._shaders.RimLightingMaterial=Th,f_._shaders.SlopeRampMaterial=Eh,f_._shaders.StripeMaterial=Ah,f_._shaders.Water=wh,f_._shaders.AcesTonemapping=xh,f_._shaders.AdditiveBlend=Ph,f_._shaders.AmbientOcclusionGenerate=Dh,f_._shaders.AmbientOcclusionModulate=Ih,f_._shaders.BlackAndWhite=Mh,f_._shaders.BloomComposite=Rh,f_._shaders.BrightPass=Oh,f_._shaders.Brightness=Lh,f_._shaders.ContrastBias=Nh,f_._shaders.DepthOfField=Fh,f_._shaders.DepthView=Bh,f_._shaders.DepthViewPacked=kh,f_._shaders.EdgeDetection=zh,f_._shaders.FXAA=Vh,f_._shaders.FilmicTonemapping=Uh,f_._shaders.GaussianBlur1D=Gh,f_._shaders.LensFlare=Hh,f_._shaders.ModifiedReinhardTonemapping=Wh,f_._shaders.NightVision=qh,f_._shaders.PassThrough=Yh,f_._shaders.PassThroughDepth=jh,f_._shaders.PointCloudEyeDomeLighting=Xh,f_._shaders.ReinhardTonemapping=Qh,f_._shaders.Silhouette=Kh,f_.ForEach=Zh,f_.addBuffer=Jh,f_.addDefaults=$h,f_.addExtensionsRequired=ep,f_.addExtensionsUsed=tp,f_.addPipelineExtras=ip,f_.addToArray=rp,f_.findAccessorMinMax=np,f_.getAccessorByteStride=op,f_.getComponentReader=ap,f_.hasExtension=sp,f_.moveTechniqueRenderStates=lp,f_.moveTechniquesToExtension=up,f_.numberOfComponentsForType=cp,f_.parseGlb=dp,f_.readAccessorPacked=hp,f_.removeExtensionsRequired=pp,f_.removeExtensionsUsed=fp,f_.removePipelineExtras=mp,f_.removeUnusedElements=_p,f_.updateAccessorComponentTypes=gp,f_.updateVersion=vp,f_.FXAA3_11=yp,f_.Animation=Cp,f_.AnimationViewModel=bp,f_.BaseLayerPicker=Sp,f_.BaseLayerPickerViewModel=Tp,f_.ProviderViewModel=Ep,f_.createDefaultImageryProviderViewModels=Ap,f_.createDefaultTerrainProviderViewModels=wp,f_.Cesium3DTilesInspector=xp,f_.Cesium3DTilesInspectorViewModel=Pp,f_.CesiumInspector=Dp,f_.CesiumInspectorViewModel=Ip,f_.CesiumWidget=Mp,f_.FullscreenButton=Rp,f_.FullscreenButtonViewModel=Op,f_.Geocoder=Lp,f_.GeocoderViewModel=Np,f_.HomeButton=Fp,f_.HomeButtonViewModel=Bp,f_.InfoBox=kp,f_.InfoBoxViewModel=zp,f_.NavigationHelpButton=Vp,f_.NavigationHelpButtonViewModel=Up,f_.PerformanceWatchdog=Gp,f_.PerformanceWatchdogViewModel=Hp,f_.ProjectionPicker=Wp,f_.ProjectionPickerViewModel=qp,f_.SceneModePicker=Yp,f_.SceneModePickerViewModel=jp,f_.SelectionIndicator=Xp,f_.SelectionIndicatorViewModel=Qp,f_.Timeline=Kp,f_.TimelineHighlightRange=Zp,f_.TimelineTrack=Jp,f_.VRButton=$p,f_.VRButtonViewModel=ef,f_.Viewer=tf,f_.viewerCesium3DTilesInspectorMixin=rf,f_.viewerCesiumInspectorMixin=nf,f_.viewerDragDropMixin=of,f_.viewerPerformanceWatchdogMixin=af,f_._shaders.degreesPerRadian=sf,f_._shaders.depthRange=lf,f_._shaders.ellipsoidInverseRadii=uf,f_._shaders.ellipsoidRadii=cf,f_._shaders.epsilon1=df,f_._shaders.epsilon2=hf,f_._shaders.epsilon3=pf,f_._shaders.epsilon4=ff,f_._shaders.epsilon5=mf,f_._shaders.epsilon6=_f,f_._shaders.epsilon7=gf,f_._shaders.infinity=vf,f_._shaders.oneOverPi=yf,f_._shaders.oneOverTwoPi=Cf,f_._shaders.passCesium3DTile=bf,f_._shaders.passCesium3DTileClassification=Sf,f_._shaders.passCesium3DTileClassificationIgnoreShow=Tf,f_._shaders.passClassification=Ef,f_._shaders.passCompute=Af,f_._shaders.passEnvironment=wf,f_._shaders.passGlobe=xf,f_._shaders.passOpaque=Pf,f_._shaders.passOverlay=Df,f_._shaders.passTerrainClassification=If,f_._shaders.passTranslucent=Mf,f_._shaders.pi=Rf,f_._shaders.piOverFour=Of,f_._shaders.piOverSix=Lf,f_._shaders.piOverThree=Nf,f_._shaders.piOverTwo=Ff,f_._shaders.radiansPerDegree=Bf,f_._shaders.sceneMode2D=kf,f_._shaders.sceneMode3D=zf,f_._shaders.sceneModeColumbusView=Vf,f_._shaders.sceneModeMorphing=Uf,f_._shaders.solarRadius=Gf,f_._shaders.threePiOver2=Hf,f_._shaders.twoPi=Wf,f_._shaders.webMercatorMaxLatitude=qf,f_._shaders.HSBToRGB=Yf,f_._shaders.HSLToRGB=jf,f_._shaders.RGBToHSB=Xf,f_._shaders.RGBToHSL=Qf,f_._shaders.RGBToXYZ=Kf,f_._shaders.XYZToRGB=Zf,f_._shaders.alphaWeight=Jf,f_._shaders.antialias=$f,f_._shaders.approximateSphericalCoordinates=em,f_._shaders.branchFreeTernary=tm,f_._shaders.cascadeColor=im,f_._shaders.cascadeDistance=rm,f_._shaders.cascadeMatrix=nm,f_._shaders.cascadeWeights=om,f_._shaders.columbusViewMorph=am,f_._shaders.computePosition=sm,f_._shaders.cosineAndSine=lm,f_._shaders.decompressTextureCoordinates=um,f_._shaders.depthClampFarPlane=cm,f_._shaders.eastNorthUpToEyeCoordinates=dm,f_._shaders.ellipsoidContainsPoint=hm,f_._shaders.ellipsoidWgs84TextureCoordinates=pm,f_._shaders.equalsEpsilon=fm,f_._shaders.eyeOffset=mm,f_._shaders.eyeToWindowCoordinates=_m,f_._shaders.fastApproximateAtan=gm,f_._shaders.fog=vm,f_._shaders.gammaCorrect=ym,f_._shaders.geodeticSurfaceNormal=Cm,f_._shaders.getDefaultMaterial=bm,f_._shaders.getLambertDiffuse=Sm,f_._shaders.getSpecular=Tm,f_._shaders.getWaterNoise=Em,f_._shaders.hue=Am,f_._shaders.inverseGamma=wm,f_._shaders.isEmpty=xm,f_._shaders.isFull=Pm,f_._shaders.latitudeToWebMercatorFraction=Dm,f_._shaders.lineDistance=Im,f_._shaders.luminance=Mm,f_._shaders.metersPerPixel=Rm,f_._shaders.modelToWindowCoordinates=Om,f_._shaders.multiplyWithColorBalance=Lm,f_._shaders.nearFarScalar=Nm,f_._shaders.octDecode=Fm,f_._shaders.packDepth=Bm,f_._shaders.phong=km,f_._shaders.planeDistance=zm,f_._shaders.pointAlongRay=Vm,f_._shaders.rayEllipsoidIntersectionInterval=Um,f_._shaders.readDepth=Gm,f_._shaders.reverseLogDepth=Hm,f_._shaders.sampleOctahedralProjection=Wm,f_._shaders.saturation=qm,f_._shaders.shadowDepthCompare=Ym,f_._shaders.shadowVisibility=jm,f_._shaders.signNotZero=Xm,f_._shaders.sphericalHarmonics=Qm,f_._shaders.tangentToEyeSpaceMatrix=Km,f_._shaders.transformPlane=Zm,f_._shaders.translateRelativeToEye=Jm,f_._shaders.translucentPhong=$m,f_._shaders.transpose=e_,f_._shaders.unpackDepth=t_,f_._shaders.unpackFloat=i_,f_._shaders.vertexLogDepth=r_,f_._shaders.windowToEyeCoordinates=n_,f_._shaders.writeDepthClampedToFarPlane=o_,f_._shaders.writeLogDepth=a_,f_._shaders.depthRangeStruct=s_,f_._shaders.material=l_,f_._shaders.materialInput=u_,f_._shaders.ray=c_,f_._shaders.raySegment=d_,f_._shaders.shadowParameters=h_,f_.createTaskProcessorWorker=p_,f_}),require(["Cesium"],function(e){"use strict";"undefined"!=typeof window?window.Cesium=e:"undefined"!=typeof self?self.Cesium=e:"undefined"!=typeof module?module.exports=e:console.log("Unable to load Cesium.")},void 0,!0)}();
|